oracle / graalpython

A Python 3 implementation built on GraalVM
Other
1.17k stars 101 forks source link

JVM Standalone release only working on Community Edition #357

Closed JMadgwick closed 5 months ago

JMadgwick commented 9 months ago

Steps to reproduce:

  1. Download graalpy-jvm-23.1.0-linux-amd64.tar.gz from releases. This is supposed to be the JVM configuration of Oracle GraalVM.
  2. Extract it, open graalpy and run example "The Java Host Interop API" from the docs:
    import java
    BigInteger = java.type("java.math.BigInteger")
    myBigInt = BigInteger.valueOf(42)

Result:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: foreign object has no attribute 'valueOf'

Repeating the above but instead using the graalpy-community-jvm-23.1.0-linux-amd64.tar.gz release works as expected.

The prompt appears too quickly for a JVM to be starting and running ./bin/graalpy --version with the broken version returns GraalPy 3.10.8 (Oracle GraalVM Native 23.1.0) which makes me think that maybe this is a packaging error with the release?

Also, when running graalpy --help the option

--jvm                                        Run on the Java Virtual Machine with access to Java libraries.

is only seen with the community edition. This should be in PythonOptions.java but I couldn't see it there. This is probably irrelevant as the option looks to be deprecated now there's intended to be two separate releases. In any case, when using this option on the binary in graalpy-jvm-23.1.0-linux-amd64.tar.gz the response is ERROR: '--jvm' is only supported when this launcher is part of a GraalVM.

msimacek commented 9 months ago

Thank you for the report. It indeed looks like a release engineering mistake. I'll have a look

ansalond commented 9 months ago

This is now fixed in master: https://github.com/oracle/graal/commit/7f29f8bd69ebeb74f4ba2ce0a7096388bf757dfa

I'll try to add a comment here when there will be a release that includes these changes.

msimacek commented 5 months ago

Fixed in 23.1.2 release.