test(ci): check if macos build is stable on nix-darwin host#8163
Open
markoburcul wants to merge 2 commits intounstablefrom
Open
test(ci): check if macos build is stable on nix-darwin host#8163markoburcul wants to merge 2 commits intounstablefrom
markoburcul wants to merge 2 commits intounstablefrom
Conversation
Signed-off-by: markoburcul <marko@status.im>
a6a1f55 to
b5f8d69
Compare
Check if GNU getopt is available in PATH before falling back to Homebrew-specific paths. This supports nix-darwin and other package managers that install GNU getopt outside of Homebrew. Also updates DYLD_LIBRARY_PATH discovery to check standard locations before assuming Homebrew. Signed-off-by: markoburcul <marko@status.im>
b5f8d69 to
7fed330
Compare
jakubgs
approved these changes
Apr 13, 2026
Comment on lines
+34
to
+44
| if uname | grep -qi darwin; then | ||
| # Check if getopt in PATH is GNU getopt (exit code 4 from --test) | ||
| getopt_rc=0 | ||
| getopt --test > /dev/null 2>&1 || getopt_rc=$? | ||
| if [ $getopt_rc -eq 4 ]; then | ||
| GETOPT_BINARY="getopt" | ||
| else | ||
| # Fall back to Homebrew paths | ||
| GETOPT_BINARY=$(find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null | head -n1 || true) | ||
| [[ -f "$GETOPT_BINARY" ]] || { echo "GNU getopt not installed. Install via 'brew install gnu-getopt' or ensure GNU getopt is in PATH. Aborting."; exit 1; } | ||
| fi |
Member
There was a problem hiding this comment.
Wouldn't it be simpler to make this into a scripts/getopt-wrapper.sh and use that:
GETOPT_BINARY="${SCRIPTS_DIR}/getopt-wrapper.sh"
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.
Adjustments to the scripts to also work on the MacOS hosts where we configure them using nix-darwin.
Reason for this change is that we are in the process of removing homebrew from our MacOS CI hosts and replacing it with nix-darwin.