fix: force C++17 for native module compilation in all CI workflows#592
Merged
cute-omega merged 2 commits intomasterfrom Apr 12, 2026
Merged
fix: force C++17 for native module compilation in all CI workflows#592cute-omega merged 2 commits intomasterfrom
cute-omega merged 2 commits intomasterfrom
Conversation
@parcel/[email protected] uses std::optional which requires C++17. Without explicit flags node-gyp defaults to an older standard and the build fails. Fix by writing the appropriate flags to GITHUB_ENV before pnpm install runs in every workflow: - Linux/macOS: CXXFLAGS=-std=c++17, CFLAGS=-std=c11 (GCC/Clang) - Windows: CL=/std:c++17 (MSVC) All three workflow files (test-and-upload, build-and-release, npm-run-electron) are updated. .npmrc is annotated with the requirement so local developers know what to export when building native deps. Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/ff93a323-112d-4413-8665-e7393d39479f Co-authored-by: cute-omega <[email protected]>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job due to C++17 requirement
fix: force C++17 for native module compilation in all CI workflows
Apr 12, 2026
Collaborator
|
c++ 17已正确启用,报错是因为flatpak打包失败。本问题应视为已解决。 如果不强制合并该PR,则PR #593 修复flatpak的PR也不能成功 |
There was a problem hiding this comment.
Pull request overview
This PR addresses CI failures when compiling native Node dependencies (notably @parcel/[email protected]) by ensuring the compiler uses the C++17 standard across all GitHub Actions workflows that run pnpm install.
Changes:
- Add a pre-install step in all relevant workflows to set C++17 flags for native compilation (Unix:
CXXFLAGS=-std=c++17; Windows:CL=/std:c++17). - Add
.npmrccomments documenting why C++17 is required and how CI enforces it.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.npmrc |
Documents the C++17 requirement for native modules and notes how CI sets flags. |
.github/workflows/test-and-upload.yml |
Sets C++17 flags immediately before pnpm install for all OSes in the matrix. |
.github/workflows/npm-run-electron.yml |
Sets C++17 flags immediately before pnpm install for all OSes in the matrix. |
.github/workflows/build-and-release.yml |
Sets C++17 flags immediately before pnpm install for all OSes in the matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
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.
@parcel/[email protected]usesstd::optional, requiring C++17. CI runners default to an older standard, causingpnpm installto fail during native compilation.Changes
test-and-upload.yml,build-and-release.yml,npm-run-electron.yml): inject compiler flags intoGITHUB_ENVimmediately beforepnpm install:CXXFLAGS=-std=c++17,CFLAGS=-std=c11(GCC/Clang)CL=/std:c++17(MSVC).npmrc: added comments documenting the C++17 requirement for local buildsOriginal prompt
This pull request was created from Copilot chat.