Skip to content

Commit 2c29f79

Browse files
authored
Document current issues using JDKs > 17 and nailgun (#22533)
Ran into #20603. This is quite a big gotcha and the workaround should be documented while a proper fix is prepared (disabling nailgun by default). https://pantsbuild.slack.com/archives/C046T6T9U/p1753112068755689
1 parent cf1b160 commit 2c29f79

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

docs/docs/jvm/java-and-scala.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ JDKs used by Pants are automatically fetched using [Coursier](https://get-coursi
6666

6767
To override the default on a particular target, you can use the [`jdk=` field](../../reference/targets/java_source.mdx#jdk). It can be useful to use the [`parametrize` builtin](../using-pants/key-concepts/targets-and-build-files.mdx#parametrizing-targets) with the `jdk=` field, particularly to run test targets under multiple JDKs.
6868

69+
To get a list of available JDK versions:
70+
71+
```sh
72+
$ coursier java --available
73+
adoptium:1.11.0.15
74+
adoptium:1.11.0.16
75+
...
76+
```
77+
78+
Please note that JDKs later than 17 are not supported by nailgun
79+
(see [#20603](https://github.com/pantsbuild/pants/issues/20603)), which
80+
must be disabled manually:
81+
82+
```toml title="pants.toml"
83+
[GLOBAL]
84+
process_execution_local_enable_nailgun = false
85+
86+
[jvm]
87+
jdk = "temurin:1.22"
88+
```
89+
6990
#### Scala version
7091

7192
The Scala version to use is configured on a resolve-by-resolve basis (see the "Third-party dependencies" section below) using the [`[scala].version_for_resolve` option](../../reference/subsystems/scala.mdx#version_for_resolve). The default Scala version for your repository will thus be whichever Scala version is configured for the "default" resolve, which is configured by the [`[jvm].default_resolve` option](../../reference/subsystems/jvm#default_resolve).

docs/notes/2.29.x.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Fixed an issue where environment targets with empty sequence fields would overri
2626

2727
### Backends
2828

29+
#### JVM
30+
31+
Document nailgun compatibility issues.
32+
2933
#### Python
3034

3135
The version of [Pex](https://github.com/pex-tool/pex) used by the Python backend has been upgraded to v2.45.2.

src/python/pants/option/global_options.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,13 @@ class BootstrapOptions:
14531453
)
14541454
process_execution_local_enable_nailgun = BoolOption(
14551455
default=DEFAULT_EXECUTION_OPTIONS.process_execution_local_enable_nailgun,
1456-
help="Whether or not to use nailgun to run JVM requests that are marked as supporting nailgun.",
1456+
help=softwrap(
1457+
"""
1458+
Whether or not to use nailgun to run JVM requests that are marked as supporting nailgun.
1459+
Note that nailgun only works correctly on JDK <= 17 and must be disabled manually for
1460+
later versions.
1461+
"""
1462+
),
14571463
advanced=True,
14581464
)
14591465
process_execution_graceful_shutdown_timeout = IntOption(

0 commit comments

Comments
 (0)