snap: Start snap support.

- Create a snapcraft.yaml file in snap directory.
  Couldn't put this in packaging directory.
- Use make-snapcraft.py to generate the snapcraft file.
- Use make-snap to make the snap from the snapcraft file.
- Eris is confined to only access projects in home.
- os.setpriority doesn't work in snaps.
- eris-webserver is run as "eris.webserver".
This commit is contained in:
Andrew Hamilton 2021-12-05 18:33:42 +10:00
parent abb9633e97
commit 0331a9da1e
5 changed files with 195 additions and 4 deletions

View file

@ -148,7 +148,7 @@ tools_for_extensions = [
[unrar]
dependencies = ["unrar"]
url = "http://www.rarlabs.com/"
command = "unrar l"
command = "unrar-nonfree l"
[7z]
dependencies = ["p7zip"]
@ -214,7 +214,7 @@ tools_for_extensions = [
has_color = true
[php8_syntax]
dependencies = ["php8.0-cli"]
dependencies = ["php-cli"]
url = "https://en.wikipedia.org/wiki/PHP"
command = "php --syntax-check"
@ -237,7 +237,7 @@ tools_for_extensions = [
[lua_syntax]
dependencies = ["lua5.3"]
url = "http://www.lua.org"
command = "luac -p"
command = "luac5.3 -p"
[js_syntax]
dependencies = ["nodejs"]

View file

@ -31,7 +31,8 @@ class Worker:
self.process = await create
pid_line = await self.process.stdout.readline()
self.child_pgid = int(pid_line.strip())
os.setpriority(os.PRIO_PGRP, self.child_pgid, 19)
if "SNAP" not in os.environ: # Can't do setpriority inside snaps.
os.setpriority(os.PRIO_PGRP, self.child_pgid, 19)
self.process.stdin.write(f"{self.compression}\n".encode("utf-8"))
async def run_tool(self, path, tool):