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

Docker-based cross-compilation #23

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mbmccoy
Copy link
Contributor

@mbmccoy mbmccoy commented Oct 3, 2024

This PR adds an example showing cross compilation to a raspberry pi using a Docker environment.

@tgolsson
Copy link
Owner

tgolsson commented Oct 3, 2024

Hmm, what is the issue you're tackling?

@mbmccoy mbmccoy changed the title Fix cache path Docker-based cross-compilation Oct 4, 2024
@mbmccoy
Copy link
Contributor Author

mbmccoy commented Oct 4, 2024

The ultimate goal I'm looking to solve is cross-compilation for the RPi (using docker). I was debugging some issues and noticed that a directory called {cache_path} was created in the sandbox, hence the original title of the draft PR.

So the good news is that the docker builds seem to work, in the sense that I can run the compiler in the docker environment! The bad news is that I don't know how to get the built artifacts into the dist directory. (Usually when I build a PEX binary it will land in dist/path/to/binary.pex.)

@mbmccoy mbmccoy force-pushed the mbm-fix-cache-path branch from cb95c7d to ddc034f Compare October 4, 2024 19:43
@mbmccoy mbmccoy force-pushed the mbm-fix-cache-path branch from d50bea1 to 48b68cf Compare October 4, 2024 19:43
@mbmccoy mbmccoy marked this pull request as ready for review October 4, 2024 19:45
@tgolsson
Copy link
Owner

tgolsson commented Oct 8, 2024

19:45:34.86 [INFO] Completed: Pulling Docker image cross-compiler because the image is missing locally.

Something weird with the setup? Or does this require manually building the image locally first?

@mbmccoy
Copy link
Contributor Author

mbmccoy commented Oct 11, 2024

Ok, this may take me a little bit to figure out. We use the docker environment specified in a docker image build rule, and I thought it would automatically build the environment—that doesn't seem to be the case.

I can definitely locally build the docker file and then it runs, but I'll need to read up on docker environments to really understand what's going on.

@@ -1,11 +1,12 @@
[GLOBAL]
pants_version = "2.21.1"
pants_version = "2.23.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This is for testing to see if the issues are fixed in the current stable; will move to a different PR before this is merged.

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

Successfully merging this pull request may close these issues.

2 participants