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

Darwin+Podman: Unable to cross-compile #1583

Open
4 of 11 tasks
skittishdev opened this issue Nov 1, 2024 · 2 comments
Open
4 of 11 tasks

Darwin+Podman: Unable to cross-compile #1583

skittishdev opened this issue Nov 1, 2024 · 2 comments

Comments

@skittishdev
Copy link

skittishdev commented Nov 1, 2024

Checklist

Describe your issue

cross doesn't work when I try to use it with podman (even if I set the CROSS_CONTAINER_ENGINE=podman env variable) on my Mac/M2. But the same project cross compiles successfully with docker.

What target(s) are you cross-compiling for?

aarch64-unknown-linux-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.5 (4090bec 2024-10-15)

Example

I have both docker and podman installed on my Mac. My Docker Desktop application is not running.

ps -ef | grep docker
  503 68715 69102   0  5:05PM ttys007    0:00.00 grep docker
podman machine init --cpus=8 --disk-size=64 --memory=24576 foo
podman machine start foo
CROSS_CONTAINER_ENGINE=podman cross build --target aarch64-unknown-linux-gnu --release

This results in an error like so:

Error: 
   0: /proc/self/mountinfo is unavailable when target_os != linux

Location:
   src/docker/shared.rs:1354

Additional information / notes

Cross works just fine with Docker. The command below results in a successful build when my Docker Desktop application is running in the background.

cross build --target aarch64-unknown-linux-gnu --release

I installed cross as specified in the docs: https://github.com/cross-rs/cross/blob/main/docs/getting-started.md#installing-cross-1

@skittishdev
Copy link
Author

Podman info (if needed)

$ podman version
Client:       Podman Engine
Version:      5.2.5
API Version:  5.2.5
Go Version:   go1.23.2
Git Commit:   10c5aa720d59480bc7edad347c1f5d5b75d4424f
Built:        Fri Oct 18 07:51:48 2024
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      5.2.5
API Version:  5.2.5
Go Version:   go1.22.7
Built:        Thu Oct 17 17:00:00 2024
OS/Arch:      linux/arm64

@Emilgardis
Copy link
Member

This was changed in #1485 and there some assumption done there that is incorrect for podman in the rest of the application logic. Should be an easy fix once located why it happens

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

2 participants