Skip to content

FIX: don't let set -e abort on old bwrap/kernel version checks#13

Merged
Thomas A Caswell (tacaswell) merged 1 commit into
NSLS2:mainfrom
tacaswell:fix/old_bwrap
Jul 10, 2026
Merged

FIX: don't let set -e abort on old bwrap/kernel version checks#13
Thomas A Caswell (tacaswell) merged 1 commit into
NSLS2:mainfrom
tacaswell:fix/old_bwrap

Conversation

@tacaswell

Copy link
Copy Markdown
Contributor

Commit c83d29a replaced the manual major/minor/patch comparisons in detect_bwrap_capabilities and detect_kernel_capabilities with a _version_ge helper, called as:

_version_ge "${_bwrap_ver}" "0.6.3" && HAS_BIND_OVER_RO=1

Each such line is the last statement in its function. When _version_ge returns false — as it does on RHEL8's bubblewrap 0.4.0 (< 0.5.0 and < 0.6.3) and 4.18 kernel (< 5.14) — the function inherits that non-zero exit status. Under the wrappers' set -euo pipefail, the bare call to the detection function then aborts the whole script immediately, before any bwrap arguments are built. The result on RHEL8 is that bw* wrappers exit 1 with no output. On newer hosts every _version_ge returns true, so the last command exits 0 and the bug stays hidden.

Convert the three capability lines to if _version_ge ...; then VAR=1; fi. The if form is set -e-safe and leaves the detection functions returning 0 regardless of the comparison result.

Summary

Replace this with a brief summary of what this PR accomplishes.
For example, what functionality is added/removed, and why.

Description

More details could be added here with background info,
explanation of design choices, open questions for reviewers, etc.

Testing

Summarize how these changes were tested and on which hosts.
Include or link to test output here.
DO NOT POST SENSITIVE INFORMATION HERE.

Checklist

  • Edit the sections above with relevant information
  • Update in-repo documentation, if applicable
  • Run pixi run -e dev lint locally (or wait for CI) — see .github/workflows/lint.yml
  • Test the changes on a representative managed host (or runansible deployment)

Commit c83d29a replaced the manual major/minor/patch comparisons in
detect_bwrap_capabilities and detect_kernel_capabilities with a
_version_ge helper, called as:

    _version_ge "${_bwrap_ver}" "0.6.3" && HAS_BIND_OVER_RO=1

Each such line is the last statement in its function. When _version_ge
returns false — as it does on RHEL8's bubblewrap 0.4.0 (< 0.5.0 and
< 0.6.3) and 4.18 kernel (< 5.14) — the function inherits that non-zero
exit status. Under the wrappers' `set -euo pipefail`, the bare call to
the detection function then aborts the whole script immediately, before
any bwrap arguments are built. The result on RHEL8 is that bw* wrappers
exit 1 with no output. On newer hosts every _version_ge returns true, so
the last command exits 0 and the bug stays hidden.

Convert the three capability lines to `if _version_ge ...; then VAR=1; fi`.
The if form is set -e-safe and leaves the detection functions returning 0
regardless of the comparison result.
@tacaswell Thomas A Caswell (tacaswell) merged commit 5f564d4 into NSLS2:main Jul 10, 2026
1 check passed
@tacaswell Thomas A Caswell (tacaswell) deleted the fix/old_bwrap branch July 10, 2026 03:02
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.

2 participants