Commit Graph

51342 Commits

Author SHA1 Message Date
Hauke Mehrtens 0943f4dc99
CI: Build all boards and testing kernel
This adds options to build all boards of a selected target and an
additional option to build the testing kernel instead of the normal
kernel. This can be used by other trigger work flows.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit cf361b8509)
2022-12-04 16:28:13 +01:00
Hauke Mehrtens b0e6bce634
CI: Allow building with internal toolchain
This adds an option to build with internal toolchain. This can be used
to build targets which are currently not build by the OpenWrt build bots
and which needs their own toolchain build for every build.

Building the toolchain takes about 30 minutes compared to using the
external toolchain which takes some seconds.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 08f5283392)
2022-12-04 16:28:07 +01:00
Hauke Mehrtens 02391a5e5a
CI: Extract the OpenWrt building to own sub workflow
Extract the building of OpenWrt into an own workflow which is then
triggered by the kernel.yml and packages.yml workflow with different
inputs. This allows us to share much of the code of the workflow.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 7c406a5f08)
2022-12-04 16:28:03 +01:00
Hauke Mehrtens 43980bfbf0
CI: Simplify if conditions
There is no need to put a ${{ }} around the if conditions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ce343653c2)
2022-12-04 16:27:55 +01:00
Jo-Philipp Wich 6ca1d74ac1
meta: drop issue_template
The contents do not apply anymore now that the switch to Github issue
has been decided.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 64125ed1d0)
2022-12-04 16:27:00 +01:00
Hauke Mehrtens 1b34fc20cc
CI: packages.yml: Fix usage of pre-build tools
Activate CONFIG_AUTOREMOVE to match the settings used to build the
pre-build tools. This has to match the pre-build tools to not rebuild
them.

This prevents the tools being rebuild in packages.yml.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6645a019f8)
2022-12-04 16:27:00 +01:00
Hauke Mehrtens c14030c6bf
CI: packages: Add github CI job to build all packages
This will build OpenWrt for MIPS malta BE and x86 64 Bit with all
packages and kernel modules activated. It is triggered when something
changes in the build system or when a package definition is changed.
This task probably needs 90 minutes to execute, but I hope that it
will find build problems in pull requests early.

This intentionally does not activate the feeds, because building them
too would take too long. We only build x86/64 and malta/be to save
resources.

I would like to detect build problems when a package is changed. We
often had build breaks when a package version was increased sometime
even in other packages which used it as a dependency.

This is based on the .github/workflows/packages.yml workflow.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b99d377886)
2022-12-04 16:27:00 +01:00
Christian Marangi 1ae19596b8
CI: kernel: fix deprecation of set-output
From [0], github deprecated set-output with a better approach of
appending variables to $GITHUB_OUTPUT

[0] https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 6d4bcadaa3)
2022-12-04 16:27:00 +01:00
Petr Štetiar 4460990610
ci: kernel: trigger build check on changes in kernel.mk as well
So we can QA more parts of kernel build process.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 5e31c82bb5)
2022-12-04 16:27:00 +01:00
Christian Marangi 5872b1bfd0
CI: kernel: check if patch are refreshed for each target
Enforce refreshed patch for each target with kernel pr tests.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 689cfaeb7c)
2022-12-04 16:27:00 +01:00
Christian Marangi 3e41081eff
CI: labeler: target major version of labeler action
Target major version of labeler to include minor fixes and use always
the latest major version with included fixes.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 5fb7232bc0)
2022-12-04 16:27:00 +01:00
Christian Marangi c4345c7a7d
CI: bump actions/download,upload-artifact action to v3
Bump actions/download,upload-artifact action to v3 on every workflow
to mute node deprecation warning.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 77b24012db)
2022-12-04 16:27:00 +01:00
Christian Marangi 2454da3d5e
CI: bump actions/checkout action to v3
Bump actions/checkout action to v3 on every workflow to mute node
deprecation warning.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 87c69d73bb)
2022-12-04 16:27:00 +01:00
Christian Marangi 305688f537
CI: kernel: generate ccache cache on kernel push
To actually use ccache cache on kernel test from pr, the kernel workflow
has to be run first from a push action.

This will permit as a side effect to test merged commits and catch commit
that may cause regression in kernel compilation even outside the github
system.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 23e946d1ad)
2022-12-04 16:27:00 +01:00
Christian Marangi 9718dffd27
CI: kernel: use ccache to speedup workflow
Use ccache to speedup kernel compilation.
Ccache dir is cached across each build test. To refresh ccache directory
we generate an hash of the kernel include files, that includes the
kernel versions of every kernel supported and the kernel compile
includes.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 137ba15e6e)
2022-12-04 16:27:00 +01:00
Christian Marangi c95622ac6e
CI: tools: compile tools with ccache support for tools container
Enable ccache support for tools container, useful to speedup other
workflow even more.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 2781e3839e)
2022-12-04 16:27:00 +01:00
Edward Chow 3ba78a839a
CI: Add workaround for github uppercase usernames
The workflow defined in tools.yml and kernel.yml used to fail on
forked repositories of contributers whose github username contains
uppercase letters.

A workaround mentioned in
https://github.com/orgs/community/discussions/27086 and
https://stackoverflow.com/questions/70326569/ is applied.

Signed-off-by: Edward Chow <equu@openmail.cc>
(cherry picked from commit c27b439564)
2022-12-04 16:27:00 +01:00
Christian Marangi f4db275250
CI: use tools:latest container to speedup kernel workflow
Use tools:latest container with prebuilt host tools to speedup kernel
compilation in kernel workflow.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 5d09118f8e)
2022-12-04 16:27:00 +01:00
Paul Spooren ec55b1217a
CI: create Docker container containing compiled tools
Currently each Kernel compilation takes about 30 minutes of which 20
minutes are used to compile our tools. While the toolchain is downloaded
and instantly ready the tools are missing.

This commit starts uploading a Docker container including compiled tools
which are ready to use. It is automatically updated whenever any tools
are changed.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Co-Developed-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 25b65f548d)
2022-12-04 16:27:00 +01:00
Paul Spooren 6f9067e9d4
CI: use buildbot container for building
Instead of using a fresh Linux installation which is setup every time
use the Buildbot container which is used for our own Buildbot
infrastructure, too.
While at it also tidy up the workflow to make it more consistent with
other workflow.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Co-Developed-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3b23227d43)
2022-12-04 16:27:00 +01:00
Petr Štetiar 01000b0cec
ci: show build failures directly in job log output
Instead of waiting for complete workflow finish, then downloading the
artifacts, unpacking them and inspecting them, lets try to make the
build failure immediately visible in the log output:

  ====== Make errors from logs/target/linux/compile.txt ======
  * Legacy (non-UHI/non-FIT) Boards
  *
  Support MIPS SEAD-3 boards (LEGACY_BOARD_SEAD3) [N/y/?] (NEW)
  Error in reading or end of file.

  make[6]: *** [scripts/kconfig/Makefile:77: syncconfig] Error 1
  make[5]: *** [Makefile:616: syncconfig] Error 2
  make[4]: *** [Makefile:736: include/config/auto.conf.cmd] Error 2
  make[3]: *** [Makefile:24: build_dir/target-mipsel-openwrt-linux-musl_musl/linux-ramips_mt7620/linux-5.15.62/.modules] Error 2
  make[2]: *** [Makefile:11: compile] Error 2
  time: target/linux/compile#30.09#11.30#37.92

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit f4ca4187cd)
2022-12-04 16:26:59 +01:00
Petr Štetiar 2e29823034
ci: move scripts into separate directory
So it's clean and tidy.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 63ed733d30)
2022-12-04 16:26:59 +01:00
Alex Low 3a9f927c2f
build: harden GitHub workflow permissions
Grant pull-requests write permission to the labeler workflow and
read-only to everything else.

Signed-off-by: Alex Low <aleksandrosansan@gmail.com>
[ wrap to 80 columns and fix wrong author as requested by author itself ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 7152599407)
2022-12-04 16:26:59 +01:00
Piotr Dymacz 8496275f83
CI: include automatic Pull Request Labeler
This adds GitHub CI action which makes use of 'Labeler', allowing
automatic labeling of new PRs, based on the modified files paths.

Below labels are supported and more can be added later:
- 'target/*'
- 'target/imagebuilder'
- 'kernel'
- 'core packages'
- 'build/scripts/tools'
- 'toolchain'
- 'GitHub/CI'

For more information:
https://github.com/marketplace/actions/labeler

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 4f42566d47)
2022-12-04 16:26:59 +01:00
Christian Marangi 3082e83596
CI: package kmods in kernel workflow
Actually package kmods in kernel workflow to catch dependency error and
other problem that may arise from kmods packaging.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 0c45db5560)
2022-12-04 16:26:59 +01:00
Christian Marangi 8dc0a963a8
CI: kernel: Cache external toolchain
Cache external toolchain for each target to remove load from openwrt cdn
server and make the external toolchain setup quicker.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit f522c27385)
2022-12-04 16:26:59 +01:00
Hauke Mehrtens 5978ab409c
CI: kernel: Build all kernel modules
Activate building all kernel modules.

This builds all kernel modules from the core packages and the feeds.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit fed325f463)
2022-12-04 16:26:59 +01:00
Hauke Mehrtens 93d67c96a6
CI: kernel: Checkout feeds from github
Instead of cloning the feeds from the default location at
git.openwrt.org use the github action to clone them directly from
github. We saw some error messages when cloning from git.openwrt.org,
probably related to some rate limiting applied. Cloning from github
within a github action should work more stable.

The "./scripts/feeds update -a" script will use the already checked out
feed repositories and not clone them again from git.openwrt.org, but it
will also not change the branch name.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b120e78917)
2022-12-04 16:26:59 +01:00
Hauke Mehrtens fde584a3ec
CI: kernel: Show used OpenWrt configuration
Show the configuration used to build OpenWrt before starting the build.
This should make it easier for people to reproduce problems when it
fails.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 43afaf6149)
2022-12-04 16:26:59 +01:00
Hauke Mehrtens ae63723f0a
CI: kernel: Use downloads.cdn.openwrt.org
Use downloads.cdn.openwrt.org to download the toolchain. This should
reduce the load on the servers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 7b4daf0076)
2022-12-04 16:26:59 +01:00
Hauke Mehrtens 1cf24edac7
CI: kernel: Trigger workflow for more directories
Trigger the kernel build workflow also for more directories.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 546822775c)
2022-12-04 16:26:59 +01:00
Paul Spooren 73e37f2763
CI: run inside the buildbot docker container
Run github actions insider buildbot docker container.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[ run container under buildbot user ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8a77adb048)
2022-12-04 16:26:59 +01:00
Paul Spooren e1e47d5984
CI: add Kernel compile tests
Add Github Actions yaml script to build test kernel PR changes for
each target.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[ add commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit c17c931a90)
2022-12-04 16:26:59 +01:00
Paul Spooren cf2b72ed7f
CI: usability improvements for tools
* Always store build logs
* Store .config as an artifact
* Rename job to `tools-{ os }` for log archive without spaces
* Run CI job on changes to the CI file itself

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 80f79beb95)
2022-12-04 16:26:59 +01:00
Paul Spooren d3a8cacfcc
CI: move logs/ to GITHUB_WORKSPACE
Artifacts can only be uploaded from inside the GITHUB_WORKSPACE. While
the Linux CI jobs run inside that per default, a special case-sensitive
mount outside the GITHUB_WORKSPACE is used for macOS builds.

To make log artifacts work for both macOS and Linux, move logs/ folder
to GITHUB_WORKSPACE on failures.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit a5eeac8033)
2022-12-04 16:26:59 +01:00
Paul Spooren 9c4d81ec5e
CI: build changes in tools/ on ubuntu/macos
This commits adds GitHub CI to check that all tools compile on both
Ubuntu and macOS. Since running in parrallel this should also detect
badly set depdendencies within tools/Makefile.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit fb830fd894)
2022-12-04 16:26:59 +01:00
Paul Spooren 6d4d665147
CI: allow dots in commit subject area
Due to a limited grep pattern, subjects containing dots like `image.mk`
were falsely reported as problematic. Extend pattern to allow dots.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit fb5d0dc362)
2022-12-04 16:11:57 +01:00
Paul Spooren 09f4533d6d
CI: add formal checks
The formal checks verify the following things:
- Commits does not contain any merge commits
- Signed by a real name
- Commit titles starts with an `<area>:`
- Author name matches signed of name
- Commit message is not empty

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 3dc38823a2)
2022-12-04 16:11:57 +01:00
Christian Marangi fd90eed40c
scripts: ext-toolchain: add support for musl
Openwrt now supports only glibc and musl. Add support for musl and
rework the libc check to handle the new config flags and correctly
compile package basend on that.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 7be01fe13b)
2022-12-04 16:07:35 +01:00
Christian Marangi 462c5653e1
scripts: ext-toolchain: add support for info.mk in probe_cc
Openwrt generate info.mk that contains the libc type. For probe_cc check
if the file exist and parse directly it for LIBC type.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 75311977f5)
2022-12-04 16:07:35 +01:00
Christian Marangi 1f5b8a32e4
scripts: ext-toolchain: actually probe libc type on config generation
Currently we never call probe_cc before config generation, this cause
the script to never actually detect the correct libc type.
Call probe_cc before config generation to correctl set the .config file.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit ddeabc75eb)
2022-12-04 16:07:35 +01:00
Christian Marangi ed785589ea
scripts: ext-toolchain: add option to overwrite config
It can be useful to overwrite an already generated config.
Option are simply added at the end of the config and make defconfig
will overwrite the relevant option with the new one.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit f4dd18ca39)
2022-12-04 16:07:34 +01:00
Christian Marangi 1e764ea7df
scripts: ext-toolchain: fix wrong prefix in print_config generation
The parsed prefix in print_config is wrong and this produce broken
generated .config that won't work with any external toolchain.

Currently the prefix from a CC of

'arm-openwrt-linux-muslgnueabi-gcc-12.1.0'

produce a prefix

'arm-openwrt-linux-muslgnueabi-gcc-'

This is wrong as the real prefix should be

'arm-openwrt-linux-muslgnueabi-'

This is probably caused by a change in how the toolchain is now handled
that now append also the gcc version. Probably in ancient days the
version wasn't part of the name and the prefix generation stripped the
'-gcc' instead of the gcc version.

Fix this and correctly strip the gcc version and the gcc suffix to
correctly call toolchain bins.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 53c293262f)
2022-12-04 16:07:34 +01:00
Josh Soref 997ab54373
scripts: fix various typos
This only affects typos in comments or user-facing output.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
[only picks changes to scripts, drop "commandline" replacement,
 fix case for "arbitrary", improve commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 08622de7d6)
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-04 16:07:34 +01:00
Christian Marangi fd7e8e4e75
scripts/ext-tools: introduce new script to install prebuilt tools
Add a simple script to make it easier to install a prebuilt tools tar.
Currently it will be used by our tools container and kernel workflow on
github.

Simple script that take a tar that contains prebuilt host tools, extract
them and refresh the timestamps to skip recompilation of such host
tools.

By default it refresh timestamps of build_dir/host and
staging_dir/host/stamp.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 5428bdc2df)
2022-12-04 16:07:34 +01:00
Hauke Mehrtens 629199f6c8
toolchain: Include ./include/fortify for external musl toolchain
When building with an external toolcahin with musl also include
./include/fortify by default. This is also done when we build with the
internal toolchain using musl libc.

Without this extra include the fortify source feature is not working
when using an external musl toolchain. All binaries were compiled
without fortify source when an external musl toolchain was used. All
binaries release done by the OpenWrt project use the internal toolcahin
where fortify source is working.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 3053045093a5c89dad970b7db3ed9f2a5be993f6)
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-04 16:07:33 +01:00
Vincent Wiemann 56fd8355b0
rules_mk: use gcc versions for external toolchain
When using the OpenWrt toolchain as an external toolchain the build
failed due to missing LTO support. By choosing the GCC wrappers of
the tools this commit makes sure that the LTO-enabled executables
are being used.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
[ wrap the commit description to 72 char ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 2555ffb453)
2022-12-04 16:07:33 +01:00
Christian Marangi 654e0242e4
rules_mk: don't include wrapped bin with external toolchains
Don't add wrapped bin to the TARGET_PATH as it does cause compilation
error.

cmake.mk will use the "command -v" and will use the wrapped bin instead
of the external toolchain bin as they have the same name and command
will select the first result.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a90eabf602)
2022-12-04 16:07:33 +01:00
Christian Marangi 360d756fbf
build: make find_md5 reproducible with AUTOREMOVE
While experimenting with the AUTOREMOVE option in search of a way to use
prebuilt host tools in different buildroot, it was discovered that the
md5 generated by find_md5 in depends.mk is not reproducible.

Currently the hash is generated by the path of the file in addition to
the file mod time. Out of confusion, probably, there was an idea that
such command was used on the package build_dir. Reality is that this
command is run on the package files. (Makefile, patches, src)

This is problematic because the package Makefile (for example) change at
each git clone and base the hash on the Makefile mtime doesn't really
reflect if the Makefile actually changes across a buildroot or not.

A better approach is to generate an hash of each file and then generate
an hash on the sort hash list. This way we remove the problem of git
clone setting a wrong mtime while keeping the integrity of checking if a
file changed for the package as any change will result in a different
hash.

Introduce a new kind of find_md5 function, find_md5_reproducible that
apply this new logic and limit it only with AUTOREMOVE option set to
prevent any kind of slowdown due to additional hash generation.

(cherry picked from commit 53a08e3743)
[ reworked mkhash to old implementation ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-04 16:07:33 +01:00
Christian Marangi 1392bec7de
procd: add patch to fix compilation error
procd complain for an unused verbose variable causing compilation error.
Fix this by setting the variable static following upstream procd
changes.

This is a variant of 0ee73b2c86a853ae3274c7080e2dcd36b81aa1fa that
introduced major change and fixed the verbose variable to static.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-04 16:06:35 +01:00