Skip to content

Commit

Permalink
the first MacOS build finished successfully!
Browse files Browse the repository at this point in the history
 * https://github.com/maltfield/cross-platform-python-gui/runs/793360108?check_suite_focus=true

And the cooresponding release tarball (80M) can be downloaded here:

 * https://github.com/maltfield/cross-platform-python-gui/runs/793360108?check_suite_focus=true

Unfortunately it fails to actually run when I download it:

  bash-3.2$ wget https://github.com/maltfield/cross-platform-python-gui/releases/download/142928970_mac/helloWorld-mac-x86_64.142928970.tar.bz2
  --2020-06-21 23:46:58--  https://github.com/maltfield/cross-platform-python-gui/releases/download/142928970_mac/helloWorld-mac-x86_64.142928970.tar.bz2
  Resolving github.com (github.com)... 140.82.118.3
  Connecting to github.com (github.com)|140.82.118.3|:443... connected.
  HTTP request sent, awaiting response... 302 Found
  Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/268355288/69756880-b410-11ea-8a6e-aa8585e68c4f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200621%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200621T224658Z&X-Amz-Expires=300&X-Amz-Signature=dcb81a1c91a75bda10322491ecc32b491a5e56da52502d24920e35d54298852c&X-Amz-SignedHeaders=host&actor_id=0&repo_id=268355288&response-content-disposition=attachment%3B filename%3DhelloWorld-mac-x86_64.142928970.tar.bz2&response-content-type=application%2Foctet-stream [following]
  --2020-06-21 23:46:58--  https://github-production-release-asset-2e65be.s3.amazonaws.com/268355288/69756880-b410-11ea-8a6e-aa8585e68c4f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200621%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200621T224658Z&X-Amz-Expires=300&X-Amz-Signature=dcb81a1c91a75bda10322491ecc32b491a5e56da52502d24920e35d54298852c&X-Amz-SignedHeaders=host&actor_id=0&repo_id=268355288&response-content-disposition=attachment%3B filename%3DhelloWorld-mac-x86_64.142928970.tar.bz2&response-content-type=application%2Foctet-stream
  Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.205.43
  Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.205.43|:443... connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 84091803 (80M) [application/octet-stream]
  Saving to: ‘helloWorld-mac-x86_64.142928970.tar.bz2’

  helloWorld-mac-x86_64.142928970.tar 100%[==================================================================>]  80.20M  1.74MB/s    in 33s

  2020-06-21 23:47:32 (2.44 MB/s) - ‘helloWorld-mac-x86_64.142928970.tar.bz2’ saved [84091803/84091803]

  bash-3.2$ ls
  helloWorld-mac-x86_64.142928970.tar.bz2
  bash-3.2$ tar -xzvf helloWorld-mac-x86_64.142928970.tar.bz2
  ...
  bash-3.2$ open -W buildozer/dist/helloWorld.app
  2020-06-21 23:48:53.484 open[91108:2095733] There was an error parsing the Info.plist for the bundle at URL <0x7f98b7c20820>: NSCocoaErrorDomain - 3840
  The application cannot be opened because its executable is missing.
  bash-3.2$

