-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Question on Using cargo-zigbuild
on Github Actions
#48
Comments
cargo-zigbuils
on Github Actionscargo-zigbuild
on Github Actions
I don't think it's not created because the I've had some issue with cache handling in
This should be fine, |
You could try set |
I think it's specifically this isn't being crated: |
To test this, I tried comment out these two lines and run $ cargo-zigbuild build --manifest-path tests/hello-rustls/Cargo.toml --target aarch64-unknown-linux-gnu
Compiling ring v0.16.20
Compiling unicode-normalization v0.1.19
Compiling num_cpus v1.13.1
Compiling socket2 v0.4.4
error: failed to run custom build command for `ring v0.16.20`
Caused by:
process didn't exit successfully: `/root/code/cargo-zigbuild/tests/hello-rustls/target/debug/build/ring-5a5041ae08ab4353/build-script-build` (exit status: 101)
--- stdout
OPT_LEVEL = Some("0")
TARGET = Some("aarch64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_aarch64-unknown-linux-gnu = None
CC_aarch64_unknown_linux_gnu = Some("/root/.cache/cargo-zigbuild/0.11.1/zigcc-aarch64-unknown-linux-gnu.sh")
CFLAGS_aarch64-unknown-linux-gnu = None
CFLAGS_aarch64_unknown_linux_gnu = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("neon,pmuv3")
--- stderr
running "/root/.cache/cargo-zigbuild/0.11.1/zigcc-aarch64-unknown-linux-gnu.sh" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-DNDEBUG" "-c" "-o/root/code/cargo-zigbuild/tests/hello-rustls/target/aarch64-unknown-linux-gnu/debug/build/ring-6c69e656904de07c/out/aesv8-armx-linux64.o" "/root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesv8-armx-linux64.S"
thread 'main' panicked at 'failed to execute ["/root/.cache/cargo-zigbuild/0.11.1/zigcc-aarch64-unknown-linux-gnu.sh" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-DNDEBUG" "-c" "-o/root/code/cargo-zigbuild/tests/hello-rustls/target/aarch64-unknown-linux-gnu/debug/build/ring-6c69e656904de07c/out/aesv8-armx-linux64.o" "/root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesv8-armx-linux64.S"]: No such file or directory (os error 2)', /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/ring-0.16.20/build.rs:653:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish... |
A simpler one without $ cargo-zigbuild build --manifest-path tests/libhello/Cargo.toml --target aarch64-unknown-linux-gnu
Compiling hello v0.1.0 (/root/code/cargo-zigbuild/tests/libhello)
error: linker `/root/.cache/cargo-zigbuild/0.11.1/zigcc-aarch64-unknown-linux-gnu.sh` not found
|
= note: No such file or directory (os error 2)
error: could not compile `hello` due to previous error |
So that looks identical, which means that it seems it's either not being written or Update: Setting the global cache didn't seem to work. I'll just intercept stuff internally and run a check on the directory using |
Just to add some info I tried zigbuild with GitHub action and it seems to just work https://github.com/sigmaSd/reedline-deno/blob/master/.github/workflows/rust.yml |
Interesting, because it's currently working for me on (all containers are x86_64 Linux, the documented items below are the hosts):
I have an x86_64 Apple Darwin computer I could test, but it doesn't seem the host is the issue. I believe WSL2 will also work, but it hasn't finished running. In short, it doesn't seem the host or the container engine matters, which is what makes this even more unexpected. I'll try a docker-in-docker scenario and see if that does anything (which isn't expected, since I don't believe Github Actions runs in a container). I'll try to get more information, but this is very perplexing and thanks for all your help so far. |
Yeah, some of the CI failures (without using containers) also works for me locally. It's very confusing. |
It might be a cross-related issue: it seems like that it might be the minimal toolchains we install, although this might not be related to the issue at hand. Here's the log. The lines of interest are (for all but
For
|
Wait, this has to be due to the instrument coverage we use in the setup. Thanks for all the help, this was a "me" mistake it seems. Not failing fast helped a lot. I'll re-open this if there's another issue. |
We're currently integrating
cargo-zigbuild
into cross so users can use Zig as a build option. However, we're having issues with our tests on Github Actions only, and not on other platforms. You can see the branch here, and the Dockerfile, install script and the unit test.This all works locally, however, remotely we get the following error:
Specifically, it seems
/target/.zig-cache/cargo-zigbuild/0.11.0/zigcc-aarch64-unknown-linux-gnu.sh
isn't created, for some weird reason. Everything works locally, so I'm very confused on how this works. Here's a link to the failing action. I was wondering if you had any experience with this.The specific PR is cross-rs/cross#880, in case if the context helps. The only special things cross does here is it mounts
CARGO_HOME
to/cargo
, and the target directory to/target
. Github Actions doesn't have a Docker-in-Docker situation, so this is quite unexpected. The other is we invokecargo-zigbuild
directly, rather than usecargo zigbuild
, since we download it for a specific architecture rather than build from source.The text was updated successfully, but these errors were encountered: