Repository navigation
test(shell): stop a slow first otool on a fresh macOS runner from failing the sherpa bundle check - #496
Merged
Conversation
…first otool cannot fail the check On a fresh macOS runner the first otool call goes through a cold xcrun lookup (0.8 to 2.9 s on 20 fresh runners, once over 5 s in CI), and at the 5 s test timeout Bun killed it and the check read empty output. The load commands are now parsed from the Mach-O file; a file that is not one throws. Removes the temporary probe workflow.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Owner
Author
|
@coderabbitai full review |
Action not completed
|
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.
The sherpa-onnx bundle check failed
check (macos-latest)on PR #494 withExpected to contain "@rpath/libsherpa-onnx-c-api.dylib", Received "". The addon was fine. The test askedotool -Lfor the libraries it links, and otool never answered in time./usr/bin/otoolis an xcrun shim. On a fresh runner its first lookup is always cold. On a quiet Mac it costs 0.4 s afterxcrun --kill-cacheand 0.00 s warm. On CI it is much slower: the test took 0.44 to 2.8 s (median 1.3 s) across 54 macOS check jobs, and once 5.02 s. That once, Bun hit the 5 s test timeout, killed the child (the log sayskilled 1 dangling processfive seconds into the test) and the check read empty stdout. So a slow tool showed up as "the addon links neither library".The fix reads the libraries straight from the addon's Mach-O load commands in the test process (
tests/macho-helpers.ts, about 40 lines). No subprocess, no xcrun. On the real addon it returns the same four namesotool -Lprints after the file's own id. A file that is not a thin Mach-O throws, so a bad read can't pass as "links nothing". On darwin-arm64 a missing addon now fails the check instead of skipping it.Before and after, on 20 fresh
macos-latestrunners (a temporary probe workflow, deleted in the second commit):The CI history has 1 failure in 54 jobs, and nothing in it beat the 5 s timeout except the one failure.
Regression test:
[spike] Native libraries missing from the bundle: the linked names come from the file's load commands, with no otool to outlive the test. Positive controls: an addon missing one library is caught, and a shell script throws. I also checked two mutations on a Mac. DroppingLC_LOAD_DYLIBfrom the parser turns both sherpa tests red. Naming an extra library inSHERPA_LIBSturns the bundle test red.The TRAPS entry sits at the end of Packaging.