Skip to content

fix(market): upgrade dshmarket to 1.15.0 - #141

Open
yaojin3616 wants to merge 4 commits into
mainfrom
fix/upgrade-dshmarket-1.15.0
Open

fix(market): upgrade dshmarket to 1.15.0#141
yaojin3616 wants to merge 4 commits into
mainfrom
fix/upgrade-dshmarket-1.15.0

Conversation

@yaojin3616

Copy link
Copy Markdown
Contributor

Bump default recommended dshmarket version from 1.9.0 to 1.15.0 and update market installer tests.

On macOS Harness runs inside an Electron utility process, so its
process.execPath and argv0 point at the Electron helper rather than a Node
binary. Plugins re-invoke the dsh CLI through the executable running them —
dsh-market forwards process.execArgv with it — and that child booted as an
Electron app, where the leading --expose-internals shifts argv and the CLI
answers "error: --profile <name> is required". Updating a plugin from the
market therefore always failed on macOS ("Update failed: dshmarket").

The flag cannot travel in the Harness process environment: the utility
process is launched with Chromium switches Node rejects as bad options, so
setting it there stops Harness from starting at all (exit 2304). The Harness
entry declares Node mode from the inside instead, after its own switches are
parsed, marking only the children. The packaged node/pnpm shims declare it
themselves too, so a caller that scrubs the environment still gets Node
semantics.

Verified end to end on a dev launch: POST /dsh-market/update for dshmarket
returned exitCode 0 and moved the profile from 1.15.0 to 1.17.1.
Windows cannot replace a directory while something holds a handle inside
it, and pnpm finishes each package by renaming <pkg>_tmp_<pid>_<n> onto
<pkg>. With Harness running — it has the profile's modules loaded, and the
platform's scanners open files behind everyone's back — that final rename
fails, which is what "Update failed: dshmarket — EPERM ... rename
'…argparse_tmp_19856_4' -> '…argparse'" is. dshmarket 1.15.0 made this
reachable by gaining runtime dependencies (js-yaml -> argparse, undici)
where 1.9.0 had none.

pnpm is reached by name through the packaged shim by every profile package
operation — the desktop installer and the community market alike — so the
shim now points at a runner that owns the recovery for both: retry once (a
scanner's handle is gone within a second), then move the blocked directory
aside and let pnpm install over the freed name. Renaming the directory
itself succeeds where replacing its contents does not. Anything
unrecognized passes straight through with the same exit code and output.

The sidelined copies are swept alongside pnpm's staging directories before
Harness next starts, when nothing holds them.

Verified on macOS that install and failure propagation still behave through
the new shim path (dshmarket@1.15.0 installs; a bad spec still exits 1).
The recovery itself is covered by unit tests over the real failure text —
its effect needs a Windows run to confirm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant