chore: make dev tooling cross-platform - #173
Open
freema wants to merge 3 commits into
Open
Conversation
`npm run test:mozlog` hardcoded /tmp/firefox-mozlog-test.log, which resolves to C:\tmp on Windows and does not exist, so the script died with ENOENT before launching Firefox. Use the platform temp directory, as the sibling scripts already do. The Taskfile's clean task shelled out to `rm -rf`, unavailable on Windows.
Two failures a Windows contributor hits before writing any code: - `npm run clean` shelled out to `rm -rf`, which does not exist in the cmd.exe that npm runs scripts through. That also broke prepublishOnly, so `npm publish` could not run on Windows at all. - `npm run build:mcpb` shelled out to `mkdir -p` for the same reason.
A plain YAML scalar cannot contain a colon followed by a space, so task refused to parse the file at all and every task was unavailable. The clean command hit this through the rmSync options object; dropping the spaces after the colons is enough. The bump-version description hit it through its "(usage: ...)" parenthetical, which predates this branch, and clean stays unreachable while that line is unquoted.
freema
marked this pull request as ready for review
August 25, 2026 20:27
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.
Split out of #169, which @juliandescottes asked me to break into smaller pieces. Dev tooling only, no
src/changes.npm run cleanshelled out torm -rf, which does not exist in the cmd.exe that npm runs scripts through. That also brokeprepublishOnly, sonpm publishcould not run on Windows at all.npm run build:mcpbshelled out tomkdir -pfor the same reason. cmd.exe does not fail on that one outright: itsmkdirreads-pas a second directory name, so the build quietly leaves a stray-pdirectory in the repo root, and a later run with-ppresent anddist-mcpbgone exits 1 and takesexecSyncdown with it.npm run test:mozloghardcoded/tmp/firefox-mozlog-test.log, which resolves toC:\tmpon Windows and does not exist, so the script died with ENOENT before launching Firefox. It now uses the platform temp directory, as the sibling scripts already do.cleantask shelled out torm -rf.Two things I changed relative to #169: the
.gitattributespart is gone, since #164 already landed it, and I kept thetest:integration:winentry, because the runner it points at is only removed by the integration-suite commit that stays in #169.The last commit is a YAML fix rather than a portability one, and it is worth a word. A plain YAML scalar cannot contain a colon followed by a space, and the replacement
cleancommand has two of them inside{ recursive: true, force: true }, sotaskrefused to parse the file and reportedmapping values are not allowed in this context. Dropping the spaces after those colons fixes it. While confirming that, I found the same problem already onmain, in thebump-versiondescription:taskcannot parse the Taskfile today because of that line, socleanwould have stayed unreachable even after this PR. I quoted it here. Happy to split that one line out if you would rather keep this PR to portability alone.Verified on Windows 11, Node 22.22.0.
npm run clean,npm run build:mcpbandnpm publish --dry-run(which runsprepublishOnly) all fail onmainand pass here.npm run test:mozlogruns end to end and captures its log under%TEMP%.task --listnow parses the whole file, andtask cleanremovesdist,node_modulesandpackage-lock.jsonas intended.