-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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:rustc-link-search
becomes invalid when you move a Cargo project
#4053
Labels
A-build-scripts
Area: build.rs scripts
A-linkage
Area: linker issues, dylib, cdylib, shared libraries, so
C-bug
Category: bug
Comments
I seem to recall we had a bug saying we shouldn't do anything when a Cargo project is moved, and now here's a bug saying we should do things when a Cargo project is moved. There's probably some way to distinguish this which we need to look into. |
carols10cents
added
A-build-scripts
Area: build.rs scripts
A-linkage
Area: linker issues, dylib, cdylib, shared libraries, so
C-bug
Category: bug
labels
Oct 3, 2017
This is the related issue that says we shouldn't need to recompile when the project dir is moved: #3273 |
alexcrichton
added a commit
to alexcrichton/cargo
that referenced
this issue
Dec 18, 2017
This commit fixes an issue in Cargo where if a project's folder was renamed but it also contained a build script the project could break. Cargo would continue to use the previous `rustc-link-search` arguments to configure env vars like `LD_LIBRARY_PATH` but the literal values from the previous compilation would be stale as the directories would no longer be there. To fix this when parsing the build script output we now retain a log of the previous output directory of a build script invocation as well as the current output, tweaking paths as appropriate if they were contained in the output folder. Closes rust-lang#4053
bors
added a commit
that referenced
this issue
Dec 18, 2017
Fix renaming a project using build scripts This commit fixes an issue in Cargo where if a project's folder was renamed but it also contained a build script the project could break. Cargo would continue to use the previous `rustc-link-search` arguments to configure env vars like `LD_LIBRARY_PATH` but the literal values from the previous compilation would be stale as the directories would no longer be there. To fix this when parsing the build script output we now retain a log of the previous output directory of a build script invocation as well as the current output, tweaking paths as appropriate if they were contained in the output folder. Closes #4053
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-build-scripts
Area: build.rs scripts
A-linkage
Area: linker issues, dylib, cdylib, shared libraries, so
C-bug
Category: bug
STR
Note the linker invocation; the
foo
search path is the same as before. By moving thehello
crate the search path generated by thefoo
dependency becomes invalidated.Meta
Possible solution: Re-run all build scripts when the Cargo project is moved.
cc @alexcrichton @dpc
Originally reported in rust-embedded/cortex-m#31
The text was updated successfully, but these errors were encountered: