Repository navigation
Conversation
Projects such as odhcpd, libubox, ubus and uci build themselves in CI with the cross compilers of the runner's distribution. Ubuntu 26.04 ships no MIPS cross compilers, so those jobs fail on ubuntu-latest. Add a reusable workflow that builds the calling project as its OpenWrt package inside the SDK container of each architecture, with the checkout as the package source. The caller names the source package, the binary packages to build and optionally the feed, the architectures and the SDK branch. The job publishes the built packages, a size table and, on failure, the build logs. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a reusable workflow,
sdk-package-build.yml, that builds the calling project as its OpenWrt package insideghcr.io/openwrt/sdk:<arch>-<branch>for a list of architectures, with the checkout as the package source. It publishes the built packages as artifacts, writes a size table to the job summary and uploads the build logs on failure.openwrt/odhcpd, libubox, ubus, uci, libnl-tiny and odhcp6c each carry a copy of the same build matrix, which installs the cross compilers of the runner's distribution. Ubuntu 26.04 ships no MIPS cross compilers (
gcc-mips-linux-gnuandgcc-mips64-linux-gnuabi64are in 24.04 and absent from 26.04), so those jobs fail now thatubuntu-latestis 26.04. Building with the SDK uses OpenWrt's own toolchains and C library and needs nothing from the runner beyond Docker. The build script is the one openwrt/procd already uses in itsbuild.yml, with the package name, package list and feed turned into parameters.A caller needs only this:
Optional inputs are
feed(defaultbase),archs(a JSON array, default x86_64, i386_pentium4, aarch64_generic, arm_cortex-a15_neon-vfpv4, mips_24kc, mipsel_24kc, powerpc_8548, riscv64_generic) andsdk_branch(defaultmaster).Tested by running
sdk_package_build.shlocally inghcr.io/openwrt/sdk:x86_64-masteragainst a checkout of odhcpd master: bothodhcpdandodhcpd-ipv6onlybuilt, versioned with the checkout's commit. The workflow file itself has not run on GitHub yet; openwrt/odhcpd will be its first caller.LLM use: the workflow and the generalised script were written with the help of an LLM coding assistant and reviewed by me.