Skip to content

Commit

Permalink
The last build's .app from GitHub's shared runner won't start on my M…
Browse files Browse the repository at this point in the history
…ac, but when I run the same script on my Mac, it works fine. So I began to diff/merge the two resulting .app dirs and I isolated the issue to be the python binary located in:

  helloWorld.app/Contents/Resources/python

That's a binary so my ability to diff is limited, but when I execute it, I get this error:

  bash-3.2$ helloWorld.app/Contents/Resources/python
  Could not find platform independent libraries <prefix>
  Could not find platform dependent libraries <exec_prefix>
  Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
  Fatal Python error: initfsencoding: unable to load the file system codec
  ModuleNotFoundError: No module named 'encodings'

  Current thread 0x000000010b76bdc0 (most recent call first):
  Abort trap: 6
  bash-3.2$

Compare that to the execution of the binary in the .app generated locally, which works fine

  bash-3.2$ /Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Resources/python
  Python 3.7.3 (default, Jun 21 2020, 15:12:57)
  [Clang 11.0.3 (clang-1103.0.32.62)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>>
  bash-3.2$

I was able to get the python executable distributed by the GitHub's .app dir to load if I specified PYTHONHOME as requested

So this could be some issue with setting up the environment varialbe, but I also noticed that the binaries have distinct md5sums. Here's the sum on the working .app dir

  bash-3.2$ md5 /Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Resources/python
  MD5 (/Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Resources/python) = 19406f01cd51f5b85689f0d9a25fd71c
  bash-3.2$

And here's the sum on the broken one given by GitHub:

  bash-3.2$ md5 helloWorld.app/Contents/Resources/python
  MD5 (helloWorld.app/Contents/Resources/python) = 7f1bde512187cdf1cf2df1f27026162f
  bash-3.2$

Note that these are both distinct from my system's python version:

  bash-3.2$ which python3
  /usr/bin/python3
  bash-3.2$ md5 /usr/bin/python3
  MD5 (/usr/bin/python3) = 285200a03e90d8e012abe6769274dab1
  bash-3.2$

However, I found 5x python binaries in the buildozer dir, and they all match the version in my working .app dir

  bash-3.2$ find /Users/maltfield/sandbox/cross-platform-python-gui/buildozer -type f -name python3
  /Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Resources/venv/bin/python3
  /Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Frameworks/python/3.7.3/bin/python3
  bash-3.2$ find /Users/maltfield/sandbox/cross-platform-python-gui/buildozer -type f -name python3 -exec '{}' --version \;
  Python 3.7.3
  Python 3.7.3
  bash-3.2$ find /Users/maltfield/sandbox/cross-platform-python-gui/buildozer -type f -name python -exec '{}' --version \;
  Python 3.7.3
  Python 3.7.3
  Python 3.7.3
  bash-3.2$
  bash-3.2$ find /Users/maltfield/sandbox/cross-platform-python-gui/buildozer -type f -name python -exec md5 '{}' \;
  MD5 (/Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Resources/python) = 19406f01cd51f5b85689f0d9a25fd71c
  MD5 (/Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Resources/venv/bin/python) = 19406f01cd51f5b85689f0d9a25fd71c
  MD5 (/Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Frameworks/python/3.7.3/bin/python) = 19406f01cd51f5b85689f0d9a25fd71c
  bash-3.2$ find /Users/maltfield/sandbox/cross-platform-python-gui/buildozer -type f -name python3 -exec md5 '{}' \;
  MD5 (/Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Resources/venv/bin/python3) = 19406f01cd51f5b85689f0d9a25fd71c
  MD5 (/Users/maltfield/sandbox/cross-platform-python-gui/buildozer/dist/helloWorld.app/Contents/Frameworks/python/3.7.3/bin/python3) = 19406f01cd51f5b85689f0d9a25fd71c
  bash-3.2$

Anyway, this is a dumb termiante-early commit that'll be used to collect info about the python versions available on the GitHub shraed runner. I'm guessing that this might be an issue with the fact that our system's python is 3.7.3 but GitHub's `python3` binary is 3.7.7.
  • Loading branch information
maltfield committed Jun 22, 2020
1 parent c6fe8ff commit 2bb01ab
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions build/mac/buildDmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ APP_NAME='helloWorld'
PYTHON_VERSION="`${PYTHON_PATH} --version | cut -d' ' -f2`"
PYTHON_EXEC_VERSION="`echo ${PYTHON_VERSION} | cut -d. -f1-2`"

###################
# INSTALL DEPENDS #
###################
########
# INFO #
########

# install os-level depends
brew install wget
brew cask install platypus
# print some info for debugging failed builds

uname -a
sw_vers
Expand All @@ -43,6 +41,28 @@ echo $PATH
pwd
ls -lah

echo "INFO: list of python* in /usr/bin/"
ls -lah /usr/bin/python*
find /usr/bin -type f -name python -exec '{}' --version \;
find /usr/bin -type f -name python3 -exec '{}' --version \;
md5 /usr/bin/python*

echo "INFO: list of python* in /usr/local/bin/"
ls -lah /usr/local/bin/python*
find /usr/local/bin -type f -name python -exec '{}' --version \;
find /usr/local/bin -type f -name python3 -exec '{}' --version \;
md5 /usr/bin/python*

exit 0

###################
# INSTALL DEPENDS #
###################

# install os-level depends
brew install wget
brew cask install platypus

# first update our PATH so installed depends can be executed
PATH=${PATH}:/Users/runner/Library/Python/${PYTHON_EXEC_VERSION}/bin

Expand Down

0 comments on commit 2bb01ab

Please sign in to comment.