Skip to content

Scoop install: published wheels.cmd hits two Windows-only bugs (JAVA_HOME path + cmd.exe parses lucli bat-jar tail) #2765

@bpamiri

Description

@bpamiri

The Scoop-installed wheels CLI is broken on at least some Windows configurations. Two distinct bugs compound.

Bug 1 — JAVA_HOME points at a non-existent path

The published wheels.cmd (under ~/scoop/apps/wheels/current/wheels.cmd) sets:

set "JAVA_HOME=%~dp0share\jdk"
set "PATH=%JAVA_HOME%\bin;%PATH%"

On a scoop install, share/ contains only module/ and framework/ — there is no share/jdk/. The brew formula (tools/distribution-drafts/homebrew/wheels-be.rb:93) sets JAVA_HOME to Formula["openjdk@21"].opt_prefix, which is a real path; the Windows wrapper was written assuming a parallel share\jdk layout that scoop never produces.

The current tools/distribution-drafts/scoop/build-manifests.py already drops these two lines, so the source-of-truth is clean — but the published wheels-dev/scoop-wheels bucket manifest is stale and existing installs still carry the broken wrapper.

Bug 2 — call "%~dp0lucli-0.3.7.bat" chokes cmd.exe on the JAR tail

lucli-0.3.7.bat is a ~915 KB bat-jar concatenation (small bat preamble that runs java -jar "%~f0", followed by :JAR_BOUNDARY and the raw JAR ZIP bytes). When wheels.cmd does:

call "%~dp0lucli-0.3.7.bat" %*

cmd.exe pre-parses the entire bat file looking for labels/control flow. On this Windows build (Win 11 Pro 10.0.26200.8457), that pre-parse trips on a byte sequence in the JAR tail and aborts with:

The filename, directory name, or volume label syntax is incorrect.

…before lucli-0.3.7.bat ever executes. Reproduction:

cmd /c 'C:\Users\peter\scoop\apps\wheels\current\lucli-0.3.7.bat --help'
# -> ERROR_INVALID_NAME (0x7B), exit 1

Bypassing the bat-jar self-execution by invoking Java directly works:

"%JAVA_HOME%\bin\java.exe" -client -jar "%~dp0lucli-0.3.7.bat" %*

Proposed fix (in build-manifests.py::cmd_wrapper)

Replace the call "%~dp0lucli-<ver>.bat" %* line with a direct Java invocation that doesn't make cmd.exe parse the bat-jar:

f'"%JAVA_HOME%\\bin\\java.exe" -client -jar "%~dp0lucli-{LUCLI_VERSION}.bat" %*',

…and add a JAVA_HOME resolver near the top of the wrapper that finds the scoop openjdk21\current dir (the dependency declared by "depends": "java/openjdk21"), so users without a system Java still work.

Repro environment

  • OS: Windows 11 Pro 10.0.26200.8457
  • Wheels: 4.0.0-SNAPSHOT+1442 (stable channel via scoop)
  • LuCLI bat sha512 matches the manifest pin (75c948...dd71b), so this is not a corrupted download.
  • Bundled jdk-21.0.2/ exists under the wheels app dir on this install (curious — depends: java/openjdk21 should have put it in a sibling scoop app, not here; may indicate this install came from an older manifest).

Workaround for affected users

Edit ~/scoop/apps/wheels/current/wheels.cmd:

  1. Change set "JAVA_HOME=%~dp0share\jdk" -> set "JAVA_HOME=%~dp0jdk-21.0.2" (or point at your actual scoop openjdk21\current path).
  2. Change call "%~dp0lucli-0.3.7.bat" %* -> "%JAVA_HOME%\bin\java.exe" -client -jar "%~dp0lucli-0.3.7.bat" %*.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions