tag:gpgtools.tenderapp.com,2011-11-04:/discussions/problems/106342-cant-compile-on-command-lineGPGTools: Discussion 2020-07-27T12:26:41Ztag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-23T16:09:16Z2020-06-23T16:09:16Zcan't compile on command line<div><p>Hello? Developers? Any idea how to fix this?</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-24T15:23:18Z2020-06-24T15:23:18Zcan't compile on command line<div><p>Hi Helmut,</p>
<p>leider können wir dieses Problem nicht nachvollziehen.<br>
Welche Version von Xcode verwendest du?</p></div>Luke Letag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-24T17:11:09Z2020-06-24T17:11:09Zcan't compile on command line<div><p>I tried on 2 machines:</p>
<p>macOS 10.15.5 19F101<br>
Xcode 11.5 11E608c</p>
<p>macOS 10.14.6 18G5033<br>
Xcode 11.3.1 11C504</p>
<p>Then I tried to start over with cloning the repo from scratch. The compile run failed with another error. The dependencies are missing in the <code>Dependencies</code> directory. One has to manually create symbolic links. I think you have to update the README how to properly setup a dev environment. Something is certainly off.</p>
<p>After solving the dependencies issues, I still get the same error.</p>
<p>Please setup a new VM with macOS and just follow your readme how to compile GPG Keychain. You will run into several issues.....</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-24T20:52:43Z2020-06-24T20:52:43Zcan't compile on command line<div><p><code>git clone</code> should be <code>git clone --recursive</code> so submodules are checked out as well. No other dependencies are needed, if you have Libmacgpg installed from GPG Suite. Otherwise you will need to compile Libmacgpg and install it in <code>/Library/Frameworks</code></p>
<p>About your error, please check in <code>Xcode › File › Project Settings…</code> if the Build System is set to <code>Legacy Build System</code>. If not, set it to <code>Legacy Build System</code>. That's the only thing I could think of that might result in the problem you are seeing. Apple is doing some strange things in non legacy build system and it's not well documented last time I checked.</p></div>Luke Letag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-25T14:42:59Z2020-06-25T14:48:12Zcan't compile on command line<div><p>Thanks for your reply, but I think you mix up repositories. I tried <code>--recursive</code>, but it can't do anything in the GPGKeychainAccess repo (<a href="https://github.com/GPGTools/GPGKeychainAccess.git">https://github.com/GPGTools/GPGKeychainAccess.git</a>), since it does not have any sub modules defined.<br>
So as suspected, the <code>Dependencies</code> directory is empty and as soon as I do a <code>make</code> this is what happens:</p>
<pre>
<code>Ld /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/Release/GPG\ Keychain.app/Contents/MacOS/GPG\ Keychain normal x86_64 (in target 'GPG Keychain' from project 'GPGKeychain')
cd /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-macos10.12 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/Release -F/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/Release -F/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Dependencies/Libmacgpg/build/Release -F/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Dependencies/Zxcvbn/build/Release -F/Library/Frameworks -F/Users/tessus/Library/Frameworks -filelist /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/GPGKeychain.build/Release/GPG\ Keychain.build/Objects-normal/x86_64/GPG\ Keychain.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -fobjc-arc -fobjc-link-runtime -lsqlite3 -framework QuartzCore -framework CoreImage -framework ScriptingBridge -framework Security -weak_framework Libmacgpg -framework Cocoa /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Dependencies/Zxcvbn/build/Release/Zxcvbn.framework/Zxcvbn -Xlinker -dependency_info -Xlinker /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/GPGKeychain.build/Release/GPG\ Keychain.build/Objects-normal/x86_64/GPG\ Keychain_dependency_info.dat -o /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/Release/GPG\ Keychain.app/Contents/MacOS/GPG\ Keychain
ld: warning: directory not found for option '-F/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Dependencies/Libmacgpg/build/Release'
ld: reference to bitcode symbol '_objc_destroyWeak' which LTO has not compiled in '-[GKMenuButton .cxx_destruct]' from /tmp/lto.o for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Resources/Info.plist'. (in target 'GPG Keychain' from project 'GPGKeychain')
** BUILD FAILED **</code>
</pre>
<p>Do you see the part where the linker tries to access <code>Dependencies/Libmacgpg/build/Release</code>? After checkout of the repo there is no such directory, even when using <code>--recursive</code> (which can't work for the reason I mentioned above: no submodules in this repo).<br>
Btw, the README does not mention <code>recursive</code> either.</p>
<p>And yes, I have the most recent GPG Tools (2020.1) installed on my machine.</p>
<p>Changing the build system to <code>Legacy Build System</code> does not help either.</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-25T14:48:19Z2020-06-25T14:48:19Zcan't compile on command line<div><p>Ah right, I thought Zxcvbn was added as a submodule, but that's no longer the case. So --recursive is in fact not required.</p>
<p>Did you check Project Settings?</p>
<p>The reference to Dependencies/Libmacgpg/build/Release is only one of all possible search paths for Frameworks. In your case /Library/Framework works fine, since Libmacgpg.framework is installed there (at least it normally is). The linker error is something else.</p></div>Luke Letag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-25T14:50:36Z2020-06-25T14:50:36Zcan't compile on command line<div><p>Yes, I updated my post a second before you sent your reply, because I forgot to add that info...</p>
<p>Changing the build system to <code>Legacy Build System</code> does not help either.</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-25T14:51:32Z2020-06-25T14:51:32Zcan't compile on command line<div><p>What does <code>git status</code> say? Are you on branch dev? If not, switch to <code>dev</code> by running <code>git checkout dev</code></p></div>Luke Letag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-25T14:52:51Z2020-06-25T14:52:51Zcan't compile on command line<div><p>Yes, I'm on dev.</p>
<p>It's really a weird problem. When the version before the most recent came out, I had no issues compiling... So something must have changed in between....</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-29T10:07:46Z2020-06-29T10:08:01Zcan't compile on command line<div><p>So I've looked into that again and it appears that a file which is no longer necessary is still compiled in and creates an issue under certain configurations (not yet clear when). Remove the file PLWeakCompatibilityStubs.m from the list of files to be compiled, or generally from the project. After that it might work.</p></div>Luke Letag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-29T22:54:22Z2020-06-29T22:54:22Zcan't compile on command line<div><p>Awesome. This fixed the issue.</p>
<blockquote>
<p>(not yet clear when)</p>
</blockquote>
<p>Since it doesn't happen for the debug build, but only the release branch (Release and Archive) it must have to do with that.</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-30T14:08:44Z2020-06-30T14:08:44Zcan't compile on command line<div><p>Unfortunately under Catalina I run into another problem:</p>
<pre>
<code>Process: GPG Keychain [95307]
Path: /Applications/GPG Keychain.app/Contents/MacOS/GPG Keychain
Identifier: org.gpgtools.gpgkeychain
Version: 1.6.1 (1620)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: GPG Keychain [95307]
User ID: 502
Date/Time: 2020-06-30 10:07:13.892 -0400
OS Version: Mac OS X 10.15.5 (19F101)
Report Version: 12
Bridge OS Version: 4.5 (17P5300)
Anonymous UUID: 8978A6E7-3C54-43CD-60CE-105246DB01E4
Sleep/Wake UUID: A03009A4-2957-4FEA-81B9-AE9D3DCFD656
Time Awake Since Boot: 800000 seconds
Time Since Wake: 5500 seconds
System Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: DYLD, [0x5] Code Signature
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: @rpath/Zxcvbn.framework/Versions/A/Zxcvbn
Referenced from: /Applications/GPG Keychain.app/Contents/MacOS/GPG Keychain
Reason: no suitable image found. Did find:
/Applications/GPG Keychain.app/Contents/MacOS/../Frameworks/Zxcvbn.framework/Versions/A/Zxcvbn: code signature in (/Applications/GPG Keychain.app/Contents/MacOS/../Frameworks/Zxcvbn.framework/Versions/A/Zxcvbn) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
/Applications/GPG Keychain.app/Contents/MacOS/../Frameworks/Zxcvbn.framework/Versions/A/Zxcvbn: stat() failed with errno=1</code>
</pre></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-06-30T14:19:14Z2020-06-30T14:19:14Zcan't compile on command line<div><p>maybe the framework is not codesigned in the build process?</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-07-07T21:35:01Z2020-07-07T21:35:01Zcan't compile on command line<div><p>Can you reproduce this on Catalina?</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-07-08T17:21:43Z2020-07-08T17:21:43Zcan't compile on command line<div><p>Did you try to deactivate any code signing at all?</p></div>Luke Letag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-07-08T20:27:25Z2020-07-08T20:27:25Zcan't compile on command line<div><p>This is not possible. You must at least select 'Sign to Run Locally'. There's no no signing option.</p></div>Helmut K. C. Tessarektag:gpgtools.tenderapp.com,2011-11-04:Comment/484049582020-07-08T21:13:13Z2020-07-08T21:13:13Zcan't compile on command line<div><p>Found the solution: Remove the hardened runtime.</p></div>Helmut K. C. Tessarek