Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zenoh with default-features=false in the workspace #686

Closed
yellowhatter opened this issue Jan 26, 2024 · 8 comments
Closed

Zenoh with default-features=false in the workspace #686

yellowhatter opened this issue Jan 26, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@yellowhatter
Copy link
Contributor

yellowhatter commented Jan 26, 2024

Describe the bug

Currently, I see that zenoh is added into our root workspace like this:
(root Cargo.toml)
zenoh = { version = "0.11.0-dev", path = "zenoh", default-features = false }

By disabling any default features, we exclude literally ANY link implementations. That affects the default zenoh build and makes the example set not working without customizing it's build.

In order to offer a proper solution, I think we need to discuss why we disabled the default features by default (sounds really weird, right?)

To reproduce

run any examples with default build
cargo run --release --package zenoh-examples --example z_pub_shm_thr --features shared-memory -- 8 -e tcp/127.0.0.1:7447 --no-multicast-scouting

System info

dosn't really matter

@yellowhatter yellowhatter added the bug Something isn't working label Jan 26, 2024
@Mallets
Copy link
Member

Mallets commented Jan 26, 2024

I compile and run examples quite often and I've never experienced this behaviour.
Could you please report the various steps to reproduce it?

@yellowhatter
Copy link
Contributor Author

yellowhatter commented Jan 26, 2024

@Mallets I recently reproduced it with the following command:
cargo run --release --package zenoh-examples --example z_pub_shm_thr --features shared-memory -- 8 -e tcp/127.0.0.1:7447 --no-multicast-scouting
used clean recent main branch

the output was:
thread 'main' panicked at 'called Result::unwrap()on anErrvalue: Unsupported protocol: tcp. at io/zenoh-link/src/lib.rs:140.', examples/examples/z_pub_shm_thr.rs:32:45 note: run withRUST_BACKTRACE=1 environment variable to display a backtrace Aborted
that means that there is no "tcp" link implementation

@Mallets
Copy link
Member

Mallets commented Jan 26, 2024

Can you retry without passing --package zenoh-examples? It should still be able to compile the examples.

@yellowhatter
Copy link
Contributor Author

@Mallets hmm, that worked :) unbelievable...

@Mallets
Copy link
Member

Mallets commented Jan 26, 2024

Great that it worked.
In any case, the way cargo features are propagated in a workspace and included packages is still a bit unclear...

@yellowhatter
Copy link
Contributor Author

Yes, it is really unclear, because workspace=true must take the workspace's zenoh package without any default features.....

Anyway that is quite strange to disable default features by default, isn't it?

@Mallets
Copy link
Member

Mallets commented Jan 26, 2024

It is strange but it's the good way to go to avoid having all features enabled by default in any dependency. Otherwise it would be impossible to disable certain features in transitive dependencies in Zenoh.

@yellowhatter
Copy link
Contributor Author

Ah, ok, I've got the point! Thank you for the explanation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants