Graal: `GRAALVM_CATALOG` variable does not work as documented

Created on 18 Jun 2020  路  7Comments  路  Source: oracle/graal

Describe the issue

The gu documentation states that we can use GRAALVM_CATALOG to specify a custom catalog to download Graal components from. I am trying to do just that, and gu still tries to download from https://www.graalvm.org/component-catalog/graal-updater-component-catalog-java8.properties

Passing GRAALVM_CATALOG as -C argument works, but is not an option in this case, as we need it in the context of a Gradle build, and the plugin we use does not allow for custom gu options.

Steps to reproduce the issue

  1. Install graalvm-ce-java8-20.1.0
  2. Create an empty file named test
  3. Set export GRAALVM_CATALOG=file://$PWD/test
  4. Run gu install native-image

The last step should have failed, because the catalog is empty, but it actually succeeeds. There is more elaborate procedure to reproduce the issue if you have isolated network.

Describe GraalVM and your environment:

  • This is as of version 20.1.0 and documentation website as of 2020-06-18.
  • JDK major version: 8
  • OS: RHEL 6
  • Architecture: AMD64

More details
Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary.

-bash-4.1$ /app/localstorage/dimitrda/caches/com.palantir.graal/20.1.0/8/graalvm-ce-java8-20.1.0/bin/gu install native-image
Downloading: Component catalog from www.graalvm.org
Error: Error downloading component catalog from https://www.graalvm.org/component-catalog/graal-updater-component-catalog-java8.properties: www.graalvm.org. 
Please check your connection and proxy settings. If your machine is behind a proxy, environment variables (http_proxy, https_proxy, ...) must be set appropriately.

-bash-4.1$ set | grep GRAAL
GRAALVM_CATALOG=file:///home/dimitrda/fixer/acme-graal-updater-component-catalog-java8.properties
bug

Most helpful comment

@ddimtirov yes, there's a typo in constant in the code: GRAA-VL-M_ instead of GRAA-LV-M. There's even a test that checks the correct precedence of env vs. builting catalogs, but that used the constant too :-/

All 7 comments

I think https://github.com/oracle/graal/pull/2581 should fix this issue. As a workaround, could just use GRAAVLM_CATALOG for now.

@fniephaus good catch! Will include a test for this code part.

as a workaround, could just use GRAAVLM_CATALOG for now.

Apologies, how exactly can I use GRAAVLM_CATALOG as a workaround? The issue is that this env variable seems to be ignored... Or is it a slightly different spelling I just can't see?

@ddimtirov yes, there's a typo in constant in the code: GRAA-VL-M_ instead of GRAA-LV-M. There's even a test that checks the correct precedence of env vs. builting catalogs, but that used the constant too :-/

Any idea when can we expect a release that I can use to validate the fix?

You can use a nightly build for validation:
https://github.com/graalvm/graalvm-ce-dev-builds/releases

It's not unlikely that this fix will ship with the upcoming 20.2 release, but I don't know for sure.

Was this page helpful?
0 / 5 - 0 ratings