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

How to run unofficial node node-v18.16.1-linux-x64-musl.tar.gz on alpine? #294

Open
jansu76 opened this issue Nov 16, 2023 · 6 comments
Open
Labels
bug Something isn't working musl / nixos / alpine

Comments

@jansu76
Copy link

jansu76 commented Nov 16, 2023

I want to use gradle-node-plugin to install node on alpine linux. Using this advice #51 (comment) combined with this https://github.com/node-gradle/gradle-node-plugin/blob/main/docs/faq.md#is-this-plugin-compatible-with-centralized-repositories-declaration I managed to get a working configuration that downloads the correct binary package from https://unofficial-builds.nodejs.org/download/release/v18.16.1/node-v18.16.1-linux-x64-musl.tar.gz

build.gradle:

node {
	download = true
	version = "18.16.1"
	distBaseUrl = null;
	}
}

settings.gradle

dependencyResolutionManagement {
    repositories {
        repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)

        // Declare the Node.js download repository
        ivy {
            name = "Node.js"
            setUrl("https://unofficial-builds.nodejs.org/download/release/")
            patternLayout {
                artifact("v[revision]/[artifact](-v[revision]-linux-x64-musl).[ext]")
            }
            metadataSources {
                artifact()
            }
            content {
                includeModule("org.nodejs", "node")
            }
        }
    }
}

However, npmInstall fails since it tries to look for the binary in the wrong directory. Can I do something to fix this?

> Task :clean
> Task :nodeSetup
> Task :npmSetup SKIPPED
> Task :npmInstall FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':npmInstall'.
> A problem occurred starting process 'command '/mydir/frontend/.gradle/nodejs/node-v18.16.1-linux-x64/bin/node''

Binary is in node-v18.16.1-linux-x64-musl, not in node-v18.16.1-linux-x64.

@deepy
Copy link
Member

deepy commented Nov 17, 2023

In it's current state I don't think there's a solution, I'm currently doing a refactor related to the configurable components in this plugin and will tackle this as part of that

@deepy deepy added this to runtimes Nov 17, 2023
@deepy
Copy link
Member

deepy commented Nov 17, 2023

If all your linux systems use musl and you have the ability to setup an internal mirror I guess there's technically a workaround available by repackaging it

@jansu76
Copy link
Author

jansu76 commented Nov 21, 2023

there's technically a workaround available by repackaging it

To make sure I understand, do you mean taking an unofficial build, and changing it so that the binary is in node-v18.16.1-linux-x64/bin/node instead of node-v18.16.1-linux-x64-musl/bin/node?

@deepy
Copy link
Member

deepy commented Nov 21, 2023

Yeah, it's not a pretty solution though and could easily lead to some confusion

@deepy deepy added musl / nixos / alpine bug Something isn't working labels Nov 28, 2023
@tmisirpash
Copy link

Has there been any movement on this? Is there any way to specify glibc-217 or musl in the configuration when using unofficial builds?

@deepy
Copy link
Member

deepy commented Dec 9, 2024

Supporting Node's unofficial-builds is pretty low on the priority list, it produces two builds one for glibc 2.17 which was released in 2012 and the other for musl - and only the musl build is interesting for us
(Though any extra configuration added will make it easier for people to consume the glibc build as well)

But the reason this is low-priority is that the unofficial-builds are essentially provided as-is:

unofficial-builds attempts to provide basic Node.js binaries for some platforms that either not supported or only partially supported by Node.js. This project does not provide any guarantees and its results are not rigorously tested. Builds made available at nodejs.org have very high quality standards for code quality, support on the relevant platforms platforms and for timing and methods of delivery. Builds made available by unofficial-builds have minimal or no testing; the platforms may have no inclusion in the official Node.js test infrastructure. These builds are made available for the convenience of their user community but those communities are expected to assist in their maintenance.

I'll happily review and assist with PRs that want to make this easier, but my focus is on other issues at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working musl / nixos / alpine
Projects
Status: No status
Development

No branches or pull requests

3 participants