lwouis / fat-drive-sorter

Actually sort files on your FAT drives
https://fat-drive-sorter.netlify.app
GNU General Public License v3.0
28 stars 0 forks source link

Unable to build from release tarball on Xcode 16 #5

Open i0ntempest opened 1 month ago

i0ntempest commented 1 month ago

I am trying to build the Xcode project from 1.1.2 release tarball and later publish it to MacPorts but I'm encountering errors: First I got a No such module 'LetsMove' error. It's not needed for MacPorts anyway so I tried to remove it by editing the code and LDFLAGS a bit. This allowed me to get pass the error but then I got another one: ld: framework 'Pods_fat_drive_sorter' not found during the final linking phase. Seems to be related to cocoapods so I did a pod install but that didn't do anything. Help please?

lwouis commented 1 month ago

Hi,

Dependencies are already commited on git. No need to download them with pod install.

Have you opened the project using the .xcworkspace file? You shouldn't open with the .xcodeproj file.

Thank you 🙇

i0ntempest commented 1 month ago

Yea thanks, I was using the project file. I managed to get it built but the version is #VERSION#. How do you handle versions in release builds? Or do you just set version manually in Xcode every time?

i0ntempest commented 1 month ago

Also the app built from Release scheme does not work correctly, it's calling fatsort wrong. The Debug scheme works fine. Xcode console log: [AppCenterCrashes] WARNING: -[MSACCrashes configureCrashReporterWithUncaughtExceptionHandlerEnabled:]/731 Detecting crashes is NOT enabled due to running the app with a debugger attached. NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed "list" "afterUnmount" main: WARNING: The C locale does not support all multibyte characters! main: Too many arguments! main: Use -h for more help. "fatsort -l" "" WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:. "afterMount"

i0ntempest commented 1 month ago

Could be a swift v6 bug. Disable swift optimization and it works fine...

lwouis commented 1 month ago

Hi,

The project uses Swift 5.

If your goal is only to add the project to MacPorts, I think it's something that would be better handled via CI/CD. On my other big mac project, AltTab, the CI/CD pushes every release to homebrew.

I initially wanted to replicate that, but it turns out that homebrew only accept projects with a certain userbase. They won't let you list your app when it's just released, with no users yet. See this thread. Thus I removed that.

I imagine MacPorts operates similarly? Would they accept to list this project even though it has very few users?

Thank you

i0ntempest commented 1 month ago

MacPorts has no such notability requirement. Actually I already published it there with some slight modifications to use fatsort provided by MacPorts. And because MacPorts builds everything from source I imagine it's gonna be harder for CI/CD to push updates, especially when patching is involved.

ryandesign commented 1 month ago

If your goal is only to add the project to MacPorts, I think it's something that would be better handled via CI/CD. On my other big mac project, AltTab, the CI/CD pushes every release to homebrew.

MacPorts accepts contributions from humans not robots.

i0ntempest commented 1 month ago

The project uses Swift 5.

Does your release build uses swift optimizations? I'm trying to figure out if this is a problem in Xcode 16.

lwouis commented 1 month ago

All the XCode configuration is in the /config folder. I think since we don't specify the Swift Compiler Optimization Level there, we get the default XCode values. On my install of XCode 16 on Sequoia, I see those:

image

Your question was about the release builds. Those are done on a CI machine which is running XCode 13.4. I imagine the Swift Optimization settings haven't changed though. These seem like they would probably never change.

i0ntempest commented 1 month ago

If you have updated to Xcode 16 you might want to build a release build and try if you have the problem I mentioned.