Lazarus

Using the Lazarus IDE => General => Topic started by: powerpcer on June 05, 2021, 04:39:07 am

Title: compile lazrus ide on MacOS Arm
Post by: powerpcer on June 05, 2021, 04:39:07 am
build it on MacOS, every thing goes good,but launch startlazarus with "open startlazarus".
it show don't have permission.
do i miss something?
i had check in developer.apple.com, looks no solution for this problem.
any one have solution?
Title: Re: compile lazrus ide on MacOS Arm
Post by: skalogryz on June 05, 2021, 07:06:21 am
why happens if you start it with "open lazarus"?
Title: Re: compile lazrus ide on MacOS Arm
Post by: powerpcer on June 05, 2021, 08:05:15 am
when i typed, it shows lazarus startup picture, and then
termined.
message below:
Code: Pascal  [Select][+][-]
  1. he application /Users/terrylou/Downloads/lazarus/lazarus-upstream/lazarus.app cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826 "kLSNoLaunchPermissionErr: User doesn't have permission to launch the app (managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard, _LSLine=2539, NSUnderlyingError=0x136f06880 {Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x136f072a0 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111" UserInfo={NSLocalizedDescription=Launchd job spawn failed with error: 111}}}}}
  2. Saving session...
  3. ...copying shared history...
  4. ...saving history...truncating history files...
  5. ...completed.
  6.  
Title: Re: compile lazrus ide on MacOS Arm
Post by: skalogryz on June 05, 2021, 08:48:08 am
check if you've a quarantine mark (https://derflounder.wordpress.com/2012/11/20/clearing-the-quarantine-extended-attribute-from-downloaded-applications/) on the app.
If you did build it, you should not have it, BUT it never hurts to check. Maybe the macOS security is more tricky.

Also make sure that Unix  execute right is specified for "lazarus" executable. (which should be found next the Lazarus.app directory/bundle)


Title: Re: compile lazrus ide on MacOS Arm
Post by: trev on June 05, 2021, 11:11:09 am
1. Are you using an M1 (Apple Processor) Mac?

2. Did you compile an Intel or ARM64 version of Lazarus?
Title: Re: compile lazrus ide on MacOS Arm
Post by: powerpcer on June 05, 2021, 01:22:21 pm
1. Are you using an M1 (Apple Processor) Mac?

2. Did you compile an Intel or ARM64 version of Lazarus?
1. yes
2. i use fpc-3.2.2.intelarm64-macosx.dmg to compile lazarus
Title: Re: compile lazrus ide on MacOS Arm
Post by: trev on June 06, 2021, 01:36:45 am
This was unanswered:

2. Are you compiling an Intel or ARM64 version of Lazarus?

and

3. What command line did you use to compile Lazarus with FPC?

Note: You can download a pre-compiled daily development snapshot of Lazarus for ARM64 from https://sourceforge.net/projects/macos-lazarus-snapshots/ - it would be interesting to know whether that Lazarus version works for you.
Title: Re: compile lazrus ide on MacOS Arm
Post by: powerpcer on June 06, 2021, 05:01:25 am
my cmd for build lazarus was
Code: Pascal  [Select][+][-]
  1. make distclean all LCL_PLATFORM=cocoa CPU_TARGET=aarch64 bigide
  2.  
Title: Re: compile lazrus ide on MacOS Arm
Post by: trev on June 07, 2021, 03:01:32 am
This seems to be a very odd Gatekeeper issue. It's hard for me to help because when I compile Lazarus (daily) on my M1 Mac mini I do not experience the issue with the resulting binaries. They are always successfully executable.

Maybe it's a code directory hash (https://wiki.lazarus.freepascal.org/Code_Signing_for_macOS#Updating_a_signed_file) issue: Try deleting the existing lazarus and startlazarus executables first and then recompiling.

Title: Re: compile lazrus ide on MacOS Arm
Post by: trev on June 07, 2021, 03:45:20 am
I just noticed that you are doing this in your Downloads directory - try moving the source to a directory not subject to the operating system's TCC (Transparency, Consent, and Control). Try your home directory (ie move lazarus-upstream to /Users/terrylou/lazarus-upstream) and recompile.
Title: Re: compile lazrus ide on MacOS Arm
Post by: powerpcer on June 07, 2021, 08:00:50 am
thanks, trev.
i had download your daily build, when i use your command to open lazarus, it shows me that binary have no signature, just like download old intel lazarus running.
i test my build, if don't use open, it will open lazarus and tell me debugger not set, but i cannot do any input into lazarus setting, because all input will catch by terminal.
Title: Re: compile lazarus ide on macOS Arm64
Post by: trev on June 07, 2021, 10:16:38 am
thanks, trev.
i had download your daily build, when i use your command to open lazarus, it shows me that binary have no signature, just like download old intel lazarus running.

You should be able to just ad hoc sign the executable binaries (ie sign with the pseudo-identity “-” a dash). For example: codesign --force -s - lazarus

Quote
i test my build, if don't use open, it will open lazarus and tell me debugger not set, but i cannot do any input into lazarus setting, because all input will catch by terminal.

1. Did you delete previous executables?
2. Did you move the code directory to your home directory?
Title: Re: compile lazarus ide on macOS Arm64
Post by: powerpcer on June 07, 2021, 03:11:39 pm
thanks, trev.
i had download your daily build, when i use your command to open lazarus, it shows me that binary have no signature, just like download old intel lazarus running.

You should be able to just ad hoc sign the executable binaries (ie sign with the pseudo-identity “-” a dash). For example: codesign --force -s - lazarus

