-
Notifications
You must be signed in to change notification settings - Fork 95
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
Cant build with cross
#530
Comments
Hrmnn - fascinating. This is working on Linux (obviously, since CI is passing), and since everything is Docker based, in theory it should just work. I wonder if it's a Docker-in-docker issue 🤔 Within WSL, if you I might have to fire up a windows machine to test. |
As an aside, an easy way to get a shell within the container - Cargo is in my path. But strangely, not for you 🤔 From your shell, if you run On research, code 127 is:
(source) Which does lead me to the belief that for some reason, something can't find I also just found this: cross-rs/cross#260 Which is, concerning. I'll keep digging in, see what I can find. |
I was hoping that this was a "things break if you start from scratch" problem, but I cleared out all my docker images and tried it again on my Debian machine, and it all still worked for me. Sounds like I might need to provision a Windows machine and get a Docker Desktop licence to work through this (unless you have some bandwidth to investigate?) |
Interesting, I would've guessed this was platform independent since it's in Docker. 🤔 I can do some investigation tomorrow or early next week so feel free to put this on hold on your side for a while! |
Yeah same. I'm also confused. Something is weird somewhere. |
Seems 100% related to |
Yeah, definitely does seem related to I am wondering if the workaround
From cross-rs/cross#260 (comment) will solve the issue for us. If you have a chance to drop it into the Dockerfile (it will rebuild automatically on next run) and see if it works for you, that would be great - otherwise I'll see if I can replicate on Ubuntu as a next step, before going full Windows (and having to get a Docker Desktop licence). |
After a reboot of my computer and restart of Rancher Desktop, I actually can build with
It sounded unlikely given it works on Debian and Manjaro but just to confirm this I created a VM instance with Ubuntu 22.04 and that worked as expected. Tried both vanilla Ubuntu on the VM and also DinD in the VM with the steps from my comment. I also tried to test this on macOS but I can't successfully even install # cargo install cross
Updating crates.io index
Killed Fetch [======> ] 28.46%, 4.52MiB/s
I tried explicitly setting |
Uh. I wish cross compilation with Rust was easier (or maybe I'm missing something). https://www.reddit.com/r/rust/comments/r60fzb/m1_users_how_are_you_cross_compiling/ seems like a whole thread on cross and M1. You know, I never actually tried using |
From the meeting today -- it sounds like it's worth experimenting to see if we can build with |
This is the result of me investigating WSL: cross-rs/cross#728 TL;DR: Doesn't seem to be related to Is Windows supposed to be supported? Thinking if you have access to a WSL host you probably have Windows access as well so we might not have to support WSL right now. The problem is I can't get this to build on Windows either although that's not due to |
So I always believed it was supposed to work: But maybe WSL is causing issue? 🤔 On WSL, I assume you can |
So just running some tests, and, unfortunately, it looks like we'll still need
Either that, or maybe we setup some time on a video call, and try and debug this together? |
Was doing some hunting around, and found this recent article: https://kerkour.com/rust-cross-compilation Which shows some clever ways to avoid the need for |
Actually, this wasn't very hard at all - been pottering on this this evening. WIP here: I expect we can leave the cross compile to mac in place, since none of that uses Docker in Docker. I just need to make sure the generation of the Docker image still works (some of the paths of binary creation may have changed), then I can submit PRs. |
By including a linker for windows and the corresponding toolchain, we can cross compile to Windows quite easily, and then we no longer need cross or Docker in Docker. (Hopefully) closes googleforgames#530
By including a linker for windows and the corresponding toolchain, we can cross compile to Windows quite easily, and then we no longer need cross or Docker in Docker. (Hopefully) closes googleforgames#530
By including a linker for windows and the corresponding toolchain, we can cross compile to Windows quite easily, and then we no longer need cross or Docker in Docker. (Hopefully) closes #530
What happened:
When running
make build-image
(or more exactlybuild-linux-binary
) I getmake: *** [Makefile:94: build-linux-binary] Error 127
This also happens when running the failing step without
make
:What you expected to happen:
Quilkin to build successfully with
cross
.How to reproduce it (as minimally and precisely as possible):
docker run --rm \ -w /workspace \ -v /path/to/quilkin:/workspace \ -v ~/.cargo/registry:/usr/local/cargo/registry \ -v /var/run/docker.sock:/var/run/docker.sock \ --entrypoint=cross quilkin-build build --target x86_64-unknown-linux-gnu
Just changing the
entrypoint
tocargo
makes it work.Anything else we need to know?:
I don't get any output from the
Makefile
or when running Docker manually but if I attach to the image and try to runcross
manually I get the following:docker run --rm -it \ -v /path/to/quilkin:/workspace \ -v ~/.cargo/registry:/usr/local/cargo/registry \ -v /var/run/docker.sock:/var/run/docker.sock \ -w /workspace \ --entrypoint=/bin/bash quilkin-build
Environment:
The text was updated successfully, but these errors were encountered: