NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.96k stars 13.33k forks source link

graalvm17-ce: it's not possible to install graalvm components #202336

Closed pshirshov closed 1 year ago

pshirshov commented 1 year ago
❯ gu install js
Error: Insufficient privileges for administration of the GraalVM installation. You need to become "root" user to perform administrative tasks on GraalVM.
NOTE: depending on your operating system, you may need to use OS tools to install or uninstall GraalVM components.

❯ sudo gu install js
[sudo] password for pavel:
Error: Insufficient privileges for administration of the GraalVM installation. You need to become "root" user to perform administrative tasks on GraalVM.
NOTE: depending on your operating system, you may need to use OS tools to install or uninstall GraalVM components.

Probably that should be somehow done in the formula itself

ericdallo commented 1 year ago

Yes, we did the same for the native-image IIRC, we need to do the same for js

pshirshov commented 1 year ago

Ideally this should be user-configurable. E.g.graaalvm node binary may cause a lot of issues and many devs would be happy to op out of having it installed.

thiagokokada commented 1 year ago

We need to refactor the GraalVM to add all products as separate derivations, and merge them using something like symlinkJoin in one unique output.

I kinda have an idea on how to do it, however have zero energy to do it right now.

victorpigmeo commented 1 year ago

I'm having this issue with graalvm11-ce anyone knows how to fix it? or maybe at least a workaround for this error?

Sohalt commented 1 year ago

Take a look at https://github.com/NixOS/nixpkgs/pull/209060 You can then generate your own graalvm11-ce-sources.json with the js product and add it to sourcesPath in mkGraal

victorpigmeo commented 1 year ago

Sorry, forgot to mention that I'm having this issue when I try to install native-image :stuck_out_tongue:

thiagokokada commented 1 year ago

After #216228 is merged, this will be possible:

{ pkgs, ... }:
{
  environment.systemPackages = with pkgs; [
    (graalvm11-ce.override {
      products = with graalvmCEPackages; [
        js-installable-svm-java11
        llvm-installable-svm-java11
        native-image-installable-svm-java11
        python-installable-svm-java11
        ruby-installable-svm-java11
        wasm-installable-svm-java11
      ];
    })
  ];
}

To add a new product should be fairly simple. You can see this commit for a simple example: https://github.com/NixOS/nixpkgs/pull/216228/commits/19e4e0a5e9465de8a60e7b62a37fa97d2dc06087.

The basic idea is to add the new product in products_url inside the update.sh script, run it with FORCE=1 ./update.sh to force it to rerun, generate a new hashes.nix file and create a derivation using the buildGraalvmProduct to allow it to be composed with the main graalvm*-ce derivations.

thiagokokada commented 1 year ago

I am closing this issue now that #216228 is merged. If this is still an issue, please re-open this issue.

pshirshov commented 10 months ago

It seems like this is not possible anymore?..

pshirshov commented 8 months ago

By the way, I made the legacy formulas available as nur packages: https://github.com/7mind/7mind-nix

Many things are broken on modern JDKs (notably the hadoop libraries), so this might be required for a while.