Skip to content

src: define O_SYNC, O_DSYNC and O_DIRECT on Windows - #64707

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
JaneaSystems:win-fix-fs-constants
Aug 20, 2026
Merged

src: define O_SYNC, O_DSYNC and O_DIRECT on Windows#64707
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
JaneaSystems:win-fix-fs-constants

Conversation

@PickBas

@PickBas PickBas commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

src: define O_SYNC, O_DSYNC and O_DIRECT on Windows

These POSIX open-flag names have no macro in the Windows C runtime, so they were missing from fs.constants on Windows and got silently dropped when passed to fs.open(). libuv already honors the underlying flags (FILE_FLAG_WRITE_THROUGH for sync, FILE_FLAG_NO_BUFFERING for direct), so this just exposes the constants under their portable names wired to libuv's values.

Portable code requesting synchronized or unbuffered I/O now works on Windows instead of losing the flag.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jul 24, 2026
@PickBas
PickBas force-pushed the win-fix-fs-constants branch 2 times, most recently from 16f53e6 to d45f76d Compare July 24, 2026 08:20
@PickBas
PickBas force-pushed the win-fix-fs-constants branch from d45f76d to 3171100 Compare July 24, 2026 08:28
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (874e96e) to head (3171100).
⚠️ Report is 496 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64707      +/-   ##
==========================================
- Coverage   90.24%   90.12%   -0.13%     
==========================================
  Files         739      741       +2     
  Lines      241676   242251     +575     
  Branches    45544    45621      +77     
==========================================
+ Hits       218102   218329     +227     
- Misses      15101    15427     +326     
- Partials     8473     8495      +22     
Files with missing lines Coverage Δ
src/node_constants.cc 99.71% <ø> (ø)

... and 104 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@StefanStojanovic StefanStojanovic added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@StefanStojanovic StefanStojanovic added the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 20, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 6d60352 into nodejs:main Aug 20, 2026
70 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 6d60352

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 20, 2026
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
Signed-off-by: Kirill Saied <[email protected]>
PR-URL: #64707
Reviewed-By: Stefan Stojanovic <[email protected]>
Reviewed-By: James M Snell <[email protected]>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
Signed-off-by: Kirill Saied <[email protected]>
PR-URL: #64707
Reviewed-By: Stefan Stojanovic <[email protected]>
Reviewed-By: James M Snell <[email protected]>
sarayev added a commit to aws-amplify/amplify-backend that referenced this pull request Sep 1, 2026
## Summary

Raises the `aws-cdk-lib` peer dependency floor from `^2.234.1` to
`^2.254.0` across all packages and refreshes the lockfile (now resolves
`aws-cdk-lib` to `2.267.0`).

## Why

On Windows with recent Node.js releases, CDK asset fingerprinting
crashes with `EINVAL` because `fs.openSync` is invoked with the `O_SYNC
| O_DSYNC` flag combination, which Node rejects on that platform. This
makes the Windows unit/coverage job fully red while Linux and macOS stay
green.

The crash was fixed upstream in aws-cdk and first released in
`aws-cdk-lib` 2.254.0. Bumping the floor to `^2.254.0` pulls in the fix.

- Upstream issue: aws/aws-cdk#38692
- Upstream fix (PR): aws/aws-cdk#37802 (released
in `aws-cdk-lib` 2.254.0)
- Related Node.js change: nodejs/node#64707

## What changed

- Bumped `aws-cdk-lib` from `^2.234.1` to `^2.254.0` in all 16
`packages/*/package.json` files (peer/dep/devDep as applicable). No
other dependencies changed.
- Refreshed `package-lock.json` — `aws-cdk-lib` now resolves to
`2.267.0` (latest within the range), deduped across the workspace.
- Updated `packages/create-amplify/src/default_packages.json` so the
default `aws-cdk-lib` pin for new projects matches the lockfile
(generated via `npm run update:create-amplify-deps`).
- Added a changeset (patch bump for affected published packages).

## How tested

- `npm install` + `npm run build` — clean.
- Ran the unit/integration suites. All CDK-heavy suites pass (in-memory
CDK synthesis integration tests, `auth-construct`, `backend-storage`,
`backend-data`): 280/280.
- No CDK-generated construct snapshots/logical IDs changed as a result
of the bump, so no snapshot regeneration was needed.
- `check:package-lock`, `check:package-json`, `check:api`, and prettier
all pass.

The only local failures were in `platform-core` config/telemetry tests
that write to a real user-profile path; these fail identically with and
without this change in the local sandboxed environment
(permission-restricted `~` path) and are unrelated to the CDK bump.

---------

Co-authored-by: sarayev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants