mozilla / webrtc-sdp

Rust SDP parser for WebRTC
Mozilla Public License 2.0
155 stars 30 forks source link

Consider distribute the library as a crate #97

Closed manifest closed 5 years ago

manifest commented 5 years ago

Any plans on that?

nils-ohlmeier commented 5 years ago

I wasn't aware that anyone is interested in this yet :-)

Let me do one more sync between the Firefox code and this library and then I can go ahead and publish a crate.

na-g commented 5 years ago

@nils-ohlmeier, how would you feel about naming the crate something that made it obvious that it isn't a general purpose SDP parser, like web-rsdparsa or some such? It is just a thought.

nils-ohlmeier commented 5 years ago

That probably makes sense.

nils-ohlmeier commented 5 years ago

PR #99 prepares for publishing as 'webrtc_sdp'. Any thoughts on the name?

manifest commented 5 years ago

Any thoughts on the name?

It looks amazing, let's publish it :-) It's definitely matter of taste, personally I find - more readable than _.

nils-ohlmeier commented 5 years ago

I actually tried it initially with -, but Rust was yelling at me that - is not allowed in crate names. So that's why I changed it to _.

na-g commented 5 years ago

@nils-ohlmeier, that webrtc_sdp sounds fine to me.

manifest commented 5 years ago

I actually tried it initially with -, but Rust was yelling at me that - is not allowed in crate names. So that's why I changed it to _.

That's strange, for example tower-web: https://crates.io/crates/tower-web https://github.com/carllerche/tower-web/blob/master/Cargo.toml#L2

nils-ohlmeier commented 5 years ago

Yes putting a name with - into the manifest was not causing problems. But when I then build the compiler complained about the extern statements like this https://github.com/nils-ohlmeier/rsdparsa/blob/master/src/bin/file_parser.rs#L6 Not allowing - in the name. Not sure what is up with that.

nils-ohlmeier commented 5 years ago

Looking at the error again is rather .... strange...

Compiling webrtc-sdp v0.1.0 (/Users/nilsohlmeier/src/rsdparsa) error: crate name using dashes are not valid in extern crate statements --> src/bin/file_parser.rs:6:14 6 extern crate webrtc-sdp; ^^^^^^^^^^ dash-separated idents are not valid help: if the original crate name uses dashes you need to use underscores in the code
6 extern crate webrtc_sdp;
^

error: aborting due to previous error

error: Could not compile webrtc-sdp.

nils-ohlmeier commented 5 years ago

This appears to give some context, but it's not pretty https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md

manifest commented 5 years ago

You can simply use extern webrtc_sdp; for webrtc-sdp crate. Isn't it? That's what I thought. Haven't released any crates yet.

nils-ohlmeier commented 5 years ago

Yes that appears to work to my surprise. I haven't released any crate either. So that's why I'm trying to not screw it up :) I feel like combining webrtc_sdp and webrtc-sdp is not ideal. I'll probably poke a little more around before publishing.

manifest commented 5 years ago

jsep-sdp as another option, if that library only targets javascript sessions

nils-ohlmeier commented 5 years ago

Looks like I jumped the gun there... I can't publish a crate with * dependencies. Which then leads to reworking the clippy dependency, which then leads to tons of lingering clippy issues.

nils-ohlmeier commented 5 years ago

Done https://crates.io/crates/webrtc-sdp