From d61b1504a662329533d819bee42361ff910866c5 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 4 Jul 2017 14:49:46 +0100 Subject: [PATCH] AppImages aren't working correctly afterall. --- BUGS | 1 + appimage/make-appimage-yml.py | 12 ++++++++---- vigil/worker.py | 5 ++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/BUGS b/BUGS index a74da73..8abebf7 100644 --- a/BUGS +++ b/BUGS @@ -7,6 +7,7 @@ Current - If a job is paused for longer than the timeout period, sometimes it has the timed out status when un-paused. - Tmp files are being left behind after shutdown. +- All tools in AppImages aren't working correctly. See ./vigil --self_test Current (tool related) diff --git a/appimage/make-appimage-yml.py b/appimage/make-appimage-yml.py index 044b08d..4718c64 100755 --- a/appimage/make-appimage-yml.py +++ b/appimage/make-appimage-yml.py @@ -14,10 +14,10 @@ for dependency in tools.dependencies("ubuntu"): else: dist_deps.add(dependency) dist_deps.update({"python3-pygments", "python3-pyinotify", "python3-docopt", - "util-linux", "python3-pil", "python3-pip", - "python3-setuptools"}) + "util-linux", "python3-pil"}) dep_list = "\n - ".join(sorted(dist_deps)) print("""app: vigil-code-monitor +union: true ingredients: packages: @@ -27,7 +27,11 @@ ingredients: - deb http://archive.ubuntu.com/ubuntu/ zesty main universe script: - - ./usr/bin/python3 -m pip install $VIGIL_PATH + - export APPDIR=$(pwd) + - export PYTHONPATH=$APPDIR/usr/share/pyshared + - mkdir -p $PYTHONPATH + - (cd $VIGIL_PATH; /usr/bin/python3 setup.py install \ + --prefix=$APPDIR/usr --install-lib=$PYTHONPATH) - cp $VIGIL_PATH/appimage/vigil-icon.png . - cp -a $VIGIL_PATH/tests . - cp $VIGIL_PATH/test-all tests @@ -36,7 +40,7 @@ script: - Type=Application - Name=Vigil Code Monitor - Comment=Vigil maintains an up-to-date set of reports for every file in a codebase. - - Exec=./bin/python3 -m vigil + - Exec=vigil - Terminal=true - Icon=vigil-icon.png - Categories=Application; diff --git a/vigil/worker.py b/vigil/worker.py index 6f5a1c2..509cf4e 100755 --- a/vigil/worker.py +++ b/vigil/worker.py @@ -18,11 +18,14 @@ class Worker: self.result = None self.process = None self.child_pgid = None + self.script_path = (os.path.join( + os.environ["APPDIR"], "usr", "bin", "vigil-worker") + if "APPDIR" in os.environ else "vigil-worker") @asyncio.coroutine def create_process(self): create = asyncio.create_subprocess_exec( - "vigil-worker", stdin=asyncio.subprocess.PIPE, + self.script_path, stdin=asyncio.subprocess.PIPE, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, preexec_fn=os.setsid) self.process = yield from create