Skip to content

Commit 1b59350

Browse files
Jamesclaude
authored andcommitted
compile_<demo>.bat never created the directory it compiles into
The windows-bat job failed on its first run, which is what it is for: javac: directory not found: build ##[error]compile_checksyntax.bat did not produce checksyntax.class Every compile_<demo>.bat sets `targetdir=build` and passes it to `javac -d` without creating it. JDK 8's javac requires the output directory to already exist -- it will make package subdirectories underneath, but not the root. So on a fresh clone none of these 39 scripts could compile anything. It went unnoticed because a machine that had ever built the demos already had build\, and because nothing ran them. Reproduced exactly, under JDK 8, in a clean `git archive` export: $ javac -d build -cp ".:external_lib/*:lib/*" ...checksyntax.java javac: directory not found: build $ mkdir build && javac -d build ... $ echo $? 0 Worth noting this cannot be reproduced on a current JDK: javac creates the directory itself from some later release, so on JDK 21 the same command succeeds. The scripts target a JDK 8 era toolchain, which is what CI runs. All 39 now do: if not exist %targetdir% mkdir %targetdir% The other two fixes from the previous commit did work: JAVA_HOME came through from the runner (C:\hostedtoolcache\...\Java_Temurin-Hotspot_jdk\8.0.492-9) rather than being overwritten by the hardcoded path, and feeding stdin from NUL carried `pause` straight through ("Press any key to continue . . ." with no hang). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qPRpoD8exYRrUmbfXXWXj
1 parent aa3a824 commit 1b59350

39 files changed

Lines changed: 120 additions & 0 deletions

File tree

src/main/java/gudusoft/gsqlparser/demos/analyzescript/compile_analyzescript.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\demos\*.java src\main\java\gudusoft\gsqlparser\demos\analyzescript\*.java
3639

3740
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/analyzesp/compile_analyzesp.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\analyzesp\Analyze_SP.java
3639

3740
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/analyzesp/sybase/compile_analyzesp.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\analyzesp\sybase\sybase\Analyze_SP.java
3639

3740
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/analyzeview/compile_analyzeview.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\analyzeview\Analyze_View.java
3639

3740
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/columnImpact/compile_columnImpact.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\antiSQLInjection\columnImpact\*.java
3639

3740
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/compile_antiSQLInjection.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\antiSQLInjection\*.java
3639

3740
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/benchmark/compile_benchmark.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\benchmark\benchmark.java
3639

3740
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/checksyntax/compile_checksyntax.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ call setenv\setenv.bat
2828
)
2929

3030
REM # Compile the gsp demo
31+
REM # javac -d needs the output directory to already exist.
32+
if not exist %targetdir% mkdir %targetdir%
33+
3134
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\checksyntax\checksyntax.java
3235

3336
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/columnAnalyze/compile_columnAnalyze.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\columnAnalyze\*.java src\main\java\gudusoft\gsqlparser\demos\columnAnalyze\*.java
3639

3740
echo Completed.

src/main/java/gudusoft/gsqlparser/demos/columnDetail/compile_columnDetail.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ call setenv\setenv.bat
3232
)
3333

3434
REM # Compile the gsp demo
35+
REM # javac -d needs the output directory to already exist.
36+
if not exist %targetdir% mkdir %targetdir%
37+
3538
%JAVAC_CMD% -d %targetdir% -classpath %CLASSPATH% src\main\java\gudusoft\gsqlparser\demos\columnDetail\*.java
3639

3740
echo Completed.

0 commit comments

Comments
 (0)