-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve error handling 3 #255
Conversation
Debian stretch build still failing as mentioned earlier in #248 (comment). But not an issue introduced by this PR. This PR here makes the issue only visible. I compared with an arbitrary different recent PR. A PR not authored by me. Namely this PR: Here is the relevant excerpt from the other PR build log:
This issue seems parmement. And also not worth reporting to Debian as stretch doesn't have security support by Debian anymore anyhow. Potential solutions:
Quote https://wiki.debian.org/DebianStretch
I'll attempt to implement option B) for now until I receive other feedback. |
3eaca7a
to
da01692
Compare
All tests are passing now except shellcheck but these seem to be unrelated to this PR. I would appreciate some feedback on how to proceed with this PR. |
grml-debootstrap
Outdated
@@ -257,7 +257,9 @@ cleanup() { | |||
|
|||
# Remove temporary mountpoint again | |||
if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then | |||
rmdir "$MNTPOINT" 2>/dev/null | |||
if test -d "$MNTPOINT" ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use if [ -d ....
style here, as we do elsewhere in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I.
- A) simply add a commit on top (preferred, easier for me) or,
- B) should I (learn to) modify the existing commit and fix the style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed after force push just now.
if stage $i ; then | ||
$i | ||
stage $i 'done' | ||
if stage "$i" ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaving the comment here, since on GitHub one sadly can't seem to comment on the commit message itself, AFAICS: the change itself LGTM, though please use something like "chroot-script: properly quote stage execution code" in the commit message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means I should leave most commit messages as is but modify this specific commit message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be more than happy to get nice commit messages! This one only clearly jumped into my eye :) So please feel free and invited to the reword your commit messages (and also squash logically related commits!), so they tell a nice story when going through them, but also have a (somewhat) nice state/story for debian/changelog (the first line of each commit message message shows up there by default when I release a new version, see gbp dch
!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was about to suggest, I was hoping, all of these commits could be squashed into 1. These changes aren't really interesting for users. Just "improved error handling".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote this commit message, grouped together and also improved other commit messages.
unstable|sid) ;; # no security pool available | ||
jessie|stretch|buster) | ||
unstable|sid|stretch) ;; # no security pool available | ||
jessie|buster) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure this change makes sense? stretch is in between jessie and buster (see https://wiki.debian.org/DebianReleases)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I am sure. The repository is defunct but not worth reporting upstream to Debian because that suite is end of life.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but then at least jessie should be affected as well, nor? :)
Also see http://archive.debian.org/debian-security/dists/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, I agree. It should also be affected. But in practice, it's not as I could see from the CI tests. I don't have an explanation why it is as is. I just noticed that oddly 1 Debian security repository for an EOL suite is broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Porting to archive.debian.org
might fix this issue but lets consider that a separate issue that is not worth doing for an EOL suite? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that not enabling security repository for stretch didn't reduce the security or change installed packages.
- Previously: the stretch build would just show an error message that the stretch repository is unavailable, ignore it, and proceed.
- After this PR that enabled strict error checking: That resulted in a build failure so we at least know something is wrong. It only made this issue apparent. But the issue was there all along even if nobody noticed.This PR however didn't worsen anything. Well, could argue in theory if that stretch security repository ever comes back online then it's missing from these builds. If that is considered an issue then indeed code to make stretch use
archive.debian.org
might be required.
chroot-script
Outdated
@@ -480,6 +480,10 @@ EOF | |||
local rootfs_mount_options="" | |||
|
|||
if [ -z "${FILESYSTEM}" ] ; then | |||
## Debugging. | |||
ls -la /dev/disk/by-uuid/"${TARGET_UUID}" | |||
blkid /dev/disk/by-uuid/"${TARGET_UUID}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reason to leave this commit in this PR, nor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Removed after force push. Done.
Ok great
Yeah I think we can go forward with this, I left comments on some of the commits, and think we should get rid of the debugging related changes that shouldn't be part of the main grml-debootstrap? (No objections to enable debugging code when running with |
because these are now covered by the error_handler
No need to use both, `eend 1` and `bailout 1`. In these cases, only `bailout 1` is sufficient.
da01692
to
e2222be
Compare
only delete `$MNTPOINT` if such a folder actually exists
only delete `$MNTPOINT` if such a folder actually exists
because these are now covered by the new error handling method
because the cleanup function gets run by the error handler and should not be nested
because it will not always work will not work in cases where /dev etc is still mounted inside the chroot
to work around an issue by github actions drop `-q` from modprobe for better debug output
because no longer provided by Debian
e2222be
to
7a3f1d9
Compare
I've hopefully addressed all your feedback. Please kindly let me know if there's other blockers to get this merged. There's a new related issue which is triggered (but not caused) by this PR for which I created a separate issue: |
instead of sometimes mixed with "${MNTPOINT}/boot/efi"
Sorry for the delay, finally found some spare minutes to take care of this. Thanks for all your work around this, @adrelanos ! 👍 |
Fixes #224