CentOS runner for rpm builds (#7552)

* disable build links

* Disable binary stripping - #3846

Causes error:
`ImportError: /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon/chiavdf.cpython-39-x86_64-linux-gnu.so: ELF load command address/offset not properly aligned`

* Quote NODE_ROOT

* Add workaround for building on centos

* Remove the cache stages, since this is on self-hosted now and we remove it all anyways
This commit is contained in:
Chris Marslender 2021-07-16 17:07:31 -04:00 committed by GitHub
parent 257021d862
commit 200bdf16e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 38 deletions

View File

@ -1,4 +1,4 @@
name: Linux .rpm installer on Python 3.8
name: Linux .rpm installer on Python 3.9
on:
workflow_dispatch:
@ -13,15 +13,15 @@ on:
jobs:
build:
name: Linux .rpm installer on Python 3.8
name: Linux .rpm installer on Python 3.9
runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.8]
os: [ubuntu-18.04]
python-version: [3.9]
os: [centos]
steps:
- name: Cancel previous runs on the same branch
@ -39,38 +39,6 @@ jobs:
- name: Cleanup any leftovers that exist from previous runs
run: bash build_scripts/clean-runner.sh || true
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
with:
# Note that new runners may break this https://github.com/actions/cache/issues/292
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
# Create our own venv outside of the git directory JUST for getting the ACTUAL version so that install can't break it
- name: Get version number
id: version_number
@ -106,7 +74,6 @@ jobs:
- name: Build .rpm package
run: |
. ./activate
sudo apt-get -y install rpm
ldd --version
cd ./chia-blockchain-gui
git status

View File

@ -33,7 +33,7 @@ rm -rf dist
mkdir dist
echo "Create executables with pyinstaller"
pip install pyinstaller==4.2
pip install pyinstaller==4.4
SPEC_FILE=$(python -c 'import chia; print(chia.PYINSTALLER_SPEC_PATH)')
pyinstaller --log-level=INFO "$SPEC_FILE"
LAST_EXIT_CODE=$?
@ -70,6 +70,19 @@ cd ../build_scripts || exit
if [ "$REDHAT_PLATFORM" = "x86_64" ]; then
echo "Create chia-blockchain-$CHIA_INSTALLER_VERSION.rpm"
# shellcheck disable=SC2046
NODE_ROOT="$(dirname $(dirname $(which node)))"
# Disables build links from the generated rpm so that we dont conflict with other packages. See https://github.com/Chia-Network/chia-blockchain/issues/3846
# shellcheck disable=SC2086
sed -i '1s/^/%define _build_id_links none\n%global _enable_debug_package 0\n%global debug_package %{nil}\n%global __os_install_post \/usr\/lib\/rpm\/brp-compress %{nil}\n/' "$NODE_ROOT/lib/node_modules/electron-installer-redhat/resources/spec.ejs"
# Updates the requirements for building an RPM on Centos 7 to allow older version of rpm-build and not use the boolean dependencies
# See https://github.com/electron-userland/electron-installer-redhat/issues/157
# shellcheck disable=SC2086
sed -i "s#throw new Error('Please upgrade to RPM 4.13.*#console.warn('You are using RPM < 4.13')\n return { requires: [ 'gtk3', 'libnotify', 'nss', 'libXScrnSaver', 'libXtst', 'xdg-utils', 'at-spi2-core', 'libdrm', 'mesa-libgbm', 'libxcb' ] }#g" sed -i "s#throw new Error('Please upgrade to RPM 4.13.*#console.warn('You are using RPM < 4.13')\n return { requires: [ 'gtk3', 'libnotify', 'nss', 'libXScrnSaver', 'libXtst', 'xdg-utils', 'at-spi2-core', 'libdrm', 'mesa-libgbm', 'libxcb' ] }#g" $NODE_ROOT/lib/node_modules/electron-installer-redhat/src/dependencies.js
electron-installer-redhat --src dist/$DIR_NAME/ --dest final_installer/ \
--arch "$REDHAT_PLATFORM" --options.version $CHIA_INSTALLER_VERSION \
--license ../LICENSE