Skip to content

Build for musl libc #1140

Closed
Closed

Description

@asottile

Copying from nodejs/nodejs.org#1569 (comment)


The current binaries provided at http://nodejs.org/dist/v9.5.0/ are all glibc binaries and do not function inside alpine docker containers. Executing the binary after extraction leads to:

# ./node --version
sh: ./node: not found

Here's the specific operating system in question:

$ docker run -ti py:2.7.14-alpine3.7 sh -xc 'uname -a && cat /etc/os-release'
+ uname -a
Linux 6913c996248d 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64 Linux
+ cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.7.0
PRETTY_NAME="Alpine Linux v3.7"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"

While the node:x.x-alpine images are nice, they don't satisfy all the usecases I'd like these to handle:

  • using some other alpine docker image (in this specific instance, I'd like to use the python alpine images)
  • using some other platform which also uses muslc and is neither docker nor alpine (gentoo musl for instance)

My actual usecase is with nodeenv, the rabbit hole so far:

Activity

  1. rvagg commented on Feb 21, 2018

    @rvagg
    Member

    fwiw this has been discussed a few times before, see https://github.com/nodejs/build/search?q=musl&type=Issues

    I'm not entirely opposed to this but there is a potential permutation explosion problem here, do we need musl x64 and x86? What about musl on ARM, I bet that's a thing that people are using. Does that mean we're stuck with shipping 10 (whatever) more files in each of our release directories? How do we keep that at a minimum so as not to saddle ourselves with the maintenance burden.

    Perhaps you should just do a compile from source in your container builds? It's really not that complicated and shouldn't be too hard to remove the build dependencies after it's done. Maybe that's something we can help with providing instructions or examples for.

  2. asottile commented on Feb 21, 2018

    @asottile
    Author

    x64 is probably sufficient, x86 would be a nice to have. I'm not sure arm would be necessary (maybe the first push of this doesn't need arm?)

    I could already compile from source, but that takes ~30 minutes. Most of the goal of nodeenv is to avoid needing to maintain build infrastructure due to being able to leverage prebuilt packages -- it already works great for other linux / windows / mac clients due to the binaries provided for them :)

  3. rvagg commented on Feb 22, 2018

    @rvagg
    Member

    x64 is probably sufficient, x86 would be a nice to have. I'm not sure arm would be necessary

    That's you, but this really is a slippery slope problem, you may be fine with x64 but if we go out with only that then it's not a hard argument to make to expand it to all of the rest of these platforms. There's a limit to our infrastructure, the time we're willing to let release builds take (if we double-up our infra to make this work) and our ability to keep our infra maintained. This is a non-trivial addition and it's easy to see it expanding.

  4. asottile commented on Feb 22, 2018

    @asottile
    Author

    Ah yes of course, understood. I'm not familiar with your current setup so I don't know the costs associated with scaling -- does it utilize resources such as travis or are there custom build servers?

  5. piranna commented on Apr 2, 2018

    @piranna

    If it's useful or of your interest, at https://github.com/NodeOS/nodejs I have automated builds of Node.js using musl for x86, x64 and arm. The scripts check each night if there was a new stable version and compile, pack and publish them both on npm and as Github. I'm using them to don't need to compile Node.js each time I do a new release of NodeOS.

  6. SimenB commented on May 13, 2018

    @SimenB
    Member

    The build time of the alpine images has been mentioned as what takes the most time when getting security updates out for the docker images (beyond getting humans to merge PRs), see nodejs/security-wg#168 (comment).

    The list of arches for docker images and alpine is somewhat extensive (https://github.com/nodejs/docker-node/blob/master/architectures), but every prebuilt binary helps. Supporting arches beyond what docker does seems unnecessary, so it might help with your concern about ever expanding build matrix? Still might be too many, though.

  7. richardlau commented on Dec 11, 2019

    @richardlau
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions