diff --git a/CHANGELOG.md b/CHANGELOG.md index f9d6ec288f..2c4c7f1293 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This changelog summarizes major changes between GraalVM versions of the Python language runtime. The main focus is on user-observable behavior of the engine. ## Version 25.1.0 +* The standalone artifacts now include the Python version name before the Graal version. The new artifacts now start with `graalpy---`. +* Standalone JVM artifacts are no longer released as separate distributions. For standalone deployments, use the GraalPy native artifacts. If you require Java interoperability, use a custom embedding. * Treat foreign buffer objects as Python buffer-compatible binary objects, so APIs like `memoryview`, `bytes`, `bytearray`, `binascii.hexlify`, and `io.BytesIO` work naturally on them when embedding GraalPy in Java. This allows passing binary data between Python and Java's `ByteBuffer` and `ByteSequence` types with minimal (sometimes zero) copies. * Add support for [Truffle source options](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/source/Source.SourceBuilder.html#option(java.lang.String,java.lang.String)): * The `python.Optimize` option can be used to specify the optimization level, like the `-O` (level 1) and `-OO` (level 2) commandline options. @@ -22,6 +24,7 @@ language runtime. The main focus is on user-observable behavior of the engine. * Add an experimental `python.InitializationEntropySource` option to control the entropy source used for initialization-only randomness such as hash secret generation and `random.Random(None)` seeding. This means embeddings and tests can select deterministic or externally provided initialization entropy without affecting cryptographically relevant APIs like `os.urandom()` or `random.SystemRandom()`. * Foreign temporal objects (dates, times, and timezones) are now given a Python class corresponding to their interop traits, i.e., `date`, `time`, `datetime`, or `tzinfo`. This allows any foreign objects with these traits to be used in place of the native Python types and Python methods available on these types work on the foreign types. * Make BouncyCastle an optional dependency for embedding use cases. BouncyCastle is only needed for legacy RSA, DSA, and EC privat keys versions 0 and 1. To support these from Python embeddings, BouncyCastle must now be explicitly enabled by adding the `org.graalvm.python:python-bouncycastle-support` Maven artifact. +* The GraalPy Native standalone on Linux now uses a lower-footprint Native Image garbage collection configuration. This reduces resident set size (RSS) for many workloads, but may increase startup time and warmup time, and can slow down some workloads. ## Version 25.0.1 * Allow users to keep going on unsupported JDK/OS/ARCH combinations at their own risk by opting out of early failure using `-Dtruffle.UseFallbackRuntime=true`, `-Dpolyglot.engine.userResourceCache=/set/to/a/writeable/dir`, `-Dpolyglot.engine.allowUnsupportedPlatform=true`, and `-Dpolyglot.python.UnsupportedPlatformEmulates=[linux|macos|windows]` and `-Dorg.graalvm.python.resources.exclude=native.files`. @@ -40,7 +43,6 @@ language runtime. The main focus is on user-observable behavior of the engine. * Enable FTS3, FTS4, FTS5, RTREE, and math function features in the bundled sqlite3 library. * Add support patches for Torch 2.7.0, PyGObject 3.52.3, xmlschema 4.0.0, lxml < 5.4.0, SciPy 1.15, jq 1.8.0, NumPy < 2.3, ormsgpack < 1.9.1, pandas 2.2.3, PyArrow 19.0, PyMuPDF 1.25.4. * The GraalPy Native standalone on Linux now uses the G1 garbage collector which is much faster. -* The GraalPy Native standalone on Linux now uses a lower-footprint Native Image garbage collection configuration. This reduces resident set size (RSS) for many workloads, but may increase startup time and warmup time, and can slow down some workloads. * The full-featured Python REPL is now available on GraalPy standalone builds for Windows. ## Version 24.2.0 diff --git a/ci/graal/common.json b/ci/graal/common.json index fdf00027bd..ece8a56eb9 100644 --- a/ci/graal/common.json +++ b/ci/graal/common.json @@ -4,7 +4,7 @@ "Jsonnet files should not include this file directly but use ci/common.jsonnet instead." ], - "mx_version": "7.79.1", + "mx_version": "7.81.0", "COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet", "jdks": { diff --git a/docs/site/01-python-developers.md b/docs/site/01-python-developers.md index 6ffb62b221..63fb88871e 100644 --- a/docs/site/01-python-developers.md +++ b/docs/site/01-python-developers.md @@ -74,8 +74,8 @@ audience_identifier: python

