-
Notifications
You must be signed in to change notification settings - Fork 390
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
Can't build on Apple Silicone, cross doesn't use custom image or hangs #558
Comments
I also have the same project on intel laptop and there is work fine on the laptop. |
If you are not sure that your image is used you can run cross with |
I might have the same issue, cross did not pull any docker images on Apple silicon Mac host. |
Having the same issue... |
Guys after installing Docker Desktop and installing from master using the command qemu: uncaught target signal 11 (Segmentation fault) - core dumped
error: could not compile `typenum`
Caused by:
process didn't exit successfully: `rustc --crate-name build_script_main --edition=2018 /cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.13.0/build/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off -C metadata=392454c66f8e2573 -C extra-filename=-392454c66f8e2573 --out-dir /target/release/build/typenum-392454c66f8e2573 -L dependency=/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference) |
@Selyatin |
I experienced the same issue with Apple Silicon (not using Docker) and it was solved by using master. Building however completely freezes after a short while. |
Did anyone find a solution? Why was this closed? |
@BouweCeunen what error are you getting and are you running with the newest (unreleased) code? |
I did
Maybe not related to cross, but just wondering if anyone here found a solution. |
@BouweCeunen right! Do you have a better experience if you do
|
Now it hangs for some reason |
@BouweCeunen did you ever figure this out? I'm getting the same freezing on an M1 |
I have a M1 myself now, I've been doing most of my work via ssh on my regular box but I've experienced this when building locally via cross. It seems the major culprit is pkg-config, I suspect the issue is something to do with file-access and/or binary execution through docker via the x86_64 compat. Need to debug it further, or implement native aarch64 images, see #751 |
No not really, ended up not using this. |
Hey! I got same issue on last master
|
Does anyone know a cloud service I can test on an M1 system and not pay a fortune? Like, SSH access? I'd love to be able to fix this but latest macOS system is a 2013 MacBook Pro, and Qemu isn't cutting it. |
So, if you need I could help you with debug. |
Sure, can you first try compiling a simple crate rust-cpp-hello-world with the git clone https://github.com/cross-rs/cross
cd cross
# you can also install, but this is so your environment stays clean
cargo build
cd ..
git clone https://github.com/cross-rs/rust-cpp-hello-word
cd rust-cpp-hello-word
../cross/target/debug/cross build --target $TARGET --verbose If you could give me that info, that'd be a great starting point. I'd also love to be able to debug it on a machine I have SSH access to, but I currently don't have a way to use a machine. Also showing me the output of a few commands: $ rustup target list
$ rustup toolchain list
$ rustc --print sysroot |
Targets info:
|
So, compiling is freezing for
|
x86_64-unknown-linux-gnu is same
|
That all seems normal. Can you try running basically the same command except an interactive shell? /usr/local/bin/docker run \
--userns host -e 'PKG_CONFIG_ALLOW_CROSS=1' \
-e 'XARGO_HOME=/xargo' -e 'CARGO_HOME=/cargo' \
-e 'CARGO_TARGET_DIR=/target' -e 'CROSS_RUNNER=' \
-e TERM -e 'USER=mnwa' --rm --user 501:20 \
-v /Users/mnwa/.xargo:/xargo:Z \
-v /Users/mnwa/.cargo:/cargo:Z \
-v /cargo/bin \
-v /Users/mnwa/crossdebug/rust-cpp-hello-word:/project:Z \
-v /Users/mnwa/.rustup/toolchains/stable-x86_64-unknown-linux-gnu:/rust:Z,ro \
-v /Users/mnwa/crossdebug/rust-cpp-hello-word/target:/target:Z \
-w /project -it ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main bash Then do the following in the shell: export PATH="$PATH":/rust/bin And try doing stuff like If that all works, try build commands and see what's going on with a system profiler (like top), when running it in the background. |
|
It does, but that could maybe be a coincidence or "good" luck when I've tested |
|
Youre not running on aarch64 here, youre using emulation. Need #751 |
I might end up just getting a Mac M1 Mini and seeing if I can test locally. I think we might need the native aarch64 hosts. |
Another alternative is rpi4, ofc not apple silicon but same arch |
Any updates on this issue? I've run into a similar problem that my build simply freezes after having compiled a couple of crates. I am running on M1 with a custom aarch64 image. The same happens when I use an x86_64 image for building. I am using Rancher-desktop as my Docker env. |
No progress, however I've not seen this issue anymore myself on docker desktop, I don't think there's much we can do but report back to whatever docker engine is being used sadly. |
What helped in my case was switching Lima's mount type to 9p as suggested here: rancher-sandbox/rancher-desktop#3777 (comment) |
I encountered:
... with:
Does cross doesn't release an image for aarch64 macosx? |
We do not have images for any darwin targets, see cross-toolchains @tisonkun |
I built custom docker image for solving openssl issues.
Dockerfile
openssl.sh
My docker build command:
docker build -t fomotoshi/openssl:latest cross/
Cross.toml
my issue:
It looks like cross doesn't use my custom image for building.
I also tried to downgrade rustup to 1.49. and use minimal profile, but had the same issue.
The text was updated successfully, but these errors were encountered: