Repository navigation
Conversation
helly25
marked this pull request as ready for review
October 17, 2026 17:26
helly25
requested review from
dzbarsky,
fmeum,
jsharpe and
rrbutani
as code owners
October 17, 2026 17:26
Collaborator
Author
|
Superseded by #911, which reimplements version selection using mboworks/bzl and includes the subsequent selector and prerelease-policy improvements. Please continue review there. |
helly25
added a commit
that referenced
this pull request
Oct 20, 2026
…e control (#911) Cleanup of expression-based LLVM and linker version selectors using bzl 0.8.0, with independent `llvm_version_allow_prereleases` and `linker_version_allow_prereleases` controls. This clean redo supersedes the closed #909. Mainly we are using the advanced/generalized bzl 0.8.0 functionality. NOTE: The two `*_allow_prereleases` are incompatible changes. They replace the old magic allowance by referencing in requirements. ## AG;DR - Share requirement parsing, SemVer comparisons, projection constants, filtering, and first/latest selection through bzl. Restrict candidates to compatible artifacts before selecting and preserve the chosen artifact alongside its version. - Both public prerelease flags default to false. Requirements always apply; exact pins remain authoritative. The generic `allow_prereleases` parameter exists only in internal resolver code and tests. - Use the same environment selector expansion for LLVM and catalogued linkers, including mold. Feature overrides inherit the flags independently; linker-only changes preserve LLVM archive sharing. - Replace `_version_string` with bzl `normalize_string`; existing distribution goldens remain unchanged. - Resolve bzl 0.8.0 directly from BCR in all four module roots, with no temporary overrides. Both WORKSPACE declarations use the published release archive. bazelbuild/bazel-central-registry#11173 is merged; the release dependency is satisfied. - Validation at synchronized head `c71ba5c`: all 45 toolchain tests passed in Bzlmod (Bazel 9.3.0) and all 45 passed in WORKSPACE mode (Bazel 8.8.1). All 14 Python wrapper tests and 11 distribution-script tests passed; Trunk buildifier/prettier checks passed. The three integration module graphs were previously validated at `1e1ea62` and were not rerun for this sync. - Remove the redundant distribution-version wrapper; both production callers use the existing parser directly. - Move all three LLVM distribution golden-output writers and their fixtures into `llvm_distributions_test.bzl`. Production code exposes one internal-only `testing` struct with eight helper references; existing test targets and golden files are unchanged. - Tests cover selector parity, prerelease pins, platform compatibility, environment fallbacks and errors, and independent feature-override policies. The complete bzl 0.8.0 dependency upgrade merged into master via #912 (including #913). This branch is synchronized with upstream master `6ceed3a`, including the dylib-linked tool wrapper fix (#914) and LLVM 23.1.4 catalogue update (#915). The prerelease golden conflict was resolved by preserving all expanded selector cases and updating only the catalogue-driven expectations to 23.1.4; synthetic fixtures are unchanged. Its diff against master contains only the selector functionality, tests, and documentation, plus removal of an obsolete dependency comment. --------- Signed-off-by: helly25 <6420169+helly25@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support release-series policies such as
latest:major==23, so updating the pinned toolchain catalogue can adopt LLVM 23 fixes without another exact-version edit. Keep major compiler and clang-tidy upgrades explicit, with the same requirement syntax for LLVM and linker catalogues.AG;DR
Dependency: mboworks_bzl 0.7.0 is published in the official Bazel Central Registry; BCR #11158 is merged. The registry source metadata and MODULE.bazel are reachable and identify version 0.7.0. Its archive integrity matches the published release (
sha256-sS12HYg9SX7MP15MAFoCsZtCVgax6t1RXRWD2KvpyhQ=).Implementation:
bazel_depto bzl 0.7.0 and resolve it normally through BCR. Remove the temporary bzl archive overrides and publication-pending comments from all four module roots: the repository root,tests,tests/feature_overrides, andtests/mold_module. The integration roots retain their existing local overrides of toolchains_llvm so they test this checkout. Merged Update dependency mboworks_bzl to v0.7.0 #910 already supplies the 0.7.0 WORKSPACE/archive dependency declarations; those files are outside this PR's diff.versions.with_mode("semver"). Parsing, ordering, supplied constants and nested expression calls consistently inherit SemVer mode. The macOS LLVM linker guard uses the same mode. Numeric releases compare with zero padding; prerelease identifiers retain their spelling and boundaries (rc1differs fromrc.1, andrc10precedesrc2lexically).version_selectorsnamespace. LLVM prerelease call sites invoke its method directly. Export the bound library parser directly too: no local comma splitting or second expression parser. This preserves quoted commas while the shared parser rejects genuinely empty clauses.~=), negated compatible (!~=), trailing-prefix matching/exclusion (==23.1.*/!=23.1.*), extended compatible (~~=), and its negation (!~~=).major,minorandpatchconstants.latest:major==23andlatest:major()==23both work; constants and functions have independent namespaces. Support the library's allowlisted nested component/introspection calls, implied or explicit versions, literal/keyword arguments, and typed integer/boolean/text results. Expression calls cannot switch mode or evaluate arbitrary Starlark; Python-only helpers fail in SemVer mode.latest:major==23confines this to LLVM 23. Fixed inputs and host produce a fixed selection; builds do not discover new upstream releases.+-.rc1does not classify a stable version as a prerelease. Fix the no-match diagnostic's sorting call.Validation of the override removal:
source.jsonandMODULE.bazelboth resolve; version and archive integrity match the released 0.7.0 artifact.//toolchain/...tests pass using the normal registry, with no temporary bzl override, command-line module override or additional registry URL. Valid cached test results are reused after fresh analysis.bazel mod graphsucceeds independently in all three integration roots and each resolvesmboworks_bzl@0.7.0through the normal registry.trunk fmt,trunk check --ciandgit diff --checkpass.ac4055749414b749173bdfa820f5276d4c5714c8passes all 100 GitHub checks, including the Linux/macOS and Bazel/WORKSPACE matrices. The temporary bzl overrides are removed, and official-registry resolution is validated in CI. The branch is up to date with master and conflict-free.latest:major==23, selecting LLVM 23.1.3. That local check tested the current selector implementation with the published bzl archive; valid build/test cache results were reused. The host's uutils printf also fails a baseline child-argument assertion, so the passing local run puts the installed GNU printf first on the test PATH without changing source or tests. xff draft #1011 still needs the released toolchains_llvm version containing this integration and validation of that final dependency pin before merge.Runtime remains pure Starlark; this updates an existing dependency. Catalogue availability remains host-dependent. The exact LLVM 22.1.8/compiler-runtime pairing used by the existing MSan configuration is preserved.