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

graalvm-oracle: init at 22 #321026

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkgs/by-name/gr/graalvm-ce/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{ graalvmPackages }:
graalvmPackages.graalvm-ce
farnoy marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions pkgs/by-name/gr/graalvmCEPackages/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{ graalvmPackages }:
graalvmPackages
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{ stdenv
, fetchurl
, graalvmCEPackages
, graalvmPackages
, useMusl ? false
}:

graalvmCEPackages.buildGraalvm {
graalvmPackages.buildGraalvm {
inherit useMusl;
src = fetchurl (import ./hashes.nix).hashes.${stdenv.system};
version = (import ./hashes.nix).version;
Expand Down
20 changes: 20 additions & 0 deletions pkgs/development/compilers/graalvm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
lib,

Check failure on line 2 in pkgs/development/compilers/graalvm/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `lib` is not used
stdenv,

Check failure on line 3 in pkgs/development/compilers/graalvm/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `stdenv` is not used
callPackage,
fetchurl,

Check failure on line 5 in pkgs/development/compilers/graalvm/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `fetchurl` is not used
farnoy marked this conversation as resolved.
Show resolved Hide resolved
}:

let
cePackages = callPackage ./community-edition { };
in
cePackages
// {

buildGraalvm = callPackage ./buildGraalvm.nix;

graalvm-ce = cePackages.graalvm-ce;

graalvm-oracle = callPackage ./graalvm-oracle { };
farnoy marked this conversation as resolved.
Show resolved Hide resolved
graalvm-oracle_17 = callPackage ./graalvm-oracle { version = "17"; };
}
16 changes: 16 additions & 0 deletions pkgs/development/compilers/graalvm/graalvm-oracle/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
lib,
stdenv,
fetchurl,
graalvmPackages,
useMusl ? false,
version ? "22",
}:

graalvmPackages.buildGraalvm {
inherit useMusl version;
src = fetchurl (import ./hashes.nix).${version}.hashes.${stdenv.system};
meta.platforms = builtins.attrNames (import ./hashes.nix).${version}.hashes;
meta.license = lib.licenses.unfree;
pname = "graalvm-oracle";
}
42 changes: 42 additions & 0 deletions pkgs/development/compilers/graalvm/graalvm-oracle/hashes.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"22" = {
"hashes" = {
farnoy marked this conversation as resolved.
Show resolved Hide resolved
"aarch64-linux" = {
sha256 = "d303d30c10764feaab076efe79019df3c981b0487fcac3df7a5313f76f61040e";
url = "https://download.oracle.com/graalvm/22/archive/graalvm-jdk-22_linux-aarch64_bin.tar.gz";
};
"x86_64-linux" = {
sha256 = "d1860b5b7588310e70b259c891156f6d0cbc34d0d1feec3b37169ed2a415f3c3";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these hashes are correct, I calculated them with nix-prefetch-url but I need to double check.

url = "https://download.oracle.com/graalvm/22/archive/graalvm-jdk-22_linux-x64_bin.tar.gz";
};
"x86_64-darwin" = {
sha256 = "5b83f20dbc4c636ed41f19c3309f09839d4f5c6442dba986f460589c494a476c";
url = "https://download.oracle.com/graalvm/22/archive/graalvm-jdk-22_macos-x64_bin.tar.gz";
};
"aarch64-darwin" = {
sha256 = "61632065cfcdc4e121362f1fd25a543955836bbacd6c1aadbcbe0d469d5ab8a3";
url = "https://download.oracle.com/graalvm/22/archive/graalvm-jdk-22_macos-aarch64_bin.tar.gz";
};
};
};
"17" = {
"hashes" = {
"aarch64-linux" = {
sha256 = "1s3ma7x22wqg10cqhdgwj0g9qk3n7bqy10dq6x1vgpljdd41v6dx";
url = "https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_linux-aarch64_bin.tar.gz";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this URL is deterministic, there is no /archive/ version for these

};
"x86_64-linux" = {
sha256 = "0gviji4g10k3ixa8nkjfyqyz9m00dz4g85h2g7n606fg4k7dmwxn";
url = "https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_linux-x64_bin.tar.gz";
};
"x86_64-darwin" = {
sha256 = "1mvpx94n0pm9kpmhknkfym8lbb30kvdnap5pqmb5ma9z3x3w3jiy";
url = "https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_macos-x64_bin.tar.gz";
};
"aarch64-darwin" = {
sha256 = "1igzzsij0izkryshm45bg0dqwz0vbxhbd4fizhz7gxlmjdndrpsc";
url = "https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_macos-aarch64_bin.tar.gz";
};
};
};
}
3 changes: 1 addition & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15879,8 +15879,7 @@ with pkgs;
openjdk = jdk;
openjdk_headless = jdk_headless;

graalvmCEPackages = callPackage ../development/compilers/graalvm/community-edition { };
graalvm-ce = graalvmCEPackages.graalvm-ce;
graalvmPackages = recurseIntoAttrs (callPackage ../development/compilers/graalvm { });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the usage of recurseIntoAttrs here, we probably need to introduce a scope inside graalvmPackages to ensure that all packages are build with the same scope.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with scopes and not sure what this means. I tried just removing recurseIntoAttrs and things seem to work all the same, so it seems it can be safely dropped?

Is the fact that pkgs/development/compilers/graalvm/graalvm-oracle/default.nix uses graalvmPackages.buildGraalvm (from the parent "scope"?) problematic?

buildGraalvmNativeImage = (callPackage ../build-support/build-graalvm-native-image {
graalvmDrv = graalvm-ce;
}).override;
Expand Down
Loading