-
Notifications
You must be signed in to change notification settings - Fork 2
Attempt to move building to GitHub Actions #97
Comments
Just to reiterate what was said in #98: Nuitka does not work with PonyORM (one does not supply I guess we're going back to cx_Freeze. |
Going all-in on the recommended I'm veering toward simply doing what we always did in Jenkins, but using GitHub Actions. |
Considering the Practically, this means checking out the repo with submodules using GitHub Actions as usual and then remove:
The above is somewhat error-prone if we have to do all of this by hand (though I don't think we'll be refactoring the entire directory structure very often). So, I still want to explore using a tool (e.g., Nuitka) to determine what files should be kept in the repository after checkout. |
For my next attempt, I used nuitka to determine the required
This produces a import os
import sys
from xml.etree.ElementTree import parse
from nuitka.PythonVersions import getSystemPrefixPath
tree = parse("compilation-report.xml")
root = tree.getroot()
sys_prefix = sys.prefix
real_sys_prefix = getSystemPrefixPath()
cwd = os.getcwd()
library_directories = [
os.path.abspath("./src") + "/",
f"{sys_prefix}/lib/python3/dist-packages/",
f"{sys_prefix}/lib/python3.10/",
"~/.local/lib/python3.10/site-packages/"
]
for child in root.iter("module"):
reported_path = child.attrib["source_path"]
# Undo path shortening in Nuitka
reported_path = reported_path.replace("${sys.prefix}", sys_prefix)
reported_path = reported_path.replace("${sys.real_prefix}", real_sys_prefix)
reported_path = reported_path.replace("${cwd}", cwd)
# Normalize to local directory
normalized_path = reported_path
for libdir in library_directories:
if normalized_path.startswith(libdir):
normalized_path = normalized_path[len(libdir):]
break
# The new destination path and the path we need to copy it from
print(normalized_path, reported_path)
# shutil.copyfile(reported_path, normalized_path) If we copy only these files, a build using |
Using Nuitka to reduce the file size is a nice optimization but, ultimately, I guess we should just port our current scripts (unmodified) to GitHub Actions for now. Optimizations can come later. |
Inspired by other projects it seems that we can downsize our build procedures immensely by moving to GitHub Actions, powered by
nuitka
(since we have asetup.py
, using this).IF this works as advertised, we can easily create builds on GitHub Actions. However, we would still need all of the fluff like NSIS and Debian metadata to make installers and properly register the executable in the OS.
The text was updated successfully, but these errors were encountered: