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

"failed to remove .dSYM" when cross compiling to 32-bit macOS #4699

Closed
japaric opened this issue Nov 4, 2017 · 10 comments
Closed

"failed to remove .dSYM" when cross compiling to 32-bit macOS #4699

japaric opened this issue Nov 4, 2017 · 10 comments

Comments

@japaric
Copy link
Member

japaric commented Nov 4, 2017

I don't have a mac to investigate further but I'm seeing this error on Travis (build log) when cross compiling Xargo to i686-apple-darwin on a 64-bit macOS builder. (The travis builder is using Cross to build Xargo but Cross is simply doing rustup target add i686-apple-darwin && cargo build --target i686-apple-darwin).

This was working before but I haven't tried to bisect.

Seems related to #4671. cc @kennytm

@kennytm
Copy link
Member

kennytm commented Nov 4, 2017

Seems to affect 64-bit as well. https://travis-ci.org/japaric/xargo/jobs/297248793

japaric added a commit to japaric/xargo that referenced this issue Nov 4, 2017
@kennytm
Copy link
Member

kennytm commented Nov 4, 2017

@japaric No repro with a fresh cargo build. It is repro only with the following steps:

$ rm target/debug/xargo.dSYM
$ cp -r target/debug/deps/xargo-0b99a456403c6af1.dSYM/ target/debug/xargo.dSYM
$ cargo build

which suggests that probably it is caused by the cache polluted by code before the #4672 landed. The debug log associated with the above was:

INFO:cargo::ops::cargo_rustc::job_queue: start: xargo v0.3.9 (file://$DIR/xargo) => Target(bin: xargo)/Profile(build) => Host
DEBUG:cargo::ops::cargo_rustc: linking $DIR/xargo/target/debug/deps/xargo-0b99a456403c6af1 to $DIR/xargo/target/debug/xargo
DEBUG:cargo::ops::cargo_rustc: linking $DIR/xargo/target/debug/deps/xargo-0b99a456403c6af1.dSYM to $DIR/xargo/target/debug/xargo.dSYM
INFO:cargo::ops::cargo_rustc::job_queue: end: xargo v0.3.9 (file://$DIR/xargo) => Target(bin: xargo)/Profile(build) => Host
DEBUG:cargo: exit_with_error; err=CliError { error: Some(CargoError(Msg("failed to remove: $DIR/xargo/target/debug/xargo.dSYM"), State { next_error: Some(Error { repr: Os { code: 1, message: "Operation not permitted" } }), backtrace: None })), unknown: false, exit_code: 101 }

This should be fixed once you deleted the cache.

@kennytm
Copy link
Member

kennytm commented Nov 4, 2017

This bug itself is a more general problem than #4671. Here's a repro step on Linux:

$ cargo new a
$ cd a
$ cargo build
$ rm target/debug/liba.rlib
$ mkdir target/debug/liba.rlib
$ cargo build

screenshot_2017-11-05 00 49 33_ovrrku

@japaric
Copy link
Member Author

japaric commented Nov 4, 2017

@kennytm Thanks for looking into this. I'll try clearing the cache. (I think I tried that before before but it probably was before #4672 landed).

japaric pushed a commit to japaric/xargo that referenced this issue Nov 4, 2017
use recent nightly for macOS

let's see if clearing the cache fixes the problem reported in rust-lang/cargo#4699
@alexcrichton
Copy link
Member

Thanks for investigating @kennytm! Sounds like we should just update the cache removal/cleaning to just handle files as well as directories?

@kennytm
Copy link
Member

kennytm commented Nov 7, 2017

@alexcrichton Yes I think so. If failed to remove as file, try to remove as directory recursively (may need to be careful with NTFS junction point though).

HyeonuPark added a commit to HyeonuPark/Nal that referenced this issue Nov 16, 2017
ozkriff added a commit to ozkriff/zemeroth that referenced this issue Nov 19, 2017
badboy added a commit to badboy/signify-rs that referenced this issue Nov 20, 2017
@Luthaf
Copy link

Luthaf commented Nov 20, 2017

This does also happen when compiling directly on OS X with the beta toolchain (see https://www.reddit.com/r/rust/comments/7e8sms/travis_failure_for_rust_beta_on_osx/).

@KillTheMule
Copy link

KillTheMule commented Nov 23, 2017

Beta seems fixed now, but I'm seeing this on stable (travis).

(e) Ok, I just read the release notes properly, and realized that travis is still at 1.22.0, so disregard that. Sorry for the noise!

@alexcrichton
Copy link
Member

I think this was fixed in #4672, so closing.

@victusfate
Copy link

bumped into this but I think it was due to a dropbox restore on a new system, just removed target and reinstalled aok

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

6 participants