-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac OS bundle are rejected by Apple's notarization process #594
Comments
Hi @darad, |
Here you can find the implementation of our wrapper command around We are currently using this command to restructure the cx-frozen bundle to make it notarizable by Apple. Feel free to contact me for any questions regarding the gist. Hope it helps. |
Thanks! |
I have added an updated Gist for you here the main change from @darad's previous gist is that with > Please let us know if you have questions re: the Gist / Apples requirements . Equally we'd be very happy to help test new versions of cx_freeze as we have a cross-platform product & supporting CI all ready to go. |
Just a head's up im picking up this issue now - We're updating our whole dependency chain so i'm investigating the output of cx_freeze since we developed the workaround linked above ( Which is now slightly stale with other cx_freeze changes ), I'll keep you posted with progress - For now I've been running into other reported issues. Right now I'm encountering something like this issue : #1511 with cx_freeze 6.15.4.
Was the issue closed due to resolution or lack of response from the author? :) ( I'm currently trying to understand why its picking up libs from this location / whats changed dependency wise for why its now being included ) |
Hi @TechnicalPirate I'm doing a patch for v6.16, which will reevaluate some dependencies, mainly Qt, so you should work with that in mind. When I publish it, I'll let you know. |
Just minor comment to aggregate some notes that may be beneficial to resolving this issue Already reported issues with code sign (Which in turn will cause notarization fails)
On the notarization front - above a user linked a issue from onionshare - looking at their resolution it appears they are monkey patching the DistributionCache... might warrant closer inspection once we clear code-sign issues :) |
Hi @marcelotduarte resuming conversation from the other issue. Problem Statement: To quote apples docs Placing Content in a Bundle
This i believe explains most of the reports cx_freeze gets re: signing / notarization issues. Looking at the output of Skimming the docs - the expected structure is:
The workaround Darad and i were using was a post script that did the restructuring to be compliant. ( But obviously this isn't working perfectly with changes - this is what im trying to fix up now ) Even with the discovery of Edit: Some useful links here With regards to As mentioned in the other issue - i'm still hoping to fix up our restructuring code to get a clean build, then work with you to contribute back to ensure the native output of cx_freeze for the ... i hope that all makes sense 😅 |
Mini update After some more head scratching / head desk interactions - I was stumped for ages on afinal error i was getting from the notarization process + our bundle restructuring post step
Eventually i stumped on this forum post link and low and behold - ... but the app dosen't yet run - so some more fiddling required - will update once i get a running, clean build and then start dissecting all the mess of changes so far :) |
Hi @marcelotduarte! Another mini update -> My teammate is back from vacation and we're now co-dev'ing a solution to this on a fork. Couple of questions:
|
Generally what I did for bdist_msi was minimal, just a few tweaks. If I have to do something, only if something different from what you're already looking at comes up. To review, I think following this is best, but if the change is focused on bdist_mac, and doesn't affect other modules, you can do whatever is best for production and testing. |
Making progress but hit a snag when building locally on mac vs on our CI setup. How do you build .whl's for cx_freeze when releasing? - Using i suspect I'm not invoking the build process correctly / I'm missing environment variables or context - Can you tell me what commands you call when building a release? / what env vars have been set? :) Edit1: Right now im trying to locally build this commit as its the last stable version - but when i generate the
Edit2: Inspecting the .whl's themselves - when i build locally the entire |
I use cibuildwheel. Locally you can use:
|
Release 6.15.7 is out! |
Heya! So I'm now porting our actual apps ( not just the samples ) to the latest cx_Freeze and I'm stumbling on some corner cases that i think warrant this issue being reopened to address :) For transparency - Apple can be quite cryptic / ambiguous on why notarization can fail - I just realized upon porting that it will give misleading no timestamp / no hardened runtime warnings + errors on the For the record - the errors are: Removing the extra files from our core app fixed this issue - where does this leave us w/cx_Freeze? - well
There is perhaps more corner cases that we will discover - But for now documenting what i've found and preparing a fix. |
Ok after a lot of digging i've come to the conclusion i can work past these issues without further changes -but i will report them here for clarity ( they may need turning into their own issues )
... im still testing - but im veering away from needing to reopen this issue - as the blockers so far i can workaround - but we could improve the out of the box experience of cx_Freeze by making some these changes, i also feel we may want to raise an exception / warn the user if the |
Hi!
From what I understand, executable and symlink are acceptable, so I had an idea, I'll post it later. |
Correct yep - executables + symlinks are allowed anything else will cause hard to debug notarization errors :) |
PR #2048 Basically:
With is patch, files in include_files will be in the Resource
bdist_mac already has include_resources but you won't need to use.
Now, icon goes to Resource too.
bdist_mac already has iconfile that is added to icon.icns, but we have check if it work correctly. |
Hey just confirming - have tested this, honestly great improvement - wish i'd thought of it myself :D |
Release 6.15.8 is out! |
We create a bundle of our python project using the bdist_mac command from cx_freeze. It seems that Apple now requires bundles to be notarized to be able to pass the Gatekeeper on target machine.
Our app is currently being rejected by the notarisation process seemingly because cx-Freeze places all the files (ie executables, libraries, scripts, data) in the
MacOS
folder. That by itself violates many of rules and recommendations by Apple's codesigning guide. For example, all the data and script files need to be inContents/Resources
and althoughcodesign
is able to sign the bundle, running the verification (iecodesign -vvv --strict /path/to/bundle
) fail due to existence of data/script files in code locations.We've been trying to implement a post-cx-freeze step in our build process that tries to restructure the bundle to conform to requirements by the notarisation process. However, the implementation is very hacky and error-prone to future changes of libraries and python version.
It sounds like a problem that needs to be fixed at cx-Freeze's level of operations.
The text was updated successfully, but these errors were encountered: