Debug: add binary diagnostics to find arm64 build output location#5148
Debug: add binary diagnostics to find arm64 build output location#5148
Conversation
… step Print BINARY_NAME value and contents of all three release dirs (release/, arm64-apple-macosx/release/, x86_64-apple-macosx/release/) before the binary existence check, so we can see exactly where the built binaries actually land on Codemagic mac_mini_m2.
Greptile SummaryAdds diagnostic output to the "Create universal app bundle" step in the Codemagic CI/CD workflow to help debug where arm64 binaries are placed during builds on
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 69fb2ee |
There was a problem hiding this comment.
Code Review
This pull request adds diagnostic commands to a Codemagic workflow to help debug the location of build artifacts. My review focuses on improving the correctness and readability of these new shell commands. I've identified a potential issue where the 'not found' message for missing directories may not be displayed as intended and have suggested a refactoring to fix this.
| echo "Desktop/.build/release/ contents:" | ||
| ls "Desktop/.build/release/" 2>/dev/null | grep -v "\.build\|\.o$\|\.d$" | head -30 || echo " (not found)" | ||
| echo "Desktop/.build/arm64-apple-macosx/release/ contents:" | ||
| ls "Desktop/.build/arm64-apple-macosx/release/" 2>/dev/null | grep -v "\.build\|\.o$\|\.d$" | head -30 || echo " (not found)" | ||
| echo "Desktop/.build/x86_64-apple-macosx/release/ contents:" | ||
| ls "Desktop/.build/x86_64-apple-macosx/release/" 2>/dev/null | grep -v "\.build\|\.o$\|\.d$" | head -30 || echo " (not found)" |
There was a problem hiding this comment.
The || echo " (not found)" fallback may not work as expected. The exit code of a pipeline is determined by the last command (head), which exits with 0 even on no input. This prevents the fallback from triggering when a directory is missing.
To make this more robust and correctly report when a directory is not found, it's better to explicitly check for the directory's existence. I've also corrected the grep pattern to use single quotes, which is safer in shell scripts to prevent unintended expansions and correctly pass the pattern to grep.
echo "Desktop/.build/release/ contents:"
if [ -d "Desktop/.build/release/" ]; then
ls "Desktop/.build/release/" | grep -v '\.build\|\.o$\|\.d$' | head -30
else
echo " (not found)"
fi
echo "Desktop/.build/arm64-apple-macosx/release/ contents:"
if [ -d "Desktop/.build/arm64-apple-macosx/release/" ]; then
ls "Desktop/.build/arm64-apple-macosx/release/" | grep -v '\.build\|\.o$\|\.d$' | head -30
else
echo " (not found)"
fi
echo "Desktop/.build/x86_64-apple-macosx/release/ contents:"
if [ -d "Desktop/.build/x86_64-apple-macosx/release/" ]; then
ls "Desktop/.build/x86_64-apple-macosx/release/" | grep -v '\.build\|\.o$\|\.d$' | head -30
else
echo " (not found)"
fi…sedHardware#5148) Adds ls of release dirs before binary check so we can see where arm64 binary actually lands on Codemagic mac_mini_m2 Xcode 16.4.
Adds ls of release dirs before binary check so we can see where arm64 binary actually lands on Codemagic mac_mini_m2 Xcode 16.4.