-
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
Cargo from rustup nightly as of Oct 28 2017 does not cargo build correctly on macOS 10.13 on APFS #4671
Comments
Cc @kennytm, I wonder if we could use symlinks here as we will never execute this code on Windows? |
@alexcrichton Yes symlink should work. I thought the previous code would fail hardlink and fallback to do a deep-copy o_O. |
same problem
|
As a workaround for now, I've been developing and building on a HFS+ sparse disk image which will still permit directory hardlinks in 10.13. |
When uplifting directories, symlink them instead of hard-link them. Fixes #4671.
[beta] When uplifting directories, symlink them instead of hard-link them. Backport of #4672 to 1.22 (cargo 0.23) The current stable RC (cee38cd) contains #4616 *but not* #4672. Without the latter it is known to cause #4671 on APFS (enabled by default on macOS 10.13 "High Sierra"). The issue was found by kpy3 on https://internals.rust-lang.org/t/rust-1-22-0-prerelease-testing/6282/2.
Sorri, I'm very new to Rust and it's ecosystem. I'm still having this issue. I tried to compile using the stable version of Rust but it gives me the same error. Thanks in advance |
@jjgumucio try to manually remove the Also, please show your |
We were sporadically but persistently seeing errors like failed to link or copy `.../target/debugs/deps/bin-264030cd6c8a02be.dSYM` to `.../target/debug/bin.dSYM` Caused by: the source path is not an existing regular file while running `cargo build`. Once the error occurs once, `cargo build` will fail forever with the same error until `target/debug/bin.dSYM` is manually unlinked. After some investigation, I've determined that this situation arises when the target of `bin.dSYM` goes missing. For example, if bin.dSYM is pointing at `deps/bin-86908f0fa7f1440e.dSYM`, and `deps/bin-86908f0fa7f1440e.dSYM` does not exist, then this error will occur. I'm still not clear on why the underlying dSYM bundle sporadically goes missing--perhaps it's the result of pressing Ctrl-C at the wrong moment?--but Cargo should at least be able to handle this situation better. It turns out that Cargo was getting confused by the broken symlink. When it goes to install the new `target/debug/bin.dSYM` link, it will remove the existing `target/debug/bin.dSYM` file, if it exists. Unfortunately, Cargo was checking whether the *target* of that symlink existed (e.g., `deps/bin-86908f0fa7f1440e.dSYM`, which in the buggy case would not exist), rather than the symlink itself, deciding that there was no existing symlink to remove, and crashing with EEXIST when trying to install the new symlink. This commit adjusts the existence check to evaluate whether the symlink itself exists, rather than its target. Note that while the symptoms are the same as rust-lang#4671, the root cause is unrelated.
Fix dSYM uplifting when symlink is broken We were sporadically but persistently seeing errors like failed to link or copy `.../target/debugs/deps/bin-264030cd6c8a02be.dSYM` to `.../target/debug/bin.dSYM` Caused by: the source path is not an existing regular file while running `cargo build`. Once the error occurs once, `cargo build` will fail forever with the same error until `target/debug/bin.dSYM` is manually unlinked. After some investigation, I've determined that this situation arises when the target of `bin.dSYM` goes missing. For example, if bin.dSYM is pointing at `deps/bin-86908f0fa7f1440e.dSYM`, and `deps/bin-86908f0fa7f1440e.dSYM` does not exist, then this error will occur. I'm still not clear on why the underlying dSYM bundle sporadically goes missing--perhaps it's the result of pressing Ctrl-C at the wrong moment?--but Cargo should at least be able to handle this situation better. It turns out that Cargo was getting confused by the broken symlink. When it goes to install the new `target/debug/bin.dSYM` link, it will remove the existing `target/debug/bin.dSYM` file, if it exists. Unfortunately, Cargo was checking whether the *target* of that symlink existed (e.g., `deps/bin-86908f0fa7f1440e.dSYM`, which in the buggy case would not exist), rather than the symlink itself, deciding that there was no existing symlink to remove, and crashing with EEXIST when trying to install the new symlink. This commit adjusts the existence check to evaluate whether the symlink itself exists, rather than its target. Note that while the symptoms are the same as #4671, the root cause is unrelated.
I am sorry that I am still having the same issue when I
Would you please have a look at this issue again? Thanks a lot. |
@khoguan Can you run cargo with the |
@ehuss Thanks for your kind help and hint. I just found that my issue is different from this one (#4671). I did not
Here is the output of
|
Ah that looks like a bug in Cargo, @khoguan mind opening a separate issue for that? |
Cargo fails to hardlink/copy
.dSYM
symbols to the target location on APFS. I think this might be related to these new.dSYM
folders instead of the.d
files thatrustc
now generates.I tried this:
cargo new --bin dsym_demo && cd dsym_demo && cargo build
I expected to see this happen: No errors.
Instead, this happened:
I'm using
cargo 0.24.0-nightly (e5562ddb0 2017-10-26)
. I'm running macOS 10.13. I'm using APFS.Here's a debug log of
RUST_LOG=debug cargo build
:https://gist.github.com/nelsonjchen/7d082de8def7fb8c23b714139f729795
I'm not too versed in cargo's internals but I believe that it tries to hardlink files/directories before falling back to
std::fs::copy
. Now the hard link worked on 10.12 on HFS and I believe that's what the build machines for the Rust project are running. It also works in this Travis build I just ran for thatdsym_demo
project I mentioned. In these cases, I think the hard link of the.dSYM
symbols directory succeeds without error.I also fell back to stable which still uses the older
.d
file symbols. On 10.13 with APFS, this is still fine.So, hard linking works for the older
.d
file symbols on 10.13 with APFS and also.dSYM
on 10.12 with HFS. But when these new.dSYM
symbol "folders" appear and we're on APFS, it does not work as hard links are not supported for directories andstd::fs::copy
will not copy the directory "file".Here's a related issue where some users discuss that directory hard linking is no longer supported in 10.13 on APFS:
selkhateeb/hardlink#31
A user in that discussion even mentions that the FAQ explicitly mentions APFS does not support directory hardlinks anymore. During the HFS->APFS conversion, they get transformed to symlinks.
The text was updated successfully, but these errors were encountered: