-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
doc: expand on "the build script’s current directory is the source directory of the build script’s package." #4907
Comments
Note: the above is thwarted by #4001 (comment) And a correction, for OP:
and I took it to mean that the symlink timestamp changing would rebuild |
Workaround: exclude = [ "thesymlink" ] There are no more rebuilds now and I can keep the symlink:) |
@xftroxgpx hm so this isn't necessarily documentation about the current directory per se but rather about the behavior of rebuilding build scripts, is that right? |
I'm closing this because it's such a mess. And I don't know how else to explain it to make any sense ( I've been trying to phrase it and write in this post for at least 30mins :D was still a mess, so deleted all, out of respect for people's time :) and i don't know how to answer your question ) |
This doc says:
I would like it* to somehow expand upon that and say that for example, every file in the CARGO_MANIFEST_DIR (ie. same dir as
build.rs
) is now a dependencyforwhich means that if any of them change (timestamp-wise), thenbuild.rs
build.rs
and thussrc/main.rs
will be rebuilt! EDIT I misinterpreted this! see my next comment. (I used strikeout above)More specifically, if you have a symlink to the resulting binary(ie. to ./target/debug/yourprojectname ) in the same dir that
build.rs
resides, thencargo build
will always rebuild, because, due to the symlink, it detects a new timestamp(of the exe that was previously built!), thus requiring a new build every time.* but I'm no doc guru, so if someone could take up the task of encapsulating the above into concise,readable words for the doc, that would be greatly appreciated.
To reproduce:
then keep re-running the last command as many times as you want to see it rebuild, and you can meanwhile notice the "WARN" lines listing all the files that it depends on, including the symlink, preceeded with their timestamps (initially 0s for the symlink, but no matter)
Remove the symlink (ie. file named
thesymlink
) if you want to see it stop re-building.Or, alternatively, you can remove/rename
build.rs
for the same effect. (but in this latter case, the WARN lines are not shown anymore)Tested with:
cargo 0.25.0-nightly (a88fbac 2017-12-29)
release: 0.25.0
commit-hash: a88fbac
commit-date: 2017-12-29
rustc 1.24.0-nightly (8e7a609e6 2018-01-04)
binary: rustc
commit-hash: 8e7a609e635b728eba65d471c985ab462dc4cfc7
commit-date: 2018-01-04
host: x86_64-unknown-linux-gnu
release: 1.24.0-nightly
LLVM version: 4.0
The text was updated successfully, but these errors were encountered: