Avoid breaking the cat pipe by reading from head (infra)#936
Merged
Conversation
yphus
approved these changes
Jan 15, 2024
yphus
left a comment
There was a problem hiding this comment.
Tested with the checkbox classic20 frontend snap:
Building workaround-automated-review-issue
+ echo 'This file is a workaround for a bug in the automated snap review tool'
+ echo 'this only contains random bytes to pad the snap to 16kb'
+ echo 'see: https://bugs.launchpad.net/review-tools/+bug/2049093'
+ head -c 16384 /dev/urandom
Staging config-variables
+ snapcraftctl stage
Staging launchers
+ snapcraftctl stage
Staging version-calculator
+ snapcraftctl stage
Staging workaround-automated-review-issue
+ snapcraftctl stage
Priming config-variables
+ snapcraftctl prime
Priming launchers
+ snapcraftctl prime
Priming version-calculator
+ snapcraftctl prime
Priming workaround-automated-review-issue
+ snapcraftctl prime
The 'passthrough' property is being used to propagate experimental properties to snap.yaml that have not been validated.
Snapping |
Snapped checkbox_3.3.0-dev87_amd64.snap
LiaoU3
pushed a commit
to LiaoU3/checkbox
that referenced
this pull request
Mar 20, 2024
Avoid breaking the cat pipe by reading from head
binli
pushed a commit
to binli/checkbox
that referenced
this pull request
Mar 22, 2024
Avoid breaking the cat pipe by reading from head
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.
Description
Currenty the frontend snaps are failing to build. In the logs snapcraft is reporting a non-0 return value on the new workaround part. This error is
141(broken pipe). This happens because we arecat-ing from/dev/urandom(an infinite source) and closing the pipe via head, effectively breaking it. This doesn't make some series fail because it may be (not confirmed, but a very likely theory) that snapcraft started to set theset -o pipefailonly recently-ish.This PR fixes this problem by making head read the file directly instead of reading it via cat
Resolved issues
Broken daily builds here: https://github.com/canonical/checkbox/actions/runs/7505763759
Documentation
N/A
This doesn't change the effect of the command, it should only make it go through without "breaking" the pipe and making snapcraft mad
Tests
The following fails (exits with return code 141) with the same error:
while this doesn't: