Skip to content
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

Cannot use xcross inside a Docker container #8

Open
fripSide opened this issue Jul 24, 2024 · 0 comments
Open

Cannot use xcross inside a Docker container #8

fripSide opened this issue Jul 24, 2024 · 0 comments

Comments

@fripSide
Copy link

I tend to use containers as my development environment. Consequently, I try to run xcross in the container with the following configuration:

docker run -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp -it --name qemu-dev -h hy --privileged fripside2021/my-dev:20.04 bash

I encountered an issue where the cross-compilation toolchain is created outside the container on the host.

no such file: /tmp/xcross/.__ahuszagh_xcross_uuid_2f

Thus, I need to share the host's /tmp directory with the container using the -v /tmp:/tmp configuration. Now the container can access the toolchain.
However, it still reads the files on the host OS but cannot find the files inside the container.

export CROSS_TARGET=arm64-unknown-linux-musl
xcross --dir . c++ main.c -o basic
aarch64-unknown-linux-musl-g++: error: main.c: No such file or directory

I want to know how to use xcross within containers.
If xcross cannot be used in the container, I will have to revert to using a VM as the development environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant