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

RFE: add --debug to build and --release to install #7720

Closed
ensc opened this issue Dec 18, 2019 · 2 comments
Closed

RFE: add --debug to build and --release to install #7720

ensc opened this issue Dec 18, 2019 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@ensc
Copy link

ensc commented Dec 18, 2019

With traditional build systems I am using a workflow like

make build CFLAGS='-O2 -g3'
make check
make install DESTDIR=`pwd`/i

to

  1. build the software

  2. run tests

  3. install the built artifacts

With cargo, this is more complicated because cargo install executes the build step and ignores the previous cargo build. But build and install expect different options; e..g. you have to do either

cargo build             --feature foo
cargo install --debug   --feature foo --path . --root `pwd`/i 

or

cargo build   --release --feature foo
cargo install           --feature foo --path . --root `pwd`/i 

This require to carry around two different options expressing the same.

Things would be more easy when both --debug and --release are available to build + install. Then, you can just call

cargo build   $CARGO_FLAGS
cargo install $CARGO_FLAGS --path . --root `pwd`/i 

and use a common CARGO_FLAGS variable.

@ensc ensc added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Dec 18, 2019
@ehuss
Copy link
Contributor

ehuss commented Dec 22, 2019

I think we're moving towards using --profile=release and --profile=debug instead of adding more --release and --debug flags. It is implemented on nightly, and is tracked in #6988.

@ehuss
Copy link
Contributor

ehuss commented Feb 2, 2020

Closing since we will likely be using the --profile flag.

@ehuss ehuss closed this as completed Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants