From 79ce8722e5c61356b238a5349595724a7a1ab6a4 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Sat, 1 Oct 2022 05:39:48 -0700 Subject: [PATCH 01/14] Add github action build --- .github/dependabot.yaml | 7 +++++++ .github/release.yaml | 18 ++++++++++++++++++ .github/workflows/build.yaml | 24 ++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .github/dependabot.yaml create mode 100644 .github/release.yaml create mode 100644 .github/workflows/build.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..f54fbcd --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,7 @@ +version: 2 +updates: + + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..0f4884c --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,18 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - dependabot + categories: + - title: Breaking Changes 🛠 + labels: + - semver-major + - breaking-change + - title: New Features 🎉 + labels: + - semver-minor + - enhancement + - title: Other Changes + labels: + - '*' diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..fbf7d96 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,24 @@ +name: Build +on: [push] +jobs: + build: + strategy: + matrix: + os: [windows-2022, macos-11, ubuntu-22.04] + addrsize: ["64"] + include: + - os: windows-2022 + addrsize: "32" + runs-on: ${{ matrix.os }} + steps: + - uses: secondlife/action-autobuild@release/v3 + with: + addrsize: ${{ matrix.addrsize }} + release: + needs: build + runs-on: [ubuntu-latest] + if: startsWith(github.ref, 'refs/tags/v') + steps: + - uses: secondlife/action-autobuild-release@v1 + with: + public: true From 2eef4c42b1d319a66141b3c07eb0edbef99f9698 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 28 Mar 2023 16:34:27 -0400 Subject: [PATCH 02/14] SL-19489: Update README.md: we no longer need 'nose'. --- README.md | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index c6f6f5d..0761db1 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,8 @@ Viewer Management Process ========================= -This is the master process that is launched for the Second Life -Viewer (https://bitbucket.org/lindenlab/viewer-release). It manages -updates and will soon manage crash data collection and reporting. +This is the updater process that is launched for the Second Life +Viewer (https://github.com/secondlife/viewer). -To build it, you'll need to have the python 'nose' package installed. -You need the 'nose' package (a python testing framework) installed: - -`pip install nose` - -and set the `nosetests` environment to the location of the `nosetests` -executable. If you installed nose such that it is in your path, this -will work: - -``` -export nosetests=nosetests; -autobuild build -autobuild package -``` - -If you want to support both 32 and 64 bit Windows, you'll need to -build this with a 32 bit Windows python and use the resulting .exe for -both. +If you want to support both 32 and 64 bit Windows, you'll need to build this +with a 32 bit Python interpreter and use the resulting .exe for both. From bfdf5632af120306bffdd7fe9895119ed098f318 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 28 Mar 2023 16:42:02 -0400 Subject: [PATCH 03/14] SL-18837: Use correct action-autobuild tag. --- .github/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fbf7d96..c12a750 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,9 +9,10 @@ jobs: include: - os: windows-2022 addrsize: "32" + continue-on-error: true runs-on: ${{ matrix.os }} steps: - - uses: secondlife/action-autobuild@release/v3 + - uses: secondlife/action-autobuild@v3 with: addrsize: ${{ matrix.addrsize }} release: From 98a9d21809b87ccdfeb838ead32be6f72e843e5d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 28 Mar 2023 17:23:19 -0400 Subject: [PATCH 04/14] SL-18837: Use build.yaml to install Python packages. build-cmd.py used to run an internal 'pip install' to pull in Python package dependencies. Because of the persistent side effect beyond the current build, it aborted unless the build was running in a virtualenv, presumed to be transient for the current build. Since every GitHub workflow is run in a transient environment, this check is no longer needed. Moreover, since the build.yaml file can set up the environment, we simply add a 'pip install' step before the action-autobuild step. Remove the related code from build-cmd.py. Don't run on 64-bit Windows: we explicitly want only a 32-bit Windows build. Defend against eventual removal of the deprecated cgitb package. Now that there's only one call of the build-cmd.py run() convenience function, usually unused, the convenience is no longer required. --- .github/workflows/build.yaml | 6 ++-- build-cmd.py | 68 ++++++------------------------------ 2 files changed, 15 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c12a750..6ef77b0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,7 +4,7 @@ jobs: build: strategy: matrix: - os: [windows-2022, macos-11, ubuntu-22.04] + os: [macos-11, ubuntu-22.04] addrsize: ["64"] include: - os: windows-2022 @@ -12,6 +12,8 @@ jobs: continue-on-error: true runs-on: ${{ matrix.os }} steps: + - name: Install Python packages + run: pip install -U eventlet llbase pytest PyInstaller requests - uses: secondlife/action-autobuild@v3 with: addrsize: ${{ matrix.addrsize }} @@ -20,6 +22,6 @@ jobs: runs-on: [ubuntu-latest] if: startsWith(github.ref, 'refs/tags/v') steps: - - uses: secondlife/action-autobuild-release@v1 + - uses: secondlife/action-autobuild-release@v2 with: public: true diff --git a/build-cmd.py b/build-cmd.py index f5b8e86..cd8367d 100644 --- a/build-cmd.py +++ b/build-cmd.py @@ -27,7 +27,6 @@ # Check https://wiki.lindenlab.com/wiki/How_To_Start_Using_Autobuild/Examples for info on how to build this package from shutil import copy, rmtree -import cgitb from collections import deque from contextlib import suppress import errno @@ -46,19 +45,12 @@ import trace # set this up early to report crashes in anything that follows -cgitb.enable(format='text') - -# Python packages on which our build depends. Each entry maps a package name -# (the name you would 'import') to the string you would use to 'pip install' -# that package. That may include any version qualifiers, or whatever, -# recognized by pip. -BUILD_DEPS = dict( - eventlet='eventlet', - llbase='llbase', - pytest='pytest', - PyInstaller='pyinstaller', - requests='requests', -) +try: + import cgitb + cgitb.enable(format='text') +except ImportError: + # sigh, they should not have deprecated and removed this + pass class Error(Exception): pass @@ -88,29 +80,6 @@ def main(): stage_VMP = os.path.join(stage, "VMP") build = os.path.join(top, 'build') - # ensure we're running in a virtualenv - try: - virtualenv = os.environ["VIRTUAL_ENV"] - except KeyError as err: - raise Error('Run %s within a virtualenv: it uses pip install' % scriptname) from err - - # Install the Python packages on which this build depends. - # iterating over a dict produces just its keys - print("Installing %s into virtualenv: %s" % - (', '.join(BUILD_DEPS), virtualenv)) - - try: - # 'python -m pip' is recommended since, if you just invoke 'pip', you - # could end up finding a different pip than the one associated with - # the Python interpreter running the current script. - # https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program - # -U means: even if we already have an older version of (say) requests - # in the system image, ensure our virtualenv has the version specified - # in RUNTIME_DEPS (or the latest version if not version-locked). - run(sys.executable, '-m', 'pip', 'install', '-U', *BUILD_DEPS.values()) - except RunError as err: - raise Error(str(err)) from err - # Make sure our staging area is clean because our manifest sweeps up # whatever's in this directory. with suppress(FileNotFoundError): @@ -137,15 +106,8 @@ def main(): test_env.pop('LIB', None) test_env.pop('WINDOWSSDK_EXECUTABLEPATH_X64', None) - # If we were to run pytest installed in system Python, as opposed to - # our virtualenv, then the scripts under test won't be able to import - # (e.g.) eventlet -- which is only in our virtualenv, not system Python. - # The tricky thing is that if system Python already contains an up-to-date - # version of pytest, 'pip install -U pytest' won't actually write anything to - # our virtualenv. - # So instead, invoke pytest using the alternate tactic in which we - # explicitly run python, the one from our virtualenv, explicitly invoking - # the pytest module: + # Invoke pytest using the alternate tactic in which we explicitly run + # python, our own interpreter, explicitly invoking the pytest module: # https://docs.pytest.org/en/latest/how-to/usage.html#calling-pytest-through-python-m-pytest command = [sys.executable, '-m', 'pytest', tests] print("About to call %s\n" @@ -241,19 +203,11 @@ def pyinstaller(mainfile, dstdir, icon, manifest_from_build=None): manifest = os.path.join(manifest_from_build, basebase, basebase + '.exe.manifest') # https://msdn.microsoft.com/en-us/library/ms235591.aspx try: - run('mt.exe', '-manifest', manifest, '-outputresource:%s;1' % exe) - except RunError as e: + subprocess.check_call( + ['mt.exe', '-manifest', manifest, '-outputresource:%s;1' % exe]) + except subprocess.CalledProcessError as e: raise Error("Couldn't embed manifest %s in %s: %s" % (manifest, exe, e)) from e -# We don't bother to catch CalledProcessError and reraise it as RunError; we -# just alias the original exception. -RunError = subprocess.CalledProcessError - -def run(*command, **kwds): - print_command(*command) - # it's caller's responsibility to catch RunError - return subprocess.check_call(command, **kwds) - def print_command(*command): print(' '.join(shlex.quote(word) for word in command), flush=True) From 568f8805e26f9a02cafc7427042737ae1d58e742 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 28 Mar 2023 17:37:50 -0400 Subject: [PATCH 05/14] SL-18837: Use pip3 instead of pip to set up environment. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6ef77b0..c5e9927 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Install Python packages - run: pip install -U eventlet llbase pytest PyInstaller requests + run: pip3 install -U eventlet llbase pytest PyInstaller requests - uses: secondlife/action-autobuild@v3 with: addrsize: ${{ matrix.addrsize }} From d088f39c21edc92a0a51ebe82f85e21020d8c75c Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Tue, 28 Mar 2023 15:47:49 -0700 Subject: [PATCH 06/14] Use x86 python during win32 build Specify `python-architecture` as appropriate in build.yaml. This should fix win32 builds, which require a python interpreter of matching architecture. --- .github/workflows/build.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c5e9927..ca01f22 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,17 +6,24 @@ jobs: matrix: os: [macos-11, ubuntu-22.04] addrsize: ["64"] + python-architecture: ["x64"] include: - os: windows-2022 addrsize: "32" + python-architecture: "x86" continue-on-error: true runs-on: ${{ matrix.os }} steps: + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + architecture: ${{ matrix.python-architecture }} - name: Install Python packages run: pip3 install -U eventlet llbase pytest PyInstaller requests - uses: secondlife/action-autobuild@v3 with: addrsize: ${{ matrix.addrsize }} + setup-python: false release: needs: build runs-on: [ubuntu-latest] From 71b53a731f372c76526d4592d658db45b231621f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 29 Mar 2023 14:52:28 -0400 Subject: [PATCH 07/14] SL-19489: Try new archive-format spec for autobuild package. --- .github/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c5e9927..3c7e3c7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,9 +14,10 @@ jobs: steps: - name: Install Python packages run: pip3 install -U eventlet llbase pytest PyInstaller requests - - uses: secondlife/action-autobuild@v3 + - uses: secondlife/action-autobuild@signal/archive-format with: addrsize: ${{ matrix.addrsize }} + archive-format: tbz2 release: needs: build runs-on: [ubuntu-latest] From 8d39e0b33296415104200587e1402d8f3cdd22ee Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Wed, 29 Mar 2023 12:09:50 -0700 Subject: [PATCH 08/14] Use x86 python during win32 build Specify `python-architecture` as appropriate in build.yaml. This should fix win32 builds, which require a python interpreter of matching architecture. --- .github/workflows/build.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3c7e3c7..626ee74 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,18 +6,25 @@ jobs: matrix: os: [macos-11, ubuntu-22.04] addrsize: ["64"] + python-architecture: ["x64"] include: - os: windows-2022 addrsize: "32" + python-architecture: "x86" continue-on-error: true runs-on: ${{ matrix.os }} steps: + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + architecture: ${{ matrix.python-architecture }} - name: Install Python packages run: pip3 install -U eventlet llbase pytest PyInstaller requests - - uses: secondlife/action-autobuild@signal/archive-format + - uses: secondlife/action-autobuild@v3 with: addrsize: ${{ matrix.addrsize }} archive-format: tbz2 + setup-python: false release: needs: build runs-on: [ubuntu-latest] From 3ce7afca1c72c7765a0d9a3ac51513e58bb79b4b Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Wed, 29 Mar 2023 12:08:24 -0700 Subject: [PATCH 09/14] Use bz2 compression when building win32 Workaround for zst compression failing on 32-bit --- .github/workflows/build.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 626ee74..377ddae 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,10 +6,14 @@ jobs: matrix: os: [macos-11, ubuntu-22.04] addrsize: ["64"] + archive-format: "tzst" python-architecture: ["x64"] include: - os: windows-2022 addrsize: "32" + # workaround for zstandard/pyzstd memory issues on 32-bit + # pyzstd.ZstdError: Unable to compress zstd data: Allocation error : not enough memory + archive-format: "tbz2" python-architecture: "x86" continue-on-error: true runs-on: ${{ matrix.os }} @@ -23,7 +27,7 @@ jobs: - uses: secondlife/action-autobuild@v3 with: addrsize: ${{ matrix.addrsize }} - archive-format: tbz2 + archive-format: ${{ matrix.archive-format }} setup-python: false release: needs: build From cbf4013b22ddc1308454145eb9d1a964743ebd07 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Wed, 29 Mar 2023 12:09:50 -0700 Subject: [PATCH 10/14] Use x86 python during win32 build Specify `python-architecture` as appropriate in build.yaml. This should fix win32 builds, which require a python interpreter of matching architecture. --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6534cfa..d5a61c8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,7 +6,7 @@ jobs: matrix: os: [macos-11, ubuntu-22.04] addrsize: ["64"] - archive-format: "tzst" + archive-format: ["tzst"] python-architecture: ["x64"] include: - os: windows-2022 @@ -27,8 +27,8 @@ jobs: - uses: secondlife/action-autobuild@v3 with: addrsize: ${{ matrix.addrsize }} - setup-python: false archive-format: ${{ matrix.archive-format }} + setup-python: false release: needs: build runs-on: [ubuntu-latest] From 1ab4f3b8e9a4a510c5326e6cb781aeda14b6ce71 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 17 Apr 2023 17:15:12 -0400 Subject: [PATCH 11/14] SL-18837: re-enable build error recognition, try C++17 --- .github/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d5a61c8..9476bd9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: # pyzstd.ZstdError: Unable to compress zstd data: Allocation error : not enough memory archive-format: "tbz2" python-architecture: "x86" - continue-on-error: true + continue-on-error: false runs-on: ${{ matrix.os }} steps: - uses: actions/setup-python@v4 @@ -26,6 +26,7 @@ jobs: run: pip3 install -U eventlet llbase pytest PyInstaller requests - uses: secondlife/action-autobuild@v3 with: + build-variables-ref: viewer-c++17 addrsize: ${{ matrix.addrsize }} archive-format: ${{ matrix.archive-format }} setup-python: false From 06379d5ccc07a1ef74742ebbdc5adb86a63aeb45 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 12 May 2023 12:25:05 -0400 Subject: [PATCH 12/14] SL-18837: Revert to default build-variables-ref --- .github/workflows/build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9476bd9..fd55186 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,7 +26,6 @@ jobs: run: pip3 install -U eventlet llbase pytest PyInstaller requests - uses: secondlife/action-autobuild@v3 with: - build-variables-ref: viewer-c++17 addrsize: ${{ matrix.addrsize }} archive-format: ${{ matrix.archive-format }} setup-python: false From e2bf84f83f156da612418a9a58c149d9c6a05933 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 17 May 2023 11:38:49 -0400 Subject: [PATCH 13/14] SL-18837: Try using tgz format instead of tbz2 for Win32. It seems that when directed to produce a TarFile(mode='w:bz2'), the Python tarfile module running on GitHub produces a bzip2 compression that's valid (can be decompressed with bunzip2) but is unknown to Python 3.10's tarfile module. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fd55186..4328fb2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: addrsize: "32" # workaround for zstandard/pyzstd memory issues on 32-bit # pyzstd.ZstdError: Unable to compress zstd data: Allocation error : not enough memory - archive-format: "tbz2" + archive-format: "tgz" python-architecture: "x86" continue-on-error: false runs-on: ${{ matrix.os }} From cc7ea1e47754cef3b47d4fdfd659fbb780391c3e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 17 May 2023 13:07:03 -0400 Subject: [PATCH 14/14] SL-18837: Use 64-bit Python even on Windows. --- .github/workflows/build.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4328fb2..c51b39e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,17 +4,20 @@ jobs: build: strategy: matrix: - os: [macos-11, ubuntu-22.04] + os: [macos-11, ubuntu-22.04, windows-2022] addrsize: ["64"] archive-format: ["tzst"] python-architecture: ["x64"] - include: - - os: windows-2022 - addrsize: "32" - # workaround for zstandard/pyzstd memory issues on 32-bit - # pyzstd.ZstdError: Unable to compress zstd data: Allocation error : not enough memory - archive-format: "tgz" - python-architecture: "x86" +## As of 2023-05-17, the autobuild package produced by either "tbz2" or "tgz" +## is unreadable by the Python 3.10 or 3.11 tarfile module. But as the "tzst" +## issue remains with 32-bit Python, use 64-bit Python for all platforms. +## include: +## - os: windows-2022 +## addrsize: "32" +## # workaround for zstandard/pyzstd memory issues on 32-bit +## # pyzstd.ZstdError: Unable to compress zstd data: Allocation error : not enough memory +## archive-format: "tbz2" +## python-architecture: "x86" continue-on-error: false runs-on: ${{ matrix.os }} steps: