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

Fix Python container example #301

Merged
merged 11 commits into from
Jan 10, 2023
Merged

Fix Python container example #301

merged 11 commits into from
Jan 10, 2023

Conversation

aherrmann
Copy link
Member

The example was still using an older nixpkgs revision that did not provide the required Bazel version 5. This PR updates the nixpkgs revision. This PR also adds the example to at least build the image on CI, to make sure that we notice any such discrepancies in the future.

Change examples/python-container to pin the nixpkgs revision in the same
way as the toolchain examples.

Update the nixpkgs revision to 22.05 which is needed to include bazel_5.
@aherrmann aherrmann requested a review from avdv January 5, 2023 15:34
Use the same `local_repository` setup as the other examples.
py_image transitively depends on a cc toolchain.
rules_docker's py_image requires a dedicated Python (and transitively
C++) toolchain that is compatible with the `run_in_container` execution
constraint.

This collides with the nixpkgs host platform. So, we define a dedicated
platform that fulfills both requirements.
@aherrmann aherrmann marked this pull request as draft January 6, 2023 09:22
MacOS requires appropriate cross-platform toolchain configration since
the Docker image is a Linux target.
@aherrmann aherrmann marked this pull request as ready for review January 6, 2023 11:01
@aherrmann
Copy link
Member Author

It turns out that a rules_docker Python image also requires a CC toolchain that fulfills the run_in_container constraint. I've extended the example to support this. However, the current setup does not work on MacOS, yet. MacOS support looks to be a bit more involved, so I've opened #303 to track this separately.

Copy link
Contributor

@evertedsphere evertedsphere left a comment

Choose a reason for hiding this comment

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

LGTM

@aherrmann aherrmann added the merge-queue merge on green CI label Jan 10, 2023
@mergify mergify bot merged commit 25e7da5 into master Jan 10, 2023
@mergify mergify bot deleted the python-container-example branch January 10, 2023 12:37
@mergify mergify bot removed the merge-queue merge on green CI label Jan 10, 2023
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