Github messages for voidlinux
 help / color / mirror / Atom feed
* Re: [ISSUE] [CLOSED] slurm-wlm patches for musl
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-16777@inbox.vuxu.org>
@ 2020-02-25 10:34 ` xtraeme
  0 siblings, 0 replies; only message in thread
From: xtraeme @ 2020-02-25 10:34 UTC (permalink / raw)
  To: ml

[-- 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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-25 10:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-16777@inbox.vuxu.org>
2020-02-25 10:34 ` [ISSUE] [CLOSED] slurm-wlm patches for musl xtraeme

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).