You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for catching this — the flake was real: linux/amd64 resolved to yt-dlp_linux.zip (glibc) or yt-dlp_musllinux.zip (musl) at random, roughly 1 in 7 runs.
Rather than relaxing the assertion, I fixed the root cause in the handler in 2028bfe.
Root cause: "assumed" assets (filenames with no explicit os/arch token) are collected into a map in getAssetsNoCache and then merged into the result via for _, cAsset := range candidates — a randomized Go map iteration. When two assumed assets collapse to the same os/arch slot (glibc yt-dlp_linux.zip → linux/amd64 and musl yt-dlp_musllinux.zip → /amd64, both normalizing to linux/amd64), whichever the map visited first won. Fixed input, random output.
Fix: candidates are now resolved through a total order before gap-filling the index:
Asset.preferredOver — prefer musl over glibc (portability), then avoid gnu, then break ties by name. Because it's a total order, the winner is independent of map iteration order.
exact os/arch matches still beat assumed assets, so e.g. linux/arm64 stays yt-dlp_linux_aarch64.
Added TestAssumedAssetDeterministic (100 iterations/run) guarding both invariants; TestYtDlp is now stable over 25+ runs and the strict linux/amd64 → yt-dlp_musllinux.zip assertion is kept, so it continues to guard the musl preference.
Since the handler is deterministic now, this test change isn't needed — closing. Thanks again for the report and the clear repro!
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
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.
No description provided.