fix(market): upgrade dshmarket to 1.15.0 - #141
Open
yaojin3616 wants to merge 4 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bump default recommended
dshmarketversion from1.9.0to1.15.0and update market installer tests.