···120120 '' + concatProducts "postInstall";
121121122122 preFixup = lib.optionalString (stdenv.isLinux) ''
123123- # Find all executables in any directory that contains '/bin/'
124124- for bin in $(find "$out" -executable -type f -wholename '*/bin/*'); do
123123+ for bin in $(find "$out/bin" -executable -type f); do
125124 wrapProgram "$bin" --prefix LD_LIBRARY_PATH : "${runtimeLibraryPath}"
126125 done
127126 '' + concatProducts "preFixup";
···66cd "$(dirname "${BASH_SOURCE[0]}")"
77tmpfile="$(mktemp --suffix=.nix)"
8899+trap 'rm -rf "$tmpfile"' EXIT
1010+911info() { echo "[INFO] $*"; }
10121113echo_file() { echo "$@" >> "$tmpfile"; }
···4345 [js-installable-svm]="https://github.com/graalvm/graaljs/releases/download/vm-${new_version}/js-installable-svm-java@platform@-${new_version}.jar"
4446 [llvm-installable-svm]="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${new_version}/llvm-installable-svm-java@platform@-${new_version}.jar"
4547 [native-image-installable-svm]="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${new_version}/native-image-installable-svm-java@platform@-${new_version}.jar"
4848+ [nodejs-installable-svm]="https://github.com/graalvm/graaljs/releases/download/vm-${new_version}/nodejs-installable-svm-java@platform@-${new_version}.jar"
4649 [python-installable-svm]="https://github.com/graalvm/graalpython/releases/download/vm-${new_version}/python-installable-svm-java@platform@-${new_version}.jar"
4750 [ruby-installable-svm]="https://github.com/oracle/truffleruby/releases/download/vm-${new_version}/ruby-installable-svm-java@platform@-${new_version}.jar"
4851 [wasm-installable-svm]="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${new_version}/wasm-installable-svm-java@platform@-${new_version}.jar"
···5962 "17-darwin-amd64"
6063)
61646262-info "Generating hashes.nix file for 'graalvm-ce' $new_version. This will take a while..."
6565+info "Generating '$hashes_nix' file for 'graalvm-ce' $new_version. This will take a while..."
63666467# Indentation of `echo_file` function is on purpose to make it easier to visualize the output
6568echo_file "# Generated by $0 script"
···6871 url="${products_urls["${product}"]}"
6972echo_file " \"$product\" = {"
7073 for platform in "${platforms[@]}"; do
7171- # Reuse cache as long the version is the same
7272- if [[ "$current_version" == "$new_version" ]]; then
7373- previous_hash="$(nix-instantiate --eval "$hashes_nix" -A "$product.$platform.sha256" --json | jq -r || true)"
7474+ args=("${url//@platform@/$platform}")
7575+ # Get current hashes to skip derivations already in /nix/store to reuse cache when the version is the same
7676+ # e.g.: when adding a new product and running this script with FORCE=1
7777+ if [[ "$current_version" == "$new_version" ]] && \
7878+ previous_hash="$(nix-instantiate --eval "$hashes_nix" -A "$product.$platform.sha256" --json | jq -r)"; then
7979+ args+=("$previous_hash" "--type" "sha256")
7480 else
7575- previous_hash=""
8181+ info "Hash in '$product' for '$platform' not found. Re-downloading it..."
7682 fi
7777- # Lack of quoting in $previous_hash is proposital
7878- if hash="$(nix-prefetch-url "${url//@platform@/$platform}" $previous_hash)"; then
8383+ if hash="$(nix-prefetch-url "${args[@]}")"; then
7984echo_file " \"$platform\" = {"
8085echo_file " sha256 = \"$hash\";"
8186echo_file " url = \"${url//@platform@/${platform}}\";"