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

Document that 'cargo package' always rebuilds all dependencies #3062

Closed
Wilfred opened this issue Sep 1, 2016 · 3 comments · Fixed by #7733
Closed

Document that 'cargo package' always rebuilds all dependencies #3062

Wilfred opened this issue Sep 1, 2016 · 3 comments · Fixed by #7733
Labels
A-documenting-cargo-itself Area: Cargo's documentation C-enhancement Category: enhancement Command-package

Comments

@Wilfred
Copy link
Contributor

Wilfred commented Sep 1, 2016

Every time I invoke cargo package, everything gets rebuilt -- even dependencies.

This is awkward when fixing missing entries in Cargo.toml:

$ cargo package
warning: manifest has no license or license-file. See http://doc.crates.io/manifest.html#package-metadata for more info.
   Packaging bfc v1.7.0 (file:///home/wilfred/projects/bfc)
   Verifying bfc v1.7.0 (file:///home/wilfred/projects/bfc)
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling libc v0.2.15
   Compiling regex-syntax v0.3.4
...
# OK, I've changed Cargo.toml. Let me try again to see if the warning has gone:
$ cargo package
$ cargo package
   Packaging bfc v1.7.0 (file:///home/wilfred/projects/bfc)
   Verifying bfc v1.7.0 (file:///home/wilfred/projects/bfc)
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling bitflags v0.5.0
   Compiling winapi v0.2.8
   Compiling semver v0.1.20
   Compiling matches v0.1.2 # looks like everything is being compiled again

Seems like the inverse of #2799.

@alexcrichton
Copy link
Member

Ah yeah I believe after a successful package or when we're packaging we blow away entire directories to ensure that everything works from scratch. That's intentional currently to ensure that everything works from a pristine state, but maybe we could add a flag to not blow away existing directories?

@Wilfred
Copy link
Contributor Author

Wilfred commented Sep 4, 2016

Aha, OK. Does that make sense for dependencies too? (Is it possible to dirty your dependencies?)

This is sufficiently rare that I don't see much value in a flag. I think the behaviour is worth documenting though -- have I missed it, or should we add it?

@alexcrichton
Copy link
Member

Perhaps no, but dependencies can often do weird things like leave around build artifacts which get stale, so it can be seen as good hygiene to always start from scratch.

Seems reasonable to document at least!

@carols10cents carols10cents changed the title 'cargo package' repeatedly builds all dependencies Document that 'cargo package' always rebuilds all dependencies Sep 26, 2017
@carols10cents carols10cents added A-documenting-cargo-itself Area: Cargo's documentation C-enhancement Category: enhancement Command-package labels Sep 26, 2017
bors added a commit that referenced this issue Dec 22, 2019
Various doc updates

This is a collection of documentation updates that have been in my todo list for a while. Each change is in a separate commit.

The "features" chapter will probably get significant changes in the future, as it is pretty bare right now. Similarly the "workspace" chapter could probably use more examples.

Closes #3062
Closes #3817
Closes #3971
Closes #4212
Closes #4438
Closes #4756
Closes #5822
Closes #6913
Closes #7055
@bors bors closed this as completed in caf88f5 Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation C-enhancement Category: enhancement Command-package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants