Skip to content

Conversation

charles-zablit and others added 6 commits December 16, 2025 12:25
…m#168733)

This patch refactors and documents the setup of the `CreateProcessW`
invocation in `ProcessLauncherWindows`. It's a dependency of
llvm#168729.

`CreateEnvironmentBufferW` now sorts the environment variable keys
before concatenating them into a string. From [the `CreateProcess`
documentation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw):
> An application must manually pass the current directory information to
the new process. To do so, the application must explicitly create these
environment variable strings, sort them alphabetically (because the
system uses a sorted environment), and put them into the environment
block. Typically, they will go at the front of the environment block,
due to the environment block sort order.

`GetFlattenedWindowsCommandStringW` now returns an error which will be
surfaced, instead of failing silently.

Types were converted to their wide equivalent (i.e appending `W` to
them, see `STARTUPINFOEX`) since we are calling the `W` variant of
`CreateProcess`.

(cherry picked from commit 9edbf83)
@charles-zablit
Copy link
Author

@swift-ci please test

@charles-zablit charles-zablit changed the title 🍒 [lldb][windows] fix environment handling in CreateProcessW setup (llvm#168733) 🍒 [lldb][windows] fix environment handling in CreateProcessW setup Dec 16, 2025
@charles-zablit
Copy link
Author

@swift-ci please test windows

1 similar comment
@charles-zablit
Copy link
Author

@swift-ci please test windows

@adrian-prantl adrian-prantl merged commit 676be9d into swiftlang:swift/release/6.3 Dec 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants