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

Lookup cross compile config paths with runtime OUT_DIR vs compile time #4555

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abrisco
Copy link
Contributor

@abrisco abrisco commented Sep 14, 2024

This change addresses a build failure I found when building Bazel rules for PyO3 (abrisco/rules_pyo3#14). Essentially, because Bazel compiles and runs build scripts in a sandbox at different locations, when environment variables that refer to a directory are compiled into build scripts, the directory embedded is to an old sandbox location that will not exist for any other action (running build scripts, compiling). This change resolves the build failure by using the OUT_DIR environment variable at runtime vs compile time to locate a cross compilation config.

This change would have the side effect of these config files not being written into pyo3-build-config's OUT_DIR but the OUT_DIR of whatever the crate was linked into. This is because when the pyo3-build-config's rlib is compiled, it's OUT_DIR will be embedded into it then, thus providing a locked absolute path for it's consumers.

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.

1 participant