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

port to musl and add alpine CI build #182

Merged
merged 8 commits into from
Nov 17, 2023

Conversation

grondo
Copy link
Contributor

@grondo grondo commented Nov 16, 2023

This PR fixes some musl libc portability issues in flux-security and adds an alpine Linux CI build so we don't break it again.

Problem: Some source files in src/imp include wait.h directly when
the more portable solution is to include sys/wait.h.

Update the locations in which wait.h is included to instead include
sys/wait.h.
Problem: Some systems may not have the definitions of
TMPFS_MAGIC and CGROUP_SUPER_MAGIC available (for example musl libc).

Add definitions for these two values as found in linux/magic.h in
RHEL 8.
Problem: A couple sources are missing a required stdint.h include.
Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Merging #182 (44adb43) into master (446d6bd) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head 44adb43 differs from pull request most recent head 30b82cb. Consider uploading reports for the commit 30b82cb to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
- Coverage   85.92%   85.88%   -0.05%     
==========================================
  Files          36       36              
  Lines        4918     4918              
==========================================
- Hits         4226     4224       -2     
- Misses        692      694       +2     
Files Coverage Δ
src/imp/exec/exec.c 83.07% <ø> (ø)
src/imp/pidinfo.c 83.91% <ø> (-1.01%) ⬇️
src/libutil/timestamp.c 100.00% <100.00%> (ø)

Copy link
Member

@garlick garlick left a comment

Choose a reason for hiding this comment

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

All looks good to me!

@@ -79,7 +79,7 @@ static time_t strtotime (const char *s)
{
Copy link
Member

@garlick garlick Nov 17, 2023

Choose a reason for hiding this comment

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

Commit message typo here. Says %T-%m-%d(twice) but should be %Y-%m-%d.
Edit: Title also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Got it and force-pushed. Will set MWP.

Problem: The %F format specifier used in strptime(3) and strftime(3)
is a non-POSIX alias for %Y-%m-%d, so it fails in systems based on
musl libc.

Replace the %F alias with the full format %T-%m-%d.
Problem: The glob(3) implementation on musl libc does not return
GLOB_ABORTED when the parent directory of the pattern does not exist,
but a unit test for cf_update_glob() depends on this behavior.

Skip the test if glob(3) doesn't behave as expected in this situation.
Problem: musl libc doesn't have fgetpwent_r(3), so compilation of
t/src/getpwuid.c fails.

The program is not multithreaded, so switch to fgetpwent(3) and
getpwuid(3).
Problem: flux-security is not tested on the musl libc based alpine
distribution.

Add an alpine build to generate-matrix.py.
Problem: The build.os parameter is now required for readthedocs.

Add a build section to readthedocs.yml.
@mergify mergify bot merged commit 4c0ccb6 into flux-framework:master Nov 17, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants