Skip to content

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

Closed
abrisco wants to merge 1 commit intoPyO3:mainfrom
abrisco:docs
Closed

Lookup cross compile config paths with runtime OUT_DIR vs compile time#4555
abrisco wants to merge 1 commit intoPyO3:mainfrom
abrisco:docs

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.

@davidhewitt
Copy link
Member

Thanks very much for the PR! I think you're right that there's a problem here, but I worry that this isn't the complete solution. I'll write up my observations in an issue now...

@davidhewitt
Copy link
Member

See #4579

@davidhewitt
Copy link
Member

Given that there's a more complex problem here, which I don't think this solves, I will close this PR. Let's please continue figuring out what to do on #4579.

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