Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions .github/workflows/build-conquest-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ jobs:
- name: Set output
id: set_output
run: |
if [[ "${{ inputs.platforms }}" == "rocky8" ]]; then
echo runson=ubuntu-latest >> $GITHUB_OUTPUT
echo container=ccdcrepository.azurecr.io/conan/rocky8-gcc10:latest >> $GITHUB_OUTPUT
echo python=python3 >> $GITHUB_OUTPUT
elif [[ "${{ inputs.platforms }}" == "ubuntu" ]]; then
if [[ "${{ inputs.platforms }}" == "ubuntu" ]]; then
echo runson=ubuntu-latest >> $GITHUB_OUTPUT
echo python=python3 >> $GITHUB_OUTPUT
elif [[ "${{ inputs.platforms }}" == "macos" ]]; then
Expand All @@ -49,13 +45,13 @@ jobs:
elif [[ "${{ inputs.platforms }}" == "windows" ]]; then
echo runson=windows-2019 >> $GITHUB_OUTPUT
echo python=python >> $GITHUB_OUTPUT
else
# default to Rocky
echo runson=ubuntu-latest >> $GITHUB_OUTPUT
echo container=ccdcrepository.azurecr.io/conan/rocky8-gcc10:latest >> $GITHUB_OUTPUT
echo python=python3 >> $GITHUB_OUTPUT
fi

# Build the conquest python for rocky8
echo runson=ubuntu-latest >> $GITHUB_OUTPUT
echo container=ccdcrepository.azurecr.io/conan/rocky8-gcc10:latest >> $GITHUB_OUTPUT
echo python=python3 >> $GITHUB_OUTPUT

build-upload:
needs:
- setup
Expand All @@ -81,6 +77,16 @@ jobs:
${{ needs.setup.outputs.python }} --version
${{ needs.setup.outputs.python }} -m pip install --upgrade pip wheel setuptools

- name: Install patch
run: |
if [[ "${{ needs.setup.outputs.runson }}" == "ubuntu-latest" ]]; then
if [[ -f /etc/rocky-release ]]; then
sudo dnf install -y patch
else
sudo apt update && sudo apt install -y patch
fi
fi

- name: Build conquest python
run: |
output=$(${{ needs.setup.outputs.python }} build_conquest_python.py | grep Creating | tail -n 1)
Expand All @@ -89,6 +95,14 @@ jobs:
echo "archive_filename=$archive_filename" >> $GITHUB_ENV
echo "archive_path=$archive_path" >> $GITHUB_ENV

- name: Store conquest python as build artifact
if: ${{ !inputs.artifactory-push }}
uses: actions/upload-artifact@v4
with:
retention-days: 1
path: "${{ env.archive_path }}/${{ env.archive_filename }}"
name: ${{ env.archive_filename }}

- name: Set up JFrog CLI
if: ${{ inputs.artifactory-push }}
uses: jfrog/setup-jfrog-cli@v4
Expand Down
8 changes: 8 additions & 0 deletions build_conquest_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,14 @@ def main():
"fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL'"),
)

# Patch Pyinstaller to fix https://github.com/pyinstaller/pyinstaller/issues/5540
# The actual fix for this isn't in any of the 3.x versions, and 4.x onwards require Python 3 :(
if Package().linux:
command = ["patch", "-p1", "-i", os.path.join(os.path.dirname(os.path.abspath(__file__)), "pyinstaller.patch")]
print(f"Applying patch with {' '.join(command)}")
package_path = ConquestPythonPackage().python_base_directory / "lib" / "python2.7" / "site-packages"
subprocess.run(command, cwd=package_path)

if not Package().windows:
bdb_env = dict(os.environ)
bdb_env['BERKELEYDB_DIR'] = f'{ConquestPythonPackage().python_base_directory}'
Expand Down
13 changes: 13 additions & 0 deletions pyinstaller.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/PyInstaller/depend/utils.py b/PyInstaller/depend/utils.py
index 4776676b7..eca1e9dd8 100644
--- a/PyInstaller/depend/utils.py
+++ b/PyInstaller/depend/utils.py
@@ -372,6 +372,8 @@ def load_ldconfig_cache():
for line in text:
# :fixme: this assumes libary names do not contain whitespace
m = pattern.match(line)
+ if m is None:
+ continue
path = m.groups()[-1]
if is_freebsd:
# Insert `.so` at the end of the lib's basename. soname