Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA main: Add Alpine Linux job, to CI-test musl libc #20741

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kinke
Copy link
Contributor

@kinke kinke commented Jan 20, 2025

No description provided.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @kinke! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#20741"

@kinke kinke force-pushed the gha_alpine branch 10 times, most recently from 0560b3a to e6c031a Compare January 20, 2025 19:52
@kinke
Copy link
Contributor Author

kinke commented Jan 20, 2025

@JohanEngelen: Looks like there's no exception stack trace support for musl here upstream. I guess we'd need to upstream some druntime changes in ldc-developers/ldc#4639 and ldc-developers/ldc#4691?

@JohanEngelen
Copy link
Contributor

@JohanEngelen: Looks like there's no exception stack trace support for musl here upstream. I guess we'd need to upstream some druntime changes in ldc-developers/ldc#4639 and ldc-developers/ldc#4691?

yes indeed!

@kinke kinke force-pushed the gha_alpine branch 4 times, most recently from ae8d4ce to da60696 Compare January 21, 2025 23:50
@kinke
Copy link
Contributor Author

kinke commented Jan 22, 2025

@JohanEngelen: Okay, I've merged your two PRs to a single commit suitable for upstream here, as 2nd commit; the 3rd commit shows that it works, allowing to re-enable most hacked-out tests. Please extract it to its own PR and make sure it gets merged, as prerequisite of this PR. [It's your work after all, and you probably remember most details that could come up during a review.]

@JohanEngelen
Copy link
Contributor

@JohanEngelen: Okay, I've merged your two PRs to a single commit suitable for upstream here, as 2nd commit; the 3rd commit shows that it works, allowing to re-enable most hacked-out tests. Please extract it to its own PR and make sure it gets merged, as prerequisite of this PR. [It's your work after all, and you probably remember most details that could come up during a review.]

#20758

@thewilsonator
Copy link
Contributor

merged that PR

@kinke kinke changed the title GHA main: Add Alpine Linux job GHA main: Add Alpine Linux job, to CI-test musl libc Jan 23, 2025
@kinke kinke marked this pull request as ready for review January 23, 2025 11:07
@@ -149,20 +159,20 @@ jobs:
- name: Test dmd
run: ci/run.sh test_dmd
- name: Test druntime
if: '!matrix.coverage'
if: '!matrix.coverage && (success() || failure())'
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this needed and how does this help? (seems to add && true which is a no-op?)

Copy link
Contributor Author

@kinke kinke Jan 23, 2025

Choose a reason for hiding this comment

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

It runs all of the test steps (if all steps before were successful IIRC), doesn't abort after the 1st failing test step. I.e., you see all failures and don 't have to fix the compiler testsuite before seeing results for druntime and Phobos etc.

ifeq ($(OS),linux)
# Alpine Linux comes with an apk tool
ifeq (1,$(shell which apk &>/dev/null && echo 1))
IS_MUSL:=1
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: maybe this should be IS_ALPINE and later make the mapping IS_ALPINE --> IS_MUSL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What matters is musl, the detection here is incomplete, only supporting Alpine. Could add a FIXME comment if really required.

# /usr/include/asm-generic/fcntl.h(195): Error: struct `importc_includes.flock` conflicts with struct `importc_includes.flock` at /usr/include/fcntl.h(24)
ifeq ($(OS),linux)
ifeq (1,$(shell which apk &>/dev/null && echo 1))
TESTS :=
Copy link
Contributor

Choose a reason for hiding this comment

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

so that here you can use ifneq ($(IS_ALPINE),1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Different file and druntime test dir, plus I don't know if this is Alpine-specific, possibly even v3.21 specific. (This test wasn't in v2.110, so no results with LDC for this test yet.)

# FIXME: segfaults with musl libc
ifneq ($(IS_MUSL),1)
TESTS += unknown_gc
endif
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was unexpected, works with LDC (and its druntime v2.110 though). The test looks as harmless as it gets.

@@ -44,7 +44,7 @@ void main(string[] args)
auto nf1 = new NoFinalize;
auto nf2 = new NoFinalizeBig;

shared size_t finalizeCounter;
static shared size_t finalizeCounter;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Must be a global (not on the stack), as due to the dlclose no-op, the finalizers might run after main() ends, causing a segfault.

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.

4 participants