bazel-contrib / bazel-contrib/toolchains_llvm

Failure when specifying 'release candidate' (-rc..) versions of llvm distributions

Open
#664 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
371
Forks
283
Avg merge
1d 55m
Merged PRs (30d)
25

Description

```
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
extra_llvm_distributions = {
"LLVM-22.1.0-rc2-Linux-X64.tar.xz": "663d9df63a71ba5cd2649e88af34c2c00aa4285e0c7e5e7b68da7b42c3799b90",
},
llvm_version = "22.1.0-rc2",
)
use_repo(llvm, "llvm_toolchain")
use_repo(llvm, "llvm_toolchain_llvm")
```
Fails with the following exception:
```
/home/builder/.cache/bazel/_bazel_builder/11b4e3ffa56c08f73bfb257afd96de19/external/toolchains_llvm+/toolchain/internal/llvm_distributions.bzl", line 739, column 22, in _parse_version
return tuple([int(s) for s in v.split(".")])
Error in int: invalid base-10 literal: "0-rc2"
ERROR: no such package '@@toolchains_llvm++llvm+llvm_toolchain_llvm//': invalid base-10 literal: "0-rc2"
```

Seems that the version parsing does not handle versions with postfixes after the bugfix number.

Contributor guide

Open the contributing guide

Research direction

Read toolchain/internal/llvm_distributions.bzl, especially _parse_version around the reported failure at line 739. Reproduce the supplied llvm.toolchain configuration with the 22.1.0-rc2 distribution and verify that release-candidate versions are accepted without the invalid integer conversion.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.