Skip to content

dist/tools/dlcache: make script more portable#21924

Merged
maribu merged 1 commit intoRIOT-OS:masterfrom
maribu:dlcache/portable
Dec 2, 2025
Merged

dist/tools/dlcache: make script more portable#21924
maribu merged 1 commit intoRIOT-OS:masterfrom
maribu:dlcache/portable

Conversation

@maribu
Copy link
Copy Markdown
Member

@maribu maribu commented Dec 2, 2025

Contribution description

  • do not use bash in shebang, e.g. containers may not ship bash
  • do not use flock -w <timeout_secs> ..., but timeout <timeout_secs> flock ... to be portable to even busybox's flock implementation

Testing procedure

dlcache should still work as before

Issues/PRs references

None

@maribu maribu requested a review from crasbe December 2, 2025 10:39
@github-actions github-actions bot added the Area: tools Area: Supplementary tools label Dec 2, 2025
- do not use `bash` in shebang, e.g. containers may not ship bash
- do not use `flock -w <timeout_secs> ...`, but
  `timeout <timeout_secs> flock ...` to be portable to even busybox's
  flock implementation
- sha512sum is more common on Linux than shasum
@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Dec 2, 2025
rm "$lockfile"
}
else
SHA512="sha512sum"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the reason for this change? shasum should be portable 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sha512sum --verison
sha512sum: unrecognized option: verison
BusyBox v1.37.0 (2025-08-05 16:40:33 UTC) multi-call binary.

Usage: sha512sum [-c[sw]] [FILE]...

Print or check SHA512 checksums

	-c	Check sums against list in FILEs
	-s	Don't output anything, status code shows success
	-w	Warn about improperly formatted checksum lines
/ # shasum --version
/bin/sh: shasum: not found
/ # 

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Huh, okay. Haven't tried Busybox.

@riot-ci
Copy link
Copy Markdown

riot-ci commented Dec 2, 2025

Murdock results

✔️ PASSED

21824cc dist/tools/dlcache: make script more portable

Success Failures Total Runtime
1 0 1 02m:42s

Artifacts

@maribu maribu added this pull request to the merge queue Dec 2, 2025
Merged via the queue into RIOT-OS:master with commit 668dfd9 Dec 2, 2025
32 checks passed
@maribu maribu deleted the dlcache/portable branch December 2, 2025 12:52
@leandrolanzieri leandrolanzieri added this to the Release 2026.01 milestone Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants