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 and cargo install -f write Cargo.lock differently #3133

Closed
oconnor0 opened this issue Sep 29, 2016 · 3 comments
Closed

cargo build and cargo install -f write Cargo.lock differently #3133

oconnor0 opened this issue Sep 29, 2016 · 3 comments

Comments

@oconnor0
Copy link

Given the following repo: https://github.com/oconnor0/build-your-own-editor/tree/24586c991a7faa513723595164df544e7c81ae73

When I run cargo build from the root, the Cargo.lock is written out one way.
When I run cargo install -f from the root, the Cargo.lock is written in a different way.

They are consistent - so that if I run cargo build, git will show no changed. If I then run cargo install -f, I see changes in Cargo.lock. Running cargo build again shows no changes.

There are only two Cargo.toml in the repository:

At the root:

[package]
name = "build-your-own-editor"
version = "0.0.1"
authors = ["Matthew O'Connor <[email protected]>"]

[dependencies]
textbox = { path = "textbox" }

[workspace]
members = [".", "textbox"]

[replace]
"winapi:0.2.8" = { git = "https://github.com/oconnor0/winapi-rs.git", rev = "textbox" }
"wio:0.1.2" = { git = "https://github.com/oconnor0/wio-rs.git", rev = "textbox" }

Inside the textbox directory:

[package]
name = "textbox"
version = "0.0.1"
authors = ["Matthew O'Connor <[email protected]>"]
workspace = ".."

[dependencies]
bitflags = "*"
bit-set = "*"
num-traits = "*"

[target.'cfg(windows)'.dependencies]
winapi = "0.2.8"
wio = "0.1.2"
kernel32-sys = "*"

[target.'cfg(unix)'.dependencies]
termbox-sys = "*"
@alexcrichton
Copy link
Member

Interesting! Could you gist the diff between the two lock files?

@oconnor0
Copy link
Author

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Sep 30, 2016
Prevent lock files from oscillating.

Closes rust-lang#3133
@alexcrichton
Copy link
Member

Thanks! Confirms my suspicions and fixed in #3146

bors added a commit that referenced this issue Oct 6, 2016
Use workspaces during `cargo install`

Prevent lock files from oscillating.

Closes #3133
@bors bors closed this as completed in #3146 Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants