Skip to content

Commit 64a8b2e

Browse files
committed
[GR-76258] Github development workflow improvements and minor website update.
PullRequest: graalpython/4626
2 parents 530f5c3 + db14c72 commit 64a8b2e

11 files changed

Lines changed: 146 additions & 39 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
22
"name": "GraalPy",
3-
"build": { "dockerfile": "Dockerfile" },
3+
"image": "mcr.microsoft.com/devcontainers/universal:linux",
4+
"remoteEnv": {
5+
"MX_GLOBAL_ENV": "${containerWorkspaceFolder}/.mxenv",
6+
"MX_CACHE_DIR": "${containerWorkspaceFolder}/.mxcache",
7+
"PATH": "${containerWorkspaceFolder}/.mx:${containerWorkspaceFolder}/.mx/labsjdk-ce-latest/bin:${containerEnv:PATH}"
8+
},
49
"postCreateCommand": {
5-
"hint": "echo 'GraalPy devcontainer ready. Run mx python-jvm if you need to build GraalPy for testing.'"
10+
"install_packages": "sudo apt-get update && sudo apt-get install -y build-essential libffi-dev zlib1g-dev libbz2-dev cmake ninja-build",
11+
"setup_mx": "bash \"${containerWorkspaceFolder}/.devcontainer/setup-mx.sh\" \"${containerWorkspaceFolder}\"",
12+
"setup_jdtls": "bash \"${containerWorkspaceFolder}/.devcontainer/setup-jdtls.sh\" \"${containerWorkspaceFolder}\""
613
},
714
"hostRequirements": {
815
"cpus": 2,
@@ -11,11 +18,9 @@
1118
"customizations": {
1219
"vscode": {
1320
"extensions": [
14-
"vscjava.vscode-java-pack",
15-
"zoma.vscode-auto-open-workspace"
21+
"vscjava.vscode-java-pack"
1622
],
1723
"settings": {
18-
"autoOpenWorkspace.enableAutoOpenIfSingleWorkspace": true,
1924
"java.autobuild.enabled": false
2025
}
2126
},

.devcontainer/setup-jdtls.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
2+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3+
#
4+
# The Universal Permissive License (UPL), Version 1.0
5+
#
6+
# Subject to the condition set forth below, permission is hereby granted to any
7+
# person obtaining a copy of this software, associated documentation and/or
8+
# data (collectively the "Software"), free of charge and under any and all
9+
# copyright rights in the Software, and any and all patent rights owned or
10+
# freely licensable by each licensor hereunder covering either (i) the
11+
# unmodified Software as contributed to or provided by such licensor, or (ii)
12+
# the Larger Works (as defined below), to deal in both
13+
#
14+
# (a) the Software, and
15+
#
16+
# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
17+
# one is included with the Software each a "Larger Work" to which the Software
18+
# is contributed by such licensors),
19+
#
20+
# without restriction, including without limitation the rights to copy, create
21+
# derivative works of, display, perform, and distribute the Software and make,
22+
# use, sell, offer for sale, import, export, have made, and have sold the
23+
# Software and the Larger Work(s), and to sublicense the foregoing rights on
24+
# either these or other terms.
25+
#
26+
# This license is subject to the following condition:
27+
#
28+
# The above copyright notice and either this complete permission notice or at a
29+
# minimum a reference to the UPL must be included in all copies or substantial
30+
# portions of the Software.
31+
#
32+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38+
# SOFTWARE.
39+
40+
#!/usr/bin/env bash
41+
42+
set -euo pipefail
43+
44+
JDTLS_SNAPSHOT_URL="https://download.eclipse.org/jdtls/snapshots"
45+
DOWNLOAD_FILE=$(curl -s -L "${JDTLS_SNAPSHOT_URL}/latest.txt")
46+
mkdir -p "/tmp/jdtls"
47+
curl -s -L -o "/tmp/jdtls/${DOWNLOAD_FILE}" "${JDTLS_SNAPSHOT_URL}/${DOWNLOAD_FILE}"
48+
cd /tmp/jdtls
49+
tar xfz "/tmp/jdtls/${DOWNLOAD_FILE}"
50+
rm "/tmp/jdtls/${DOWNLOAD_FILE}"
51+
sudo mv "/tmp/jdtls" /opt
52+
sudo ln -s /opt/jdtls/bin/jdtls /usr/local/bin/jdtls

.devcontainer/setup-mx.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
2+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3+
#
4+
# The Universal Permissive License (UPL), Version 1.0
5+
#
6+
# Subject to the condition set forth below, permission is hereby granted to any
7+
# person obtaining a copy of this software, associated documentation and/or
8+
# data (collectively the "Software"), free of charge and under any and all
9+
# copyright rights in the Software, and any and all patent rights owned or
10+
# freely licensable by each licensor hereunder covering either (i) the
11+
# unmodified Software as contributed to or provided by such licensor, or (ii)
12+
# the Larger Works (as defined below), to deal in both
13+
#
14+
# (a) the Software, and
15+
#
16+
# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
17+
# one is included with the Software each a "Larger Work" to which the Software
18+
# is contributed by such licensors),
19+
#
20+
# without restriction, including without limitation the rights to copy, create
21+
# derivative works of, display, perform, and distribute the Software and make,
22+
# use, sell, offer for sale, import, export, have made, and have sold the
23+
# Software and the Larger Work(s), and to sublicense the foregoing rights on
24+
# either these or other terms.
25+
#
26+
# This license is subject to the following condition:
27+
#
28+
# The above copyright notice and either this complete permission notice or at a
29+
# minimum a reference to the UPL must be included in all copies or substantial
30+
# portions of the Software.
31+
#
32+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38+
# SOFTWARE.
39+
40+
#!/usr/bin/env bash
41+
42+
set -euo pipefail
43+
44+
repo_dir="${1:-$PWD}"
45+
mx_dir="$repo_dir/.mx"
46+
jdk_dir="$mx_dir/labsjdk-ce-latest"
47+
bootstrap_cache="$repo_dir/.mx-bootstrap-cache"
48+
49+
if [[ ! -x "$mx_dir/mx" ]]; then
50+
rm -rf "$mx_dir"
51+
git clone https://github.com/graalvm/mx "$mx_dir"
52+
fi
53+
54+
mkdir -p "$repo_dir/.mxcache"
55+
56+
if [[ ! -x "$jdk_dir/bin/java" ]]; then
57+
MX_CACHE_DIR="$bootstrap_cache" "$mx_dir/mx" \
58+
-p "$mx_dir" \
59+
-y fetch-jdk \
60+
-A \
61+
--to "$mx_dir" \
62+
--jdk-id labsjdk-ce-latest
63+
rm -rf "$bootstrap_cache"
64+
fi
65+
66+
printf 'JAVA_HOME=%s\n' "$jdk_dir" > "$repo_dir/.mxenv"
67+
echo 'GraalPy devcontainer ready. Java editing works from the checked-in Maven POMs; run mx python-jvm for full builds and tests.'

.github/workflows/build-website.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- '.github/workflows/build-website.yml'
88
push:
99
branches:
10-
- master
10+
- 'release/graal-vm/**'
1111
paths:
1212
- 'docs/site/**'
1313
- '.github/workflows/build-website.yml'
@@ -50,9 +50,8 @@ jobs:
5050
path: docs/site/_site
5151

5252
deploy:
53-
# The website should only be deployed from a release branch:
54-
# if: startsWith(github.head_ref, 'release/graal-vm/')
55-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
53+
# Deploy only explicitly from the Actions tab.
54+
if: github.event_name == 'workflow_dispatch'
5655
runs-on: ubuntu-latest
5756
needs: build
5857
environment:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,7 @@ compile_commands.json
104104
opencode.json
105105
pyrightconfig.json
106106
bench-results.json
107+
/.mx/
108+
/.mxcache/
109+
/.mxenv
110+
/.mx-bootstrap-cache/

docs/contributor/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Please also take some time to review our [code of conduct](http://www.graalvm.or
1111

1212
### Using a Github codespace
1313

14-
The devcontainer we create sets up a code workspace on launch—the first time you launch the container, you will need a bit of patience.
15-
Then, use the command palette or the File menu and select "Open Workspace from File" and select [/workspace/graalpython.code-workspace](../../../graalpython.code-workspace).
16-
The VSCode window will reload and open GraalPy and all the related Java projects.
14+
The devcontainer will use checked-in Maven POM facades, so basic Java editing works directly.
15+
Use `mx python-jvm` to build, run, and test a GraalPy distribution artifact.
16+
For full editing support, run `mx vscodeinit` and open the `graalpython.code-workspace` file that command generates.
1717

1818
### Setting up on your machine
1919

@@ -63,9 +63,9 @@ This will generate configurations for Eclipse, IntelliJ, and NetBeans so that yo
6363
See also the documentation in mx for [setting up your IDE](https://github.com/graalvm/mx/blob/master/docs/IDE.md).
6464
If you use another editor (such as VSCode, Emacs, or Neovim) with support for the [Eclipse language server](https://github.com/eclipse/eclipse.jdt.ls) or [Apache NetBeans language server](https://marketplace.visualstudio.com/items?itemName=ASF.apache-netbeans-java), you can also get useable development setups with that, but it's not something we explicitly support.
6565
66-
The checked-in Maven POMs are lightweight facades for quick Java IDE import in editors such as Eclipse, VSCode, or Eglot/JDT-LS.
66+
The checked-in Maven POMs are lightweight facades for quick Java IDE import in editors such as Eclipse, VSCode, or any editor using JDTLS.
6767
They are not the full GraalPy build; use `mx ideinit` for the full generated IDE setup and `mx python-jvm` for the build needed to run or test GraalPy.
68-
The facade uses a `graalvm.version` Maven range for the current release train so fresh checkouts resolve the newest available GraalVM artifacts; override `graalvm.version` locally to lock a specific version.
68+
The facade uses the `graalvm.version` Maven property for GraalVM artifact resolution; override it locally if you need a different version.
6969
7070
## Development Layout
7171

docs/site/01-jvm-developers.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ audience_identifier: jvm
100100
{%- highlight java -%}
101101
import org.graalvm.polyglot.Context;
102102

103-
try (Context context = Context.newBuilder()
104-
.allowAllAccess(true) // See documentation for options
105-
.build()) {
103+
try (Context context = Context.newBuilder().build()) {
106104
context.eval("python", "print('Hello from GraalPy!')");
107105
}
108106
{%- endhighlight -%}
@@ -131,9 +129,7 @@ dependencies {
131129
{%- highlight java -%}
132130
import org.graalvm.polyglot.Context;
133131

134-
try (Context context = Context.newBuilder()
135-
.allowAllAccess(true) // See documentation for options
136-
.build()) {
132+
try (Context context = Context.newBuilder().build()) {
137133
context.eval("python", "print('Hello from GraalPy!')");
138134
}
139135
{%- endhighlight -%}

docs/site/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ layout: base
2727
{%- highlight java -%}
2828
import org.graalvm.polyglot.Context;
2929

30-
try (Context context = Context.newBuilder()
31-
.allowAllAccess(true) // See documentation for options
32-
.build()) {
30+
try (Context context = Context.newBuilder().build()) {
3331
context.eval("python", "print('Hello from GraalPy!')");
3432
}
3533
{%- endhighlight -%}

mx.graalpython/mx_pominit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
LOCAL_GROUP_ID = "${project.groupId}"
5959
LOCAL_VERSION = "${project.version}"
6060
GRAALVM_VERSION = "${graalvm.version}"
61-
DEFAULT_GRAALVM_VERSION = "25.2.0"
61+
DEFAULT_GRAALVM_VERSION = "25.0.0"
6262
CURRENT_GRAALVM_VERSION = "25.1.0"
6363

6464
XML_UPL_HEADER = """<!--

0 commit comments

Comments
 (0)