Skip to content

Commit bc8485c

Browse files
authored
Merge pull request #163 from Jayy001/debug
Add debug build flag and update nuitka
2 parents c2d44b9 + 97d7a6c commit bc8485c

3 files changed

Lines changed: 51 additions & 25 deletions

File tree

.github/workflows/main.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ defaults:
3434

3535
jobs:
3636
remote:
37-
name: Build for ${{ matrix.os }}
37+
name: Build for ${{ matrix.os }}${{ matrix.debug == 1 && ' (debug)' || '' }}
3838
strategy:
3939
fail-fast: false
4040
matrix:
@@ -43,6 +43,9 @@ jobs:
4343
- windows-latest
4444
- macos-latest
4545
- macos-15-intel
46+
debug:
47+
- 0
48+
- 1
4649
runs-on: ${{ matrix.os }}
4750
steps:
4851
- name: Install Apt packages
@@ -51,11 +54,20 @@ jobs:
5154
uses: awalsh128/cache-apt-pkgs-action@latest
5255
with:
5356
execute_install_scripts: true
54-
packages: libfuse-dev
57+
packages: libfuse-dev upx-ucl
5558
version: 1.0
59+
- name: Install windows packages
60+
if: matrix.os == 'windows-latest'
61+
run: |
62+
winget install -e \
63+
--id UPX.UPX \
64+
--disable-interactivity \
65+
--accept-source-agreements \
66+
--accept-package-agreements
67+
echo "$LOCALAPPDATA/Microsoft/WinGet/Links/" >> $GITHUB_PATH
5668
- name: Install brew packages
5769
if: matrix.os == 'macos-latest' || matrix.os == 'macos-15-intel'
58-
run: brew install coreutils
70+
run: brew install coreutils upx
5971
- name: Checkout the Git repository
6072
uses: actions/checkout@v4
6173
- name: ccache
@@ -82,14 +94,14 @@ jobs:
8294
run: chmod +x ./scripts/github-make-executable.sh
8395
- name: Build codexctl
8496
shell: bash
85-
run: ./scripts/github-make-executable.sh
97+
run: DEBUG_BUILD=${{ matrix.debug }} ./scripts/github-make-executable.sh
8698
env:
8799
nuitka_cache: ${{ github.workspace }}/.nuitka
88100
- name: Upload Compilation Report
89101
uses: actions/upload-artifact@v4
90102
if: (success() || failure()) && runner.debug == '1'
91103
with:
92-
name: ${{ matrix.os }}-compilation-report
104+
name: ${{ matrix.os }}${{ matrix.debug == 1 && '-debug' || '' }}-compilation-report
93105
path: compilation-report.xml
94106
if-no-files-found: warn
95107
- name: Move .ccache
@@ -102,19 +114,25 @@ jobs:
102114
if: matrix.os != 'windows-latest'
103115
uses: actions/upload-artifact@v4
104116
with:
105-
name: ${{ matrix.os }}
117+
name: ${{ matrix.os }}${{ matrix.debug == 1 && '-debug' || '' }}
106118
path: dist/codexctl
107119
if-no-files-found: error
108120
- name: Upload executable
109121
if: matrix.os == 'windows-latest'
110122
uses: actions/upload-artifact@v4
111123
with:
112-
name: ${{ matrix.os }}
124+
name: ${{ matrix.os }}${{ matrix.debug == 1 && '-debug' || '' }}
113125
path: dist/codexctl.exe
114126
if-no-files-found: error
115127
device:
116-
name: Build for remarkable
128+
name: Build for remarkable${{ matrix.debug == 1 && ' (debug)' || '' }}
117129
runs-on: ubuntu-latest
130+
strategy:
131+
fail-fast: false
132+
matrix:
133+
debug:
134+
- 0
135+
- 1
118136
steps:
119137
- name: Free up disk space
120138
shell: bash
@@ -161,18 +179,18 @@ jobs:
161179
cd /src
162180
source /opt/lib/nuitka/bin/activate
163181
chmod +x ./scripts/github-make-executable.sh
164-
./scripts/github-make-executable.sh
182+
DEBUG_BUILD=${{ matrix.debug }} ./scripts/github-make-executable.sh
165183
- name: Upload Compilation Report
166184
uses: actions/upload-artifact@v4
167185
if: runner.debug == '1'
168186
with:
169-
name: remarkable-compilation-report
187+
name: remarkable${{ matrix.debug == 1 && '-debug' || '' }}-compilation-report
170188
path: compilation-report.xml
171189
if-no-files-found: warn
172190
- name: Upload executable
173191
uses: actions/upload-artifact@v4
174192
with:
175-
name: remarkable
193+
name: remarkable${{ matrix.debug == 1 && '-debug' || '' }}
176194
path: dist/codexctl
177195
if-no-files-found: error
178196
test_device:

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ else
2323
endif
2424
CODEXCTL_BIN := codexctl
2525
endif
26+
CODEXCTL_FLAGS :=
27+
ifeq ($(DEBUG_BUILD),1)
28+
CODEXCTL_FLAGS += --debug
29+
CODEXCTL_FLAGS += --no-debug-c-warnings
30+
CODEXCTL_FLAGS += --no-debug-immortal-assumptions
31+
endif
2632

