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
graalvm-ce-java8-20.1.0testexport GRAALVM_CATALOG=file://$PWD/testgu install native-imageThe 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:
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
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_CATALOGfor 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 :-/
This seems to have been fixed https://github.com/oracle/graal/blob/91cb0529ea6540cbda7c284f56f6dad5a65d1ace/vm/src/org.graalvm.component.installer/src/org/graalvm/component/installer/CommonConstants.java#L81
Let me know if I'm wrong so I can reopen.
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.
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 :-/