Open
Conversation
Collaborator
|
Ohh, nice! Building the macOS wheel locally real quick to check it out :) |
AlexanderViand
requested changes
Mar 26, 2026
Collaborator
There was a problem hiding this comment.
I think it might be safer to not do the stripping for macOS?
At least, my local macos isn't very happy about it:
ERROR: /Users/a.viand/Code/heir/tools/BUILD:14:10: Stripping tools/heir-opt.stripped for @@//tools:heir-opt failed: (Exit 1): strip failed: error executing CcStrip command (from target //tools:heir-opt) /usr/bin/strip -S -o bazel-out/darwin_arm64-opt/bin/tools/heir-opt.stripped --strip-all bazel-out/darwin_arm64-opt/bin/tools/heir-opt
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: unrecognized option: --strip-all
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip [-AnuSXx] [-] [-d filename] [-s filename] [-R filename] [-o output] file [...]
ERROR: Build did NOT complete successfully
error: command '/opt/homebrew/bin/bazel' failed with exit code 1
ERROR Backend subprocess exited when trying to invoke build_wheel
✕ 748.31s
cibuildwheel: error: Command ['/private/var/folders/5l/3dm70vvs6kz5s_bt9h67zlvm0000gp/T/cibw-run-aaxc9bbn/cp312-macosx_arm64/build/venv/bin/python', '-m', 'build', '/Users/a.viand/Code/heir', '--wheel', '--outdir=/private/var/folders/5l/3dm70vvs6kz5s_bt9h67zlvm0000gp/T/cibw-run-aaxc9bbn/cp312-macosx_arm64/built_wheel', '--installer=uv'] failed with code 1.
(heir) a.viand@MacBook-Air-A heir %
EDIT: linux x86_64 build is still running on an aws instance
Collaborator
|
linux x86_64 built fine and the package is now only 36.5MB (compressed), amazing!!! |
- Strip all symbols from executable targets, which cuts their size by ~35% - Dedupe the binaries from data_files by providing a python entrypoint.
Collaborator
Author
|
Oh good call. I knew I had to filter for linux but I forgot. I added the corresponding macos strip flag now instead |
Collaborator
|
Works great on macOS now! |
asraa
approved these changes
Mar 27, 2026
AlexanderViand
approved these changes
Mar 27, 2026
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.
Fixes #2822
I was able to test the python entrypoints locally with
pip install /path/to/heir(though it needs to happen outside of HEIR's project workspace or else the heir-opt and heir-translate binaries will be in HEIR's root). I was also able to confirm manually that the stripped binaries are stripped, though I configured the aggressive stripping to only occur in cibuildwheel.