Skip to content

refactor: Sort sysext SHA256SUMS entries for deterministic output#21

Open
frostyardyeti[bot] wants to merge 1 commit intomainfrom
yeti/improve-cb33
Open

refactor: Sort sysext SHA256SUMS entries for deterministic output#21
frostyardyeti[bot] wants to merge 1 commit intomainfrom
yeti/improve-cb33

Conversation

@frostyardyeti
Copy link
Copy Markdown

@frostyardyeti frostyardyeti bot commented Mar 28, 2026

In internal/generator/sysext/generator.go lines 121-125, the SHA256SUMS content is built by iterating over a Go map (sha256Entries), whose iteration order is non-deterministic. This means the SHA256SUMS file will have entries in a different order on each run, even when the input is identical. This breaks reproducible builds and causes unnecessary diffs when checking generated output into version control or comparing incremental updates.

Fix: Add sort.Strings(sha256Lines) before the strings.Join on line 129. The sort package is already imported in this file.


Automated improvement by yeti improvement-identifier

The SHA256SUMS content was built by iterating over a Go map, whose
iteration order is non-deterministic. Sort the lines before joining
to ensure reproducible output across runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant