Skip to content

julia: strip JLL build metadata from versions#15113

Open
maleadt wants to merge 1 commit into
dependabot:mainfrom
maleadt:julia-strip-jll-build-metadata
Open

julia: strip JLL build metadata from versions#15113
maleadt wants to merge 1 commit into
dependabot:mainfrom
maleadt:julia-strip-jll-build-metadata

Conversation

@maleadt
Copy link
Copy Markdown

@maleadt maleadt commented May 22, 2026

What are you trying to accomplish?

Julia's JLL packages use a +N suffix on the version (e.g. 0.0.43+1) to identify rebuilds of the same source version. Per semver, build metadata is ignored when ordering versions, and Julia's Pkg treats e.g. 0.0.43 and 0.0.43+1 as compatibility-equivalent.

Previously, Dependabot::Julia::Version.new("0.0.43+1") parsed the build suffix as an additional segment, producing [0, 0, 43, 1]. That sorted strictly greater than 0.0.43, so:

  • LatestVersionFinder reported a JLL rebuild as a newer release available for update.
  • Gem::Requirement.new("=0.0.43").satisfied_by? returned false for the rebuild, so RequirementsUpdater did not short-circuit and appended a redundant version spec.

The result was spurious PRs like JuliaLLVM/LLVM.jl#562, which proposed changing LLVMExtra_jll = "=0.0.43" to LLVMExtra_jll = "=0.0.43, 0.0.43" after LLVMExtra_jll published a 0.0.43+1 rebuild.

This change strips the +... suffix in the Version constructor so JLL rebuilds compare equal to the underlying source version, matching Julia's resolution semantics.

Anything you want to highlight for special attention from reviewers?

The strip happens before super, so all downstream comparisons (<=>, satisfied_by?, sorting) see the canonical 3-segment version. to_s returns the stripped form, which I think is the right tradeoff — the build counter is not semantically meaningful and surfacing it elsewhere just risks the same comparison bug recurring. Open to feedback if you'd rather preserve the original string for display.

How will you know you've accomplished your goal?

Added julia/spec/dependabot/julia/version_spec.rb covering:

  • Parsing versions with +N build metadata
  • Equality of 0.0.43+1 and 0.0.43 for ordering
  • Exact-pin requirement (=0.0.43) being satisfied by a rebuild

Running locally:

$ bundle exec rspec spec/dependabot/julia/version_spec.rb spec/dependabot/julia/requirement_spec.rb spec/dependabot/julia/requirements_updater_spec.rb
99 examples, 0 failures

Checklist

  • I have run the relevant pure-Ruby tests (version_spec, requirement_spec, requirements_updater_spec) locally. I have not run the integration tests that require the Julia helper.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request.
  • I have ensured that the code is well-documented and easy to understand.

Julia's JLL packages use a "+N" suffix on the version (e.g. "0.0.43+1")
to identify rebuilds of the same source version. Per semver, build
metadata is ignored when ordering versions, and Julia's Pkg treats e.g.
"0.0.43" and "0.0.43+1" as compatibility-equivalent.

Previously, `Dependabot::Julia::Version.new("0.0.43+1")` parsed the
build suffix as an additional segment, producing `[0, 0, 43, 1]`. That
sorted strictly greater than `"0.0.43"`, so:

  - `LatestVersionFinder` reported a JLL rebuild as a newer release
    available for update.
  - `Gem::Requirement.new("=0.0.43").satisfied_by?` returned false for
    the rebuild, so `RequirementsUpdater` did not short-circuit and
    appended a redundant version spec (e.g. `"=0.0.43"` →
    `"=0.0.43, 0.0.43"`).

Strip the build metadata in the constructor so build rebuilds compare
equal to the underlying source version.
@maleadt maleadt requested a review from a team as a code owner May 22, 2026 13:23
Copilot AI review requested due to automatic review settings May 22, 2026 13:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for Julia SemVer build metadata (notably JLL “+N” rebuild suffixes) by normalizing versions so build metadata does not affect comparisons or requirement satisfaction.

Changes:

  • Strip +... build metadata during Dependabot::Julia::Version initialization.
  • Add RSpec coverage for .correct?, initialization normalization, ordering/equality, and Gem::Requirement satisfaction behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
julia/lib/dependabot/julia/version.rb Normalizes versions by removing build metadata suffix before parsing/comparison.
julia/spec/dependabot/julia/version_spec.rb Adds specs validating metadata stripping and equality/requirement semantics for JLL rebuilds.

Comment on lines +28 to +32
# Strip build metadata suffix (e.g. "0.0.43+1" -> "0.0.43"). Julia's JLL
# packages use the "+N" suffix to identify rebuilds of the same source
# version; per semver build metadata is ignored when ordering versions,
# and Julia's Pkg treats "0.0.43" and "0.0.43+1" as compatibility-equivalent.
version_string = version_string.sub(/\+.*\z/, "")
# packages use the "+N" suffix to identify rebuilds of the same source
# version; per semver build metadata is ignored when ordering versions,
# and Julia's Pkg treats "0.0.43" and "0.0.43+1" as compatibility-equivalent.
version_string = version_string.sub(/\+.*\z/, "")
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 this pull request may close these issues.

3 participants