Add Windows GUI executable subsystem support - #276
Open
ctate wants to merge 4 commits into
Open
Conversation
Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>
Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>
Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>
Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Comment on lines
+3848
to
+3853
| await rename(tmp, stampPath).catch(async () => { | ||
| // POSIX rename replaces a previous same-output stamp, but Windows does | ||
| // not. A console build followed by a GUI build deliberately has a new | ||
| // identity at the same output path; failing to replace this metadata | ||
| // suppresses onArtifactReady, leaving the GUI executable unavailable to | ||
| // the bootstrap's routed cache on its next invocation. |
Contributor
There was a problem hiding this comment.
Suggested change
| await rename(tmp, stampPath).catch(async () => { | |
| // POSIX rename replaces a previous same-output stamp, but Windows does | |
| // not. A console build followed by a GUI build deliberately has a new | |
| // identity at the same output path; failing to replace this metadata | |
| // suppresses onArtifactReady, leaving the GUI executable unavailable to | |
| // the bootstrap's routed cache on its next invocation. | |
| await rename(tmp, stampPath).catch(async (error) => { | |
| // POSIX rename replaces a previous same-output stamp, but Windows does | |
| // not. A console build followed by a GUI build deliberately has a new | |
| // identity at the same output path; failing to replace this metadata | |
| // suppresses onArtifactReady, leaving the GUI executable unavailable to | |
| // the bootstrap's routed cache on its next invocation. On POSIX a rename | |
| // failure is a genuine error (EACCES, ENOSPC, a concurrently removed | |
| // directory), so surface it rather than deleting a valid prior stamp. | |
| if (process.platform !== "win32") throw error; |
publishLocalArtifactStamp's rename fallback runs the rm+retry on all platforms and swallows the original error, instead of only running on Windows and rethrowing genuine POSIX rename failures.
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.
Summary
Adds first-class Windows executable subsystem selection through the CLI and compiler API. Windows executable builds and
scriptc runaccept--subsystem=consoleor--subsystem=windows; console remains the default, whilewindowslinks a GUI PE executable without changing scriptc’s ordinarymainentry point. Invalid combinations are rejected for non-executable output and non-Windows targets.The linker, executable caches, local artifact identities, and routed cache keys now preserve separate console and GUI variants. Windows-safe artifact and metadata replacement also allows a cached executable or generated artifact at the same path to be refreshed when the selected subsystem changes. The supported behavior is documented for the CLI and Windows cross-compilation workflow, with Windows regression coverage included.
Closes #259