eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.23k stars 868 forks source link

How about accept a property about to the node installiation in system for supporting some arch or custom patch? #1160

Open qyl27 opened 1 month ago

qyl27 commented 1 month ago

Do you want to request a feature or report a bug? It's a feature.

I am building packages of some software for Arch Linux RISC-V Port.
Node.js did not provide the prebuilt binary for RISC-V, but we have a patched one provided by the system's package manager.
Jenkins used frontend-maven-plugin to build their frontend page, we can't do many patches to the source in order to build it, so I want to make it use the node in the system.
Would you be willing to accept a property point to a node executable file to replace the default downloaded one? Also, users no longer need to use the exec-maven-plugin.
If that sounds good, I'd love to create a PR for it.

eirslett commented 1 month ago

Here's a possible thing you can do: put your patched Node binary inside the .m2 folder of your RISC-V device. With the same layout as it would be on x64 Linux or whatever. Frontend-maven-plugin looks inside your .m2 folder before downloading Node from anywhere else - so that should work. Maybe try and put your patched binary on https://github.com/nodejs/unofficial-builds/ (which already has RISC-V?) and then the frontend-maven-plugin should be able to download it from there?

qyl27 commented 1 month ago

Here's a possible thing you can do: put your patched Node binary inside the .m2 folder of your RISC-V device. With the same layout as it would be on x64 Linux or whatever. Frontend-maven-plugin looks inside your .m2 folder before downloading Node from anywhere else - so that should work. Maybe try and put your patched binary on https://github.com/nodejs/unofficial-builds/ (which already has RISC-V?) and then the frontend-maven-plugin should be able to download it from there?

The main problem is that most Linux distributions don't like to make too many patches to keep reproducibility. (They often use some automatic building system that treats putting binaries into cache dir in build time as a patch, also they didn't like to use the binaries that are not provided by the system package manager.)
If we can use a command-line argument or environment variable, they will be happy.