x86_64-pc-windows-gnu gitlab
nilgoyette opened this issue · 3 comments
Checklist
- I've looked through the issues and pull requests for similar reports
Describe your issue
I'm trying to create a Window build on a Linux host. I found this issue and I read the README.
Yes, I use -v /var/run/docker.sock:/var/run/docker.sock
. My .gitlab-ci.yml looks like:
build:windows:
image: "docker:latest"
before_script:
- apk update && apk add g++ tar wget
- *install_rust
- export CROSS_CONTAINER_IN_CONTAINER=true
- cargo install cross
script:
- cross build --release -v
And my Cross.toml is
[build]
default-target = "x86_64-pc-windows-gnu"
pre-build = [
"apt update",
"apt install -y gfortran-mingw-w64-x86-64",
"export FC=x86_64-w64-mingw32-gfortran",
"ln -s /usr/bin/x86_64-w64-mingw32-gfortran /usr/bin/f77",
]
[build.env]
passthrough = [
"FC"
]
When I use export CROSS_CONTAINER_IN_CONTAINER=true
, I get this error
+ /usr/local/bin/docker
Error:
0: `docker inspect runner-sgxzu8b5-project-153-concurrent-2` failed with exit status: 1
Stderr:
Error: No such object: runner-sgxzu8b5-project-153-concurrent-2
Stdout:
[]
When I don't use it, I get this error
+ /usr/local/bin/docker run --userns host -e FC -e 'PKG_CONFIG_ALLOW_CROSS=1' -e 'XARGO_HOME=/xargo' -e 'CARGO_HOME=/cargo' -e 'CARGO_TARGET_DIR=/target' -e 'CROSS_RUNNER=' -e 'USER=root' --rm --user 0:0 -v /root/.xargo:/xargo:Z -v /root/.cargo:/cargo:Z -v /cargo/bin -v /builds/dmri/diffima:/project:Z -v /root/.rustup/toolchains/1.63.0-x86_64-unknown-linux-gnu:/rust:Z,ro -v /builds/dmri/diffima/target:/target:Z -w /project cross-custom-diffima:x86_64-pc-windows-gnu-6e9d4-pre-build sh -c 'PATH=$PATH:/rust/bin cargo build --release -v --target x86_64-pc-windows-gnu'
sh: 1: cargo: not found
This is better. At least the docker image is found so it goes further.
In both cases, I get this warning
error: DEPRECATED: future versions of rustup will require --force-non-host to install a non-host toolchain as the default.
warning: toolchain '1.63.0-x86_64-unknown-linux-gnu' may not be able to run on this system.
warning: If you meant to build software to target that platform, perhaps try `rustup target add x86_64-unknown-linux-gnu` instead?
verbose: installing toolchain '1.63.0-x86_64-unknown-linux-gnu'
The problem is, I don't know if this should work or not. Am I forgetting something?
What target(s) are you cross-compiling for?
x86_64-pc-windows-gnu
Which operating system is the host (e.g computer cross is on) running?
- macOS
- Windows
- Linux / BSD
- other OS (specify in description)
What architecture is the host?
- x86_64 / AMD64
- arm32
- arm64 (including Mac M1)
What container engine is cross using?
- docker
- podman
- other container engine (specify in description)
cross version
cross 0.2.4
Example
No response
Additional information / notes
No response
You need to use CROSS_REMOTE=1
which was implemented in #785. See the section on Gitlab CI Workflows on the wiki. There is currently a bug copying remote binaries to the host. This functionality was added in v0.2.2.
This is because remote building does not mount the local filesystem, so you need to use data volumes to have access to those files.
Sorry, I didn't check that part of the wiki.
I confirm that CROSS_REMOTE=1
fixes the problem I had. I ignored the other variables and the "services" line.
Thank you.
No worries, I'm glad everything works now.