Indeed, the Info.plist xml file is truncated in the build

  bash-3.2$ pwd
  /Users/maltfield/Downloads
  bash-3.2$ ls
  buildozer				helloWorld-mac-x86_64.142928970.tar.bz2
  bash-3.2$ cat buildozer/dist/helloWorld.app/Contents/Info.plist
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http:https://www.apple.com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
  <dict>
	  <key>Bundle display name</key>
	  <string>Hello World</string>
	  <key>Bundle identifier</key>
	  <string>org.test</string>
	  <key>Bundle name</key>
	  <string>Hello World</string>
	  <key>Bundle version</key>
	  <string>0.1</string>
	  <key>CFBundleDevelopmentRegion</key>
	  <string>en</string>
	  <key>CFBundleDocumentTypes</key>
	  <array>
		  <dict>
			  <key>CFBundleTypeExtensions</key>
			  <array>
				  <string>*</string>
			  </array>
			  <key>CFBundleTypeRole</key>
			  <string>Viewer</string>
			  <key>LSItemContentTypes</key>
			  <array>
				  <string>public.item</string>
				  <string>public.folder</string>
			  </array>
		  </dict>
	  </array>
	  <key>CFBundleExecutable</key>
	  <string>Kivy</string>
	  <key>CFBundleIconFile</key>
	  <string>appIcon.icns</string>
	  <key>CFBundleIdentifier</key>
	  <string>org.kivy.osxlauncher</string>
	  <key>CFBundleInfoDictionaryVersion</key>
	  <string>6.0</string>
	  <key>CFBundleName</key>
	  <string>Kivy</string>
	  <key>CFBundlePackageType</key>
	  <string>APPL</string>
	  <key>CFBundleShortVersionString</key>
	  <string>1.11.1</string>
	  <key>CFBundleSignature</key>
	  <string>????</string>
	  <key>CFBundleVersion</key>
	  <string>1.11.1</string>
	  <key>LSMinimumSystemVersion</key>
	  <string>10.7.0</string>
	  <key>LSUIElement</key>
	  <true/>
	  <key>NSAppTransportSecurity</key>
	  <dict>
		  <key>NSAllowsArbitraryLoads</key>
		  <true/>
	  </dict>
	  <key>NSHumanReadableCopyright</key>
  bash-3.2$

The full error log from the build on github's shared runners can be found here:

 * https://pipelines.actions.githubusercontent.com/F2zzeBHbT5rqUO9ZVMwB3U8BPkur9naeactTMfgHfMsfOMttkU/_apis/pipelines/1/runs/27/signedlogcontent/3?urlExpires=2020-06-21T22%3A59%3A43.6280022Z&urlSigningMethod=HMACV1&urlSignature=T5rEb1Gf3AGjB8Upo0ogQS75%2Blq3brjauIm9FYwToKY%3D