2733
UNAME_S := $(shell uname -s)
2834
ifeq ($(UNAME_S),Darwin)
@@ -140,7 +146,7 @@ executable: $(VENV_BIN_ACTIVATE)
140146
. $(VENV_BIN_ACTIVATE); \
141147
python -m pip install \
142148
--extra-index-url=https://wheels.eeems.codes/ \
143-
nuitka==2.7.12 \
149+
nuitka==2.8.10 \
144150
setuptools
145151
@echo "[info] Building codexctl"
146152
@set -e; \
@@ -152,6 +158,7 @@ executable: $(VENV_BIN_ACTIVATE)
152158
--output-dir=dist \
153159
--report=compilation-report.xml \
154160
--output-filename=codexctl \
161+
$(CODEXCTL_FLAGS) \
155162
main.py
156163

157164
if [ -d dist/codexctl.build ]; then \

scripts/github-make-executable.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/bin/bash
22
set +e
33

4-
make executable 2>&1 \
5-
| while read -r line; do
6-
IFS=$'\n' read -r -a lines <<< "$line"
7-
if [[ "$line" == 'Nuitka'*':ERROR:'* ]] || [[ "$line" == 'FATAL:'* ]] || [[ "$line" == 'make: *** ['*'] Error'* ]] ; then
8-
printf '::error file=main.py,title=Nuitka Error::%s\n' "${lines[@]}"
9-
elif [[ "$line" == 'Nuitka'*':WARNING:'* ]]; then
10-
printf '::warning file=main.py,title=Nuitka Warning::%s\n' "${lines[@]}"
11-
elif [[ "$line" == 'Nuitka:INFO:'* ]] || [[ "$line" == '[info]'* ]]; then
12-
echo "$line"
13-
else
14-
printf '::debug::%s\n' "${lines[@]}"
15-
fi
16-
done
4+
DEBUG_BUILD=$DEBUG_BUILD \
5+
make executable 2>&1 |
6+
while read -r line; do
7+
IFS=$'\n' read -r -a lines <<<"$line"
8+
if [[ "$line" == 'Nuitka'*':ERROR:'* ]] || [[ "$line" == 'FATAL:'* ]] || [[ "$line" == 'make: *** ['*'] Error'* ]]; then
9+
printf '::error file=main.py,title=Nuitka Error::%s\n' "${lines[@]}"
10+
elif [[ "$line" == 'Nuitka'*':WARNING:'* ]]; then
11+
printf '::warning file=main.py,title=Nuitka Warning::%s\n' "${lines[@]}"
12+
elif [[ "$line" == 'Nuitka:INFO:'* ]] || [[ "$line" == '[info]'* ]]; then
13+
echo "$line"
14+
else
15+
printf '::debug::%s\n' "${lines[@]}"
16+
fi
17+
done
1718

1819
if ! make test-executable; then
1920
printf '::error file=codexctl,title=Test Error::Sanity test failed\n'

0 commit comments

Comments
 (0)