Replies: 2 comments
-
Assuming you're using crate_universe, you should be able to use https://bazelbuild.github.io/rules_rust/crate_universe.html#crate.annotation-build_script_env - https://github.com/bazelbuild/rules_rust/blob/main/examples/crate_universe/WORKSPACE.bazel has some examples of setting up (other) annotations when using crate_universe |
Beta Was this translation helpful? Give feedback.
0 replies
-
I was just doing this myself. In my case, the environment variable needed to be set on the crates_repository(
...
annotations = {
"pyo3-ffi": [crate.annotation(
build_script_env = {
"PYO3_CROSS_PYTHON_VERSION": "3.11",
},
)],
},
...
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
When adding
pyo3
as a dep to arust_library
, it runs its own build script. I would like to configurePYO3_PYTHON
https://pyo3.rs/v0.20.3/building_and_distribution.html?highlight=interpreter#configuring-the-python-version.Does rules_rust have a way to do this? For
rust_library
, I only seerustc_env
. cargo_build_script does havebuild_script_env
, but in this case I do not own the build script / did not make acargo_build_script
.Also, using
PYO3_PYTHON=... bazel run ...
does not seem to propregate the env to the build script, is this supposed to be the case?Beta Was this translation helpful? Give feedback.
All reactions