Skip to content

Partial SDK implementation#14211

Merged
JohnMcPMS merged 27 commits intomicrosoft:feature/wsl-for-appsfrom
JohnMcPMS:sdk-session
Feb 17, 2026
Merged

Partial SDK implementation#14211
JohnMcPMS merged 27 commits intomicrosoft:feature/wsl-for-appsfrom
JohnMcPMS:sdk-session

Conversation

@JohnMcPMS
Copy link
Member

Summary of the Pull Request

Implements enough of the SDK for the sample demo to operate.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Implements the functions called by the sample demo (as well as a few more trivial functions). These are implemented as best as possible, but there are several TODO callouts for updates that are likely needed to the SDK API surface to account for disparities with the runtime API. I intentionally did not make those changes to the SDK in this PR to limit the friction so that it might get merged sooner. I plan to make a follow-up PR with those changes that can have more/longer discussions.

Additionally, tests are not added for the SDK with this PR at this time. Again, a fast follow-up PR is expected to start adding those tests. Recommendation for new or existing test project are welcome.

Finally, I left the changes that were merged in #14187 to discuss how mainline changes should make it to the feature branch (as I'm dependent on this change for my machine setup to build WSL). Happy to remove it late in the PR process so I can keep building without constant git juggling.

Validation Steps Performed

Sample demo runs successfully and can be run multiple times.

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner February 12, 2026 23:10
Copilot AI review requested due to automatic review settings February 12, 2026 23:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a partial SDK for the WSL Container functionality, providing enough implementation for a sample demo to operate. The implementation bridges the public SDK API (wslcsdk.h) with the internal WSLA runtime services through COM interfaces. The PR also includes a change from #14187 that adds a Clang requirement to the vswhere usage in the build system.

Changes:

  • Implements core SDK functions for session management, container creation/management, and process handling
  • Adds callback implementations for progress reporting and session termination notifications
  • Updates build configuration to require Clang installation in Visual Studio
  • Changes API signature of WslcContainerCreate to require a session parameter
  • Reduces WSLC_SESSION_OPTIONS_SIZE from 80 to 72 bytes (due to memoryMb type change from uint64_t to uint32_t)

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
CMakeLists.txt Adds Clang requirement to vswhere command and improves error message to show missing path
src/windows/WslcSDK/wslcsdk.h Changes WslcContainerCreate signature to add session parameter and adjusts WSLC_SESSION_OPTIONS_SIZE from 80 to 72 bytes
src/windows/WslcSDK/wslcsdk.cpp Implements SDK functions by wrapping WSLA COM runtime APIs, including session/container/process management and image pulling
src/windows/WslcSDK/WslcsdkPrivate.h Updates internal structures (memoryMb type change), adds GetInternalType helper declarations, and defines macros for opaque type conversions
src/windows/WslcSDK/WslcsdkPrivate.cpp Implements GetInternalType helper functions for casting between opaque SDK types and internal implementation types
src/windows/WslcSDK/TerminationCallback.h Defines ITerminationCallback implementation for forwarding session termination events to SDK callback
src/windows/WslcSDK/TerminationCallback.cpp Implements termination callback conversion between runtime and SDK termination reason types
src/windows/WslcSDK/ProgressCallback.h Defines IProgressCallback implementation for forwarding image operation progress to SDK callback
src/windows/WslcSDK/ProgressCallback.cpp Implements progress callback with string-to-enum conversion for progress status values
src/windows/WslcSDK/CMakeLists.txt Updates source and header file lists to include new callback implementation files

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@OneBlue OneBlue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good, mostly minor comments

Copy link
Member

@benhillis benhillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like your PR from your fork isn't triggering checks. I'm not sure why, in the meantime you might want to push a user branch to the main WSL repo

@JohnMcPMS JohnMcPMS mentioned this pull request Feb 13, 2026
6 tasks
@benhillis
Copy link
Member

Looks like your PR from your fork isn't triggering checks. I'm not sure why, in the meantime you might want to push a user branch to the main WSL repo

seems to be working now.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Copy link
Collaborator

@OneBlue OneBlue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change LGTM, couple minor comments

@JohnMcPMS JohnMcPMS dismissed benhillis’s stale review February 17, 2026 21:30

Stale, based on checks not running at the time but they are now working.

@JohnMcPMS JohnMcPMS merged commit 9ae45e3 into microsoft:feature/wsl-for-apps Feb 17, 2026
6 checks passed
@JohnMcPMS JohnMcPMS deleted the sdk-session branch February 17, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments