Munksgaard / session-types

MIT License
550 stars 21 forks source link

Allow building on stable rust by making chan_select an optional feature. #31

Closed zrneely closed 8 years ago

zrneely commented 8 years ago

This allows session-types to build on stable Rust 1.4, while preserving the chan_select features for people who need them and don't mind being on nightly. Compiling with this feature is simply:

cargo build --features channel_select

and including session-types as a dependency with this feature:

[dependencies]
session_types = { version = "0.2.1", features = ["channel_select"] }

I also incremented the minor version number since this is a breaking change for users who already use the feature - they'll need to update their dependency listing to include the feature.

Travis, using the current yaml, will not test with the feature present. I can add a change to fix that if you'd like.

Munksgaard commented 8 years ago

This is great!

Travis, using the current yaml, will not test with the feature present. I can add a change to fix that if you'd like.

Is it possible to run tests on both the channel_select version and the stable version?

zrneely commented 8 years ago

Hmm... it appears that the "rand_macros" dev dependency is failing to compile. It looks like it should be possible to remove the dependency from the example that uses it, however.

However, compiletest also doesn't build on stable, which is a bit of a problem.

laumann commented 8 years ago

This looks great...

Minor nit: Could we call it chan_select instead of channel_select just to keep the naming consistent? Other than that I have no objections

zrneely commented 8 years ago

How would you like to handle the fact that tests still only work on nightly, due to compiletest being nightly-only?

Munksgaard commented 8 years ago

Hm, that is unfortunate... But I guess if the tests work on nightly, everything should work on stable too. I think it should be fine to leave the compiletest tests out of stable. I guess send_recv.rs will be the only test left on stable, but that should be enough to ensure that the library compiles and that everything works.

zrneely commented 8 years ago

I think this should fix all the issues with test cases and nightly things.

zrneely commented 8 years ago

Any update on the status of this pull request, or comments or concerns about its contents?

Munksgaard commented 8 years ago

Yes! I've been a bit busy lately, sorry for not getting back to you... I think it's great, if @laumann agrees we'll merge it right away :smile:

laumann commented 8 years ago

:+1: Merge away