Skip to content

Try to fix/workaround build on alpine - #454

Closed
lucasdemarchi wants to merge 3 commits into
masterfrom
tip-ci-update
Closed

Try to fix/workaround build on alpine#454
lucasdemarchi wants to merge 3 commits into
masterfrom
tip-ci-update

Conversation

@lucasdemarchi

Copy link
Copy Markdown
Contributor

No description provided.

Lucas De Marchi and others added 3 commits August 3, 2026 15:18
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>
lucasdemarchi added a commit that referenced this pull request Aug 5, 2026
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
lucasdemarchi added a commit that referenced this pull request Aug 5, 2026
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
@lucasdemarchi

Copy link
Copy Markdown
Contributor Author

Dropped the first commit... it could be further polished. Merged the fixes

@evelikov evelikov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/dev-container.py
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*$")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly worried that (m)any yml changes might break the RE above. Perhaps we could wire some simple check to CI to catch issues?

Comment thread .github/dev-container.py
if [ ! -x "${setup_script}" ]; then
echo "Missing setup script: ${setup_script}" >&2
exit 1
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the above bits are from setup-os/action.yml. Would be great if they can be fleshed out and reused.

Comment thread .github/dev-container.py
local: str


def unique(items: list[str]) -> list[str]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Admittedly, I didn't follow exactly how the script operates, but it feels like there should be no duplicates while parsing the yml.

Comment thread .github/dev-container.py

def strip_yaml_scalar(value: str) -> str | None:
value = value.strip()
if not value or value in {"|", ">"}:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lucasdemarchi

Copy link
Copy Markdown
Contributor Author

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants