Skip to content

Conversation

omar-droubi
Copy link
Contributor

Resolves #3079

  • Added PYTHONHOME to whl_library execution environment. Without it, the python interpreter is getting confused where it's running from when bazel --vendor_dir is used
  • In _get_toolchain_unix_cflags, the real path for python is used instead of the symlink.

- Added PYTHONHOME to whl_library execution enviornment. Without
it the python interpretter is getting confused where it's running
from when bazel --vendor_dir is used. PYTHONHOME will be aquired
by running python in isolated mode, and the sys.prefix queried.
- In _get_toolchain_unix_cflags, the real path for python is used
instead of the symlink.
@omar-droubi
Copy link
Contributor Author

Hi @aignas, with regards to the tests, the bug this PR resolves occurs when there is a "bazel clean --expunge" between the "bazel vendor" and the "bazel build" commands. Is it possible to update the "integration_test_bzlmod_ubuntu_vendor" with a "bazel clean" ? I am not sure how impactful that would be on the CI performance.

integration_test_bzlmod_ubuntu_vendor:
<<: *reusable_build_test_all
name: "examples/bzlmod: bazel vendor"
working_directory: examples/bzlmod
platform: ubuntu2204
shell_commands:
- "bazel clean --expunge"
- "bazel vendor --vendor_dir=./vendor //..."
- "bazel clean --expunge"
- "bazel build --vendor_dir=./vendor //..."
- "rm -rf ./vendor"

@aignas
Copy link
Collaborator

aignas commented Jul 24, 2025

I would like to avoid adding bazel clean in the CI, maybe we could just add a line that does bazel vendor if it is not present yet. If we have regressions in the future, we can look into bazel clean usage.

Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

Thank you!

@aignas aignas enabled auto-merge August 7, 2025 13:08
@aignas aignas added this pull request to the merge queue Aug 7, 2025
Merged via the queue into bazel-contrib:main with commit babfc2b Aug 7, 2025
3 checks passed
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.

PIP Installation failure when using partially vendorred dependencies using bazel vendor

2 participants