Architecture trimming should be mentioned in README and on the webpage
Artoria2e5 opened this issue · 15 comments
Now that fat binaries are becoming common again, it makes a lot of sense to really mention this feature.
+1 I also came to the Monolingual website in the hopes for a M1/Intel fat binary trimming solution and looked for that info.
Btw, is Monolingual suited for trimming the M1 or Intel part of fat binaries?
And if so, is this a manual oneshot operation?
Or a semi/fully automatic solution that runs event-based (filesystem changes in /Applications/*
or AppStore events or PKG installer events) or schedule-based ( every X min/hour/days
)?
I don't have an M1-based Mac to test, so I would appreciated if someone could test 22283e3 and provide feedback here.
As for oneshot vs. automated operation: Monolingual is currently a manual operation, but you may have some luck automating it using the embedded command-line interface provided by the helper tool, see
/Applications/Monolingual.app/Contents/XPCServices/Monolingual.xpc/Contents/Library/LaunchServices/com.github.IngmarStein.Monolingual.Helper -h
Thanks for clarifying that stripping is currently a oneshot operation.
Another inquiry: I would like to know "How much potential saving would I gain when stripping all or certain apps and certain architectures and languages?" before performing this. To consider whether the storage gain is worth the flexibility/portability loss. Does the app already do that?
Mockup:
⊟▾ | Name | Current size | - architectures | - languages | Total saved | in % |
---|---|---|---|---|---|---|
☐ | BBEdit | 23 MB | - 0,3 MB | - 2 MB | -2,3 MB | -10 % |
☑︎ | mpv | 80 MB | - 10 MB | - 10 MB | - 20 MB | -25 % |
☑︎ | Visual Studio | 1,2 GB | - 16 MB | - 44 MB | -60 MB | -5% |
= | 2 of 3 apps | 1,2 GB | - 28 MB | 66,3 MB | - 82,3 MB | 6,3% |
Monolingual does not do a preflight to estimate the space savings. I recommend CleanMyMac, if you need this.
I don't have an M1-based Mac to test, so I would appreciated if someone could test 22283e3 and provide feedback here.
As for oneshot vs. automated operation: Monolingual is currently a manual operation, but you may have some luck automating it using the embedded command-line interface provided by the helper tool, see
/Applications/Monolingual.app/Contents/XPCServices/Monolingual.xpc/Contents/Library/LaunchServices/com.github.IngmarStein.Monolingual.Helper -h
i have M1 mac mini, and I have Xcode 12.4... tried to compile, but is there any documentation for it ? when i tried it from command line w/ "make release", i got below error:
[21:25:59]: $ set -o pipefail && xcodebuild -scheme Monolingual -project Monolingual.xcodeproj -configuration Release -destination 'generic/platform=macOS' -archivePath /Users/alperc/Library/Developer/Xcode/Archives/2021-03-21/Monolingual\ 2021-03-21\ 21.25.59.xcarchive clean archive | tee /Users/alperc/Library/Logs/gym/Monolingual-Monolingual.log | xcpretty
[21:25:59]: ▸ objc[6479]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x203aec188) and ?? (0x1184502b8). One of the two will be used. Which one is undefined.
[21:25:59]: ▸ objc[6479]: Class AMSupportURLSession is implemented in both ?? (0x203aec1d8) and ?? (0x118450308). One of the two will be used. Which one is undefined.
[21:26:00]: ▸ Clean Succeeded
[21:26:01]: ▸ ❌ error: No signing certificate "Developer ID Application" found: No "Developer ID Application" signing certificate matching team ID "ADVP2P7SJK" with a private key was found. (in target 'Monolingual' from project 'Monolingual')
[21:26:01]: ▸ ❌ error: The linked and embedded framework 'Sparkle.framework' is missing one or more architectures required by this target: arm64. (in target 'Monolingual' from project 'Monolingual')
[21:26:01]: ▸ ❌ error: No signing certificate "Developer ID Application" found: No "Developer ID Application" signing certificate matching team ID "ADVP2P7SJK" with a private key was found. (in target 'Helper' from project 'Monolingual')
[21:26:01]: ▸ ❌ error: No signing certificate "Developer ID Application" found: No "Developer ID Application" signing certificate matching team ID "ADVP2P7SJK" with a private key was found. (in target 'XPCService' from project 'Monolingual')
[21:26:01]: ▸ ** ARCHIVE FAILED **
Ah, codesigning of course… here's a build signed with my Developer ID: Monolingual-1.8.2.dmg.zip
ok, it shows my architecture correctly: ARM64E. architecture list is also fine. but it doesn't remove anything. both on languages & arch window. on console, there is nothing helpful. let me know if i can help somehow to debug.
btw, on architecture section, Intel 64 is selected by default, but as you know, lots of apps doesn't support ARM currently, so we need Intel 64 too on M1 machines.
A console log would be helpful, thanks!
It should be fine to select Intel64: Monolingual should only remove it when there is an ARM slice present - it would not be removed it if is the only architecture in a binary. This logic had been working in the PPC -> Intel transition, so it should be validated if it's still correct.
it is interesting, i clicked "remove" on both language and arch with default settings... but nothing happened...
I didn't get much out of the attached log above. Was anything written to ~/Library/Logs/Monolingual.log?
Here's another build where I bumped the version number to 1.9.0 to ensure that the helper is updated (it is left alone if the version number doesn't change): Monolingual-1.9.0.dmg.zip
uninstalled old file (w/ AppCleaner), installed Monolingual 1.9.0. after it i tried to delete languages & archs again, nothing happened.
this is ~/Library/Logs/Monolingual.log:
Monolingual.log
just to update about latest situation: macos 11.3 didn't solve the problem. it doesn't remove any files again. it has "full disk access" too. let me know if i can help somehow. maybe a test build with more debug lines can help, just my 2 cents.
I have the same log on Monterey: Deleted files is blank, and the progress bar just bounces around.