Skip to content

Commit 2f8b053

Browse files
committed
Update devcontainer to use maven facades
1 parent 7aaa597 commit 2f8b053

8 files changed

Lines changed: 139 additions & 25 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+
VERSION="1.58.0"
45+
DOWNLOAD_FILE=$(curl -s -L "https://download.eclipse.org/jdtls/milestones/${VERSION}/latest.txt")
46+
mkdir -p "/tmp/jdtls"
47+
curl -s -L -o "/tmp/jdtls/${DOWNLOAD_FILE}" "https://download.eclipse.org/jdtls/milestones/${VERSION}/${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.'

.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: 4 additions & 4 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 Java editing directly.
15+
The Maven facades are for editor navigation and basic completion only; use `mx python-jvm` to run and test GraalPy.
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

@@ -65,7 +65,7 @@ If you use another editor (such as VSCode, Emacs, or Neovim) with support for th
6565
6666
The checked-in Maven POMs are lightweight facades for quick Java IDE import in editors such as Eclipse, VSCode, or Eglot/JDT-LS.
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

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 = """<!--

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ SOFTWARE.
6666
<maven.deploy.skip>true</maven.deploy.skip>
6767
<maven.compiler-plugin.version>3.14.1</maven.compiler-plugin.version>
6868
<maven.enforcer-plugin.version>3.6.1</maven.enforcer-plugin.version>
69-
<graalvm.version>25.2.0</graalvm.version>
69+
<graalvm.version>25.0.0</graalvm.version>
7070
</properties>
7171

7272
<dependencyManagement>

0 commit comments

Comments
 (0)