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

cargo build in a workspaced crate builds workspaces' default members #5932

Closed
Nemo157 opened this issue Aug 23, 2018 · 4 comments · Fixed by #7270
Closed

cargo build in a workspaced crate builds workspaces' default members #5932

Nemo157 opened this issue Aug 23, 2018 · 4 comments · Fixed by #7270
Labels
A-workspaces Area: workspaces C-bug Category: bug

Comments

@Nemo157
Copy link
Member

Nemo157 commented Aug 23, 2018

I have a virtual workspace where I override the default-members. I expected this to just set the package that builds when in the root of the virtual workspace, however when I go into one of the members sub-directories I find that it still only builds the default members:

~/sources/embrio-rs → cargo build --verbose
       Fresh futures-core-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh either v1.5.0
       Fresh pin-utils v0.1.0-alpha.1
       Fresh memchr v2.0.1
       Fresh futures-channel-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh futures-io-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh embrio-core v0.1.0 (file:///Users/Nemo157/sources/embrio-rs/embrio-core)
       Fresh futures-sink-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh futures-util-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh embrio-util v0.1.0 (file:///Users/Nemo157/sources/embrio-rs/embrio-util)
       Fresh embrio v0.1.0 (file:///Users/Nemo157/sources/embrio-rs/embrio)
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s

~/sources/embrio-rs/ → cd embrio-native

~/sources/embrio-rs/embrio-native → cargo build --verbose
       Fresh futures-core-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh pin-utils v0.1.0-alpha.1
       Fresh either v1.5.0
       Fresh memchr v2.0.1
       Fresh futures-channel-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh futures-io-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh embrio-core v0.1.0 (file:///Users/Nemo157/sources/embrio-rs/embrio-core)
       Fresh futures-sink-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh futures-util-preview v0.3.0-alpha.3 (https://github.com/rust-lang-nursery/futures-rs#09617ac0)
       Fresh embrio-util v0.1.0 (file:///Users/Nemo157/sources/embrio-rs/embrio-util)
       Fresh embrio v0.1.0 (file:///Users/Nemo157/sources/embrio-rs/embrio)
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
@alexcrichton alexcrichton added C-bug Category: bug A-workspaces Area: workspaces labels Aug 24, 2018
@jrobsonchase
Copy link

Just ran into this today. It seems to technically behave as the docs here specify, but I don't believe this is the desired behavior for real usage.

@Nemo157
Copy link
Member Author

Nemo157 commented Jan 9, 2019

While it might technically behave as the docs specify, that means the case when default-members is unspecified doesn't work as the docs say.

When you go into the subdirectory of a workspaced crate without default-members and run cargo build it will build just the crate you are in, whereas the docs say when neither -p or --all are specified it should use the default default-members (either the root of the crate, or every member).

So when fixing this, it would probably be good to describe this a bit better in the docs as well.

@Nemo157
Copy link
Member Author

Nemo157 commented Jan 9, 2019

Turns out this is pretty trivial to fix, and doesn't break any of the existing tests. I need to add a new test, and think about the docs, but I'll try and open a PR this week (@jrobsonchase thanks for reminding me about this issue).

@thomcc
Copy link
Member

thomcc commented Mar 15, 2019

This is annoying for me.

@Nemo157 is there any chance you'll get around to this?

If not I could take a stab at it, since it's supposedly easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-workspaces Area: workspaces C-bug Category: bug
Projects
None yet
4 participants