Open JonathanLoungani opened 6 months ago
I am looking further into this issue. Currently, this StackOverflow post suggests that "This problem happens when xcode-select
developer directory was pointing to /Library/Developer/CommandLineTools
when a full regular Xcode was required (happens when CommandLineTools are installed after Xcode)".
I verified that xcode-select -p
prints /Library/Developer/CommandLineTools
.
In addition, the following is output after entering the command xcodebuild
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Interesting - Briefcase should be verifying that all the necessary tools are available, including differentiating between Xcode and the Command Line Tools.
I've just done a test on my M1 Mac, and it looks like it is possible to use the command line tools to sign; I wonder if this might be an x86-related incompatibility. Although the SO post mentions the specific install order, I don't think the order of installation is likely to be the cause - this should only be triggered be the tools that are currently active.
Continuing to dig, I found the following page on PyInstaller which explains an issue with PyInstaller that produces the same error message.
PyInstaller breaks OSX code signing because it appends python code at the end of the binary. Appending data at the end of executable breaks the Mach-o format structure. codesign utility complains with the following messages.
the __LINKEDIT segment does not cover the end of the file (can't be processed)
file not in an order that can be processed (link edit information does not fill the __LINKEDIT segment)
I'm not sure whether this is directly relevant.
Current guess based on discussion during the sprint:
Something in the format of the template being produced by recent versions of Xcode are incompatible with the code signing tools from the older versions of Xcode.
Next steps:
If anyone is still facing issue even after checking XCode and iCloud Drive, the following worked for me!
Steps to follow:
Check if XCode is updated (App Store), installed and active (xcode-select -p)
Check if the directory where project is created is not synced to iCloud Drive (System Settings -> iCloud -> iCloud Drive)
Check git config --global –list. I had git config core.autocrlf=true by mistake. Set to false (git config core.autocrlf false) or remove (git config --global --unset core.autocrlf) it. (Setting core.autocrlf=true is generally recommended for Windows users to avoid issues with line endings) Read More about this here - https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#per-repository-settings
Finally remove the build and clean the project. Do so as mentioned below, rm -rf build rm -rf ~/.cookiecutters/ briefcase build
This worked like a charm! Happy Coding!
@nidhikamath2102 To clarify - the issue you were seeing (CRLF handling) is a different way to manifest the same error message. The PyCon sprints have revealed at least 3 ways that signing can fail:
core.autocrlf
enabledThese are all distinct issues, with different solutions - although they all manifest with the "Unable to code sign" error message.
I was unable to build the stub project from the Mac OS app template on my machine, as described in this issue: https://github.com/beeware/Python-Apple-support/issues/220
Using Ad Hoc signing, tutorial build fails for me with:
Unable to code sign /Users/lov080/Library/Mobile Documents/com~apple~CloudDocs/Python/beeware-tutorial/helloworld/build/helloworld/macos/app/Hello World.app.
Going through all of nidhikamath2102 points and adding in Intel Processor point, Python version, and OS version also mentioned in this forum:
xcode-select -p
gives: "/Applications/Xcode.app/Contents/Developer"), therefore not lack of Xcode problem.gitconfig
file, therefore not core.autocrlf
problem.icloud.com
, therefore not iCloud problem.Unfortunately this means that the problem is not due to anything discussed here and is a show stopper for me.
@hlovatt The issue with iCloud isn't having the folder being out of date with syncing - it's with using an iCloud synced folder at all. iCloud writes metadata to the folders that it manages in a way that renders them unsignable.
The only solution I'm aware of is to not use a folder that is associated with iCloud - it needs to be a "local only" folder.
Great. All works now. Many thanks. (It works on OneDrive.)
Describe the bug
When following the BeeWare tutorial on a Big Sur MacOS (x86_64), the
briefcase build
command is unable to code sign.Steps to reproduce
briefcase create
briefcase build
briefcase build
command fails with the following error:Notably, the command
Produces the following result:
Expected behavior
The ad-hoc signing should complete without issue.
Screenshots
No response
Environment
Logs
briefcase.2024_05_20-16_37_34.build.log
Additional context
No response