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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants