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

How to use a custom bazel installation? #145

Open
adamjstewart opened this issue Mar 8, 2024 · 4 comments
Open

How to use a custom bazel installation? #145

adamjstewart opened this issue Mar 8, 2024 · 4 comments

Comments

@adamjstewart
Copy link

I'm a developer for the Spack package manager. I'm trying to add a package for tensorstore but I'm having trouble getting the build to work. Spack has its own patched copy of bazel that allows our compiler wrappers to work (they need environment variables that bazel purges). Is there any way to tell tensorstore to use our own copy of bazel?

@jbms
Copy link
Collaborator

jbms commented Mar 10, 2024

To be clear are you talking about just the Python package?

Currently our setup.py expects to invoke bazelisk and doesn't have an option to directly specify a bazel binary to invoke instead. However, you can use the TENSORSTORE_BAZELISK env var (https://google.github.io/tensorstore/installation.html#envvar-TENSORSTORE_BAZELISK) to specify a different python script to run in place of bazelisk.py. See for example this conda-forge recipe that uses that env var to specify a shim wrapper that is used to invoke a specific bazel binary:
https://github.com/conda-forge/tensorstore-feedstock/tree/main/recipe

Alternatively you could use TENSORSTORE_BAZEL_BUILD_OPTIONS to specify --action_env=... as needed.

@adamjstewart
Copy link
Author

Yes, just the Python package.

Writing my own Python script just to wrap around my bazel installation sounds like a lot. There has to be a better way.

I found that I can create a symlink in tools/bazel that points to me bazel installation and that works okay. Still surprised there isn't an env var to control this.

Also asked upstream: bazelbuild/bazelisk#560

@nelsonihc
Copy link

@adamjstewart any chance packaging the c++ library for spack? that would be a great addition!

@adamjstewart
Copy link
Author

Anyone can submit a PR to package the C++ library, we have pretty good documentation on adding new packages.

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

No branches or pull requests

3 participants