Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

DownloadGraalTask generates incorrect download url causing FileNotFoundException #337

Open
mingfai opened this issue Apr 24, 2020 · 5 comments

Comments

@mingfai
Copy link

mingfai commented Apr 24, 2020

it seems the graalvm binary file naming and url are changed. when I configure the project with the following configuration:

graal {
    graalVersion '20.0.0'
    downloadBaseUrl 'https://github.com/graalvm/graalvm-ce-builds/releases/download'
}

on mac, it generates the following url:
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.0.0/graalvm-ce-darwin-amd64-20.0.0.tar.gz

the correct url is:
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.0.0/graalvm-ce-java11-darwin-amd64-20.0.0.tar.gz

so, there is "-java11" tag in the file name. I checked DownloadGraalTask.java, the FILENAME_PATTERN should need one more variable to determine java8 or java11.

@mingfai
Copy link
Author

mingfai commented Apr 24, 2020

well, same issue as #239 and there is PR already #255

@javapapo
Copy link

javapapo commented May 2, 2020

+1 on the above.

@matwjones
Copy link

matwjones commented May 15, 2020

A minor (albeit, hacky) workaround for this is to manually download graal, move it into the correct directory and rename the files, so when running the nativeImage task, it finds the correct version.

(I'm runnig on a Mac, so the windows instructions will be slightly different)

  1. Download the .tar.gz file from the new graal repository (found on their github page).

    • For me it was graalvm-ce-java11-darwin-amd64-19.3.2.tar.gz
  2. Either:
    a) Install per the instructions documented in order to run gu install native-image
    b) cd & run gu to install directly by:

cd graalvm-ce-java11-19.3.2/Contents/Home/bin/
./gu install native-image

(For newer macbooks / OS, you may get a security restriction which will prevent gu from running, in this case run xattr -d com.apple.quarantine <full_path_to>/graalvm-ce-java11-19.3.2`, then try again)

  1. Copy the folder & the .tar.gz to the correct directory & rename it to the pattern the download task looks for
mkdir ~/.gradle/caches/com.palantir.graal/19.3.2/
cp -r /Library/Java/JavaVirtualMachines/graalvm-ce-java11-19.3.2 ~/.gradle/caches/com.palantir.graal/19.3.2/graalvm-ce-19.3.2

cp ~/Downloads/graalvm-ce-java11-darwin-amd64-19.3.2.tar.gz ~/.gradle/caches/com.palantir.graal/19.3.2/graalvm-ce-19.3.2-amd64.tar.gz

(note the name change during the copy)

  1. Update the plugin config to use the new version
graal {
    graalVersion "19.3.2"
    mainClass "..."
    outputName "..."
}

Unfortunately, you have to use gu to install nativ-image before performing the copy, so the native-image script exists in the Contents/Home/bin/ directory.

What you're doing is pretty much mocking what the download & extract tasks do.
This isnt a long term solution by any means, but should help until the next release.

@saboya
Copy link

saboya commented Jun 17, 2020

Should be fixed by #255?

@phreed
Copy link

phreed commented Jul 8, 2021

The following configuration works for me.

graal {
    graalVersion("21.1.0")
    downloadBaseUrl("https://github.com/graalvm/graalvm-ce-builds/releases/download")
    javaVersion("11")
// resulting in "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-windows-amd64-21.1.0.zip

    windowsVsVersion("2019")
    windowsVsEdition("Community")
//    windowsVsVarsPath("%ProgramFiles(x86)%\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat")
}

The default downloadBaseUrl("https://github.com/oracle/graal/releases/download") does not exist.
There is a https://github.com/oracle/graal/releases/tags but no download.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants