Skip to content
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

fix mac cover upload when frozen by removing plist #564

Closed
wants to merge 2 commits into from

Conversation

axu2
Copy link
Collaborator

@axu2 axu2 commented Jul 29, 2023

Fixes #482

Fixes #436 together with #565

To clarify frozen is referring to a pyinstaller built binary

EDIT: Various issues that turned out to be unrelated were deleted.

@axu2 axu2 marked this pull request as ready for review July 29, 2023 17:10
@axu2 axu2 changed the title fix mac cover upload fix mac cover upload when frozen Jul 29, 2023
@darodi
Copy link
Collaborator

darodi commented Jul 29, 2023

Also, do you have a particular reason to not ignore *.spec files? I don't see a reason to include them since they are auto-generated by PyInstaller and are included in the standard Python gitignore: https://github.com/github/gitignore/blob/main/Python.gitignore

spec files are used in the build process and had to be adapted from the auto generated ones.

- name: Package Application
uses: JackMcKew/pyinstaller-action-windows@main
with:
path: .
spec: ./kcc.spec
- name: Package Application
uses: JackMcKew/pyinstaller-action-windows@main
with:
path: .
spec: ./kcc-c2e.spec
- name: Package Application
uses: JackMcKew/pyinstaller-action-windows@main
with:
path: .
spec: ./kcc-c2p.spec

@darodi
Copy link
Collaborator

darodi commented Jul 29, 2023

And that plist appears to be unused.

The file is needed by the bundle normally.

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/ConfigFiles.html#//apple_ref/doc/uid/20002091-CJBJIEDH

An information property list file is a structured text file that contains essential configuration information for a bundled executable.

Are you using a bundled binary?
Here you said you are not.

I've never tried running the binary.
Originally posted by @axu2 in #482 (comment)

removing the included binaries will complicate things for those using them with older mac os architectures.

disclaimer: I don't own an Apple computer currently and can't test this PR right now.
A good soul will have to test/review this.
(Or I need to annoy my mother-in-law and borrow hers)

@darodi darodi added macOS Script help wanted Extra attention is needed dependencies Pull requests that update a dependency file labels Jul 29, 2023
@axu2 axu2 closed this Jul 29, 2023
@axu2 axu2 force-pushed the cover-upload-mac branch from b019d46 to 217f571 Compare July 29, 2023 23:56
@axu2 axu2 reopened this Jul 29, 2023
@axu2 axu2 force-pushed the cover-upload-mac branch from f878451 to 0819b4b Compare July 30, 2023 00:36
@axu2
Copy link
Collaborator Author

axu2 commented Jul 30, 2023

OK, I thought multiple issues were related, but turns out they aren't, so I'll be editing this PR to only focus on the plist.

This was my first time building and running binaries using python setup.py build_binary

PyInstaller provides a plist file like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDisplayName</key>
	<string>Kindle Comic Converter</string>
	<key>CFBundleExecutable</key>
	<string>Kindle Comic Converter</string>
	<key>CFBundleIconFile</key>
	<string>comic2ebook.icns</string>
	<key>CFBundleIdentifier</key>
	<string>Kindle Comic Converter</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>Kindle Comic Converter</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>0.0.0</string>
	<key>NSHighResolutionCapable</key>
	<true/>
</dict>
</plist>

image

If we attempt to copy in our own plist we get the permission issue. I have no clue why, but I don't think our plist is doing anything functional, we don't use it when running from source anyways.

Even if I copy in an identical plist, I get the issue. So the problem lies in copying the plist into the .app, not the contents of the plist.

The proper way to edit the plist is here: https://pyinstaller.org/en/stable/spec-files.html#spec-file-options-for-a-macos-bundle

But I'm don't think it's necessary to change the default values. Our current plist is already outdated.

@axu2 axu2 changed the title fix mac cover upload when frozen fix mac cover upload when frozen by removing plist Jul 30, 2023
@axu2 axu2 closed this Jul 31, 2023
@axu2
Copy link
Collaborator Author

axu2 commented Jul 31, 2023

Superseded by #566 due to merge conflicts

@axu2 axu2 deleted the cover-upload-mac branch August 6, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file help wanted Extra attention is needed macOS Script
Projects
None yet
2 participants