-
Notifications
You must be signed in to change notification settings - Fork 85
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
[M1 Utils] silence stderr warnings from vtool
and strip
#735
Conversation
tools/m1_utils/update_dynamic.sh
Outdated
@@ -19,10 +19,12 @@ patch() { | |||
fi | |||
|
|||
# FIXME: Versions should be input from the build system | |||
xcrun vtool -arch arm64 -set-build-version 7 11.0 11.0 -replace -output "$OF" "OF.ar" | |||
# stderr is ignored to silence expected warnings that the old code signatures will be invalid | |||
xcrun vtool -arch arm64 -set-build-version 7 11.0 11.0 -replace -output "$OF" "OF.ar" 2> /dev/null |
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.
WDYT to just remove the sig before if it has one via codesign remove-signature
?
# Remove the code sig to prevent warnings on further commands
if ! xcrun otool -l $OF | grep -q LC_CODE_SIGNATURE; then
codesign remove-signature $OF
fi
Also, if these command fail for other errors it will omit the string
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 need a robust version of checking for a sig w/o verifying )
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.
Good idea, I wasn't sure if other useful output would come through stderr for these commands. I'll give this a try tomorrow
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.
The signature was removed successfully but seems to have mangled the file somehow:
/Applications/Xcode-14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: fatal error: file not in an order that can be processed (link edit information does not fill the __LINKEDIT segment)
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.
If codesign --remove-signature
is too messed up, WDTY to just pipe stderrr and grep --invert $CODE_SIGNATURE_ERROR
, otherwise conditionally swallowing for signed ones only..
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.
Otherwise, grep --invert "warning:"
🙈
125dc75
to
9ffdc95
Compare
…g signed xcframeworks
9ffdc95
to
46853e6
Compare
xcrun vtool -arch arm64 -set-build-version 7 11.0 11.0 -replace -output "$OF" "OF.ar" \ | ||
2> >(grep --invert 'warning: code signature will be invalid' >&2) | ||
|
||
# Xcode 13.1-13.2.1 workaround - see update_static.sh | ||
strip -S "$OF" | ||
# Xcode 13.1-13.2.1 workaround - see update_static.sh | ||
# filter stderr to ignore code signature warnings | ||
strip -S "$OF" \ |
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.
For future: we should revisit these soon 🙏
Silence stderr from
vtool
andstrip
when updating vendored dynamic frameworks.Hides output with pre-built xcframeworks that looks like this: