Try to fix/workaround build on alpine - #454
Conversation
Make it easy to setup the containers supported in CI so it's possible to easily setup the same environment locally. Signed-off-by: Lucas De Marchi <ldemarchi@kernel.org>
Drop warning from CI:
make[2]: Entering directory '/__w/kmod/kmod/builddir-gcc-64/testsuite/module-playground'
warning: pahole version differs from the one used to build the kernel
The kernel was built with: 130
You are using: 0
Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
Alpine build is failing in CI apparently since the move to 7.1.x: error: objtool [signal.c:118]: init_signal_handler: sigaltstack failed: Out of memory make[4]: *** [/usr/src/linux-headers-7.1.5-0-stable/scripts/Makefile.build:289: mod-foo-a.o] Error 255 make[4]: *** Deleting file 'mod-foo-a.o' Workaround by passing -j1 when building the test modules. Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
Drop warning from CI:
make[2]: Entering directory '/__w/kmod/kmod/builddir-gcc-64/testsuite/module-playground'
warning: pahole version differs from the one used to build the kernel
The kernel was built with: 130
You are using: 0
Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
Link: #454
Alpine build is failing in CI apparently since the move to 7.1.x: error: objtool [signal.c:118]: init_signal_handler: sigaltstack failed: Out of memory make[4]: *** [/usr/src/linux-headers-7.1.5-0-stable/scripts/Makefile.build:289: mod-foo-a.o] Error 255 make[4]: *** Deleting file 'mod-foo-a.o' Workaround by passing -j1 when building the test modules. Signed-off-by: Lucas De Marchi <demarchi@kernel.org> Link: #454
|
Dropped the first commit... it could be further polished. Merged the fixes |
evelikov
left a comment
There was a problem hiding this comment.
Overall I like the idea to have simple script that lists the containers combos and pulls/sets one up for us.
I left a few ideas, for the future - feel free to borrow any that makes sense.
Also: thanks for sorting out Alpine. Will try to report this upstream, if you haven't already.
| DEFAULT_PREFIX = "localhost/kmod-ci" | ||
| DEFAULT_IMAGE_ENV = ["KDIR=any"] | ||
|
|
||
| MATRIX_EXPR_RE = re.compile(r"^\s*\$\{\{\s*matrix\.([A-Za-z_][A-Za-z0-9_-]*)\s*\}\}\s*$") |
There was a problem hiding this comment.
Slightly worried that (m)any yml changes might break the RE above. Perhaps we could wire some simple check to CI to catch issues?
| if [ ! -x "${setup_script}" ]; then | ||
| echo "Missing setup script: ${setup_script}" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Most of the above bits are from setup-os/action.yml. Would be great if they can be fleshed out and reused.
| local: str | ||
|
|
||
|
|
||
| def unique(items: list[str]) -> list[str]: |
There was a problem hiding this comment.
Admittedly, I didn't follow exactly how the script operates, but it feels like there should be no duplicates while parsing the yml.
|
|
||
| def strip_yaml_scalar(value: str) -> str | None: | ||
| value = value.strip() | ||
| if not value or value in {"|", ">"}: |
There was a problem hiding this comment.
Is there some yaml library that we can use? Or the worst case scenario we can go for a shell script with yq invocations.
For example: yq .jobs.build.strategy.matrix.include .github/workflows/main.yml gives us a much more readable command and expected output.
it will need some polish/rewrite. It was not something intended for review yet... since I needed to reproduce the alpine issue I just asked gemini to code this so I could quickly iterate through the containers. In the end I think the interface ended up a little cumbersome as it would still run the setup as entrypoint, which was not exactly what I wanted. |
No description provided.