Skip to content

Commit 684dfe0

Browse files
committed
Pass on the FIXUP option when compiling packages
When compiling individual packages, one may want to pass the FIXUP option to `make check`. It can help with generating package hashes.
1 parent d875359 commit 684dfe0

4 files changed

Lines changed: 46 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,38 @@ jobs:
3939

4040
- name: Verify logs saved
4141
run: find artifacts/logs/package/feeds/packages/ -mindepth 2 -maxdepth 2 -name compile.txt -type f | grep .
42+
43+
try_options: # To test options such as FIXUP
44+
name: Option FIXUP=${{ matrix.fixup }}
45+
runs-on: ubuntu-latest
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
release:
50+
- master
51+
arch: # arch and release variants are tested above, so limit these here
52+
- x86_64
53+
fixup:
54+
- 1
55+
- 0
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Add test directories
61+
run: mkdir artifacts feed
62+
63+
- name: Build
64+
uses: ./
65+
env:
66+
ARCH: ${{ matrix.arch }}-${{ matrix.release }}
67+
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
68+
FEED_DIR: ${{ github.workspace }}/feed
69+
PACKAGES: privoxy
70+
FIXUP: ${{ matrix.fixup }}
71+
72+
- name: Verify packages saved
73+
run: find artifacts/bin/packages/${{ matrix.arch }}/packages/ -maxdepth 1 -name '*.ipk' -type f | grep .
74+
75+
- name: Verify logs saved
76+
run: find artifacts/logs/package/feeds/packages/ -mindepth 2 -maxdepth 2 -name compile.txt -type f | grep .

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@ The action reads a few env variables:
6969
* `NO_SHFMT_CHECK` disable check if init files are formated
7070
* `PACKAGES` (Optional) specify the list of packages (space separated) to be built
7171
* `V` changes the build verbosity level.
72+
* `FIXUP` set to `1` to [generate](https://openwrt.org/docs/guide-developer/packages#use_source_repository) the `PKG_MIRROR_HASH`, and for other [fixes](https://openwrt.org/docs/guide-developer/packages#testing_a_package_makefile). Only used when `PACKAGES` option is used.
73+

action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ runs:
4444
--env PACKAGES \
4545
--env INDEX \
4646
--env V \
47+
--env FIXUP \
4748
-v ${{ steps.inputs.outputs.artifacts_dir }}:/artifacts \
4849
-v ${{ steps.inputs.outputs.feed_dir }}:/feed \
4950
sdk

entrypoint.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,17 @@ else
9090
endgroup
9191

9292
group "make package/$PKG/check"
93+
if [ "${FIXUP+defined}" ] && [ "$FIXUP" -eq 1 ]; then
94+
echo "FIXUP=1 is set, so PKG_MIRROR_HASH might be generated"
95+
: # FIXUP=1 is set. Do nothing. It will get used below.
96+
else
97+
# In all other cases, avoid mention of FIXUP to build scripts.
98+
unset FIXUP
99+
fi
93100
make \
94101
BUILD_LOG="$BUILD_LOG" \
95102
IGNORE_ERRORS="$IGNORE_ERRORS" \
96-
"package/$PKG/check" V=s 2>&1 | \
103+
"package/$PKG/check" ${FIXUP:+FIXUP=$FIXUP} V=s 2>&1 | \
97104
tee logtmp
98105
endgroup
99106

0 commit comments

Comments
 (0)