Repository navigation
Skip sudo for privileged commands when already running as root - #61
Open
kurtmcdonald wants to merge 1 commit into
Open
kurtmcdonald wants to merge 1 commit into
kurtmcdonald wants to merge 1 commit into
Conversation
Co-Authored-By: Kurt McDonald <kurt@blacksmith.sh>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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.
Summary
Container jobs that opt in with
allow-inside-container: truetypically run as root in an image without asudobinary. Every privileged call inblacksmith-cache.tswas a hardcodedsudo ..., so the first one after the sticky disk was granted (blockdev --getsize64) threwUnable to locate executable file: sudo, the setup error was caught ingit-source-provider.ts, and the job silently fell back to a plain checkout — losing the git mirror.New helper, applied at all 11 call sites (
blockdev,blkid,resize2fs,mkfs.ext4,mkdir,mount,chown,umount,blockdev --flushbufs):The two
timeout N sudo ...wrappers (umount, flushbufs) spreadasRoot(...)into thetimeoutargv. Behavior on the runner VM (non-root) is unchanged.Same pattern as proposed fix #1 on BLA-4661 (stickydisk action); this PR only covers checkout.
dist/index.jsrebuilt.Link to Devin session: https://app.devin.ai/sessions/f43e6133d752489f9b3cf56906c10321
Open in Devin Desktop: https://app.devin.ai/desktop/session/f43e6133d752489f9b3cf56906c10321?variant=devin
Requested by: @kurtmcdonald
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.