Skip to content

Commit 95fc9bb

Browse files
committed
[GR-58469] Cut ties with Sulong managed.
PullRequest: graalpython/3503
2 parents 145616b + 43b65c2 commit 95fc9bb

File tree

65 files changed

+427
-491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+427
-491
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[![](https://img.shields.io/badge/pyenv-graalpy-blue)](#start-replacing-cpython-with-graalpy)
55
</a> [![Join Slack][badge-slack]][slack] [![GraalVM on Twitter][badge-twitter]][twitter] [![License](https://img.shields.io/badge/license-UPL-green)](#license)
66

7-
GraalPy is a high-performance implementation of the [Python](https://www.python.org/) language for the JVM built on [GraalVM](https://www.graalvm.org/).
8-
GraalPy is a Python 3.11 compliant runtime.
7+
GraalPy is a high-performance implementation of the Python language for the JVM built on [GraalVM](https://www.graalvm.org/python).
8+
GraalPy is a Python 3.11 compliant runtime.
99
It has first-class support for embedding in Java and can turn Python applications into fast, standalone binaries.
1010
GraalPy is ready for production running pure Python code and has experimental support for many popular native extension modules.
1111

@@ -24,7 +24,7 @@ GraalPy is ready for production running pure Python code and has experimental su
2424
* Support for native extension modules is considered experimental, but you can already install [packages](docs/user/Python-Runtime.md#installing-packages) like *NumPy*, *PyTorch*, or *Tensorflow*; run [Hugging Face](https://huggingface.co/) models like *Stable Diffusion* or *GPT*
2525
![](docs/user/assets/mcd.svg#gh-light-mode-only)![](docs/user/assets/mcd-dark.svg#gh-dark-mode-only)<sup>
2626
We run the tests of the [most depended on PyPI packages](https://libraries.io/pypi) every day.
27-
For 96% of those packages a recent version can be installed on GraalPy and GraalPy passes about 50% of all tests of all packages combined.
27+
For 97% of those packages a recent version can be installed on GraalPy and GraalPy passes over 60% of all tests of all packages combined.
2828
We assume that CPython not passing 100% of all tests is due to problems in our infrastructure that may also affect GraalPy.
2929
Packages where CPython fails all tests are marked as "not tested" for both CPython and GraalPy.
3030
</sup>

bisect-benchmark.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Usage:
44
# - Create a temporary branch based on the main branch (or the bad commit)
55
# - Fill in this configuration file, preferably using the automated script
6-
# graalpython-apptests/scripts/create-bisect-config
6+
# graal-enterprise/graalpython-enterprise/scripts/create-bisect-config
77
# - Commit and push the file
88
# - The push command output should give you a link to create a PR. Open it, but
99
# don't create a PR. Instead, you should execute the job on your commit using

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "b8527c2fa08fc88554559a4a54c9294155c84c4f" }
1+
{ "overlay": "5f2c190a2db5461ac877a32df039c3584ae08148" }

docs/contributor/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ There are also different options for how the Python interpreter is run, passed v
273273
* `default` - run using the standard options
274274
* `default-multi` - run using a shared engine, which is the mode that is recommended to embedders that want to spawn multiple isolated Python contexts
275275
* `native` - same as `default`, its name is due to the fact that it runs C extensions using a mixture of LLVM bitcode interpreted and compiled via GraalVM and real native libraries
276-
* `sandboxed` - this name is historical - this configuration requires Oracle GraalVM and runs all C extensions purely as LLVM bitcode on the GraalVM, without any access to the native OS libraries, i.e., using the `--llvm.managed` option for GraalVM.
276+
* `sandboxed` - this name is historical - this configuration runs some modules such as the posix and sha3 modules with Java code instead of with native access.
277277
278278
### Configuration of the underlying GraalVM runtime
279279

docs/user/Embedding-Permissions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ This approach is the most compatible with CPython and provides bare access to th
3535
By default, this implementation bypasses the Truffle abstraction layer, and therefore it is not sandboxed and does not support custom implementations of [Truffle FileSystem service-provider](https://www.graalvm.org/truffle/javadoc/org/graalvm/polyglot/io/FileSystem.html), and other Polyglot API providers related to system interfaces.
3636

3737
The native backend is chosen by default when GraalPy is started via the `graalpy` or any other Python related launcher.
38-
The exceptions are Python related launchers with `-managed` suffix available only in Oracle GraalVM (for example, `graalpy-managed`), which by default use the `java` POSIX backend.
3938

4039
#### Limitations of the Native Backend
4140

@@ -49,7 +48,7 @@ Known limitations are:
4948
This backend uses the [Truffle abstraction layer](https://github.com/oracle/graal/blob/master/truffle/docs/README.md) and therefore supports custom Polyglot API providers related to system interfaces and sandboxing.
5049
Because this abstraction is POSIX agnostic, it does not expose all the necessary functionality. Some functionality is emulated, and some functionality is unsupported.
5150

52-
The Java backend is the default when GraalPy is run via the `Context` API, that is, [embedded in Java applications](https://github.com/oracle/graal/blob/master/docs/reference-manual/embedding/embed-languages.md), or when it is launched using Python-related launchers with the `-managed` suffix (available only in Oracle GraalVM).
51+
The Java backend is the default when GraalPy is run via the `Context` API, that is, [embedded in Java applications](https://github.com/oracle/graal/blob/master/docs/reference-manual/embedding/embed-languages.md).
5352

5453
#### Limitations of the Java Backend
5554

docs/user/Python-Standalone-Applications.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ redirect_from: /reference-manual/python/standalone-binaries/
99
# Python Standalone Applications
1010

1111
GraalPy enables you to create a Python application or library as a native application or JAR file with no external dependencies.
12-
The [Truffle framework](https://github.com/oracle/graal/tree/master/truffle) on which GraalPy is built, combined with the [Sulong LLVM runtime](https://github.com/oracle/graal/tree/master/sulong) that GraalPy leverages for managed execution of Python's native extensions, completely virtualizes all filesystem accesses, including those to the standard library and installed packages.
12+
The [Truffle framework](https://github.com/oracle/graal/tree/master/truffle) on which GraalPy is built virtualizes all filesystem accesses, including those to the standard library and installed pure Python packages.
13+
Packages that include native code can still circumvent this, however!
1314

1415
GraalPy includes a module named `standalone` to create a Python binary for Linux, macOS, and Windows.
1516
The modules bundles all your application's resources into a single file.

docs/user/assets/mcd-dark.svg

Lines changed: 3 additions & 3 deletions
Loading

docs/user/assets/mcd.svg

Lines changed: 3 additions & 3 deletions
Loading

graalpython/com.oracle.graal.python.cext/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ if(WIN32)
4747
require_var(CAPI_INC_DIR)
4848
require_var(TRUFFLE_H_INC)
4949
require_var(TRUFFLE_NFI_H_INC)
50-
require_var(LLVM_MODE)
5150
require_var(GRAALPY_EXT)
5251

5352
if(NOT DEFINED SRC_DIR)
5453
set(SRC_DIR "${CMAKE_SOURCE_DIR}")
5554
endif()
5655

57-
set(TARGET_LIBPYTHON "python-${LLVM_MODE}")
56+
set(TARGET_LIBPYTHON "python-native")
5857

5958
######################################################################
6059
# common variables and compile/link options (for all build targets)
@@ -75,11 +74,7 @@ add_compile_definitions(
7574
GRAALVM_PYTHON_LLVM
7675
)
7776

78-
if(${LLVM_MODE} STREQUAL "native")
79-
add_compile_definitions(GRAALVM_PYTHON_LLVM_NATIVE)
80-
else()
81-
add_compile_definitions(GRAALVM_PYTHON_LLVM_MANAGED)
82-
endif()
77+
add_compile_definitions(GRAALVM_PYTHON_LLVM_NATIVE)
8378

8479

8580
if(WIN32)

graalpython/com.oracle.graal.python.cext/include/graalpy/handles.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,8 @@
4848
#define HANDLE_BASE 0x8000000000000000ULL
4949
#define IMMORTAL_REFCNT (INT64_MAX >> 1)
5050

51-
#ifdef GRAALVM_PYTHON_LLVM_MANAGED
52-
/*
53-
* We can't include sulong headers here, they include stdbool.h and CPython has a test that
54-
* Python.h won't pull in stdbool.h
55-
*/
56-
PyAPI_FUNC(int) points_to_py_handle_space(void* ptr);
57-
#define stub_to_pointer(STUB_PTR) (STUB_PTR)
58-
#define pointer_to_stub(O) (O)
59-
#else /* GRAALVM_PYTHON_LLVM_MANAGED */
60-
6151
#define points_to_py_handle_space(PTR) ((((uintptr_t) (PTR)) & HANDLE_BASE) != 0)
6252
#define stub_to_pointer(STUB_PTR) (((uintptr_t) (STUB_PTR)) | HANDLE_BASE)
6353
#define pointer_to_stub(PTR) ((PyObject *)(((uintptr_t) (PTR)) & ~HANDLE_BASE))
6454

65-
#endif /* GRAALVM_PYTHON_LLVM_MANAGED */
66-
6755
#endif /* SRC_HANDLES_H_ */

0 commit comments

Comments
 (0)