Skip to content

Commit

Permalink
switching to pip install directly in AppImage
Browse files Browse the repository at this point in the history
The previous solution of doing the `pip install` with the system's python, then rsync'ing into the AppImage had a couple issues:

 1. It was overwriting bin/python3.7 with a symlink back outside the AppImage, totally defeating the purpose of the AppImage and causing issues with systems that don't have python3.7 installed (see maltfield#4)

 2. It means that the system must have the same python version as the python version that's in our base python AppImage

I'm attempting to do this the proper way, but it's currently failing on my local system with this error:

	+ /tmp/appimagetool.AppImage /tmp/kivy_appdir dist/helloWorld.AppImage
	appimagetool, continuous build (commit effcebc), build 2084 built on 2019-05-01 21:02:41 UTC
	WARNING: appstreamcli command is missing, please install it if you want to use AppStream metadata
	Using architecture x86_64
	/tmp/kivy_appdir should be packaged as dist/helloWorld.AppImage
	AppStream upstream metadata found in usr/share/metainfo/python3.7.8.appdata.xml
	Generating squashfs...
	Parallel mksquashfs: Using 4 processors
	Creating 4.0 filesystem on dist/helloWorld.AppImage, block size 131072.
	[===========================================-                  ] 3820/5306  71%
	FATAL ERROR:gzip uncompress failed with error code -3
	Embedding ELF...
	Not able to open the AppImage for writing, aborting

I'm hoping that this is a memory-bound issue and it will "just work" on the GitHub shared runner cloud *fingers crossed*

 * AppImage/AppImageKit#398 (comment)
  • Loading branch information
maltfield committed Sep 6, 2020
1 parent 7408659 commit 7ad1851
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions build/linux/buildAppImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,21 @@ which python
which python3.7

# setup a virtualenv to isolate our app's python depends
${PYTHON_PATH} -m pip install --upgrade --user pip setuptools
${PYTHON_PATH} -m pip install --upgrade --user virtualenv
${PYTHON_PATH} -m virtualenv /tmp/kivy_venv
#${PYTHON_PATH} -m pip install --upgrade --user pip setuptools
#${PYTHON_PATH} -m pip install --upgrade --user virtualenv
#${PYTHON_PATH} -m virtualenv /tmp/kivy_venv

# install kivy and all other python dependencies with pip into our virtual env
# we'll later add these to our AppDir for building the AppImage
source /tmp/kivy_venv/bin/activate; python -m pip install -r requirements.txt
#source /tmp/kivy_venv/bin/activate; python -m pip install -r requirements.txt

##################
# PREPARE APPDIR #
##################

# cleanup old appdir, if exists
rm -rf /tmp/kivy_appdir

# We use this python-appimage release as a base for building our own python
# AppImage. We only have to add our code and depends to it.
cp build/deps/python3.7.8-cp37-cp37m-manylinux2014_x86_64.AppImage /tmp/python.AppImage
Expand All @@ -54,7 +57,9 @@ chmod +x /tmp/python.AppImage
mv squashfs-root /tmp/kivy_appdir

# copy depends that were installed with kivy into our kivy AppDir
rsync -a /tmp/kivy_venv/ /tmp/kivy_appdir/opt/python3.7/
#rsync -a /tmp/kivy_venv/ /tmp/kivy_appdir/opt/python3.7/
#/tmp/kivy_appdir/opt/python3.7/bin/python3.7 -m pip install -r requirements.txt
/tmp/kivy_appdir/AppRun -m pip install -r requirements.txt

# add our code to the AppDir
rsync -a src /tmp/kivy_appdir/opt/
Expand Down

0 comments on commit 7ad1851

Please sign in to comment.