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

build against musl #29

Merged
merged 1 commit into from Aug 14, 2021
Merged

build against musl #29

merged 1 commit into from Aug 14, 2021

Conversation

moonbuggy
Copy link
Contributor

This builds and passes tests for me in both Alpine/musl and Debian/glibc.

The sscanf() only worked because glibc apparently doesn't implement the C99 standard here. musl tries to match 'exactly 15' when it sees %15c and thus has trouble much of the time.

Is there some need to specify a maximum length for the match? None seemed immediately obvious to me. As I understand it, /proc/{pid}/stat won't ever give us a comm string more than 16 characters long, and we're storing it in a 16 character array, so I'm not entirely why we'd be limiting the length to 15 in sscanf()..?

Although I have to admit I don't play in C often so I may well have missed something. If that is the case, could we truncate the string outside of sscanf() or define comm[17] instead?

Similarly, I'm not sure if there's some reason to generally prefer canonicalize_file_name() over realpath(). All I do know is that realpath() built for me against both musl and glibc.

As for -lobstack in LIBS, it's necessary for musl and didn't seem to impair my build against glibc. I was hesitant to add a distro-specific parameter to Makefile.PL but I didn't see a mechanism elsewhere to do it. Perhaps you prefer not to have this added to Makefile.PL and let those building for musl sort it out themselves before building..?

The 10 second sleep is mostly because I just got sick of pressing Ctrl-C at the end of every test. :) I assume the test doesn't really need to sit there and do nothing for 3 hours to confirm things are working..

Copy link
Owner

@jwbargsten jwbargsten left a comment

Choose a reason for hiding this comment

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

LGTM! I also saw a discussion here https://bugs.gentoo.org/582824

@jwbargsten jwbargsten merged commit 92a2ceb into jwbargsten:master Aug 14, 2021
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.

None yet

2 participants