From: xtraeme <xtraeme@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [ISSUE] [CLOSED] slurm-wlm patches for musl
Date: Tue, 25 Feb 2020 11:34:11 +0100 [thread overview]
Message-ID: <20200225103411.3CbedgItK98vvS66Dh3N_Y7mdno_dHo97fcFbrp9Gr8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-16777@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 3757 bytes --]
Closed issue by ejolson2005 on void-packages repository
https://github.com/void-linux/void-packages/issues/16777
Description:
<!-- Don't request update of package. We have a script for that. https://alpha.de.repo.voidlinux.org/void-updates/void-updates.txt . However, a quality pull request may help. -->
### System
xuname: Void 5.3.11_1 x86_64-musl AuthenticAMD notuptodate rF
package: slurm-wlm
### Expected behavior
Build package using musl.
### Actual behavior
Doesn't build.
### Steps to reproduce the behavior
Try to build package.
### Fix
I downloaded the current release of slurm-19.05.4 and tried to compile it. I ran into three problems and will now describe three workarounds to make things work:
1. inet_nsap_addr is missing from musl. This is easily corrected by extracting the corresponding code from glibc which is
```
static char
xtob(int c) {
return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
}
static unsigned int
inet_nsap_addr(const char *ascii, unsigned char *binary, int maxlen) {
unsigned char c, nib;
unsigned int len = 0;
while ((c = *ascii++) != '\0' && len < (unsigned int)maxlen) {
if (c == '.' || c == '+' || c == '/')
continue;
if (!isascii(c))
return (0);
c = toupper(c);
if (isxdigit(c)) {
nib = xtob(c);
c = *ascii++;
if (c != '\0') {
c = toupper(c);
if (isxdigit(c)) {
*binary++ = (nib << 4) | xtob(c);
len++;
} else
return (0);
}
else
return (0);
}
else
return (0);
}
return (len);
}
```
and plopping it into the file src/common/callerid.c just before the _find_match_in_tcp_file routine.
2. The next problem was getgrent_r seemed to be missing. Upon reading the code in src/slurmctld/groups.c and upon reading the comment
```
/* Note that in environments where user/group enumeration has
* been disabled (typically necessary for large user/group
* databases), the rest of this function essentially does
* nothing. */
```
Decided to simply comment out the offending code by inserting #ifdef OMMITED just before line 158 and then ending that with #endif just before xfree(grp_buffer); around line 228.
3. The final problem was that cpu_set_t wasn't defined before src/slurmd/slurmd/req.c needed to use this. This is a struct consisting of an array which is usually defined in <sched.h> but only when _GNU_SOURCE is defined. Somewhere, that was not happening before sched.h was first included and the include guard prevented subsequent includes of the same file after _GNU_SOURCE had been defined from having any effect. Rather than track down how to fix this correctly, I simply copied the needed line from <sched.h> into req.c right after #include <sched.h> around line 55 which read
```
typedef struct cpu_set_t { unsigned long __bits[128/sizeof(long)]; } cpu_set_t;
```
After the above three changes slurm installed and seems to function correctly. I'm not suggesting that the changes I made above be included in VOID, but have only listed them to indicate the present difficulties with slurm-wlm not building with musl are relatively superficial and can be easily worked around, if necessary.
parent reply other threads:[~2020-02-25 10:34 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-16777@inbox.vuxu.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200225103411.3CbedgItK98vvS66Dh3N_Y7mdno_dHo97fcFbrp9Gr8@z \
--to=xtraeme@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).