Closed dvdhrm closed 5 years ago
This code was already there in xargo before rust-xbuild was forked from it. I know that the bin
directory is optional and only required for linking with LLD. I don't know what the lib
directory is used for.
We could of course add a check that these directories exists before trying to copy them, and otherwise print a warning and just skip the copying. I'm a bit short on time at the moment, but I would be happy to merge a PR that implements that.
Hello,
I have a similar problem on my aarch64 system.
RUST_TARGET_PATH=PATH_TO_THE_TARGET cargo xbuild --target aarch64-unknown-hermit-kernel error: intermittent IO error while iterating directory
/home/stefan/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/bin
Any idea, how I could fix it?
@stlankes We could just guard this cp_r
call with an if
that checks whether the source directory exists. If it doesn't we should emit a warning.
Hey
In
sysroot::update()
you callutil::cp_r()
to copy thelib
andbin
directories oflib/rustlib/
to the local sysroot. However, if these directories are empty, they might not exist at all, in which case thexbuild
script errors out with:In particular, if you compile
rustc
locally and userustup toolchain link <name> <path>
to link to the stage2 binaries, this error occurs. A simple workaround is to simplymkdir
the respective directories. In my scenario, thebin
directory is non-existant, so I just created it and everything runs smoothly.I assume when you install your toolchains into a target directory, the installer automatically creates these directories, and as such the error does not occur. I didn't test this, though.
Anyway, would be nice to check whether the directory exists, rather than erroring out.
Thanks! David