Skip to content

Commit b5256d4

Browse files
committed
build: pin file.encoding so the Maven build generates the parser on Windows
JJTree reads the .jjt under GRAMMAR_ENCODING but writes the intermediate .jj with the JVM default charset. On a platform whose default is a legacy code page the grammar's Unicode character classes are written lossily, and JavaCC then rejects the mangled ranges: Error: Line 2331, Column 294: Right end of character range '?' has a lower ordinal value than the left end of character range '?'. The Gradle build has pinned -Dfile.encoding=UTF-8 in gradle.properties since 2021, which is why only the Maven build is affected. Give it the same pin via .mvn/jvm.config and put windows-latest back in the maven_verify matrix.
1 parent 6c726d8 commit b5256d4

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ jobs:
6464
strategy:
6565
fail-fast: false
6666
matrix:
67-
# windows-latest disabled: see #<issue> — record the reason, not just the comment
68-
os: [ ubuntu-latest, macos-latest ]
67+
os: [ ubuntu-latest, windows-latest, macos-latest ]
6968
steps:
7069
- uses: actions/checkout@v5
7170
with:

‎.mvn/jvm.config‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Dfile.encoding=UTF-8

‎pom.xml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@
426426
<goals>
427427
<goal>jjtree-javacc</goal>
428428
</goals>
429+
<!--
430+
GRAMMAR_ENCODING governs reading only: JJTree writes the intermediate
431+
.jj with the JVM default charset, which mangles the grammar's non-ASCII
432+
character classes unless file.encoding is UTF-8 (see .mvn/jvm.config).
433+
-->
429434
<configuration>
430435
<javaccCmdLineArgs>
431436
<arg>-CODE_GENERATOR:"Java"</arg>

0 commit comments

Comments
 (0)