Install or Download

- GraalPy is available for multiple platforms in two variants: Native (for a compact download size and smaller footprint) and JVM (for full Java interoperability). Distributions based on Oracle GraalVM provide the best performance and advanced features and are released under the GFTC license. Distributions based on GraalVM Community Edition, released under the OSI-approved UPL license, are available on GitHub. - See Choosing a GraalPy Distribution for guidance on selecting the appropriate runtime. + GraalPy is available for multiple platforms. Distributions based on Oracle GraalVM provide the best performance and advanced features and are released under the GFTC license. Distributions based on GraalVM Community Edition, released under the OSI-approved UPL license, are available on GitHub. + See Choosing a GraalPy Distribution for guidance on available distributions.
@@ -160,48 +160,30 @@ docker run --rm ghcr.io/graalvm/graalpy-community:{{ site.language_version }} py - - - - - - - - - - - - - - - - + @@ -215,21 +197,6 @@ docker run --rm ghcr.io/graalvm/graalpy-community:{{ site.language_version }} py download icon - - - - - - -
VersionKind Linux (aarch64) Linux (amd64) macOS (aarch64) Windows (amd64)
+ {{ site.language_version }} Native + download icon + download icon + download icon + download icon
JVM - download icon - - download icon - - download icon - - download icon -
Latest early access buildNativeLatest early access build download icon
JVM - download icon - - download icon - - download icon - - download icon -
diff --git a/docs/site/_config.yml b/docs/site/_config.yml index 25b27925de..56ab149de8 100644 --- a/docs/site/_config.yml +++ b/docs/site/_config.yml @@ -2,6 +2,7 @@ baseurl: "/python" url: "https://graalvm.org" github: "oracle/graalpython" language_version: 25.0.2 +python_version: 3.12 name: GraalPy permalink: pretty diff --git a/docs/user/Python-on-JVM.md b/docs/user/Python-on-JVM.md index 09a23a513e..8d40d17eba 100644 --- a/docs/user/Python-on-JVM.md +++ b/docs/user/Python-on-JVM.md @@ -10,8 +10,8 @@ This guide shows you how to migrate from Jython to GraalPy. ### Prerequisites -- To move plain Jython scripts from Jython to GraalPy, use a GraalPy JVM-based runtime. (For more information, see available [GraalPy Distributions](Python-Runtime.md)) -- First migrate code from Python 2 to Python 3 following [the official guide from the Python community](https://docs.python.org/3/howto/pyporting.html) +- To migrate Jython scripts to GraalPy, you first need to create a GraalPy embedding. For more information, see [Embedding Python in Java](Embedding-Getting-Started.md). +- Make sure to migrate code from Python 2 (as supported by Jython) to Python 3 (the major version GraalPy is compatible with) following [the official guide from the Python community](https://docs.python.org/3/howto/pyporting.html) ## GraalPy Java Interoperability Overview diff --git a/docs/user/Standalone-Getting-Started.md b/docs/user/Standalone-Getting-Started.md index f84b92b17b..2efdefe498 100644 --- a/docs/user/Standalone-Getting-Started.md +++ b/docs/user/Standalone-Getting-Started.md @@ -12,37 +12,20 @@ GraalPy is available in multiple distributions: - **GraalPy built on Oracle GraalVM** provides the best experience with additional optimizations, significantly faster performance, and better memory efficiency. It is licensed under the [GraalVM Free Terms and Conditions (GFTC)](https://www.oracle.com/downloads/licenses/graal-free-license.html), which permits use by any user including commercial and production use. Redistribution is permitted as long as it is not for a fee. - **GraalPy Community** is built on top of GraalVM Community Edition and is fully open source. -### Runtime Options +### Runtime -Two language runtime options are available for both distributions: - -- **Native** (recommended for standalone use) - - GraalPy is compiled ahead-of-time to a native executable - - You do not need a JVM to run GraalPy and it is compact in size - - Faster startup time - - Faster time to reach peak performance -- **JVM** - - You can easily exploit Java interoperability - - Peak performance may be higher than the native option - - Slower startup time +The standalone GraalPy runtime is compiled ahead-of-time to a native executable. +You do not need a JVM to run it, and it has a compact size, fast startup, and fast time to reach peak performance. +For Java interoperability and JVM application embedding, see [Embedding Python in Java](Embedding-Getting-Started.md). ### Distribution Identification -The GraalPy runtimes are identified using the pattern _graalpy(-community)(-jvm)-<version>-<os>-<arch>_: - -| Distribution | Native | JVM | -| ------------- | ----------------------------------------- | ---- | -| **Oracle** | `graalpy---` | `graalpy-jvm---` | -| **Community** | `graalpy-community---` | `graalpy-community-jvm---` | - -### Runtime Comparison +The GraalPy standalone runtimes are identified using the pattern _graalpy(-community)<python-version>-<graal-version>-<os>-<arch>_: -| Runtime | Native (default) | JVM | -|:-------|:-----------------|:----| -| Time to start | faster | slower | -| Time to reach peak performance | faster | slower | -| Peak performance (also considering GC) | good | best | -| Java interoperability | needs configuration | works | +| Distribution | Runtime | License | +|---------------|-----------------------------------------------------------------|---------------------------------------------------------------------------| +| **Oracle** | `graalpy---` | [GFTC](https://www.oracle.com/downloads/licenses/graal-free-license.html) | +| **Community** | `graalpy-community---` | [UPL](https://opensource.org/licenses/UPL) | ## GraalPy Capabilities @@ -78,14 +61,14 @@ pyenv shell graalpy-25.0.2 1. Download the appropriate binary from [GitHub releases](https://github.com/oracle/graalpython/releases): - - AMD64: `graalpy-XX.Y.Z-linux-amd64.tar.gz` - - ARM64: `graalpy-XX.Y.Z-linux-aarch64.tar.gz` + - AMD64: `graalpy3.12-25.1.0-linux-amd64.tar.gz` + - ARM64: `graalpy3.12-25.1.0-linux-aarch64.tar.gz` 2. Extract and add it to your `PATH` environment variable: ```bash - tar -xzf graalpy-25.0.2-linux-amd64.tar.gz - export PATH="$PWD/graalpy-25.0.2-linux-amd64/bin:$PATH" + tar -xzf graalpy3.12-25.1.0-linux-amd64.tar.gz + export PATH="$PWD/graalpy3.12-25.1.0-linux-amd64/bin:$PATH" ``` ### macOS @@ -115,8 +98,8 @@ pyenv shell graalpy-25.0.2 3. Extract and add it to your `PATH` environment variable: ```bash - tar -xzf graalpy-25.0.2-macos-aarch64.tar.gz - export PATH="$PWD/graalpy-25.0.2-macos-aarch64/bin:$PATH" + tar -xzf graalpy3.12-25.1.0-macos-aarch64.tar.gz + export PATH="$PWD/graalpy3.12-25.1.0-macos-aarch64/bin:$PATH" ``` ### Windows @@ -129,9 +112,9 @@ pyenv shell graalpy-25.0.2 ```powershell # Extract the file and update your PATH environment variable - # to include the graalpy-XX.Y.Z-windows-amd64/bin directory - tar -xzf graalpy-25.0.2-windows-amd64.tar.gz - $env:PATH = "$PWD\graalpy-25.0.2-windows-amd64\bin;$env:PATH" + # to include the graalpy3.12-25.1.0-windows-amd64/bin directory + tar -xzf graalpy3.12-25.1.0-windows-amd64.zip + $env:PATH = "$PWD\graalpy3.12-25.1.0-windows-amd64\bin;$env:PATH" ``` #### Known Windows Limitations diff --git a/mx.graalpython/suite.py b/mx.graalpython/suite.py index e35899d688..8831f5f37f 100644 --- a/mx.graalpython/suite.py +++ b/mx.graalpython/suite.py @@ -5,7 +5,7 @@ # METADATA # # -------------------------------------------------------------------------------------------------------------- - "mxversion": "7.67.0", + "mxversion": "7.81.0", "name": "graalpython", "versionConflictResolution": "latest", @@ -1715,13 +1715,14 @@ "class": "DeliverableStandaloneArchive", "platformDependent": True, "standalone_dist": "GRAALPY_NATIVE_STANDALONE", - "community_archive_name": "graalpy-community", - "enterprise_archive_name": "graalpy", + "community_archive_name": "graalpy-community", + "enterprise_archive_name": "graalpy", "language_id": "python", }, "GRAALPY_JVM_STANDALONE_RELEASE_ARCHIVE": { "class": "DeliverableStandaloneArchive", + "deploy": False, "platformDependent": True, "standalone_dist": "GRAALPY_JVM_STANDALONE", "community_archive_name": "graalpy-community-jvm", diff --git a/scripts/wheelbuilder/README.md b/scripts/wheelbuilder/README.md index d290d845c0..a614a6b0c7 100644 --- a/scripts/wheelbuilder/README.md +++ b/scripts/wheelbuilder/README.md @@ -41,9 +41,10 @@ For Linux/amd64, I use [act](https://github.com/nektos/act/releases) on a Linux ```shell git clone https://github.com/oracle/graalpython cd graalpython -VERSION=24.2.0 +VERSION=25.1.0 +PYTHON_VERSION=3.12 BINDIR=. curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/nektos/act/master/install.sh | bash -echo "graalpy_url=https://github.com/oracle/graalpython/releases/download/graal-$VERSION/graalpy-$VERSION-linux-amd64.tar.gz" > .input +echo "graalpy_url=https://github.com/oracle/graalpython/releases/download/graal-$VERSION/graalpy$PYTHON_VERSION-$VERSION-linux-amd64.tar.gz" > .input podman system service -t 0 unix:///tmp/podman.sock & export DOCKER_HOST=unix:///tmp/podman.sock ./act --env http_proxy=$http_proxy --env https_proxy=$https_proxy -W .github/workflows/build-linux-amd64-wheels.yml --artifact-server-path=$(pwd)/artifacts @@ -53,9 +54,10 @@ For Linux/aarch64, I use act on a mac, those are usually beefy ARM machines that ```shell git clone https://github.com/oracle/graalpython cd graalpython -VERSION=24.2.0 +VERSION=25.1.0 +PYTHON_VERSION=3.12 brew install act -echo "graalpy_url=https://github.com/oracle/graalpython/releases/download/graal-$VERSION/graalpy-$VERSION-linux-aarch64.tar.gz" > .input +echo "graalpy_url=https://github.com/oracle/graalpython/releases/download/graal-$VERSION/graalpy$PYTHON_VERSION-$VERSION-linux-aarch64.tar.gz" > .input podman machine init -m 16384 --now act --env http_proxy=$http_proxy --env https_proxy=$https_proxy -W .github/workflows/build-linux-aarch64-wheels.yml --artifact-server-path=$(pwd)/artifacts --container-architecture linux/aarch64 ``` @@ -63,19 +65,21 @@ act --env http_proxy=$http_proxy --env https_proxy=$https_proxy -W .github/workf For macOS/aarch64, you get no isolation from act, so I just run it directly. ```shell git clone https://github.com/oracle/graalpython -VERSION=24.2.0 +VERSION=25.1.0 +PYTHON_VERSION=3.12 export GITHUB_RUN_ID=doesntMatterJustTriggerBrewInstallScripts python3 -m venv wheelbuilder-venv . wheelbuilder-venv/bin/activate -python3 graalpython/scripts/wheelbuilder/build_wheels.py https://github.com/oracle/graalpython/releases/download/graal-$VERSION/graalpy-$VERSION-macos-aarch64.tar.gz +python3 graalpython/scripts/wheelbuilder/build_wheels.py https://github.com/oracle/graalpython/releases/download/graal-$VERSION/graalpy$PYTHON_VERSION-$VERSION-macos-aarch64.tar.gz ``` For Windows/amd64, you get no isolation from act, so I just run it directly in Visual Studio powershell. ```shell git clone https://github.com/oracle/graalpython -$VERSION="24.2.0" +$VERSION="25.1.0" +$PYTHON_VERSION="3.12" $env:GITHUB_RUN_ID="doesntMatterJustTriggerBrewInstallScripts" python3 -m venv wheelbuilder-venv wheelbuilder-venv/scripts/activate -python3 graalpython/scripts/wheelbuilder/build_wheels.py https://github.com/oracle/graalpython/releases/download/graal-$VERSION/graalpy-$VERSION-windows-amd64.zip +python3 graalpython/scripts/wheelbuilder/build_wheels.py https://github.com/oracle/graalpython/releases/download/graal-$VERSION/graalpy$PYTHON_VERSION-$VERSION-windows-amd64.zip ```