update_check: auto-prefix refs/tags/ for info/refs patterns; adapt 101 update files#60609
Draft
Rutpiv wants to merge 104 commits into
Draft
update_check: auto-prefix refs/tags/ for info/refs patterns; adapt 101 update files#60609Rutpiv wants to merge 104 commits into
Rutpiv wants to merge 104 commits into
Conversation
Contributor
Author
|
Marking as draft. I spent a lot of time on this and want to step back and look at it from a different angle before continuing. Will come back when I have a clearer view of the scope. |
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.
@classabbyamp's PR #60025 migrated
update_check.shfrom HTML scraping to gitinfo/refs?service=git-upload-pack. This avoids fragile HTML parsing and reduces bandwidth usage.The
info/refsendpoint emits tag entries in the form<sha>\trefs/tags/<tag>. While investigating why Vulkan-Headers and related packages weren't appearing invoid-updates.txt, I found that custompattern=entries inupdatefiles, originally written against HTML output, no longer match because they don't account for therefs/tags/prefix. This PR fixes the 101 affected packages (of 152 with custom patterns reachinginfo/refs) and proposes two small additions toupdate_check.shthat aim to keepupdatefiles concise and resilient going forward.Infrastructure changes
Two additions to
update_check.sh:Auto-prefix
refs/tags/when (a) the URL is aninfo/refsendpoint and (b) the custom pattern doesn't already start withrefs/tags/. Existing patterns with explicit anchor remain unchanged. Fully backward compatible.distfiles_only=yesvariable forupdatefiles. When set, homepage scanning is skipped and only distfile URLs are checked.Manual.mdis updated to describe both features and provide guidance on choosing between the default behavior,distfiles_only=yes, andsite=URL.Design rationale
Why auto-prefix
refs/tags/?The
info/refsendpoint (used byupdate_check.shsince #60025) emits tag lines in a uniform format: every line ends withrefs/tags/<tag>. Since therefs/tags/prefix is a property of the wire format rather than something each package needs to express, it seemed reasonable to handle it at the script level.The alternative would be adding
refs/tags/to each affectedupdatefile individually. That works, but spreads endpoint-format knowledge across ~100 packages. Centralizing it in the script keepsupdatefiles focused on what's package-specific (the tag naming convention upstream chose) rather than protocol-level detail.The condition is narrow (URL contains
info/refsAND pattern doesn't already start withrefs/tags/), so explicit-anchor patterns continue working unchanged. The 44 untouched custom-pattern packages were cross-checked againstmasterto confirm this. No regressions observed.I'm happy to revisit this approach if you'd prefer the per-package path. The script change is small and easy to drop.
Why
distfiles_only=yes?The homepage scan is a useful heuristic when patterns live in HTML space, since a single broad pattern can catch versions in either the homepage or the distfiles page. With
info/refs, the situation changes a bit: the endpoint already provides a uniformly-structured tag listing, while the homepage remains a human-facing page whose layout can change for unrelated reasons.In practice, two patterns emerge:
<title>Release foo-X</title>). When upstream redesigns the site, these break even when the tags themselves are stable.info/refscan stay simpler and more structural (e.g.,vulkan-sdk-\K[\d.]+against arefs/tags/listing). Adding homepage-survival logic to them tends to bloat the regex.distfiles_only=yesis meant as an opt-in for packages where the homepage adds noise rather than signal. Default behavior is unchanged.Why a new variable instead of
site=URLtoinfo/refs?site=works for this. It's used in this PR forlibeotandlibluv, where upstream's tag scheme requires it. The reason I went with a separate variable is thatsite=URLrequires each package to spell out the fullinfo/refsURL, duplicating information already derivable from the template'shomepage/distfiles.distfiles_only=yesis one line and lets the framework keep deriving the endpoint from the template.The Manual update describes this as a small spectrum: default for most packages,
distfiles_only=yeswhen the homepage adds noise,site=URLwhen a different endpoint is genuinely required.Package changes (101)
Adapted custom patterns so
./xbps-src update-check <pkg>returns the correct latest version viainfo/refs. Each was verified individually with./xbps-src update-check, often withXBPS_VERBOSE=yesto confirm the URL and regex being used. Pre-release tags (rc,beta,pre) were caught by inspecting upstream tags viacurl 'info/refs?service=git-upload-pack'and filtered withignore=where needed.34 of these also gained
distfiles_only=yes.Full list of touched packages
CImg, EternalTerminal, ImageMagick, Lucene++, OpenSubdiv, SPIRV-Headers, SPIRV-LLVM-Translator19, SPIRV-LLVM-Translator21, SPIRV-LLVM-Translator22, SPIRV-Tools, UEFITool, Vulkan-Headers, Vulkan-Tools, Vulkan-Utility-Libraries, Vulkan-ValidationLayers, asahi-uboot, atomicparsley, cgal, cronutils, discount, eigen3.2, faac, faad2, flintlib, fntsample, font-adobe-source-code-pro, gdmd, gnome-epub-thumbnailer, godot, gopls, gzdoom, incron, inih, intel-ucode, inxi, iverilog, j4-dmenu-desktop, kodi, lf, libaccounts-qt, libblockdev, libcgroup, libeot, libgit2-1.8, libgit2-1.9, libgme, libhomfly, libkeybinder3, libluv, libmygui, libui, libvidstab, lilypond-doc, linux-asahi, liteide, lm_sensors, lmdb, love, lsyncd, lua54-luafilesystem, mame, mathjax2, md4c, minio, miruo, moosefs, openimageio, openjdk8, otfcc, pgbackrest, poedit, python3-aioamqp, python3-hypothesis, python3-pyqtgraph, re2, redshift, redsocks, sane, sasm, sdl12-compat, slurm-wlm, spectrwm, swayr, swayrbar, taplo, tectonic, tinymist, tmux, vapoursynth, w3m, wire-desktop, wlroots0.18, wlroots0.19, wlroots0.20, x265, xdelta3, yaydl, zeux-volk, zfs-auto-snapshot, zfs-lts, zimg
Numbers
Of 1,574 unique
updatefiles:site=set, so the URL is transformed toinfo/refswhen the template references a git forge.info/refsis actually used.pattern=:refs/tags/prefix and are updated here.NO VERSIONfor unrelated reasons.NO VERSIONdue to template peculiarities.info/refsis not engaged.site=set, so the URL is used as-is andinfo/refsis not engaged.tar.gz/archive/refs/tags); they continue working via HTML scraping, so migrating them is cosmetic.Commands used to gather these numbers:
Validation
Each of the 101 modified
updatefiles was individually verified with./xbps-src update-check(often withXBPS_VERBOSE=yes) to confirm the URL fetched, the regex applied (including the auto-prefix), and the version detected.In addition, the 51 untouched custom-pattern packages (44 already compatible with the
refs/tags/prefix, 7 with pre-existingNO VERSIONcauses) were cross-checked against themasterbaseline to confirm theupdate_check.shchanges introduce no regressions on the unmodified set. No regressions were observed.Out of scope / follow-up
Packages with
site=pointing to git-forge HTML pages (~85). These still work via HTML scraping but could be migrated toinfo/refsfor consistency. This is a different class of change (modifyingsite=rather thanpattern=), left as a potential cosmetic follow-up.Templates with version-format mismatches. Some packages have pattern migration that works correctly but the template's
version=itself follows an older convention than current upstream (e.g.,slurm-wlmtemplate19.05.5.1vs upstream25-11-6-1). The pattern migration is included since it makes detection work again; the version-format bump is left as separate per-package work.Upstream-archived packages (
cronutils,otfcc,minio,redshift). Patterns are migrated for consistency, but these may warrant removal or orphan in separate cleanup PRs.SPIRV-Tools tag format. The pattern migration here aligns detection with the other Khronos packages in this PR. The template currently consumes a release-candidate tag format; aligning with the Vulkan SDK release cycle would be a separate decision.
libgme upstream move. Upstream migrated from Bitbucket (
mpyne/game-music-emu) to GitHub (libgme/game-music-emu). The template still points at the old Bitbucket location, which a future PR may want to address.Feedback welcome, particularly on the auto-prefix condition scope and whether
distfiles_only=yesreads well alongside the existingsite=mechanism inManual.md.