Closed JoshuaNitschke closed 2 years ago
The error seems to indicate that the i128
feature was either enabled or autodetected for num-integer
, but not for num-traits
, which seems weird. There are sometimes problems with autocfg
detection in cross-compilation, but that should be the same between num-integer
and num-traits
. I can build a hello-world in that container just fine with num-integer
as a dependency.
Can you share the output of this command?
cargo tree --format "{p} : {f}"
@cuviper thanks for the response! Today, I was trying to get a small example of the issue going here https://github.com/JoshuaNitschke/rust-musl-builder_num-integer_example, but it builds as expected. Here is the cargo-tree output:
removed
I guess you should add --target x86_64-unknown-linux-musl
to that tree command, in case the target changes any dependencies. Please see if that's any different.
Another thing to look for are the build script outputs from num-integer
and num-traits
. There should be output
and stderr
files in a path like ./target/x86_64-unknown-linux-musl/release/build/num-integer-35c680a05bc94443/
. The exact hash at the end of that path will vary depending on a lot of factors.
You can also build verbosely, cargo build -v -v ...
, and look for lines like:
[num-traits 0.2.14] cargo:rustc-cfg=has_i128
[num-integer 0.1.44] cargo:rustc-cfg=has_i128
Or there may be visible errors if it didn't detect i128 support.
I reran with target and it was the same.
Interestingly, I have two folders: num_build_artifacts.zip
rust@9f69ab59e2b0:~/src$ ls ./target/x86_64-unknown-linux-musl/release/build/
num-integer-0694b7c89ce1bf38/
num-integer-35c680a05bc94443/
num-traits-0bb7be9c44b56e00/
num-traits-e0a4fa070967a9b6/
I think we might be getting somewhere:
error: could not copy "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-integer-35c680a05bc94443/out/probe0.probe0.990c8f4d-cgu.0.rcgu.ll" to "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-integer-35c680a05bc94443/out/probe0.ll": Operation not permitted (os error 1)
error: aborting due to previous error
error: could not copy "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-integer-35c680a05bc94443/out/probe1.probe1.84fcdf3f-cgu.0.rcgu.ll" to "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-integer-35c680a05bc94443/out/probe1.ll": Operation not permitted (os error 1)
error: aborting due to previous error
warning: autocfg could not probe for `std`
and
error: could not copy "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-traits-e0a4fa070967a9b6/out/probe0.probe0.990c8f4d-cgu.0.rcgu.ll" to "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-traits-e0a4fa070967a9b6/out/probe0.ll": Operation not permitted (os error 1)
error: aborting due to previous error
error: could not copy "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-traits-e0a4fa070967a9b6/out/probe1.probe1.84fcdf3f-cgu.0.rcgu.ll" to "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-traits-e0a4fa070967a9b6/out/probe1.ll": Operation not permitted (os error 1)
error: aborting due to previous error
warning: autocfg could not probe for `std`
error: could not copy "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-traits
-e0a4fa070967a9b6/out/probe2.probe2.c1d38c83-cgu.0.rcgu.ll" to "/home/rust/src/target/x86_64-unknown-linux-musl/release/build/num-traits-e0a4fa070967a9b6/out/probe2.ll": Operation not permitted (os error 1)
error: aborting due to previous error
I don't understand the could not copy errors.
I will try building verbosely now.
I think i have resolved this by entering the container and chmoding the target folder... will confirm later today
Yep, sorry to bother, but your troubleshooting note about how to find the error was very helpful! I did not know about that output.
Hi, one of my dependencies has a dependency on num-integer.
This code compiles fine on mac, ubuntu, and windows when I run
cargo build --release
but I have been trying to build inside docker imageekidd/rust-musl-builder
withcargo build --release --target x86_64-unknown-linux-musl
and I get the following error:Any ideas on how to fix this?