An excerpt from the above shows the actual buildozer build at the end having some ascii vs unicode issue. Maybe this is the source of the issue?

  2020-06-21T22:34:22.8132830Z + buildozer osx debug
  2020-06-21T22:34:24.6015070Z You are using pip version 19.0.3, however version 20.2b1 is available.
  2020-06-21T22:34:24.6016690Z You should consider upgrading via the 'pip install --upgrade pip' command.
  2020-06-21T22:34:41.9710300Z find: helloWorld.app/Contents/Resources/yourapp: No such file or directory
  2020-06-21T22:34:42.6043720Z Traceback (most recent call last):
  2020-06-21T22:34:42.6044080Z   File "package_app.py", line 233, in <module>
  2020-06-21T22:34:42.6044230Z     main(arguments)
  2020-06-21T22:34:42.6044340Z   File "package_app.py", line 225, in main
  2020-06-21T22:34:42.6044940Z     fill_meta(appname, arguments)
  2020-06-21T22:34:42.6046870Z   File "package_app.py", line 113, in fill_meta
  2020-06-21T22:34:42.6047040Z     plistlib.writePlist(rootObject, info_plist)
  2020-06-21T22:34:42.6047180Z   File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 94, in writePlist
  2020-06-21T22:34:42.6050500Z     writer.writeValue(rootObject)
  2020-06-21T22:34:42.6050850Z   File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 252, in writeValue
  2020-06-21T22:34:42.6057490Z     self.writeDict(value)
  2020-06-21T22:34:42.6057760Z   File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 281, in writeDict
  2020-06-21T22:34:42.6058080Z     self.writeValue(value)
  2020-06-21T22:34:42.6058370Z   File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 239, in writeValue
  2020-06-21T22:34:42.6059210Z     self.simpleElement("string", value)
  2020-06-21T22:34:42.6059460Z   File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 172, in simpleElement
  2020-06-21T22:34:42.6059660Z     value = _escapeAndEncode(value)
  2020-06-21T22:34:42.6059820Z   File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 222, in _escapeAndEncode
  2020-06-21T22:34:42.6062250Z     return text.encode("utf-8")             # encode as UTF-8
  2020-06-21T22:34:42.6062910Z UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
  2020-06-21T22:34:42.6161930Z [0m[1;34m# Check configuration tokens[0m
  2020-06-21T22:34:42.6162610Z [0m[1;34m# Ensure build layout[0m
  2020-06-21T22:34:42.6163210Z [0m[1;34m# Check configuration tokens[0m
  2020-06-21T22:34:42.6163750Z [0m[1;34m# Preparing build[0m
  2020-06-21T22:34:42.6164250Z [0m[1;34m# Check requirements for osx[0m
  2020-06-21T22:34:42.6164740Z [0m[1;34m# Check if kivy-sdk-packager exists[0m
  2020-06-21T22:34:42.6165320Z [0m[1;34m# kivy-sdk-packager found at /Users/runner/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/buildozer/.buildozer/osx/platform[0m
  2020-06-21T22:34:42.6165950Z [0m[1;34m# check if Kivy.app exists in local dir[0m
  2020-06-21T22:34:42.6167090Z [0m[1;34m# Kivy.app found at /Users/runner/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/buildozer/.buildozer/osx/platform/kivy-sdk-packager-master/osx[0m
  2020-06-21T22:34:42.6167700Z [0m[1;34m# Install platform[0m
  2020-06-21T22:34:42.6168180Z [0m[1;34m# Check application requirements[0m
  2020-06-21T22:34:42.6168800Z [0m[1;30m# Remove directory and subdirectory /Users/runner/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/buildozer/.buildozer/applibs[0m
  2020-06-21T22:34:42.6169400Z [0m[1;30m# Create directory /Users/runner/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/buildozer/.buildozer/applibs[0m
  2020-06-21T22:34:42.6169880Z [0m[1;34m# Compile platform[0m
  2020-06-21T22:34:42.6170420Z [0m[1;34m# Build the application maltfield#1[0m
  2020-06-21T22:34:42.6171100Z [0m[1;30m# Copy application source from /Users/runner/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/src[0m
  2020-06-21T22:34:42.6171800Z [0m[1;30m# Create directory /Users/runner/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/buildozer/.buildozer/osx/app[0m
  2020-06-21T22:34:42.6172400Z [0m[1;30m# Copy /Users/runner/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/src/main.py[0m
  2020-06-21T22:34:42.6172940Z [0m[1;34m# Package the application[0m
  2020-06-21T22:34:42.6173820Z [0m[1;34m# Building package[0m
  2020-06-21T22:34:42.6174410Z [0m[1;34m# Create helloWorld.app[0m
  2020-06-21T22:34:42.6192310Z Traceback (most recent call last):
  2020-06-21T22:34:42.6192540Z   File "/Users/runner/Library/Python/3.7/bin/buildozer", line 8, in <module>
  2020-06-21T22:34:42.6192660Z     sys.exit(main())
  2020-06-21T22:34:42.6193530Z   File "/Users/runner/Library/Python/3.7/lib/python/site-packages/buildozer/scripts/client.py", line 13, in main
  2020-06-21T22:34:42.6193720Z     Buildozer().run_command(sys.argv[1:])
  2020-06-21T22:34:42.6194300Z   File "/Users/runner/Library/Python/3.7/lib/python/site-packages/buildozer/__init__.py", line 1004, in run_command
  2020-06-21T22:34:42.6194440Z     self.target.run_commands(args)
  2020-06-21T22:34:42.6194990Z   File "/Users/runner/Library/Python/3.7/lib/python/site-packages/buildozer/targets/osx.py", line 214, in run_commands
  2020-06-21T22:34:42.6195120Z     func(args)
  2020-06-21T22:34:42.6195650Z   File "/Users/runner/Library/Python/3.7/lib/python/site-packages/buildozer/targets/osx.py", line 230, in cmd_debug
  2020-06-21T22:34:42.6195800Z     self.buildozer.build()
  2020-06-21T22:34:42.6196430Z   File "/Users/runner/Library/Python/3.7/lib/python/site-packages/buildozer/__init__.py", line 205, in build
  2020-06-21T22:34:42.6196660Z     self.target.build_package()
  2020-06-21T22:34:42.6197290Z   File "/Users/runner/Library/Python/3.7/lib/python/site-packages/buildozer/targets/osx.py", line 134, in build_package
  2020-06-21T22:34:42.6197420Z     check_output(cmd, cwd=cwd)
  2020-06-21T22:34:42.6197550Z   File "/Applications/Xcode_11.5.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/subprocess.py", line 395, in check_output
  2020-06-21T22:34:42.6197670Z     **kwargs).stdout
  2020-06-21T22:34:42.6197780Z   File "/Applications/Xcode_11.5.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/subprocess.py", line 487, in run
  2020-06-21T22:34:42.6197900Z     output=stdout, stderr=stderr)
  2020-06-21T22:34:42.6198690Z subprocess.CalledProcessError: Command '['python', 'package_app.py', '/Users/runner/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/buildozer/.buildozer/osx/app', '--appname=helloWorld', '--bundlename=Hello World', '--bundleid=org.test', '--bundleversion=0.1', '--displayname=Hello World']' returned non-zero exit status 1.
  2020-06-21T22:34:42.6367600Z + pushd .buildozer/osx/platform/kivy-sdk-packager-master/osx
  2020-06-21T22:34:42.6369240Z ~/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/buildozer/.buildozer/osx/platform/kivy-sdk-packager-master/osx ~/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui/buildozer ~/runners/2.263.0/work/cross-platform-python-gui/cross-platform-python-gui
  2020-06-21T22:34:42.6369950Z + rm -rf helloWorld.app/Contents/Frameworks/GStreamer.framework
  2020-06-21T22:34:42.7208600Z + mkdir -p ../../../../../dist
  2020-06-21T22:34:42.7234500Z + cp -r helloWorld.app ../../../../../dist/

Anyway, this commit doesn't fix it, yet :)
  • Loading branch information
maltfield committed Jun 21, 2020
1 parent b4ab9da commit 88bdaee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_id }}_mac
release_name: 'Public Build Artifact: Linux ${{ github.run_id }}'
release_name: 'Public Build Artifact: Mac ${{ github.run_id }}'
draft: false
prerelease: true

Expand Down
17 changes: 16 additions & 1 deletion build/mac/buildDmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,25 @@ buildozer osx debug
# THIN APP #
############

# remove unnecessary libs, such as the 141M GStreamer framework
# remove unnecessary libs
pushd .buildozer/osx/platform/kivy-sdk-packager-master/osx

# GStreamer is the easiest; ~150M gone
rm -rf "${APP_NAME}.app/Contents/Frameworks/GStreamer.framework"

# kivy build, doc, and examples dirs total to ~50M
rm -rf "${APP_NAME}.app/Contents/Resources/kivy/build/"
rm -rf "${APP_NAME}.app/Contents/Resources/kivy/doc/"
rm -rf "${APP_NAME}.app/Contents/Resources/kivy/examples/"

# somehow it still works for me with this gone, but I wonder if it's because it
# finds python outside the .app dir? Anyway, this python dir is ~150M
rm -rf "${APP_NAME}.app/Contents/Frameworks/python"

# the whole lib dir isn't necessary for our simple kivy app; I imagine if your
# app has more depends, you'll have to be more selective here
rm -rf "${APP_NAME}.app/Contents/Resources/venv/lib"

#############
# BUILD DMG #
#############
Expand Down

0 comments on commit 88bdaee

Please sign in to comment.