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

ERROR: no such package '@llvm_toolchain//': Unknown LLVM release: clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz #8072

Closed
q9f opened this issue Dec 8, 2020 · 9 comments · Fixed by #8839
Assignees

Comments

@q9f
Copy link
Contributor

q9f commented Dec 8, 2020

🐞 Bug Report

Description

Bazel fails to initialize the toolchain on Archlinux with Unknown LLVM release.

Has this worked before in a previous version?

Yes, the alpha and rc builds used to work a couple of months ago. I don't recall an exact version though.

🔬 Minimal Reproduction

❯ git clone https://github.com/prysmaticlabs/prysm.git
❯ cd prysm/
❯ git checkout v1.0.4
❯ bazel clean
❯ bazel build //beacon-chain:beacon-chain

🔥 Error

~/.opt/prysmaticlabs/prysm tags/v1.0.4
❯ bazel build //beacon-chain:beacon-chain
INFO: Repository llvm_toolchain instantiated at:
  /home/user/.opt/prysmaticlabs/prysm/WORKSPACE:29:15: in <toplevel>
Repository rule llvm_toolchain defined at:
  /home/user/.cache/bazel/_bazel_user/d2634fb3f43ac27ab03d0c2515a6af35/external/com_grail_bazel_toolchain/toolchain/rules.bzl:24:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'llvm_toolchain':
   Traceback (most recent call last):
        File "/home/user/.cache/bazel/_bazel_user/d2634fb3f43ac27ab03d0c2515a6af35/external/com_grail_bazel_toolchain/toolchain/internal/configure.bzl", line 110, column 37, in llvm_toolchain_impl
                _download_llvm_preconfigured(rctx)
        File "/home/user/.cache/bazel/_bazel_user/d2634fb3f43ac27ab03d0c2515a6af35/external/com_grail_bazel_toolchain/toolchain/internal/llvm_distributions.bzl", line 177, column 13, in download_llvm_preconfigured
                fail("Unknown LLVM release: %s\nPlease ensure file name is correct." % basename)
Error in fail: Unknown LLVM release: clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
Please ensure file name is correct.
ERROR: no such package '@llvm_toolchain//': Unknown LLVM release: clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
Please ensure file name is correct.
INFO: Elapsed time: 0.268s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

🌍 Your Environment

Operating System:

~/.opt/prysmaticlabs/prysm tags/v1.0.4
❯ cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux

~/.opt/prysmaticlabs/prysm tags/v1.0.4
❯ pacman -Qs linux | grep -iI "local/linux\s" -A1
local/linux 5.9.12.arch1-1
    The Linux kernel and modules

~/.opt/prysmaticlabs/prysm tags/v1.0.4
❯ bazel version
Build label: 3.7.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Oct 22 02:21:25 2020 (1603333285)
Build timestamp: 1603333285
Build timestamp as int: 1603333285

What version of Prysm are you running? (Which release)

tags/v1.0.4
@farazdagi
Copy link
Contributor

This issue has been raised by others on Discord as well, there's no LLVM v10 for ubuntu 16.04. So, one has to either upgrade their OS or change LLVM version in workspace file, to v8/v9 in:

llvm_version = "10.0.0",

Preston planned to fix that (probably by sticking with LLVM that corresponds to some LTS version of OS).

@prestonvanloon
Copy link
Member

The work around above is correct. For whatever reason, LLVM didn't upload a distro for ubuntu 16.

@q9f
Copy link
Contributor Author

q9f commented Jan 27, 2021

So, one has to either upgrade their OS.

I'm not even on Ubuntu. Just found this: bazel-contrib/toolchains_llvm#53

@ahadda5
Copy link
Contributor

ahadda5 commented Feb 12, 2021

I have Ubuntu 20 on WSL and the bazel supported version 18.04 (LTS) 16.04 (LTS) . Should i downgrade? there seems the only way forward

@prestonvanloon
Copy link
Member

There is a fix for this upstream bazel-contrib/toolchains_llvm@5f82830. PR #8839 will update this dependency and unblock building on arch.

@leolara
Copy link
Contributor

leolara commented Jun 29, 2022

@prestonvanloon this happens again in Ubuntu 22.04, the ifs sequence in bazel-contrib/toolchains_llvm@5f82830#diff-e02b67434274479441be96f58b4196abb68988413811199f7a254f45bfa29888 does not handle specifically 22.04 and defaults to 16.04.

@leolara
Copy link
Contributor

leolara commented Jun 29, 2022

Also, the workaround of changing the version to 9 in WORKSPACE does not work on Ubuntu 22.04. A workaround that works is to edit /etc/os-release and change where it says "22" to "20".

Also, it seems this has been fixed in the head of grailbio/bazel-toolchain https://github.com/grailbio/bazel-toolchain/blob/master/toolchain/tools/llvm_release_name.py#L60-L61

@come-maiz
Copy link

With this patch you can use a newer commit from bazel, and then it will work in Ubuntu 22.04:
https://gist.github.com/elopio/a3cfd7f382e660c2e2606f37526f7d41

@leolara
Copy link
Contributor

leolara commented Jul 7, 2022

thanks @ElOpio that is kind of this PR already submitted: #10950 does, waiting for review

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 a pull request may close this issue.

7 participants