Forum > Cocoa

Error with my app bundle on macOS 12 AArch64

(1/2) > >>

AlexTP:
User message: https://github.com/Alexey-T/CudaText/issues/3847#issuecomment-985559965
He runs my app bundle - it differs from x64 bundle in only one aspect - the binary 'cudatext' is compiled for the target 'darwin aarch64'.

Build script, on Linux x64, to make macOS app bundle:
https://github.com/Alexey-T/CudaText/blob/master/setup/mac_common.sh

Any idea why he got an error?
The macOS package is here now, made with FPC 3.2-fixes:
http://uvviewsoft.com/c/

AlexTP:
My .plist file:
https://github.com/Alexey-T/CudaText/blob/master/app/cudatext.app/Contents/Info.plist

trev:
If I start your app thus:

/Applications/CudaText.app/Contents/MacOS/cudatext

it runs and seems to work without any issue at all, but if started from the application bundle it fails as you say.

When starting the app, the log shows:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---default 15:54:17.298722+1100    kernel  ASP: Security policy would not allow process: 23101, /Applications/CudaText.app/Contents/MacOS/cudatextdefault 15:54:17.305210+1100    runningboardd   [app<application.com.uvviewsoft.cudatext.19969826.19969830(501)>:23101] termination reported by launchd (9, 8, 9)
So I tried ad hoc re-signing:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---trev@macmini8 [/Users/trev] $ codesign --force --deep -s - /Applications/CudaText.app/Applications/CudaText.app: replacing existing signature/Applications/CudaText.app: resource fork, Finder information, or similar detritus not allowed
I think that is the cause of the failure when starting the app. Yep - see:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---trev@macmini8 [/Users/trev] $ xattr -lr /Applications/CudaText.app//Applications/CudaText.app//Contents/MacOS/cudatext: com.apple.FinderInfo: ????????/Applications/CudaText.app//Contents/MacOS/cudatext: com.apple.quarantine: 0183;61aaf270;Safari;67EDDC8A-2E8A-4BC0-9173-337617FBDEF4/Applications/CudaText.app//Contents/MacOS: com.apple.quarantine: 0183;61aaf270;Safari;67EDDC8A-2E8A-4BC0-9173-337617FBDEF4/Applications/CudaText.app//Contents/Info.plist: com.apple.FinderInfo: ????????/Applications/CudaText.app//Contents/Info.plist: com.apple.lastuseddate#PS: ??a/Applications/CudaText.app//Contents/Info.plist: com.apple.quarantine: 0183;61aaf270;Safari;67EDDC8A-2E8A-4BC0-9173-337617FBDEF4/Applications/CudaText.app//Contents/PkgInfo: com.apple.FinderInfo: ????????/Applications/CudaText.app//Contents/PkgInfo: com.apple.quarantine: 0183;61aaf270;Safari;67EDDC8A-2E8A-4BC0-9173-337617FBDEF4/Applications/CudaText.app//Contents: com.apple.quarantine: 0183;61aaf270;Safari;67EDDC8A-2E8A-4BC0-9173-337617FBDEF4/Applications/CudaText.app/: com.apple.quarantine: 0183;61aaf270;Safari;67EDDC8A-2E8A-4BC0-9173-337617FBDEF4
I fixed it by running:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---xattr -cr /Applications/CudaText.app/
and now it will happily start from the application bundle :-)

There's also a (non-fatal) missing file/directory:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---default 15:54:13.774615+1100    lsd     Non-fatal error enumerating at <private>, continuing: Error Domain=NSCocoaErrorDomain Code=260 "The file “PlugIns” couldn’t be opened because there is no such file." UserInfo={NSURL=PlugIns/ -- file:///Applications/CudaText.app/Contents/, NSFilePath=/Applications/CudaText.app/Contents/PlugIns, NSUnderlyingError=0x12af64180 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

AlexTP:
User confirmed that 'xattr' has solved the problem! Tks!

Now I need to adjust the Linux build-script somehow. Is it possible?
On Linux I cannot run the 'xattr' of course.
Script: https://github.com/Alexey-T/CudaText/blob/master/setup/mac_common.sh

trev:
If you are doing this on Linux, then I cannot for the life of me imagine how Finder.Info attributes are being added to your files - I would have said it is impossible.

I just re-checked the dmg I downloaded, and every single one of the files in your application bundle (including your executable) has a Finder.Info attribute.

I can only conclude that at some point your application bundle was on a real macOS system and perhaps someone used Finder > Show Package Contents which can add those attributes.

Navigation

[0] Message Index

[#] Next page

Go to full version