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

Using apt installed xls is undocumented #1863

Open
widlarizer opened this issue Jan 16, 2025 · 2 comments
Open

Using apt installed xls is undocumented #1863

widlarizer opened this issue Jan 16, 2025 · 2 comments

Comments

@widlarizer
Copy link

Describe the bug
The documentation instructs the user how to install XLS binaries on an Ubuntu system with apt. However, it's entirely unclear to me how to do anything with it since XLS is closely tied to bazel. When I tried to build xls/modules/zstd/BUILD with bazel after installing the binaries, bazel tried to build XLS from source

To Reproduce
Steps to reproduce the behavior:

  1. docker run -it -v.:/work ubuntu:22.04
  2. Follow binary installation steps in the docs
  3. bazel-7.4.1 build in xls/modules/zstd/ which is probably an incomplete or incorrect command

Expected behavior
Either the command builds the outputs of xls/modules/zstd/BUILD or a different kind of command is recommended in the docs that does, maybe one with arguments for specifying where the binaries are?

Actual behavior

The build starts pulling llvm sources even though there's valid XLS binaries in PATH

root@ab730c91e672 /w/x/m/zstd [8]# interpreter_main --version
v0.0.0-6732-gaaaa2432d
root@ab730c91e672 /w/x/m/zstd# bazel-7.4.1 build
Computing main repo mapping:
    Fetching repository @@llvm-raw; starting
    Fetching ...ternal/llvm-raw; Extracting 19032bfe87fa0f4a3a7b3e68daafc93331b71e0d.tar.gz

Environment (this can be helpful for troubleshooting):

  • OS: Ubuntu 22.04 docker on NixOS 25.05beta733374.8f3e1f807051 (Warbler) x86_64

cc @QuantamHD

@allight
Copy link
Collaborator

allight commented Jan 16, 2025

Unfortunately I don't think that's really supported right now. If you want to use prebuilts you'd need to patch the xls/build_rules/xls_toolchains.bzl file and change all the _DEFAULT_..._TARGETs to point to the prebuilt binaries. You'll also need to put the binaries in a place that bazel can see them so under the XLS tree would be eaisest.

However, bazel caching means that once its built once subsequent rebuilds will be quite quick so you might just want to stay building from source.

(NB Bazel does have some support for doing things like this in a somewhat elegant manner called toolchains but we don't support those yet).

@widlarizer
Copy link
Author

Would be nice to have a notice in the docs that you can't really use xls the intended way as a result

Since I'm not on a Bazel-supported Linux distribution (NixOS), Bazel explicitly rejects a source build on my machine. See #1862, I might try the out-of-tree workaround repo

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

2 participants