this simple, i solved.
Quote
i test my build, if don't use open, it will open lazarus and tell me debugger not set, but i cannot do any input into lazarus setting, because all input will catch by terminal.

1. Did you delete previous executables?
2. Did you move the code directory to your home directory?
because download your daily build, i have not previous lazarus.
and i will test if i move it to below of home DIR, current my source in $HOME/Downloads/lazarus/lazarus-upstrem/
when i move it to $HOME/, and run : open startlazarus
it show same no permission message.
and i try to run with : open lazarus
it how 2 hint, 1. primaryconfigpath="User/xxx/.lazarus"
2. SecondaryConfigPath="/etc/lazarus"
Title: Re: compile lazrus ide on MacOS Arm
Post by: trev on June 08, 2021, 01:35:09 am
I'm having great difficulty understanding what you actually do after I ask you to do something. So, please, do exactly what I ask and report back on it. Missing out a step or not doing it in the order asked can be the difference between something working or not and leaves me with no data points to help with debugging the issue.

Your source
========

1. Move the source directory to your home directory.
2. Delete the executables.
3. Recompile.
4. $ open lazarus (not startlazarus)

Does it work?

Daily snapshot
=========

1. Move the source directory to your home directory.
2. Ad hoc sign the executables as described previously.
3. $ open lazarus (not startlazarus)

Does it work?
Title: Re: compile lazrus ide on MacOS Arm
Post by: powerpcer on June 08, 2021, 05:01:04 am
I'm having great difficulty understanding what you actually do after I ask you to do something. So, please, do exactly what I ask and report back on it. Missing out a step or not doing it in the order asked can be the difference between something working or not and leaves me with no data points to help with debugging the issue.

Your source
========

1. Move the source directory to your home directory.
2. Delete the executables.
3. Recompile.
4. $ open lazarus (not startlazarus)

Does it work?

Daily snapshot
=========

1. Move the source directory to your home directory.
2. Ad hoc sign the executables as described previously.
3. $ open lazarus (not startlazarus)

Does it work?
I'm having great difficulty understanding what you actually do after I ask you to do something. So, please, do exactly what I ask and report back on it. Missing out a step or not doing it in the order asked can be the difference between something working or not and leaves me with no data points to help with debugging the issue.

Your source
========

1. Move the source directory to your home directory.
2. Delete the executables.
3. Recompile.
4. $ open lazarus (not startlazarus)

Does it work?

Daily snapshot
=========

1. Move the source directory to your home directory.
2. Ad hoc sign the executables as described previously.
3. $ open lazarus (not startlazarus)

Does it work?
Your source
========
after recompile, the permission problem solved,
but when type:open lazarus
it shows me to config, and all what i type in config screen, will show in terminal not in config screen
look at attachment,

if i change to: open -a lazarus
it shows the same as yours without codesign: "lazarus" cannot be opened because the developer cannot be verified

type: codesign --force -s - lazarus
lazarus: replacing existing signature

Daily snapshot
=========
type: codesign --force -s - lazarus
objc[798]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f3eeec10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1189e42b8). One of the two will be used. Which one is undefined.

Title: Re: compile lazrus ide on MacOS Arm
Post by: trev on June 09, 2021, 09:38:54 am
Your source
========
after recompile, the permission problem solved,
but when type:open lazarus
it shows me to config, and all what i type in config screen, will show in terminal not in config screen
look at attachment,

OK. That's expected.

Try open ./lazarus.app

Quote
Daily snapshot
=========
type: codesign --force -s - lazarus
objc[798]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f3eeec10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1189e42b8). One of the two will be used. Which one is undefined.

That is a macOS info message because there are two dylibs for the particular function. It is not an error and is harmless but sloppy by Apple.

Please try open ./lazarus.app for the now signed executable (note: you may need to also sign the .app bundle in which case use codesign --force --deep -s - lazarus.app).
Title: Re: compile lazrus ide on MacOS Arm
Post by: powerpcer on June 09, 2021, 12:22:31 pm
Your source
========
after recompile, the permission problem solved,
but when type:open lazarus
it shows me to config, and all what i type in config screen, will show in terminal not in config screen
look at attachment,

OK. That's expected.

Try open ./lazarus.app
Your source
========
type: open ./lazarus.app
shows The application cannot be opened for an unexpected reason .....User doesn't have permission to launch the app(managed networks)

type: codesign --force --deep -s - lazarus.app
replacing existiing signature
the main executable or info.plist must be a regular file (no symlinks, etc.)

Quote
Daily snapshot
=========
type: codesign --force -s - lazarus
objc[798]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f3eeec10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1189e42b8). One of the two will be used. Which one is undefined.

That is a macOS info message because there are two dylibs for the particular function. It is not an error and is harmless but sloppy by Apple.

Please try open ./lazarus.app for the now signed executable (note: you may need to also sign the .app bundle in which case use codesign --force --deep -s - lazarus.app).
Daily snapshot
=========
type: open ./lazarus.app
same as before, show me that codesign problem.
type: codesign --force --deep -s - lazarus.app
objc[821]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f3eeec10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1189e42b8). One of the two will be used. Which one is undefined.
Title: Re: compile lazrus ide on MacOS Arm
Post by: trev on June 09, 2021, 12:40:02 pm
Try open ./lazarus.app
Your source
========

type: codesign --force --deep -s - lazarus.app
replacing existiing signature
the main executable or info.plist must be a regular file (no symlinks, etc.)

Replace the symlink with the real executable, re-sign with codesign --force --deep -s - lazarus.app and try open ./lazarus.app

TinyPortal © 2005-2018