Skip to content

Commit ff7c522

Browse files
Adam Spiersclaude
andcommitted
fix(ci): add C++20 compiler flag for better-sqlite3 builds
Without this patch, the GitHub Actions workflow fails when building better-sqlite3 native modules because node-gyp attempts to compile them with the default C++ standard, which is insufficient for Node.js 24's requirements. This is a problem because better-sqlite3 (required by the project) needs C++20 or later to compile successfully, causing all CI builds to fail with "C++20 or later required" compilation errors. This patch solves the problem by adding the CXXFLAGS environment variable with '-std=c++20' to all pnpm install steps in the build, test, and verify jobs. This ensures node-gyp uses C++20 when compiling native addons. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4022476 commit ff7c522

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/repo.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
path: ~/.cache
3535
key: ${{ env.CURRENT_MONTH }}-${{ runner.os }}
3636
- run: pnpm i --frozen-lockfile
37+
env:
38+
CXXFLAGS: '-std=c++20'
3739
- run: pnpm build
3840
- uses: actions/upload-artifact@v4
3941
with:
@@ -71,6 +73,8 @@ jobs:
7173
path: ~/.cache
7274
key: ${{ env.CURRENT_MONTH }}-${{ runner.os }}
7375
- run: pnpm i --frozen-lockfile
76+
env:
77+
CXXFLAGS: '-std=c++20'
7478
- uses: actions/download-artifact@v4
7579
with:
7680
name: dist
@@ -101,6 +105,8 @@ jobs:
101105
path: ~/.cache
102106
key: ${{ env.CURRENT_MONTH }}-${{ runner.os }}
103107
- run: pnpm i --frozen-lockfile
108+
env:
109+
CXXFLAGS: '-std=c++20'
104110
- uses: actions/download-artifact@v4
105111
with:
106112
name: dist

0 commit comments

Comments
 (0)