Skip to content

Commit 51c0a42

Browse files
authored
Merge pull request #11 from AppThreat/fix/binary-build-issues
Fix/binary build issues
2 parents 7c5fbc2 + effd40c commit 51c0a42

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

.github/workflows/linux.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
Blint-GNU-Build:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-20.04
1010
steps:
1111
- uses: actions/checkout@v3
1212
with:
@@ -18,23 +18,23 @@ jobs:
1818
id: poetry
1919
run: |
2020
python3 -m pip install --upgrade pip
21-
python3 -m pip install poetry
21+
python3 -m pip install setuptools pyinstaller poetry
2222
cd blint
23-
python -m poetry install
24-
wget https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-amd64_linux.tar.xz
25-
tar -xvf upx-4.0.2-amd64_linux.tar.xz
26-
mkdir -p ~/.local/bin
27-
cp upx-4.0.2-amd64_linux/upx ~/.local/bin/
23+
poetry config virtualenvs.create false
24+
poetry install --no-cache
2825
- name: Binary gnu build
2926
run: |
3027
cd blint
31-
python -m poetry run pyinstaller blint/cli.py --noconfirm --log-level=WARN \
28+
pyinstaller blint/cli.py --noconfirm --log-level=WARN \
3229
--nowindow \
3330
--onefile \
3431
--name blint \
35-
--collect-all blint \
36-
--upx-dir ~/.local/bin/
32+
--add-data="blint/data:blint/data" \
33+
--add-data="blint/data/annotations:blint/data/annotations" \
34+
--collect-submodules blint \
35+
--noupx
3736
./dist/blint -i dist/blint -o /tmp/reports
37+
sha256sum ./dist/blint > ./dist/blint.sha256
3838
env:
3939
PYTHONIOENCODING: utf-8
4040
LANG: en_US.utf-8
@@ -48,3 +48,4 @@ jobs:
4848
with:
4949
files: |
5050
blint/dist/blint
51+
blint/dist/blint.sha256

.github/workflows/win.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@ jobs:
1717
- name: Install poetry
1818
id: poetry
1919
run: |
20-
python -m pip install twine setuptools wheel poetry
20+
python -m pip install --upgrade pip
21+
python -m pip install setuptools pyinstaller tzdata poetry
2122
cd blint
22-
python -m poetry install
23-
23+
poetry config virtualenvs.create false
24+
poetry install --no-cache --without dev
2425
- name: Binary windows build
2526
run: |
2627
cd blint
27-
python -m poetry run pyinstaller blint/cli.py --noconfirm --log-level=WARN --nowindow --onefile --name blint --collect-all blint --disable-windowed-traceback -i blint.ico --version-file=file_version_info.txt
28+
pyinstaller blint/cli.py --noconfirm --log-level=WARN --nowindow --onefile --name blint --add-data="blint/data;blint/data" --add-data="blint/data/annotations;blint/data/annotations" --collect-submodules blint --disable-windowed-traceback -i blint.ico --version-file=file_version_info.txt --noupx
29+
(Get-FileHash .\dist\blint.exe).hash | Out-File -FilePath .\dist\blint.exe.sha256
2830
set PYTHONIOENCODING=UTF-8
2931
.\dist\blint.exe -i .\dist\blint.exe -o reports --no-banner
3032
env:
3133
PYTHONIOENCODING: utf-8
3234
LANG: en_US.utf-8
35+
PYTHONUTF8: 1
3336
- uses: actions/upload-artifact@v1
3437
with:
3538
path: blint/dist
@@ -40,3 +43,4 @@ jobs:
4043
with:
4144
files: |
4245
blint/dist/blint.exe
46+
blint/dist/blint.exe.sha256

blint/analysis.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@
3030

3131
review_files = []
3232
if HAVE_RESOURCE_READER:
33-
review_methods_dir = importlib.resources.contents("blint.data.annotations")
34-
review_files = [rf for rf in review_methods_dir if rf.endswith(".yml")]
33+
try:
34+
review_methods_dir = importlib.resources.contents("blint.data.annotations")
35+
review_files = [rf for rf in review_methods_dir if rf.endswith(".yml")]
36+
except Exception:
37+
pass
3538
else:
3639
review_methods_dir = Path(__file__).parent / "data" / "annotations"
3740
review_files = [p.as_posix() for p in Path(review_methods_dir).rglob("*.yml")]

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ blint = 'blint.cli:main'
3333
[tool.poetry.dependencies]
3434
python = ">=3.7,<3.12"
3535
lief = "^0.12.3"
36-
rich = "^13.3.5"
36+
rich = "^13.4.1"
3737
PyYAML = "^6.0"
3838
defusedxml = "^0.7.1"
3939

0 commit comments

Comments
 (0)