Skip to content

Commit

Permalink
Pass on the FIXUP option when compiling packages
Browse files Browse the repository at this point in the history
When compiling individual packages, one may want to pass the FIXUP
option to `make check`. It can help with generating package hashes.
  • Loading branch information
cmangla committed Nov 1, 2024
1 parent d875359 commit 684dfe0
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,38 @@ jobs:

- name: Verify logs saved
run: find artifacts/logs/package/feeds/packages/ -mindepth 2 -maxdepth 2 -name compile.txt -type f | grep .

try_options: # To test options such as FIXUP
name: Option FIXUP=${{ matrix.fixup }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
release:
- master
arch: # arch and release variants are tested above, so limit these here
- x86_64
fixup:
- 1
- 0

steps:
- uses: actions/checkout@v4

- name: Add test directories
run: mkdir artifacts feed

- name: Build
uses: ./
env:
ARCH: ${{ matrix.arch }}-${{ matrix.release }}
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
FEED_DIR: ${{ github.workspace }}/feed
PACKAGES: privoxy
FIXUP: ${{ matrix.fixup }}

- name: Verify packages saved
run: find artifacts/bin/packages/${{ matrix.arch }}/packages/ -maxdepth 1 -name '*.ipk' -type f | grep .

- name: Verify logs saved
run: find artifacts/logs/package/feeds/packages/ -mindepth 2 -maxdepth 2 -name compile.txt -type f | grep .
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ The action reads a few env variables:
* `NO_SHFMT_CHECK` disable check if init files are formated
* `PACKAGES` (Optional) specify the list of packages (space separated) to be built
* `V` changes the build verbosity level.
* `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.

1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ runs:
--env PACKAGES \
--env INDEX \
--env V \
--env FIXUP \
-v ${{ steps.inputs.outputs.artifacts_dir }}:/artifacts \
-v ${{ steps.inputs.outputs.feed_dir }}:/feed \
sdk
Expand Down
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ else
endgroup

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

Expand Down

0 comments on commit 684dfe0

Please sign in to comment.