Repository navigation
Conversation
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.
Problem
On Windows, a command that stores a file through
AtomicFileStorefails in 4.16.0:fsyncFileopened the staged file read-only before flushing it. macOS and Linux flush a read-only handle; Windows flushes only a handle opened for writing and answersEPERM. The npm package and the standalone executable share this code. It was seen withimport ledgeron a Windows machine and withconfigon the Windows runner. Nothing wrote a file on Windows before a release: the unit tests run on Ubuntu, and the executable check stopped atdevice_not_found, before any write.Change
fsyncFileopens the staged file withr+. The callers pass only files this process has just written with mode 0600, andr+neither truncates nor creates.scripts/verify-standalone.mjswrites a config value into its isolated home and reads it back, so the standalone workflow runs a write on each of the five targets.Evidence
Run on the proof branch
chore/node-sea-proof, which builds the same source into an executable on the five release runners:windows-2022fails with theEPERMabove, the other four targets pass (run 44494565013);Locally: the file store unit tests (21 passed) and
npm run typecheck.Not covered