mirror of
https://github.com/mandiant/capa.git
synced 2025-12-05 20:40:05 -08:00
fix build issues discovered during and after v9.2.0 release (#2684)
* ci: downgrade Ubuntu version to accommodate older GLIBC versions * ci: upgrade Windows version to avoid deprecation * ci: exclude pkg_resources from PyInstaller build * update CHANGELOG * update spec file * ci: check if build runs without warnings or errors * update CHANGELOG * update build commands * update build commands * update build commands * update build commands * update build commands
This commit is contained in:
3
.github/pyinstaller/pyinstaller.spec
vendored
3
.github/pyinstaller/pyinstaller.spec
vendored
@@ -74,6 +74,9 @@ a = Analysis(
|
|||||||
# only be installed locally.
|
# only be installed locally.
|
||||||
"binaryninja",
|
"binaryninja",
|
||||||
"ida",
|
"ida",
|
||||||
|
# remove once https://github.com/mandiant/capa/issues/2681 has
|
||||||
|
# been addressed by PyInstaller
|
||||||
|
"pkg_resources",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
@@ -22,16 +22,16 @@ jobs:
|
|||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-22.04
|
||||||
# use old linux so that the shared library versioning is more portable
|
# use old linux so that the shared library versioning is more portable
|
||||||
artifact_name: capa
|
artifact_name: capa
|
||||||
asset_name: linux
|
asset_name: linux
|
||||||
python_version: '3.10'
|
python_version: '3.10'
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-22.04
|
||||||
artifact_name: capa
|
artifact_name: capa
|
||||||
asset_name: linux-py312
|
asset_name: linux-py312
|
||||||
python_version: '3.12'
|
python_version: '3.12'
|
||||||
- os: windows-2019
|
- os: windows-2022
|
||||||
artifact_name: capa.exe
|
artifact_name: capa.exe
|
||||||
asset_name: windows
|
asset_name: windows
|
||||||
python_version: '3.10'
|
python_version: '3.10'
|
||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
|
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python_version }}
|
python-version: ${{ matrix.python_version }}
|
||||||
- if: matrix.os == 'ubuntu-24.04'
|
- if: matrix.os == 'ubuntu-22.04'
|
||||||
run: sudo apt-get install -y libyaml-dev
|
run: sudo apt-get install -y libyaml-dev
|
||||||
- name: Upgrade pip, setuptools
|
- name: Upgrade pip, setuptools
|
||||||
run: python -m pip install --upgrade pip setuptools
|
run: python -m pip install --upgrade pip setuptools
|
||||||
@@ -59,6 +59,28 @@ jobs:
|
|||||||
pip install -e .[build]
|
pip install -e .[build]
|
||||||
- name: Build standalone executable
|
- name: Build standalone executable
|
||||||
run: pyinstaller --log-level DEBUG .github/pyinstaller/pyinstaller.spec
|
run: pyinstaller --log-level DEBUG .github/pyinstaller/pyinstaller.spec
|
||||||
|
- name: Does it run without warnings or errors?
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ "${{ matrix.os }}" == "windows-2022" ]]; then
|
||||||
|
EXECUTABLE=".\\dist\\capa"
|
||||||
|
else
|
||||||
|
EXECUTABLE="./dist/capa"
|
||||||
|
fi
|
||||||
|
|
||||||
|
output=$(${EXECUTABLE} --version 2>&1)
|
||||||
|
exit_code=$?
|
||||||
|
|
||||||
|
echo "${output}"
|
||||||
|
echo "${exit_code}"
|
||||||
|
|
||||||
|
if echo "${output}" | grep -iE 'error|warning'; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${exit_code}" -ne 0 ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Does it run (PE)?
|
- name: Does it run (PE)?
|
||||||
run: dist/capa -d "tests/data/Practical Malware Analysis Lab 01-01.dll_"
|
run: dist/capa -d "tests/data/Practical Malware Analysis Lab 01-01.dll_"
|
||||||
- name: Does it run (Shellcode)?
|
- name: Does it run (Shellcode)?
|
||||||
@@ -82,10 +104,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
# OSs not already tested above
|
# OSs not already tested above
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-22.04
|
||||||
artifact_name: capa
|
artifact_name: capa
|
||||||
asset_name: linux
|
asset_name: linux
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-22.04
|
||||||
artifact_name: capa
|
artifact_name: capa
|
||||||
asset_name: linux-py312
|
asset_name: linux-py312
|
||||||
- os: windows-2022
|
- os: windows-2022
|
||||||
|
|||||||
20
.github/workflows/tests.yml
vendored
20
.github/workflows/tests.yml
vendored
@@ -26,7 +26,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changelog_format:
|
changelog_format:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout capa
|
- name: Checkout capa
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
if [ $number != 1 ]; then exit 1; fi
|
if [ $number != 1 ]; then exit 1; fi
|
||||||
|
|
||||||
code_style:
|
code_style:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout capa
|
- name: Checkout capa
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
@@ -64,7 +64,7 @@ jobs:
|
|||||||
run: pre-commit run deptry --hook-stage manual
|
run: pre-commit run deptry --hook-stage manual
|
||||||
|
|
||||||
rule_linter:
|
rule_linter:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout capa with submodules
|
- name: Checkout capa with submodules
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
@@ -88,16 +88,16 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-24.04, windows-2019, macos-13]
|
os: [ubuntu-22.04, windows-2022, macos-13]
|
||||||
# across all operating systems
|
# across all operating systems
|
||||||
python-version: ["3.10", "3.11"]
|
python-version: ["3.10", "3.11"]
|
||||||
include:
|
include:
|
||||||
# on Ubuntu run these as well
|
# on Ubuntu run these as well
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-22.04
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-22.04
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-22.04
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout capa with submodules
|
- name: Checkout capa with submodules
|
||||||
@@ -109,7 +109,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install pyyaml
|
- name: Install pyyaml
|
||||||
if: matrix.os == 'ubuntu-24.04'
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
run: sudo apt-get install -y libyaml-dev
|
run: sudo apt-get install -y libyaml-dev
|
||||||
- name: Install capa
|
- name: Install capa
|
||||||
run: |
|
run: |
|
||||||
@@ -126,7 +126,7 @@ jobs:
|
|||||||
name: Binary Ninja tests for ${{ matrix.python-version }}
|
name: Binary Ninja tests for ${{ matrix.python-version }}
|
||||||
env:
|
env:
|
||||||
BN_SERIAL: ${{ secrets.BN_SERIAL }}
|
BN_SERIAL: ${{ secrets.BN_SERIAL }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
needs: [tests]
|
needs: [tests]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -168,7 +168,7 @@ jobs:
|
|||||||
|
|
||||||
ghidra-tests:
|
ghidra-tests:
|
||||||
name: Ghidra tests for ${{ matrix.python-version }}
|
name: Ghidra tests for ${{ matrix.python-version }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
needs: [tests]
|
needs: [tests]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|||||||
@@ -18,6 +18,11 @@
|
|||||||
|
|
||||||
### Development
|
### Development
|
||||||
|
|
||||||
|
- ci: exclude pkg_resources from PyInstaller build @mike-hunhoff #2684
|
||||||
|
- ci: upgrade Windows version to avoid deprecation @mike-hunhoff #2684
|
||||||
|
- ci: downgrade Ubuntu version to accommodate older GLIBC versions @mike-hunhoff #2684
|
||||||
|
- ci: check if build runs without warnings or errors @mike-hunhoff #2684
|
||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
- [capa v9.2.0...master](https://github.com/mandiant/capa/compare/v9.2.0...master)
|
- [capa v9.2.0...master](https://github.com/mandiant/capa/compare/v9.2.0...master)
|
||||||
- [capa-rules v9.2.0...master](https://github.com/mandiant/capa-rules/compare/v9.2.0...master)
|
- [capa-rules v9.2.0...master](https://github.com/mandiant/capa-rules/compare/v9.2.0...master)
|
||||||
|
|||||||
Reference in New Issue
Block a user