Compare commits

...

198 Commits

Author SHA1 Message Date
Ben Hillis
49864b525e
CI: Switch away from -dev versions of MS-RDX-MRO.windows-store-publish tasks (#13841)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-05 15:20:15 -08:00
Ben Hillis
7741740f87
Add back WSL2_VM_ID environment varialbe to the system distro. (#13835)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-05 15:06:38 -08:00
Ben Hillis
caf38dcad2
wslsettings: ensure text in the oobe window properly wraps (#13823)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-04 20:29:11 -08:00
Ben Hillis
1390e644fb
cleanup: add handling for product-specific virtio networking class IDs. (#13822) 2025-12-03 18:55:25 -08:00
Ben Hillis
c64eb180d8
Remove lxutil.dll dependency and update Microsoft.WSL.DeviceHost to version 1.0.0-20251201.1 (#13633)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-02 20:05:14 -08:00
Ben Hillis
2844e4a862
test: minor updates to improve virtiofs pass rate (#13815)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-02 12:46:26 -08:00
Mitchell Levy
8f744fc188
Update Microsoft.WSL.Kernel to 6.6.114.1 (#13812)
See https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/linux-msft-wsl-6.6.114.1
2025-12-02 10:50:16 -08:00
Ben Hillis
4637f3758f
virtio networking: fix two minor issues (#13810)
* virtio networking: fix two minor issues

* Update src/windows/common/VirtioNetworking.cpp

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

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-01 21:18:09 -08:00
Ben Hillis
0f6f3c1e02
test: improve test logging infra (#13811)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-01 21:17:28 -08:00
Blue
82e54b12a8
Notice change from build: 134917819 (#13809)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-12-01 14:00:43 -08:00
Scott Bradnick
0f07dae96d
Update SLE15SP7 [QU2] and SLE16.0 [QU0] (#13808) 2025-12-01 12:02:29 -08:00
Arch Linux Technical User
d23025b575
archlinux: Release 2025.12.01.153427 (#13804)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2025-12-01 12:01:55 -08:00
Blue
71c87c211f
Localization change from build: 134886165 (#13802)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-12-01 08:33:25 -08:00
Ben Hillis
be82716c40
cleanup: move common functonality out of service exe (#13788)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-26 15:50:42 -08:00
Ben Hillis
ba90ee11fa
cleanup: remove invalid m_deviceHostSupport checks (#13787)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-26 07:59:33 -08:00
Ben Hillis
4207cc80bd
cleanup: VirtioNetworking refactoring to be more portable (#13783)
* cleanup: VirtioNetworking refactoring to be more portable

* more refactoring

* make m_guestDeviceManager private

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-25 16:40:36 -08:00
Blue
b0df225c51
Notice change from build: 134527933 (#13782)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-11-24 14:33:51 -08:00
AlmaLinux Autobot
722eecafba
chore(distributions): Almalinux auto-update - 20251124 17:13:02 (#13780)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-24 13:01:54 -08:00
Ben Hillis
66904342a5
cleanup: switch from Microsoft::WRL::ComPtr to wil::com_ptr (#13767)
* cleanup: switch from Microsoft::WRL::ComPtr to wil::com_ptr

* reformat

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-24 12:47:22 -08:00
Ben Hillis
d9c69a50ab
cleanup: VirtioNetworking refactoring (#13760)
* cleanup: update VirtioNetworking class to not rely on the WslCoreConfig struct

* cleanup: simplify VirtioNetworking construction

* remove old constructor and other cleanup

* more minor cleanup

* string cleanup in HandleVirtioModifyOpenPorts

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-21 16:50:26 -08:00
Blue
c3d369df90
Fix service crash when collecting a linux crash dump when maxCrashDumpCount is set to 0 (#13755)
* Fix service crash when collecting a linux crash dump when maxCrashDumpCount is set to 0

* Move the check inside the function
2025-11-21 08:16:04 -08:00
Blue
1b7e27ef6f
Add *.slnx to .gitignore (#13754) 2025-11-20 15:40:20 -08:00
Blue
c38230d1f1
Notice change from build: 134267142 (#13751)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-11-20 13:12:51 -08:00
Ben Hillis
1ea3a8e18b
deps: update a number of NuGet packages to the latest available versions (#13728)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-20 11:02:06 -08:00
Blue
f75997128d
Mask systemd-networkd-wait-online.service during boot (#13611) 2025-11-20 09:23:12 -08:00
AlmaLinux Autobot
dbf49f1ae9
chore(distributions): Almalinux auto-update - 20251119 12:04:35 (#13743)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-19 15:36:09 -08:00
Ben Hillis
b73897e88a
build: fix minor compiler errors when building with VS2026 (#13744)
* build: fix minor compiler errors when building with VS2026

* s

* use VS2022 for clang format and cross compiling

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-19 15:35:49 -08:00
Ben Hillis
7226b05100
wslsettings: ensure selected setting is auto-expanded and selected (#13689)
* wslsettings: ensure selected setting is auto-selected

Implement keyboard focus management for SettingsExpander controls across settings pages. This resolves an accessibility issue reported internally.

* add asserts

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-18 08:19:50 -08:00
Blue
b6cc29eefc
Localization change from build: 134015316 (#13731)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-11-17 11:18:05 -08:00
Ben Hillis
87c1100620
.clang-format: add InsertBraces: true and minor fix to FormatSource.ps1 (#13712)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-14 16:12:02 -08:00
Ben Hillis
7c010a1e93
wslsettings: add underlines to links in about page (#13703)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-13 13:53:05 -08:00
Ben Hillis
9fad2a1b59
wslsettings: fix OOBE text truncation at 200% text scaling (#13693)
* wslsettings: fix OOBE text truncation at 200% text scaling

Add text scaling factor to window resize calculation and make hero image height responsive to text scaling. Increase minimum window size for better accessibility. Fix MAS 1.4.4 compliance for OOBE dialog.

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-13 13:52:29 -08:00
Blue
b2c28b92fe
Localization change from build: 133610492 (#13704)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-11-11 08:12:16 -08:00
Ben Hillis
ea5c29eae7
wslsettings: allow OOBE window to close with escape key (#13686)
* wslsettings: allow OOBE windows to close with escape key

* fix memory leak

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-11-07 12:53:10 -08:00
Scott Bradnick
09c17eb6c6
Remove SLE15SP6; add SLE16.0 (#13647) 2025-11-04 15:56:49 -08:00
Arch Linux Technical User
bafd381aec
archlinux: Release 2025.11.01.150831 (#13661)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2025-11-03 08:15:59 -08:00
AlmaLinux Autobot
d48ece45a4
chore(distributions): Almalinux auto-update - 20251030 17:08:25 (#13653)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-30 13:29:45 -07:00
Blue
ae4347d9df
Notice change from build: 132846777 (#13654)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-10-30 11:42:48 -07:00
Blue
64160a40f0
Make the sample WSL_POST_BUILD_COMMAND more resilient (#13652) 2025-10-30 10:25:03 -07:00
Jeremy Cline
fdfe1eb843
fedora: Add Fedora 43 to the distribution list (#13643)
Six months have gone by, so it's time for another Fedora release. In
addition to the general Fedora updates this release, the WSL image is
now properly suffixed.
2025-10-28 14:45:41 -07:00
Blue
296fe805b9
Localization change from build: 132491007 (#13639)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-10-25 12:09:22 -07:00
Ben Hillis
a231b6b5f9
Fix WslDistributionConfig to not default-initialize FeatureFlags or NetworkingMode optional fields (#13629)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-10-23 08:28:13 -07:00
Blue
2715a79fb4
Localization change from build: 132360042 (#13630)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-10-23 08:27:52 -07:00
Blue
3361736a3a
Localization change from build: 132310101 (#13627)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-10-22 10:42:21 -07:00
Blue
cccae113d7
Localization change from build: 132289123 (#13625)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-10-22 08:42:54 -07:00
Ben Hillis
9e9ef6f145
Fix edge cases around .vhd support (#13061)
* Fix edge cases around .vhd support

* PR feedback

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

* pr feedback

* remove unneeded scope exit in unit test

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-21 17:00:47 -07:00
Blue
c1b77b125d
Notice change from build: 131949882 (#13608)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-10-16 14:47:32 -06:00
Ben Hillis
dab574ebc1
Update Microsoft.WSL.DeviceHost package to version 1.0.0-20251015.1 which contains support virtioproxy support for ICMP (#13606)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-10-16 13:20:26 -06:00
Ben Hillis
a445eaa89f
Update Microsoft.NETCore.App.Runtime packages version with fix for CVE-2025-55248 (#13607)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-10-16 12:06:26 -07:00
Blue
b3a7b7d395
Add logic to handle partial hvsocket writes and additional logging (#13602) 2025-10-16 10:53:49 -07:00
Blue
0974c302c0
Remove unused LXSS_DISTRO_FLAGS_WSLCORE_MODE (#13603) 2025-10-15 21:42:39 -07:00
Blue
c7aad61611
Improve logging when socket operations fail (#13579)
* Don't throw when processing an empty argument

* Cleanup diff
2025-10-08 18:24:31 -07:00
Blue
5d097195fa
Fix potential service deadlock when plugin returns an error from OnVmStarted (#13569) 2025-10-08 15:40:02 -07:00
Blue
8540b2b6f5
Add WTI rule to detect usermode crashes (#13574) 2025-10-07 15:52:56 -07:00
Ben Hillis
05d6129c4f
Implement clean instance terminate when using systemd (#13552)
* Implement clean instance terminate when using systemd

* pr feedback

* more pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-10-07 15:37:41 -07:00
Hideyuki Nagase
491d8d5707
Update WSLg to 1.0.71 (#13570)
Co-authored-by: Hideyuki Nagase <hideyukn@ntdev.microsoft.com>
2025-10-07 09:29:18 -07:00
Blue
babf0c24f1
Add hypervkvpd.service to the list of discouraged systemd units (#13568) 2025-10-06 17:20:12 -07:00
Blue
9f77522f64
Update the initramfs to set 755 permissions on /init (#13567) 2025-10-06 17:19:49 -07:00
Blue
9b5659d4b9
Respect the distribution manifest ordering when listing distributions (#13561)
* Respect the distribution manifest ordering when listing distributions

* Fix test

* Update test/windows/UnitTests.cpp

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-06 12:42:32 -07:00
Blue
d4e64b658f
Add more verbose output to bsdtar to help root cause 'ImportExportStdout' test failures (#13555) 2025-10-03 17:37:40 -07:00
Blue
65eea7b31c
Introduce a new wsl.conf config value to allow distributions to opt-in to cgroupv1 mounts (#13546)
* Introduce a new wsl.conf config value to allow distributions to opt-in to cgroupv1 mounts

* Add test coverage

* Fix tmpfs on wsl1

---------

Co-authored-by: Ben Hillis <benhillis@gmail.com>
2025-10-02 23:36:12 -04:00
Junhao Liao
98f4960118
fix: correct sparse VHD command to include true (#13512)
* fix: correct sparse VHD command to include `true`

* Revert all localization strings to f8c26f7c3 except en-US/Resources.resw

* fix: run validate-localization.py with --fix option
2025-10-01 16:49:49 -07:00
Blue
e0c6196cd5
Create a persistent install log file to help root cause package upgrade issues (#13500)
* Create a persistent install log file to help root cause package upgrade issues

* Update src/windows/common/wslutil.cpp

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

* Collect log file in diagnostic script

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-01 15:40:41 -07:00
Blue
8313d50f2e
Introduce a new kernel command line argument to collect hvsocket event logs during boot (#13537)
* Introduce a new kernel command line argument to collect hvsocket event logs during boot

* Cleanup diff

* unset env

* Add test coverage

* Fix format

* Remove prefix
2025-10-01 15:35:49 -07:00
Arch Linux Technical User
582e15e4e0
archlinux: Release 2025.10.01.148042 (#13547)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2025-10-01 11:08:41 -07:00
Scott Bradnick
004bb36f9e
Swap Leap 16.0 in for Leap 15.6 (#13549)
If we can have Leap 15.6 AND Leap 16.0 (5 total distros), that would be great 

Tumbleweed
SLE 15SP6
SLE 15SP7
Leap 15.6
Leap 16.0
2025-10-01 11:08:29 -07:00
Blue
5c5fd4a1b4
Remove no-op GetRuntimeId() call (#13545) 2025-09-30 13:33:44 -07:00
Blue
332efe1a8d
Fix incorrect timeout causing WSL1 OOBE to fail if the OOBE process takes longer than 30 seconds (#13517)
* Fix incorrect timeout causing WSL1 OOBE to fail if the OOBE process takes longer than 30 seconds

* Pass the timeout to WaitForMessage
2025-09-24 19:58:39 -07:00
Blue
4bba074bd2
Add logic to force terminate the VM if the session lock can't be acquired for 30 seconds when the service stops (#13493) 2025-09-24 14:46:28 -07:00
Blue
c8cd16a169
Add a logging profile to collect hvsocket logs (#13510) 2025-09-24 14:46:01 -07:00
Scott Bradnick
95fcc56983
Update openSUSE Tumbleweed v20250923.0 (#13515)
Updating .appx and .wsl offerings.
2025-09-24 11:37:37 -07:00
g0tmi1k
2d976b2ef9
Bump Kali 2025.3 (#13516)
Release notes: https://www.kali.org/blog/kali-linux-2025-3-release/
2025-09-24 11:37:26 -07:00
rodeka
f8c26f7c32
fix: UnboundLocalError in create-release.py (#13499) 2025-09-22 14:18:54 -07:00
Blue
7b17a7a7ab
Add WININET_E_TIMEOUT to g_commonErrors (#13506) 2025-09-22 13:32:12 -07:00
Blue
259ec4e5a9
Remove explicit '--tags' argument from find-release.py (#13481) 2025-09-17 11:27:21 -07:00
Blue
04eb4d4e8f
Increase the MSI installation timeout to 20 minutes (#13489)
* Increase the MSI installation timeout to 20 minutes

* Increase the MSI installation timeout to 20 minutes
2025-09-17 11:27:12 -07:00
Blue
b9e74a3361
Set TargetLatestRuntimePatch to false to prevent automatic framework version increases (#13483)
* Add lock files to wslsettings target to prevent automatic nuget version increases

* Update lock

* Update lock

* Enable strict mode

* Experiment

* Save state

* Experiment

* Experiment

* Experiment

* Experiment

* Experiment

* Experiment

* Experiment

* Try to set a matching version in packages.config

* Try to set a matching version in packages.config

* Experiment

* Experiment

* Experiment

* Restore pipeline

* Experiment

* Experiment

* Experiment

* Experiment

* Experiment

* Experiment

* Simplify

* Remove lock files
2025-09-16 17:46:53 -07:00
Blue
146a7511a5
Add VID event providers to WSL log profile (#13488) 2025-09-16 14:12:38 -07:00
Blue
2eac1dafec
Configure defender process exceptions when running tests (#13470)
* Configure defender process exceptions when running tests

* Use explicit %ls

* Save state

* Save state

* Add exceptions before the package is installed

* Remove extra call
2025-09-10 19:36:25 -07:00
Ben Hillis
25f7a7b38c
Notice change from build: 129899373 (#13475)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-09-10 19:35:02 -07:00
Ben Hillis
d43b725b3d
Fix: Always use 'WSLInterop` as the binfmt name (#13467)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-09-09 09:28:11 -07:00
Ben Hillis
36c077bd69
logging: add more settings to vm create begin / end events. (#13412)
* logging: add more settings to vm create begin / end events.

* pr feedback, less string allocations'

* Handle empty user module list differently

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-09-08 15:32:35 -07:00
Ben Hillis
3e322b719c
Update Microsoft .NET and AppSDK nuget packages. (#13450)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-09-07 12:00:21 -07:00
Scott Bradnick
94f44b692c
SLE15SP7 QU1 update (#13447)
Updating "Url" and "Sha256" for '"Name": "SUSE-Linux-Enterprise-15-SP7"'.
2025-09-03 12:46:07 -07:00
Arch Linux Technical User
513fc5c0c1
archlinux: Release 2025.09.01.145298 (#13442)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2025-09-03 08:54:16 -07:00
Carlos Nihelton
feb9ad97a4
More stable link for Ubuntu and Ubuntu-24.04 (#13418)
The existing AMD64 link (using the release name - noble in this case) will
break next year as it did two weeks ago when Ubuntu 24.04.3 LTS was
released.

The link I propose here will remain stable when the next point release
comes out, following the same pattern already in place for ARM64.

To prove my point we can use this pattern to fetch the previous version
of Ubuntu 24.04:

- This works:
https://releases.ubuntu.com/24.04.2/ubuntu-24.04.2-wsl-amd64.wsl

- This doesn't:
https://releases.ubuntu.com/noble/ubuntu-24.04.2-wsl-amd64.wsl
2025-08-22 11:03:21 -07:00
Carlos Nihelton
8de7016905
Remove Ubuntu-18.04 (#13419)
This distro is being out of standard support for a while now.
Users should really be on more recent LTS releases.
2025-08-22 11:02:58 -07:00
Blue
39b4cd8873
Various fixes in validate-modern.py (#13405)
* Various fixes in validate-modern.py

* Update distributions/validate-modern.py

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

* Fix copilot diff

* Fix copilot diff

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-18 14:07:40 -07:00
Ben Hillis
dc34ebfd8c
Fix for CVE-2025-53788 (#13392)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-08-15 07:13:22 -07:00
Ben Hillis
fd3b858064
Relaunch the debug shell after it exits. (#13379)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-08-13 16:31:37 -07:00
Blue
6121b56152
Disable HTTP cache when reading the distribution manifest over HTTP (#13383) 2025-08-13 11:29:25 -07:00
Copilot
17bd3716b4
Remove hardcoded --cd ~ from WSL terminal fragment profiles to support Terminal's startingDirectory (#13350)
* Initial plan

* Fix WSL terminal fragment profiles to support Terminal's startingDirectory

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* clang format

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-08-11 14:08:39 -07:00
Robert Haist
267bbb7426
Update DistributionInfo.json for Debian 13 release (#13371) 2025-08-11 11:37:22 -07:00
Ben Hillis
ca1f883dd0
wslg: update to latest version which uses wslinfo --vm-id instead of env var (#13361)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-08-08 13:29:29 -07:00
Copilot
3794ba3496
Add comprehensive GitHub Copilot instructions for WSL development (#13352)
* Initial plan

* Add comprehensive GitHub Copilot instructions for WSL repository

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* Address reviewer feedback: fix build commands and test parameters

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>
2025-08-07 17:24:23 -04:00
Kevin Jagodic
4b237351a9
Ubuntu version links updated. (#13355)
* Update DistributionInfo.json

* Update SHA256 for Ubuntu WSL distributions

* Update distributions/DistributionInfo.json

Co-authored-by: Carlos Nihelton <cnihelton@ubuntu.com>

* Update distributions/DistributionInfo.json

Co-authored-by: Carlos Nihelton <cnihelton@ubuntu.com>

---------

Co-authored-by: Carlos Nihelton <cnihelton@ubuntu.com>
2025-08-07 13:03:58 -07:00
Ben Hillis
642331364d
Switch wslinfo --vm-id to not rely on presence of VM ID environment variable (#13318)
* Switch WSLg to use wslinfo --vm-id instead of relying on environment variable

* DO NOT MERGE: bad WSLg nuget

* dead code removal

* always send response to LxInitMessageQueryVmId message

* add back invalid WslInfoMode error

* remove unneeded wsl2 check

* use temporary workaround until WSLg update is ready

* unit test update

* Update string compare

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

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-05 14:36:10 -07:00
Carlos Nihelton
b89e1f58c9
Fix json invalid utf-8 from IconPath (#13340)
When storing the IconPath value directly as a string we are subject
to unspecified behaviour as Windows stores paths as 16-bit wchar_t and
std::string doesn't convey a specific char encoding.

To be specific we need to access the icon path in its native format
(which we assume to be std::wstring) and convert it to multibyte.
2025-08-05 11:27:20 -07:00
Arch Linux Technical User
8106556cec
archlinux: Release 2025.08.01.138229 (#13319)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2025-08-04 11:14:59 -07:00
Jerry Jones
3524feba77
grammar docfixes (#13314) 2025-07-31 08:19:42 -07:00
Blue
0c0ca04ab0
Localization change from build: 127406956 (#13316)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-07-31 08:13:52 -07:00
Blue
bba5af9aea
Fix the 'WriteWslConfig' test case to reset .wslconfig when done (#13305)
* Save state

* Fix the tests
2025-07-29 15:35:35 -07:00
Josh Soref
6d18bf5074
Spelling (#13289)
* link: report them to the Microsoft Security Response Center (MSRC)

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: Microsoft Security Response Center

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: , or

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: adapters

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: at

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: attaching them to the bug, please send them to wsl-gh-logs@microsoft.com with the github issue number in the subject, and include a link to your github issue comment in the message body.

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: disk

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: effect

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: for the file

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: for the mount to be available

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: grandchild

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: last pid

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: on which the...

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: path

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: pseudo

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: script

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: service, the

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: session

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: strip

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: that a

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: that the

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: the first one we find in the test

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: to which

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: waitpid

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: whether

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: while the relay was being set up,

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: with an

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: without specifying

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Ben Hillis <benhillis@gmail.com>
2025-07-29 11:24:39 -07:00
Ben Hillis
4867250d11
install: do not attempt to install distros if a reboot is required (#13298)
* install: do not attempt to install distros if a reboot is required

* nfc: update comment

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-07-29 08:48:52 -07:00
Blue
3c800c8661
Update the test packages drop (#13300) 2025-07-29 07:34:32 -07:00
Blue
494808d308
Localization change from build: 127017409 (#13290)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-07-25 10:10:44 -07:00
S. M. Mohiuddin Khan Shiam
41f97bbc81
Fix: enforce non-empty asset list when publishing (#13201)
This patch closes a logic gap in [tools/devops/create-release.py](cci:7://file:///c:/Users/T2430514/Downloads/WSL/tools/devops/create-release.py:0:0-0:0):

* **Problem** – The script’s `--publish` mode was intended to require at least one asset, but Click passes an empty tuple if no assets are provided. The original guard (`if assets is None`) never triggered, allowing empty releases to be drafted.
* **Solution** – Replace the check with `if not assets:` which catches both `None` and empty collections, preventing accidental empty releases.
* **Impact** – Ensures CI and manual runs cannot publish a release without payload, aligning behavior with the CLI contract and avoiding junk tags that require manual cleanup.

Co-authored-by: Odio Marcelino <odiomarcelino@gmail.com>
2025-07-24 10:51:43 -07:00
Ben Hillis
d83c1b552a
NFC: minor spelling fixes (#13280)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-07-24 10:36:26 -07:00
Josh Soref
abce91d14b
Spelling (#12954)
* link: Collect WSL logs (recommended method)

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: Advanced Authoring Tests in C++

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: CMake Documentation and Community

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: Collect WSL logs for networking issues

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: Collect WSL logs (recommended method)

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: ; otherwise,

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: a

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: access

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: accessible

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: across

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: actively

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: adapters

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: address

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: addresses

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: and

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: appropriate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: argument

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: associated

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: attach

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: available

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: beginning

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: between

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: binaries

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: bound

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: buffer

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: buffers

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: cannot

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: canonical

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: capabilities

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: case-insensitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: case-sensitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: certified

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: command

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: committer

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: communication

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: complains

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: configuration

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: consumed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: continue

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: converted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: currently

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: customers

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: daemon

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: deferred

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: definitions

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: delimiter

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: delivered

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dellink

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: derived

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: descriptor

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: destined

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: destruct

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: destructible

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: destructor

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: detach

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: differentiate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: directories

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: disassociate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: disposition

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: distribution

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: distro

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: duping

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: emitted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: empty

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: environment

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: every time

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: exclusive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: expected

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: expire

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: explicitly

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: fall back

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: false

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: fastfail

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: filesystem

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: first

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: followed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: for

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: functionality

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: functionally

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: greater

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: guarantee

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: guaranteed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: handles

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: hangup

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: hierarchy

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: hogwarts

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: hydrated

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: icrnl

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: implementation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: implementing

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: initialize

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: instance

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: instantiate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: instantiations

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: intentionally

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: interpret

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: interpreter

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: irreversibly

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: iteration

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: iterator

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: its

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: kernel

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: kmsg

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: knowledge

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: maximum

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: mirrored

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: msftconnecttest

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: multi

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: mutable

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: namespace

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: notifications

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: occurred

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: occurring

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: otherwise,

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: outstanding

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: overridden

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: partition

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: pass through

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: passthrough

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: performs

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: periodically

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: positional

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: precedence

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: preexisting

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: preferring

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: prepopulate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: previous

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: privileges

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: process

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: processes

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: programmatically

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: protection

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: provided

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: reasonable

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: receive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: received

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: red hat

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: reentrant

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: registered

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: regularly

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: relay

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: release

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: representing

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: requests

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: response

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: resurrect

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: retention

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: returned

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: security

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: semaphore

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: separate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: separator

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: service

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: set up

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: setup

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: severely

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: should

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: signal

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: similarly

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: simple

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: simplified

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: single

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: specified

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: splitting

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: standard

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: stress

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: succeed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: success

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: successfully

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: supplementary

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: synced

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: system

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: take

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: than

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: that opening

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: threadpool

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: to

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: true

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: truncate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: tunneling

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: unexpected

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: uninitialize

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: unique

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: unprivileged

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: unregistered

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: untrusted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: upgrade

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: utility

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: validating

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: variant

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: variation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: variations

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: verify

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: visible

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: whether

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: winget

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: worker

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: written

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: wslservice

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* format source

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Ben Hillis <benhillis@gmail.com>
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-07-23 15:19:00 -07:00
Ben Hillis
cefe0cdcc1
Update Microsoft.RemoteDesktop.Client.MSRDC.SessionHost to version 1.2.6353 (#13271)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-07-21 10:32:38 -07:00
Blue
e8145a7ee9
Localization change from build: 126514791 (#13267)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-07-17 15:24:39 -07:00
Ben Hillis
2bdd6b999d
wslsettings: appropriately set heading level for PageHeaderTextBlockStyle (#13257)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-07-17 10:52:24 -07:00
Ben Hillis
ae77467ec8
cleanup: remove reference to deprecated pageReportingOrder setting (#13264)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-07-17 10:52:03 -07:00
Ben Hillis
ca1ed5d5ff
cleanup: remove unreferenced images (#13265)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-07-17 10:51:50 -07:00
Blue
ae323a4e9b
Temporarily disable building wslsettings.exe by default (#13008) 2025-07-10 11:05:29 -07:00
Kiran Cheparthi
227dc68783
Update DistributionInfo.json to remove old Oracle distros (#13240) 2025-07-09 12:20:58 -04:00
Craig Loewen
ec54df6362
Updated oracle distros (#13238) 2025-07-08 18:10:53 -04:00
Blue
5f34d17955
Localization change from build: 125806897 (#13229)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-07-06 10:17:24 -07:00
Craig Gumbley
4547e2a6f2
Expose the VM ID inside user distros (#13212)
* Add --vm-id to wslinfo usage string

* Pass the VM id to init

This change ensures that we pass the vm id to an
instances init. The id is then set as an environment
variable and can be accessed at runtime.

* Expose VM id to wslinfo

Add a new argument --vm-id to wslinfo so that
the caller can retrieve the VM id by calling the
binary.

Although it is an environment variable, it can be useful
here too to save additional string parsing from the caller.
2025-07-03 17:30:47 -07:00
Arch Linux Technical User
e563689b88
archlinux: Release 2025.07.01.132764 (#13208)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2025-07-01 12:29:53 -07:00
Blue
5e88d9acbf
Various improvements to dump-init.sh (#13177) 2025-06-26 11:55:12 -07:00
Blue
1b7620a4f8
Use the github generated release notes by default in create-release.py (#13161)
* Use the github generated release notes by default in create-release.py

* Merge
2025-06-26 11:54:19 -07:00
Blue
17319988a6
Notice change from build: 125117737 (#13183)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-06-25 07:45:48 -07:00
Blue
4aa472255d
Notice change from build: 125063368 (#13178)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-06-24 12:39:42 -07:00
g0tmi1k
c4b6a6b392
Bump Kali 2025.2 (#13182)
Release notes: https://www.kali.org/blog/kali-linux-2025-2-release/
2025-06-24 12:06:33 -07:00
Blue
c1d6ad1d15
Don't display a warning when the binfmt process doesn't have a controlling terminal (#13176) 2025-06-23 16:24:10 -07:00
Blue
902848b76b
Update create-release.py to find github issues without the full url (#13150) 2025-06-20 14:17:07 -07:00
Blue
9e09fe791c
Update setup-vm-for-tests.ps1 to copy the test distribution from the nuget package (#13149) 2025-06-20 14:16:58 -07:00
K900
e391e7854a
Look up systemctl from $PATH for user session checks (#13157)
This is already done in other instances where init calls systemctl, and we rely on init to find systemctl in PATH on NixOS, as we don't (really) have a /usr.
2025-06-20 14:09:50 -07:00
Mlekow
dedf36169d
Fix C1010070 compilation error in wslsettings (#12928)
Co-authored-by: Mlekow <mlekow5@outlook.com>
2025-06-20 13:15:03 -07:00
Blue
6319b02687
Fix incorrect memset call on an std::string (#12982)
* Fix incorrect memset call on an std::string

* Remove explicit clear call

* Other memset

* Cleanup diff
2025-06-18 18:29:43 -07:00
JC
c34a361330
fix: typo in wslg.exe.md (#12955)
Co-authored-by: Ben Hillis <benhillis@gmail.com>
2025-06-18 15:55:34 -07:00
Ben Hillis
3be5af4b38
cleanup: use wil::unique_fd in CreateProcessParse (#13002)
* cleanup: use wil::unique_fd in CreateProcessParse

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-06-18 14:55:01 -07:00
Blue
cc113d7c38
Exit with 1 if fatal errors are found while validating the distribution manifest (#13140) 2025-06-18 13:37:23 -07:00
Scott Bradnick
dd5dc89bc7
Remove SLE15SP5, update SUSE SLE15SP6, add SLE15SP7; update openSUSE Tumbleweed (#13139)
* Update DistributionInfo.json

* Updates for Tumbleweed (ARM64/X64 .appx & .wsl)
* Updates for SLE15SP6 (.appx & .wsl)
* Addition of SLE15SP7 (.wsl)
* Removal of SLE15SP5

* Change Default for SUSE

Switch from SP6 to SP7 as default for "SUSE".
2025-06-18 12:27:27 -07:00
Blue
ece64c8b14
Localization change from build: 124713931 (#13134)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-06-18 09:38:15 -07:00
Blue
407bfda099
Don't throw when unregistering a distro that has a BasePath that doesn't exist (#13130) 2025-06-17 15:23:31 -07:00
Blue
c7964ead5b
Localization change from build: 124643027 (#13123)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-06-17 09:25:15 -07:00
Blue
6e2cb1d94b
Update touchdown build task to v5 (#13118) 2025-06-16 18:39:06 -07:00
Blue
c3f59f8b12
Don't try to create invalid file names if the distribution download url contains parameters (#13109) 2025-06-13 17:21:28 -07:00
Blue
02ca6d3d2d
Fix various issues with systemd user sessions (#13101)
* Save state

* Save state

* Add test coverage

* Remove useless condition

* Update localized strings

* Update test distro
2025-06-13 16:31:57 -07:00
Ben Hillis
1f0e66d25c
cleanup: add ChildName to UtilCreateChildProcess error message (#13103)
* cleanup: add ChildName to UtilCreateChildProcess error message

* tweak error message

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-06-13 14:20:18 -07:00
Blue
b9a52e96c7
Notice change from build: 124333557 (#13095)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-06-12 11:12:20 -07:00
Ben Hillis
dbb68a23e4
package update: update .net runtime to 9.0.6 (#13090)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-06-11 16:12:49 -07:00
Blue
5d20b44bc6
Fix wslsettings crash when invoked from wslservice (#13089) 2025-06-11 15:06:04 -07:00
Blue
71daaef7bb
Remove directories after the OverlayFs test completes (#13085) 2025-06-11 13:40:06 -07:00
Blue
3164dc425a
Set MOVEFILE_WRITE_THROUGH when moving distribution VHD's (#13087) 2025-06-11 11:31:56 -07:00
Blue
5fd4ffb064
Discard BOM header when parsing the Windows 'hosts' file (#13079)
* Discard BOM header when parsing the Windows 'hosts' file

* Cleanup after tests

* Format
2025-06-10 15:04:32 -07:00
Blue
456b68125f
Correctly report corrupted disks when mount() fails with EUCLEAN (#13078) 2025-06-10 11:08:01 -07:00
Blue
63d1396714
Don't use a \\?\ prefix when resolving the distribution location (#13080) 2025-06-10 11:07:31 -07:00
Blue
94ecb86067
Only check GetLastError() if ReadFile returns false (#13076) 2025-06-10 11:07:16 -07:00
Mitchell Levy
4b6b3884ba
kernel: Update to WSL Kernel 6.6.87.2 (#13066)
Closes #12987 
Closes #12983 
Closes #13031
2025-06-06 15:06:29 -07:00
Blue
0c8844e0f2
Fix missing null terminator when calling execv() on modprobe (#13054) 2025-06-04 18:11:01 -07:00
Blue
c3264b73f5
Use the correct base branch in the nightly pipeline .yml (#13052) 2025-06-04 12:37:56 -07:00
Blue
9144c17073
Don't try to download a new distribution if the name is already in use (#13046) 2025-06-04 11:59:10 -07:00
Blue
e881324551
Make the post import distribution checks less strict (#13036)
* Make the post import distribution checks less strict

* Use /etc

* Update comment

* Explicitely create /etc/wsl.conf
2025-06-03 15:49:40 -07:00
Arch Linux Technical User
41e82228ff
archlinux: Release 2025.06.01.129180 (#13023)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2025-06-02 14:56:06 -07:00
Blue
ed3e9479a1
Localization change from build: 123701725 (#13034)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-06-02 14:19:36 -07:00
Blue
a630dbc613
Use the correct base branch in create-change.py (#13017) 2025-06-02 11:36:59 -07:00
Blue
9cd3438a2f
Solve test failures caused by the SKU changes (#13016)
* Debug the tests

* Debug the tests

* Debug the tests

* Use explicit directory

* Remove debug print

* Remove debug print

* Open handle directly

* Revert "Open handle directly"

This reverts commit 49ec490af67c32096942c08c92aca48469d5e790.

* Open handle directly
2025-05-30 17:40:43 -07:00
Blue
6f1a992579
Add a systemd override binfmt-support.service to protect wsl's interop entry (#12999)
* Add a systemd override binfmt-support.service to protect wsl's interop entry

* Remove extra mkdir
2025-05-30 14:16:52 -07:00
Blue
827a987fc2
Reduce the soft file descriptor limit to 10240 (#12996) 2025-05-30 11:33:14 -07:00
kotborealis
a2aa0aa60a
docs: update comments in wslpath.cpp (#13010)
Updated some comments in `wslpath.cpp`:
* Bad wording in abstract
* Return value description for AbsolutePath was mismatched with the signature
2025-05-30 08:16:28 -07:00
Blue
0fcad801bc
Implement a CI pipeline (#13003) 2025-05-29 16:31:17 -07:00
Blue
4e1784d737
Move notice & localization pipelines to the default pool (#13007) 2025-05-29 15:55:13 -07:00
Elkhan Mammadli
07d7d29190
feat(distribution): add almalinux 10 (#13005)
Add AlmaLinux OS 10 and make it as the default AlmaLinux distribution.

Signed-off-by: Elkhan Mammadli <elkhan.mammadli@protonmail.com>
2025-05-29 15:00:02 -07:00
Dannon
769e508a34
docs: fix typos in contributing.md (#12998) 2025-05-29 07:23:56 -07:00
Slavy Mihov
19764aa943
Remove dependency on tcpdumpProcess for log collection (#12997) 2025-05-28 16:52:19 -07:00
Jiaxing Liu
8c32233709
fix(validate-modern): correct f-string syntax (#12977) 2025-05-27 15:09:18 -07:00
Blue
42aacd20bc
Add a '/bsod' to resourceManagement.yml to reply with instructions to capture a kernel dump (#12981) 2025-05-27 14:56:46 -07:00
Muhammad Danish
dd99531aeb
Fix failing WinGet publish action (#12946)
* Fix failing WinGet publish action

* Removed MSIX

---------

Co-authored-by: Craig Loewen <crloewen@microsoft.com>
2025-05-27 14:51:15 -07:00
Elkhan Mammadli
9000b49687
chore(almalinux): update to 9.6.20250522.0 (#12966)
Signed-off-by: Elkhan Mammadli <elkhan.mammadli@protonmail.com>
2025-05-24 09:29:54 -07:00
Hayden Barnes
7d6a44bbe8
Update docs to include Developer Mode or Admin (#12924) 2025-05-22 10:50:45 -07:00
Josh Soref
6703980dc8
spelling: libraries (#12958)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-05-21 11:00:49 -07:00
Josh Soref
83d14de518
Spelling localizations (#12957) 2025-05-21 10:48:14 -07:00
Craig Loewen
be5b31305f
Made contribution idea clearer in feature_request.md (#12944) 2025-05-21 08:50:45 -07:00
niklod
228ebef799
fix: correct interop documentation (#12932)
* correct interop documentation
2025-05-21 08:48:58 -07:00
Suggon
d5db6fcc72
fix: typo in wslg docs (#12952) 2025-05-21 08:14:50 -07:00
Blue
b87e56c605
Create a separate pipeline for public CI (#12947) 2025-05-20 13:30:39 -07:00
Craig Loewen
1cea24b5bf
Change wsl.dev docs index.md title to 'open source docs' (#12921) 2025-05-20 08:17:58 -07:00
Blue
541321e58b
Update create-change.py and create-release.py to point to the microsoft/WSL repository (#12919) 2025-05-19 19:33:38 -07:00
Blue
bb9caa4864
Update the pipelines to reference the default branch (#12918) 2025-05-19 14:42:06 -07:00
Ben Hillis
4b5cb64e79
docs: remove duplicate support markdown file (#12917) 2025-05-19 09:55:42 -07:00
WSL Team
697572d664 Initial open source commit for WSL.
Many Microsoft employees have contributed to the Windows Subsystem for Linux, this commit is the result of their work since 2016.

The entire history of the Windows Subsystem for Linux can't be shared here, but here's an overview of WSL's history after it moved to it own repository in 2021:

Number of commits on the main branch: 2930
Number of contributors: 31

Head over https://github.com/microsoft/WSL/releases for a more detailed history of the features added to WSL since 2021.
2025-05-15 12:09:45 -07:00
Yuhang Guo
9f6c33f4a7
Fix language issues in install WSL ps1 script (#12284)
* Update install-latest-wsl.ps1

https://github.com/microsoft/WSL/issues/12282#issuecomment-2480894130 The install-latest-wsl.ps1 script cannot parse the operating "System Type" '$systeminfo = & systeminfo | findstr /C:"System Type"' due to language problems. In the Chinese interface environment, "System Type" is the Chinese "系统类型".

* Updated regular syntax
2025-05-13 15:01:21 -07:00
Blue
d3f37e41d0
Remove 'similar issues' workflow since it's not running anymore (#12872) 2025-05-02 12:00:21 -07:00
Arch Linux Technical User
28da506f69
archlinux: Release 2025.05.01.126391 (#12868)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2025-05-01 12:24:51 -07:00
Gamb1ts
15606ac19e
Update Kali Linux to 2025.1c (#12865)
* Update Kali Linux to 2025.1c

* Update DistributionInfo.json
2025-04-30 13:51:22 -07:00
Robin Candau
420b7b22db
Fix indentation in DistributionInfo.json (#12838)
* Fix indentation in DistributionInfo.json

Replace (accidental) tabs by spaces

* Add a json formatting check to the validate.py script

This should a coherent formatting for the future
2025-04-21 11:39:51 -07:00
Elkhan Mammadli
345816f03d
chore(almalinux): update 8.10, 9.5 and kitten 10 (#12828)
Updated current AlmaLinux OS distributions:
- AlmaLinux OS 8.10.20250415.0
- AlmaLinux OS 9.5.20250415.0
- AlmaLinux OS Kitten 10.20250415.0

Signed-off-by: Elkhan Mammadli <elkhan.mammadli@protonmail.com>
2025-04-16 11:42:34 -07:00
Jeremy Cline
fd0243c8ab
Add Fedora Linux to distribution list (#12710)
Fedora has started building WSL images in Fedora 42. With the general
availability of Fedora 42, we can now include Fedora in the distribution
list.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-04-16 11:42:07 -07:00
Blue
a99369981d
Add logic to warning when unsupported extended attributes are found in validate-modern.py (#12827) 2025-04-15 14:22:00 -07:00
Blue
a2fac48202
Add 'shortcut.enabled' to the list of keys in wsl-distribution.conf (#12826) 2025-04-15 12:18:42 -07:00
Robin Candau
04f0a13d4c
Add Arch Linux official WSL image to the distribution manifest (#12818)
As discussed in microsoft#12551, we (Arch Linux) now [provide an official WSL image](https://rfc.archlinux.page/0050-arch-linux-wsl-image/). This commit adds it to the Microsoft WSL's official distribution manifest, allowing users to pull and install it in an automated way (`wsl --install archlinux`).

Closes microsoft#12551
2025-04-14 15:00:16 -07:00
Nitin KM
69900a27fe
Update README.md (#12785)
fixes #12771
2025-04-07 09:20:32 -07:00
Gamb1ts
c07517c82b
Change checksums to match current Kali image (#12738) 2025-03-24 19:04:38 -07:00
Scott Bradnick
6cbb18fae7
Update openSUSE/SUSE "ModernDistributions" (#12726)
Updates for:
- openSUSE Tumbleweed (X64 & ARM64)
- openSUSE Leap 15.6 (X64 & ARM64)
- SUSE Linux Enterprise 15 SP6 (X64)
2025-03-21 13:54:40 -07:00
Craig Loewen
24670931f4
Updated SUSE distros (#12720)
* Updated SUSE distros

* Updated file names
2025-03-21 08:09:26 -07:00
764 changed files with 261938 additions and 439 deletions

150
.clang-format Normal file
View File

@ -0,0 +1,150 @@
---
# this file work is a derivative of onecoreuap/net/.clang-format
# https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md
#
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
ColumnLimit: 130
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(stdafx.h|pch.h|precomp.h)"$'
Priority: -1
IndentCaseLabels: false
InsertBraces: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: '^BEGIN_COM_MAP$|^BEGIN_CONNECTION_POINT_MAP$|^BEGIN_HELPER_NODEMAP$|^BEGIN_MODULE$|^BEGIN_MSG_MAP$|^BEGIN_OBJECT_MAP$|^BEGIN_TEST_CLASS$|^BEGIN_TEST_METHOD$|^BEGIN_TEST_METHOD_PROPERTIES$'
MacroBlockEnd: '^END_COM_MAP$|^END_CONNECTION_POINT_MAP$|^END_HELPER_NODEMAP$|^END_MODULE$|^END_MSG_MAP$|^END_OBJECT_MAP$|^END_TEST_CLASS$|^END_TEST_METHOD$|^END_TEST_METHOD_PROPERTIES$'
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Left
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros: [
_Acquires_exclusive_lock_,
_Acquires_lock_,
_Acquires_nonreentrant_lock_,
_Acquires_shared_lock_,
_Analysis_assume_smart_lock_acquired_,
_Analysis_assume_smart_lock_released_,
_Create_lock_level_,
_Detaches_lock_,
_Function_class_,
_Global_cancel_spin_lock_,
_Global_critical_region_,
_Global_interlock_,
_Global_priority_region_,
_Has_lock_kind_,
_Has_lock_level_,
_IRQL_always_function_max_,
_IRQL_always_function_min_,
_IRQL_raises_,
_IRQL_requires_,
_IRQL_requires_max_,
_IRQL_requires_min_,
_IRQL_requires_same_,
_IRQL_restores_,
_IRQL_restores_global_,
_IRQL_saves_,
_IRQL_saves_global_,
_Lock_level_order_,
_Moves_lock_,
_Must_inspect_result_,
_No_competing_thread_,
_Post_same_lock_,
_Post_writable_byte_size_,
_Pre_satisfies_,
_Releases_exclusive_lock_,
_Releases_lock_,
_Releases_nonreentrant_lock_,
_Releases_shared_lock_,
_Replaces_lock_,
_Requires_exclusive_lock_held_,
_Requires_lock_held_,
_Requires_lock_not_held_,
_Requires_no_locks_held_,
_Requires_shared_lock_held_,
_Ret_maybenull_,
_Ret_range_,
_Success_,
_Swaps_locks_,
_Use_decl_annotations_,
_When_,
RpcEndExcept,
]
TabWidth: 4
TypenameMacros: [
IFACEMETHOD,
STDMETHOD,
]
UseTab: Never
...

326
.gdnsuppress Normal file
View File

@ -0,0 +1,326 @@
{
"hydrated": false,
"properties": {
"helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/suppressions"
},
"version": "1.0.0",
"suppressionSets": {
"default": {
"name": "default",
"createdDate": "2025-04-30 22:17:21Z",
"lastUpdatedDate": "2025-04-30 22:17:21Z"
}
},
"results": {
"3d7d59d41a06e01093616033ddd4ecec1e8dcb65363768638eea6acb6d012b4e": {
"signature": "3d7d59d41a06e01093616033ddd4ecec1e8dcb65363768638eea6acb6d012b4e",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"aa145b1818ed203013a6267ca382110ec5ea9c1bf50a812964d4c7b5671224ec": {
"signature": "aa145b1818ed203013a6267ca382110ec5ea9c1bf50a812964d4c7b5671224ec",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"c5f15f6ef4ac3f1e82c31ae0f651ab0f1c8448e34824bf231dd2104cef70d9e5": {
"signature": "c5f15f6ef4ac3f1e82c31ae0f651ab0f1c8448e34824bf231dd2104cef70d9e5",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"e8eb99fd7876f9c79c0ff194de9e21cc77d63573a9b73ba1666778a247dcebff": {
"signature": "e8eb99fd7876f9c79c0ff194de9e21cc77d63573a9b73ba1666778a247dcebff",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"43df748a685bc9feca8cf04c518f57a82012d61665dca65d8a1fb652a55d9391": {
"signature": "43df748a685bc9feca8cf04c518f57a82012d61665dca65d8a1fb652a55d9391",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"fc58019c679cf3c469af5161b1f237f7552ee81c3d3ae29aff2d18fcceafe3e7": {
"signature": "fc58019c679cf3c469af5161b1f237f7552ee81c3d3ae29aff2d18fcceafe3e7",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"bedcd464fd4426dbd786cb09b7407100aa548dfff85d3c89e7fd79c8c2623391": {
"signature": "bedcd464fd4426dbd786cb09b7407100aa548dfff85d3c89e7fd79c8c2623391",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"06d5d116da395c14acda7a67c6530e675cc6d59593a94f37fbc2b91ce05380ca": {
"signature": "06d5d116da395c14acda7a67c6530e675cc6d59593a94f37fbc2b91ce05380ca",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"a93af66a96249e7041eee45e325c2548da917d4c6984e7cf67fa0c052a01a980": {
"signature": "a93af66a96249e7041eee45e325c2548da917d4c6984e7cf67fa0c052a01a980",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"2950fa4920cef845442e43dccfbdd49ca5935a1f0aa115c3b25bf5397d39bac7": {
"signature": "2950fa4920cef845442e43dccfbdd49ca5935a1f0aa115c3b25bf5397d39bac7",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"d747605a4cb9b5cbe7715f638b3909572302db204327120c50f712064c405380": {
"signature": "d747605a4cb9b5cbe7715f638b3909572302db204327120c50f712064c405380",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"be9c9eacd39f7740ac8794956f9133718e7bac4556a7a29ebdbcae5a1c762faf": {
"signature": "be9c9eacd39f7740ac8794956f9133718e7bac4556a7a29ebdbcae5a1c762faf",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"1af653b6acce89da21e37933f80d0686bf8a01aab386620533b42e06b55a3f26": {
"signature": "1af653b6acce89da21e37933f80d0686bf8a01aab386620533b42e06b55a3f26",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"5ba96332382fbe9cfb5c6baf51b5bd6e2644f1aa86c3fad66562dd648458f431": {
"signature": "5ba96332382fbe9cfb5c6baf51b5bd6e2644f1aa86c3fad66562dd648458f431",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"29432097a113f870ee7f86e585601fa1a6013f50b65893a359391ef47f996c73": {
"signature": "29432097a113f870ee7f86e585601fa1a6013f50b65893a359391ef47f996c73",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"352c2da0bfcde6f9f60c43359e7263b07247d26bff0343a369c8e3667c37fbe1": {
"signature": "352c2da0bfcde6f9f60c43359e7263b07247d26bff0343a369c8e3667c37fbe1",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"64bf4920e1b5b21e7312594ca9d95e3b48ac05a9cef507b21d91ba588a0ab08e": {
"signature": "64bf4920e1b5b21e7312594ca9d95e3b48ac05a9cef507b21d91ba588a0ab08e",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"720d1478e66c5f46670729c232d5afb787cdcc007f53e67d31edd4457e60967c": {
"signature": "720d1478e66c5f46670729c232d5afb787cdcc007f53e67d31edd4457e60967c",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"cf0a86680efb56a7eb351df85c51c6ad2e1ae64f108b8729ab7a9dd148d8312b": {
"signature": "cf0a86680efb56a7eb351df85c51c6ad2e1ae64f108b8729ab7a9dd148d8312b",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"3cedf840f8bdf45d29de68eedf06e3548fbdf86ebe3929c38b1be7babd790142": {
"signature": "3cedf840f8bdf45d29de68eedf06e3548fbdf86ebe3929c38b1be7babd790142",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"2e746764a2b4ee4971e2afded4c2dd99c5bf7647a5c8d9ae027d901caf7c5982": {
"signature": "2e746764a2b4ee4971e2afded4c2dd99c5bf7647a5c8d9ae027d901caf7c5982",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"04e31f322d76e5b2d92d36987ae5453b9d7b4eb1aba2e59f9956e088756eb3d3": {
"signature": "04e31f322d76e5b2d92d36987ae5453b9d7b4eb1aba2e59f9956e088756eb3d3",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"df6145ffc4e1301e28b405ec934470ab2346ac60ef1b5a806a470f6a86907141": {
"signature": "df6145ffc4e1301e28b405ec934470ab2346ac60ef1b5a806a470f6a86907141",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"53daee355a750916f6516911381cd31bfbb8de644cb0158a7bfb6456ffab163c": {
"signature": "53daee355a750916f6516911381cd31bfbb8de644cb0158a7bfb6456ffab163c",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"cf5679eb50b6062e91bab7a9a53aa2c356a41289192081f733e42c6def3abc96": {
"signature": "cf5679eb50b6062e91bab7a9a53aa2c356a41289192081f733e42c6def3abc96",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"9dac4ccae735c85dd3974f876f336accefa2f90f3cea74801bf4b148926bd132": {
"signature": "9dac4ccae735c85dd3974f876f336accefa2f90f3cea74801bf4b148926bd132",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"d05aa96a810d8140a0c2269e8d5e64b8b6db02652da6842547e1e1c4139096b5": {
"signature": "d05aa96a810d8140a0c2269e8d5e64b8b6db02652da6842547e1e1c4139096b5",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"cd0ad7bf2ffe4b3d068dc6c9731aa1d8f001250f30ebd3667a8982f03e72c879": {
"signature": "cd0ad7bf2ffe4b3d068dc6c9731aa1d8f001250f30ebd3667a8982f03e72c879",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"8415dbbf5b26dadc3e7d7f09b496a7f53452c60b67019bbb92c48dd1cd0f703a": {
"signature": "8415dbbf5b26dadc3e7d7f09b496a7f53452c60b67019bbb92c48dd1cd0f703a",
"alternativeSignatures": [
"88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"20edc36496c8274a97fe9179b56fcc1b5aab4b7e0d6769c23e14181844f64f35": {
"signature": "20edc36496c8274a97fe9179b56fcc1b5aab4b7e0d6769c23e14181844f64f35",
"alternativeSignatures": [
"14b018ac237bbbfe6304e73f454e190a2c60d335f249db0a9af6500eeae4808f"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
},
"2652e38833372ca84eeebf1e9cd6145d4556e3851f7e698f95b5f01574cef372": {
"signature": "2652e38833372ca84eeebf1e9cd6145d4556e3851f7e698f95b5f01574cef372",
"alternativeSignatures": [
"d705445d04087b944ab3e7777bce5c61a4efc64fc7be2953cf7ed8573321a87b"
],
"memberOf": [
"default"
],
"createdDate": "2025-04-30 22:17:21Z"
}
}
}

4
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,4 @@
# File containing policy for file ownership
# Reviewers for all files in the repository
* @microsoft/wsl-maintainers

View File

@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest a feature for Windows Subsystem for Linux
name: Feature request / Contribution idea
about: Suggest a feature or improvement for the Windows Subsystem for Linux
title: ''
labels: 'feature'
assignees: ''

View File

@ -5,9 +5,6 @@ inputs:
issue:
required: false
type: string
similar_issues_text:
required: false
type: string
comment:
required: false
type: string
@ -22,21 +19,11 @@ runs:
using: "composite"
steps:
- name: 'Run WTI'
if: ${{ !contains(inputs.similar_issues_text, '''@') }} # Skip this step if the description contains a string that will break the here document
shell: pwsh
env:
previous_body: "${{ inputs.previous_body }}"
run: |
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$message = @'
${{ inputs.similar_issues_text }}
'@
$maybe_message = @()
if (![string]::IsNullOrEmpty($message))
{
$maybe_message = @("--default-message-stdin")
}
$maybe_comment = @()
if (![string]::IsNullOrEmpty("${{ inputs.comment }}"))
@ -53,4 +40,4 @@ runs:
curl.exe -L https://github.com/OneBlue/wti/releases/download/v0.1.12/wti.exe -o triage/wti.exe
cd triage && echo -n $message | .\wti.exe --issue ${{ inputs.issue }} --config config.yml --github-token "${{ inputs.token }}" --ignore-tags @maybe_message @maybe_comment @maybe_previous_body
cd triage && .\wti.exe --issue ${{ inputs.issue }} --config config.yml --github-token "${{ inputs.token }}" --ignore-tags @maybe_comment @maybe_previous_body

218
.github/copilot-instructions.md vendored Normal file
View File

@ -0,0 +1,218 @@
# Windows Subsystem for Linux (WSL)
**ALWAYS reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.**
WSL is the Windows Subsystem for Linux - a compatibility layer for running Linux binary executables natively on Windows. This repository contains the core Windows components that enable WSL functionality.
## Working Effectively
### Critical Platform Requirements
- **Full builds ONLY work on Windows** with Visual Studio and Windows SDK 26100
- **DO NOT attempt to build the main WSL components on Linux** - they require Windows-specific APIs, MSBuild, and Visual Studio toolchain
- Many validation and development tasks CAN be performed on Linux (documentation, formatting, Python validation scripts)
### Windows Build Requirements (Required for Full Development)
- CMake >= 3.25 (`winget install Kitware.CMake`)
- Visual Studio with these components:
- Windows SDK 26100
- MSBuild
- Universal Windows platform support for v143 build tools (X64 and ARM64)
- MSVC v143 - VS 2022 C++ ARM64 build tools (Latest + Spectre) (X64 and ARM64)
- C++ core features
- C++ ATL for latest v143 tools (X64 and ARM64)
- C++ Clang compiler for Windows
- .NET desktop development
- .NET WinUI app development tools
- Enable Developer Mode in Windows Settings OR run with Administrator privileges (required for symbolic link support)
### Building WSL (Windows Only)
1. Clone the repository
2. Generate Visual Studio solution: `cmake .`
3. Build: `cmake --build . -- -m` OR open `wsl.sln` in Visual Studio
4. **NEVER CANCEL: Build takes 20-45 minutes on typical hardware. Set timeout to 60+ minutes.**
Build parameters:
- `cmake . -A arm64` - Build for ARM64
- `cmake . -DCMAKE_BUILD_TYPE=Release` - Release build
- `cmake . -DBUILD_BUNDLE=TRUE` - Build bundle msix package (requires ARM64 built first)
### Deploying WSL (Windows Only)
- Install MSI: `bin\<platform>\<target>\wsl.msi`
- OR use script: `powershell tools\deploy\deploy-to-host.ps1`
- For Hyper-V VM: `powershell tools\deploy\deploy-to-vm.ps1 -VmName <vm> -Username <user> -Password <pass>`
## Cross-Platform Development Tasks
### Documentation (Works on Linux/Windows)
- Install tools: `pip install mkdocs-mermaid2-plugin mkdocs --break-system-packages`
- Build docs: `mkdocs build -f doc/mkdocs.yml`
- **Build time: ~0.5 seconds. Set timeout to 5+ minutes for safety.**
- Output location: `doc/site/`
- **Note**: May show warnings about mermaid CDN access on restricted networks
### Code Formatting and Validation (Works on Linux/Windows)
- Format check: `clang-format --dry-run --style=file <files>`
- Apply formatting: `clang-format -i --style=file <files>`
- Format all source: `powershell formatsource.ps1` (available at repo root after running `cmake .`)
- Validate copyright headers: `python3 tools/devops/validate-copyright-headers.py`
- **Note**: Will report missing headers in generated/dependency files (_deps/), which is expected
- Validate localization: `python3 tools/devops/validate-localization.py`
- **Note**: Only works after Windows build (requires localization/strings/en-us/Resources.resw)
### Distribution Validation (Limited on Linux)
- Validate distribution info: `python3 distributions/validate.py distributions/DistributionInfo.json`
- **Note**: May fail on Linux due to network restrictions accessing distribution URLs
## Testing
### Unit Tests (Windows Only - TAEF Framework)
- Run all tests: `bin\<platform>\<target>\test.bat`
- **NEVER CANCEL: Full test suite takes 30-60 minutes. Set timeout to 90+ minutes.**
- Run subset: `bin\<platform>\<target>\test.bat /name:*UnitTest*`
- Run specific test: `bin\<platform>\<target>\test.bat /name:<class>::<test>`
- WSL1 tests: Add `-Version 1` flag
- Fast mode (after first run): Add `-f` flag (requires `wsl --set-default test_distro`)
Test debugging:
- Wait for debugger: `/waitfordebugger`
- Break on failure: `/breakonfailure`
- Run in-process: `/inproc`
### Linux Unit Tests (Linux Only)
- Location: `test/linux/unit_tests/`
- Build script: `test/linux/unit_tests/build_tests.sh`
- **Note**: Requires specific Linux build environment setup not covered in main build process
## Validation Scenarios
### Always Test These After Changes:
1. **Documentation Build**: Run `mkdocs build -f doc/mkdocs.yml` and verify no errors
2. **Code Formatting**: Run `clang-format --dry-run --style=file` on changed files
3. **Windows Build** (if on Windows): Full cmake build cycle
4. **Distribution Validation**: Run Python validation scripts on any distribution changes
### Manual Validation Requirements
- **Windows builds**: Install MSI and test basic WSL functionality (`wsl --version`, `wsl -l`)
- **Documentation changes**: Review generated HTML in `doc/site/`
- **Distribution changes**: Test with actual WSL distribution installation
## Repository Navigation
### Key Directories
- `src/windows/` - Main Windows WSL service components
- `src/linux/` - Linux-side WSL components
- `src/shared/` - Shared code between Windows and Linux
- `test/windows/` - Windows-based tests (TAEF framework)
- `test/linux/unit_tests/` - Linux unit test suite
- `doc/` - Documentation source (MkDocs)
- `tools/` - Build and deployment scripts
- `distributions/` - Distribution validation and metadata
### Key Files
- `CMakeLists.txt` - Main build configuration
- `doc/docs/dev-loop.md` - Developer build instructions
- `test/README.md` - Testing framework documentation
- `CONTRIBUTING.md` - Contribution guidelines
- `.clang-format` - Code formatting rules
- `UserConfig.cmake.sample` - Optional build customizations
### Frequently Used Commands (Platform-Specific)
#### Windows Development:
```bash
# Initial setup
cmake .
cmake --build . -- -m # 20-45 minutes, NEVER CANCEL
# Deploy and test
powershell tools\deploy\deploy-to-host.ps1
wsl --version
# Run tests
bin\x64\debug\test.bat # 30-60 minutes, NEVER CANCEL
```
#### Cross-Platform Validation:
```bash
# Documentation (0.5 seconds)
mkdocs build -f doc/mkdocs.yml
# Code formatting
find src -name "*.cpp" -o -name "*.h" | xargs clang-format --dry-run --style=file
# Copyright header validation (reports expected issues in _deps/)
python3 tools/devops/validate-copyright-headers.py
# Distribution validation (may fail on networks without external access)
python3 distributions/validate.py distributions/DistributionInfo.json
```
## Debugging and Logging
### ETL Tracing (Windows Only)
```powershell
# Collect traces
wpr -start diagnostics\wsl.wprp -filemode
# [reproduce issue]
wpr -stop logs.ETL
```
### Log Analysis Tools
- Use WPA (Windows Performance Analyzer) for ETL traces
- Key providers: `Microsoft.Windows.Lxss.Manager`, `Microsoft.Windows.Subsystem.Lxss`
### Debug Console (Linux)
Add to `%USERPROFILE%\.wslconfig`:
```ini
[wsl2]
debugConsole=true
```
### Common Debugging Commands
- Debug shell: `wsl --debug-shell`
- Collect WSL logs: `powershell diagnostics\collect-wsl-logs.ps1`
- Network logs: `powershell diagnostics\collect-networking-logs.ps1`
## Critical Timing and Timeout Guidelines
**NEVER CANCEL these operations - always wait for completion:**
- **Full Windows build**: 20-45 minutes (set timeout: 60+ minutes)
- **Full test suite**: 30-60 minutes (set timeout: 90+ minutes)
- **Unit test subset**: 5-15 minutes (set timeout: 30+ minutes)
- **Documentation build**: ~0.5 seconds (set timeout: 5+ minutes)
- **Distribution validation**: 2-5 minutes (set timeout: 15+ minutes)
## CI/CD Integration
### GitHub Actions
- **distributions.yml**: Validates distribution metadata (Linux)
- **documentation.yml**: Builds and deploys docs (Linux)
- **modern-distributions.yml**: Tests modern distribution support
### Pre-commit Validation
Always run before committing:
1. `clang-format --dry-run --style=file` on changed C++ files
2. `python3 tools/devops/validate-copyright-headers.py` (ignore _deps/ warnings)
3. `mkdocs build -f doc/mkdocs.yml` if documentation changed
4. Full Windows build if core components changed
**Note**: The `.gitignore` file properly excludes build artifacts (*.sln, *.dll, *.pdb, obj/, bin/, etc.) - do not commit these files.
## Development Environment Setup
### Windows (Full Development)
1. Install Visual Studio with required components (listed above)
2. Install CMake 3.25+
3. Enable Developer Mode
4. Clone repository
5. Run `cmake .` to generate solution
### Linux (Documentation/Validation Only)
1. Install Python 3.8+
2. Install clang-format
3. Install docs tools: `pip install mkdocs-mermaid2-plugin mkdocs`
4. Clone repository
5. Run validation commands as needed
Remember: **This is a Windows-focused project**. While some tasks can be performed on Linux, full WSL development requires Windows with Visual Studio.

View File

@ -181,16 +181,16 @@ configuration:
```
The scipt will output the path of the log file once done.
The script will output the path of the log file once done.
Once completed please upload the output files to this Github issue.
Once completed please upload the output files to this GitHub issue.
[Click here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) for more info on logging
See [Collect WSL logs (recommended method)](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method).
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue.
If you choose to email these logs instead of attaching them to the bug, please send them to wsl-gh-logs@microsoft.com with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body.
Thank you!
@ -226,18 +226,38 @@ configuration:
```
The scipt will output the path of the log file once done.
The script will output the path of the log file once done.
Once completed please upload the output files to this Github issue.
Once completed please upload the output files to this GitHub issue.
[Click here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) for more info on logging
See [Collect WSL logs (recommended method)](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method).
Thank you!
- addLabel:
label: needs-author-feedback
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/bsod?'
isRegex: True
- or:
- activitySenderHasPermission:
permission: Admin
- activitySenderHasPermission:
permission: Write
then:
- addReply:
reply: >-
Hello! Could you please provide a kernel dump to help us better diagnose your issue?
To collect a kernel dump, follow [10) Reporting a Windows crash (BSOD)](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#10-reporting-a-windows-crash-bsod)
Thank you!
- addLabel:
label: needs-author-feedback
description:
onFailure:
onSuccess:

18
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,18 @@
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
<!-- Please review the items on the PR checklist before submitting-->
## 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](https://github.com/MicrosoftDocs/wsl/) and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed

35
.github/workflows/documentation.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Build documentation
on:
workflow_dispatch:
push:
branches: [main, master]
jobs:
DeployDocs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout actions
uses: actions/checkout@v4
- name: Install packages
run: pip install mkdocs-mermaid2-plugin mkdocs --break-system-packages
shell: bash
- name: Build documentation
run: mkdocs build -f doc/mkdocs.yml
shell: bash
- uses: actions/upload-pages-artifact@v3
with:
path: doc/site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@ -6,25 +6,8 @@ on:
types: [edited]
jobs:
getSimilarIssues:
runs-on: ubuntu-latest
outputs:
message: ${{ steps.getBody.outputs.message }}
steps:
- uses: actions/checkout@v2
- id: getBody
uses: craigloewen-msft/GitGudSimilarIssues@main
with:
issueTitle: ${{ github.event.issue.title }}
issueBody: ${{ github.event.issue.body }}
repository: ${{ github.repository }}
similarityTolerance: "0.7"
commentBody: |
# View similar issues
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!
wti:
name: Run wti
needs: getSimilarIssues
runs-on: windows-2022
permissions:
issues: write
@ -34,7 +17,6 @@ jobs:
- uses: ./.github/actions/triage
with:
similar_issues_text: "${{ needs.getSimilarIssues.outputs.message }}"
issue: "${{ github.event.issue.number }}"
previous_body: "${{ github.event.changes.body.from }}"
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -6,27 +6,9 @@ on:
types: [opened]
jobs:
getSimilarIssues:
runs-on: ubuntu-latest
outputs:
message: ${{ steps.getBody.outputs.message }}
steps:
- uses: actions/checkout@v2
- id: getBody
uses: craigloewen-msft/GitGudSimilarIssues@main
with:
issueTitle: ${{ github.event.issue.title }}
issueBody: ${{ github.event.issue.body }}
repository: ${{ github.repository }}
similarityTolerance: "0.7"
commentBody: |
# View similar issues
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!
wti:
name: Run wti
needs: getSimilarIssues
runs-on: windows-2022
if: 'always()' # Run even if getSimilarIssues fails
permissions:
issues: write
steps:
@ -35,6 +17,5 @@ jobs:
- uses: ./.github/actions/triage
with:
similar_issues_text: "${{ needs.getSimilarIssues.outputs.job_status == 'success' && needs.getSimilarIssues.outputs.message || '' }}"
issue: "${{ github.event.issue.number }}"
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,4 +1,4 @@
name: Publish to Winget
name: Publish to WinGet
on:
release:
@ -18,15 +18,13 @@ jobs:
$assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json
$wingetRelevantAssetx64 = $assets | Where-Object { $_.name -like '*x64.msi' } | Select-Object -First 1
$wingetRelevantAssetARM64 = $assets | Where-Object { $_.name -like '*arm64.msi' } | Select-Object -First 1
$wingetRelevantAssetMSIX = $assets | Where-Object { $_.name -like '*.msixbundle' } | Select-Object -First 1
$version = "${{ github.event.release.tag_name }}"
$wingetx64URL = $wingetRelevantAssetx64.browser_download_url
$wingetARM64URL = $wingetRelevantAssetARM64.browser_download_url
$wingetMSIXURL = $wingetRelevantAssetMSIX.browser_download_url
$wingetPackage = "Microsoft.WSL"
$wingetPackageId = "Microsoft.WSL"
& curl.exe -JLO https://aka.ms/wingetcreate/latest
& .\wingetcreate.exe update $wingetPackage -s -v $version -u "$wingetx64URL|x64" "$wingetARM64URL|arm64" "$wingetMSIXURL|x64" "$wingetMSIXURL|arm64" -t "${{ secrets.WINGET_TOKEN }}"
& .\wingetcreate.exe update $wingetPackageId -s -v $version -u "$wingetx64URL|x64" "$wingetARM64URL|arm64" -t "${{ secrets.WINGET_TOKEN }}"

68
.gitignore vendored Normal file
View File

@ -0,0 +1,68 @@
.vscode/*
.vs/
!vendor/.preserve
out
tmp
/.vs/
/.vscode/
*.sln
*.slnx
*.user
*.csproj
*.vcxproj
*.targets
*.filters
*.pdb
*.lib
*.dll
obj/
Debug/
Release/
Properties/
/_deps/
/package/Strings/en-US/
/packages/
CMakeFiles/
CMakeCache.txt
*.msix
cmake_install.cmake
build_tools/
*_i.c
*_p.c
*_p.c
wslsupport/wslsupport.h
dlldata.c
.gdbinit
llvm/
*.a
*.so
*.o
linux/init/init
linux/init
initrd/init
bin/
*.nupkg
build/
generated/
Microsoft.WSL.PluginApi.nuspec
test/linux/unit_tests/wsl_unit_tests
*.dir/
UserConfig.cmake
*.wix
*.wixobj
*.wixpdb
test.bat
AppxManifest.xml
package_layout/
priconf.xml
resources.map.txt
resources.pri
msi-install-*.txt
kernellogs.txt
FormatSource.ps1
msixinstaller/x64
package/x64
/appx-logs.txt
tools/clang-format.exe
/linux-crashes
doc/site/

413
.pipelines/build-stage.yml Normal file
View File

@ -0,0 +1,413 @@
parameters:
- name: isRelease
type: boolean
default: true
- name: packageVersion
type: string
default: ""
- name: isNightly
type: boolean
default: false
- name: nugetPackages
type: object
default:
- Microsoft.WSL.PluginApi.nuspec
- name: traceLoggingConfig
type: string
default: ''
- name: targets
type: object
default:
- target: "wsl;libwsl;wslg;wslservice;wslhost;wslrelay;wslinstaller;wslinstall;initramfs;wslserviceproxystub;wslsettings;wslinstallerproxystub;testplugin"
pattern: "wsl.exe,libwsl.dll,wslg.exe,wslservice.exe,wslhost.exe,wslrelay.exe,wslinstaller.exe,wslinstall.dll,wslserviceproxystub.dll,wslsettings.dll,wslsettings.exe,wslinstallerproxystub.dll,wsldevicehost.dll,WSLDVCPlugin.dll,testplugin.dll,wsldeps.dll"
- target: "msixgluepackage"
pattern: "gluepackage.msix"
- target: "msipackage"
pattern: "wsl.msi"
- name: platforms
type: object
default:
- x64
- arm64
- name: pool
type: string
default: ''
- name: vsoOrg
type: string
- name: vsoProject
type: string
- name: esrp
type: object
default:
ConnectedServiceName: "AzureConnection-AME"
signConfigType: "inlineSignParams"
SessionTimeout: 60
MaxConcurrency: 50
MaxRetryAttempts: 5
ServiceEndpointUrl: $(EsrpServiceEndpointUrl)
AuthAKVName: $(EsrpAuthAKVName)
AuthSignCertName: $(EsrpAuthSignCertName)
AppRegistrationClientId: $(EsrpAppRegistrationClientId)
AppRegistrationTenantId: $(EsrpAppRegistrationTenantId)
EsrpClientId: $(EsrpClientId)
stages:
- stage: build
jobs:
- job:
displayName: "Formatting & localization checks"
timeoutInMinutes: 30
variables:
ob_outputDirectory: '$(Build.SourcesDirectory)\out'
${{ if eq(parameters.pool, '') }}:
pool: {'type': 'windows'}
${{ else }}:
pool: ${{ parameters.pool }}
steps:
- script: python tools/devops/validate-localization.py localization/strings en-US
displayName: Validate localization resources
- script: python tools\devops\validate-copyright-headers.py src
displayName: Validate copyright headers (src/)
- script: python tools\devops\validate-copyright-headers.py test
displayName: Validate copyright headers (test/)
- task: CMake@1
displayName: "CMake ."
inputs:
workingDirectory: "."
cmakeArgs: .
- task: PowerShell@2
inputs:
targetType: "filePath"
filePath: FormatSource.ps1
arguments: "-ModifiedOnly $false -Verify $true"
displayName: "Clang-format check"
- job: build
displayName: "Build WSL package"
timeoutInMinutes: 120
${{ if eq(parameters.pool, '') }}:
pool: {'type': 'windows'}
${{ else }}:
pool: ${{ parameters.pool }}
variables:
NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS: 60
NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS: 60
ob_outputDirectory: '$(Build.SourcesDirectory)\out'
ob_artifactBaseName: 'drop_wsl'
ob_artifactSuffix: '_build'
ob_sdl_codeSignValidation_excludes: -|**testbin\**
Codeql.PublishDatabaseLog: true
Codeql.SourceRoot: src
steps:
- task: CodeQL3000Init@0
inputs:
Enabled: ${{ and(parameters.isNightly, eq(variables['Build.SourceBranch'], 'refs/heads/main'))}}
- task: UseDotNet@2
displayName: Install .NET Core SDK (required by EsrpCodeSigning)
condition: and(succeeded(), eq('${{ parameters.isRelease }}', true))
inputs:
packageType: "sdk"
- task: PowerShell@2
displayName: Set trace logging configuration
condition: ne('${{ parameters.traceLoggingConfig }}', '')
inputs:
targetType: 'inline'
script: 'Set-Content -Path src/windows/inc/traceloggingconfig.h -Value $env:config.replace("\n", "`n")'
env:
config: '${{ parameters.traceLoggingConfig }}'
- task: PowerShell@2
displayName: "Compute package version"
name: version
inputs:
targetType: inline
${{ if eq(parameters.packageVersion, '') }}:
script: |
$gitversion_version = (Select-Xml -Path packages.config -XPath '/packages/package[@id=''GitVersion.CommandLine'']/@version').Node.Value
$env:path = "packages/GitVersion.CommandLine.$gitversion_version/tools;$env:path"
. .\tools\devops\version_functions.ps1
$version = Get-VersionInfo -Nightly $${{ parameters.isNightly }}
Write-Host "##vso[task.setvariable variable=WSL_PACKAGE_VERSION;isOutput=true]$($version.MsixVersion)"
Write-Host "##vso[task.setvariable variable=WSL_NUGET_PACKAGE_VERSION;isOutput=true]$($version.NugetVersion)"
${{ else }}:
script: |
Write-Host "##vso[task.setvariable variable=WSL_PACKAGE_VERSION;isOutput=true]$([string]('${{ parameters.packageVersion }}' + '.0'))"
Write-Host "##vso[task.setvariable variable=WSL_NUGET_PACKAGE_VERSION;isOutput=true]$([string]('${{ parameters.packageVersion }}'))"
- ${{ each platform in parameters.platforms }}:
- task: CMake@1
displayName: "CMake ${{ platform }}"
inputs:
workingDirectory: "."
cmakeArgs: . --fresh -A ${{ platform }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION=10.0.26100.0 -DPACKAGE_VERSION=$(version.WSL_PACKAGE_VERSION) -DWSL_NUGET_PACKAGE_VERSION=$(version.WSL_NUGET_PACKAGE_VERSION) -DSKIP_PACKAGE_SIGNING=${{ parameters.isRelease }} -DOFFICIAL_BUILD=${{ parameters.isRelease }} -DPIPELINE_BUILD_ID=$(Build.BuildId) -DVSO_ORG=${{ parameters.vsoOrg }} -DVSO_PROJECT=${{ parameters.vsoProject }} -DWSL_BUILD_WSL_SETTINGS=true
# This additional Restore NuGet package task is added as a workaround for WSL Settings to have its packages restored properly.
# Without this, building wsl settings may encounter the following error:
#
# The plugin credential provider could not acquire credentials. Authentication may require manual action.
# Consider re-running the command with --interactive for `dotnet`, /p:NuGetInteractive="true" for MSBuild or removing the -NonInteractive switch for `NuGet`
# Response status code does not indicate success: 401 (Unauthorized)
- script: _deps\nuget.exe restore -NonInteractive
- ${{ each target in parameters.targets }}:
- script: cmake --build . --config Release --target ${{ target.target }} -- -m
condition: and(succeeded(), eq('${{ parameters.isRelease }}', true))
displayName: "Build ${{ target.target }} (${{ platform }})"
- ${{ if eq(parameters.isRelease, 'true') }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
displayName: "Sign ${{ target.target }} (${{ platform }})"
condition: and(succeeded(), eq('${{ parameters.isRelease }}', true))
inputs:
ConnectedServiceName: ${{ parameters.esrp.ConnectedServiceName}}
signConfigType: ${{ parameters.esrp.signConfigType }}
SessionTimeout: ${{ parameters.esrp.SessionTimeout }}
MaxConcurrency: ${{ parameters.esrp.MaxConcurrency }}
MaxRetryAttempts: ${{ parameters.esrp.MaxRetryAttempts }}
ServiceEndpointUrl: ${{ parameters.esrp.ServiceEndpointUrl }}
AuthAKVName: ${{ parameters.esrp.AuthAKVName }}
AuthSignCertName: ${{ parameters.esrp.AuthSignCertName }}
AppRegistrationClientId: ${{ parameters.esrp.AppRegistrationClientId }}
AppRegistrationTenantId: ${{ parameters.esrp.AppRegistrationTenantId }}
FolderPath: "bin\\${{ platform }}"
Pattern: "${{ target.pattern }}"
UseMSIAuthentication: true
EsrpClientId: ${{ parameters.esrp.EsrpClientId }}
inlineOperation: |
[
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters" : {
"OpusName" : "Microsoft",
"OpusInfo" : "http://www.microsoft.com",
"FileDigest" : "/fd \"SHA256\"",
"PageHash" : "/NPH",
"TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
# Replace the intermediate wslsettings binaries file with the signed versions so that any future steps building wslsettings will use the signed versions
- task: PowerShell@2
displayName: 'Replace wslsettings binaries in intermediate folder with signed versions'
condition: and(succeeded(), eq('${{ parameters.isRelease }}', true))
inputs:
targetType: inline
script: |
$arch = '${{ platform }}'
$wslsettingsbinpath = "bin\$arch\release\wslsettings"
$wslsettingsobjpath = "src\windows\wslsettings\obj\$arch\release"
# Update the timestamp of wslsettings.exe so that it doesn't get rebuilt
(Get-Item $wslsettingsbinpath\wslsettings.exe).LastWriteTime = Get-Date
Copy-Item $wslsettingsbinpath\wslsettings.dll $wslsettingsobjpath\wslsettings.dll -Force
Copy-Item $wslsettingsbinpath\wslsettings.exe $wslsettingsobjpath\apphost.exe -Force
- script: cmake --build . --config Release -- -m
displayName: "Build installer msix and tests (${{ platform }})"
- task: PowerShell@2
displayName: "Move ${{ platform }} installer msi to output directory"
inputs:
targetType: inline
script: |
New-Item -ItemType Directory -Path "$(ob_outputDirectory)\bundle" -Force
$arch = '${{ platform }}'
Copy-Item -Path "bin\$arch\release\wsl.msi" -Destination "$(ob_outputDirectory)\bundle\wsl.$(version.WSL_PACKAGE_VERSION).$arch.msi"
- ${{ if eq(parameters.isRelease, 'true') }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
displayName: "Sign the bundle"
condition: and(succeeded(), eq('${{ parameters.isRelease }}', true))
inputs:
ConnectedServiceName: ${{ parameters.esrp.ConnectedServiceName}}
signConfigType: ${{ parameters.esrp.signConfigType }}
SessionTimeout: ${{ parameters.esrp.SessionTimeout }}
MaxConcurrency: ${{ parameters.esrp.MaxConcurrency }}
MaxRetryAttempts: ${{ parameters.esrp.MaxRetryAttempts }}
ServiceEndpointUrl: ${{ parameters.esrp.ServiceEndpointUrl }}
AuthAKVName: ${{ parameters.esrp.AuthAKVName }}
AuthSignCertName: ${{ parameters.esrp.AuthSignCertName }}
AppRegistrationClientId: ${{ parameters.esrp.AppRegistrationClientId }}
AppRegistrationTenantId: ${{ parameters.esrp.AppRegistrationTenantId }}
FolderPath: "bundle"
Pattern: "*.msixbundle"
UseMSIAuthentication: true
EsrpClientId: ${{ parameters.esrp.EsrpClientId }}
inlineOperation: |
[
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters" : {
"OpusName" : "Microsoft",
"OpusInfo" : "http://www.microsoft.com",
"FileDigest" : "/fd \"SHA256\"",
"PageHash" : "/NPH",
"TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
- script: md.exe $(ob_outputDirectory)\bin\nuget
displayName: "Create the nuget directory"
- ${{ each package in parameters.nugetPackages }}:
- script: nuget.exe pack ${{ package }} -OutputDirectory $(ob_outputDirectory)\bin\nuget -NonInteractive
displayName: Build ${{ package }}
- ${{ if eq(parameters.isRelease, 'true') }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
displayName: "Sign nuget packages"
condition: and(succeeded(), eq('${{ parameters.isRelease }}', true))
inputs:
ConnectedServiceName: ${{ parameters.esrp.ConnectedServiceName}}
signConfigType: ${{ parameters.esrp.signConfigType }}
SessionTimeout: ${{ parameters.esrp.SessionTimeout }}
MaxConcurrency: ${{ parameters.esrp.MaxConcurrency }}
MaxRetryAttempts: ${{ parameters.esrp.MaxRetryAttempts }}
ServiceEndpointUrl: ${{ parameters.esrp.ServiceEndpointUrl }}
AuthAKVName: ${{ parameters.esrp.AuthAKVName }}
AuthSignCertName: ${{ parameters.esrp.AuthSignCertName }}
AppRegistrationClientId: ${{ parameters.esrp.AppRegistrationClientId }}
AppRegistrationTenantId: ${{ parameters.esrp.AppRegistrationTenantId }}
FolderPath: '$(ob_outputDirectory)\bin\nuget'
Pattern: "*.nupkg"
UseMSIAuthentication: true
EsrpClientId: ${{ parameters.esrp.EsrpClientId }}
inlineOperation: |
[
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetSign",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-401405",
"OperationCode" : "NuGetVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
- powershell: |
foreach ($arch in @("x64", "ARM64"))
{
$binFolder = ".\bin\$arch\Release"
$pdbFolder = Join-Path $(ob_outputDirectory) "pdb\$arch\Release"
mkdir $pdbFolder
foreach ($filter in @("*.pdb", "*.debug"))
{
foreach ($e in (Get-ChildItem -Recurse -Path $binFolder -Filter $filter)) {Move-Item -Path $e.fullname -Destination (Join-Path $pdbFolder $e.name)}
}
}
displayName: Collect symbols
- powershell: |
mkdir appxsym
foreach ($arch in @("x64", "ARM64"))
{
Get-ChildItem -Path $(ob_outputDirectory)\pdb\$arch\release\*.pdb -Exclude wsltests.pdb | Compress-Archive -DestinationPath appxsym/Microsoft.WSL_$(version.WSL_PACKAGE_VERSION)_$arch.zip
Copy-Item -Path appxsym/Microsoft.WSL_$(version.WSL_PACKAGE_VERSION)_$arch.zip -Destination appxsym/Microsoft.WSL_$(version.WSL_PACKAGE_VERSION)_$arch.appxsym
}
mkdir $(ob_outputDirectory)/appxupload
Get-ChildItem -Path appxsym/*.appxsym,bundle/release/Microsoft.WSL_$(version.WSL_PACKAGE_VERSION)_x64_ARM64.msixbundle | Compress-Archive -DestinationPath $(ob_outputDirectory)/appxupload/Microsoft.WSL_$(version.WSL_PACKAGE_VERSION)_x64_ARM64.zip
Move-Item -Path $(ob_outputDirectory)/appxupload/Microsoft.WSL_$(version.WSL_PACKAGE_VERSION)_x64_ARM64.zip -Destination $(ob_outputDirectory)/appxupload/Microsoft.WSL_$(version.WSL_PACKAGE_VERSION)_x64_ARM64.appxupload
rm appxsym/*.appxsym
displayName: Create appxupload
condition: and(succeeded(), eq('${{ parameters.isRelease }}', true))
- powershell: |
$taefVersion = (Select-Xml -Path packages.config -XPath '/packages/package[@id=''Microsoft.Taef'']/@version').Node.Value
New-Item -ItemType Directory -Path "$(ob_outputDirectory)\bundle" -Force
foreach ($arch in @("x64", "ARM64"))
{
mkdir $(ob_outputDirectory)\testbin\$arch\release
Move-Item -Path "bin\$arch\release\wsltests.dll" -Destination "$(ob_outputDirectory)\testbin\$arch\release\wsltests.dll"
Move-Item -Path "bin\$arch\release\testplugin.dll" -Destination "$(ob_outputDirectory)\testbin\$arch\release\testplugin.dll"
Move-Item -Path "packages\Microsoft.Taef.$taefVersion\build\Binaries\$arch" -Destination "$(ob_outputDirectory)\testbin\$arch\release\taef"
}
Move-Item -Path "bin\x64\cloudtest" -Destination "$(ob_outputDirectory)\testbin\x64\cloudtest"
Move-Item -Path "tools\test\test-setup.ps1" -Destination "$(ob_outputDirectory)\testbin\test-setup.ps1"
Move-Item -Path "tools\test\CloudTest-Setup.bat" -Destination "$(ob_outputDirectory)\testbin\CloudTest-Setup.bat"
Move-Item -Path "tools\wsl.wprp" -Destination "$(ob_outputDirectory)\testbin\wsl.wprp"
Move-Item -Path "test\linux\unit_tests" -Destination "$(ob_outputDirectory)\testbin\unit_tests"
Move-Item -Path bundle\release\* -Destination $(ob_outputDirectory)\bundle
$TestDistroVersion = (Select-Xml -Path packages.config -XPath '/packages/package[@id=''Microsoft.WSL.TestDistro'']/@version').Node.Value
Copy-Item "packages\Microsoft.WSL.TestDistro.$TestDistroVersion\test_distro.tar.xz" "$(ob_outputDirectory)\testbin\x64"
displayName: Move artifacts to drop directory
- task: PublishSymbols@2
displayName: Publish symbols
inputs:
SymbolServerType: "TeamServices"
TreatNotIndexedAsWarning: true
SymbolsProduct: WSL
SymbolsVersion: $(version.WSL_PACKAGE_VERSION)
SearchPattern: |
$(ob_outputDirectory)/pdb/**/*.pdb
$(ob_outputDirectory)/bin/**/*.exe
$(ob_outputDirectory)/bin/**/*.dll
- ${{ if ne(parameters.pool, '') }}:
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(ob_outputDirectory)
artifactName: $(ob_artifactBaseName)$(ob_artifactSuffix)
- task: CodeQL3000Finalize@0
condition: ${{ and(parameters.isNightly, eq(variables['Build.SourceBranch'], 'refs/heads/main'))}}

120
.pipelines/flight-stage.yml Normal file
View File

@ -0,0 +1,120 @@
parameters:
- name: publishPackage
type: boolean
default: false
- name: packageVersion
type: string
default: ''
- name: bypassTests
type: boolean
default: false
stages:
- stage: flight
${{ if eq(parameters.bypassTests, true) }}:
dependsOn: [build]
${{ else }}:
dependsOn: [test]
jobs:
- job: flight
displayName: 'Package and Flight WSL package'
dependsOn: [] # The stage handles this dependency
pool:
type: windows
variables:
AppId: 9P9TQF7MRM4R
FlightId: $(StoreBrokerFlightId)
StoreBrokerPath: $(Build.SourcesDirectory)\storebroker # location of StoreBroker information in the repo
StoreBrokerPayloadPath: $(Build.ArtifactStagingDirectory)\StoreBrokerPayload # location of package created for flight
WSL_PACKAGE_VERSION: $[ dependencies.build.outputs['version.WSL_PACKAGE_VERSION'] ]
ob_outputDirectory: '$(Build.SourcesDirectory)\out'
ob_artifactBaseName: 'drop_wsl'
ob_artifactSuffix: '_flight'
ob_sdl_checkcflags_enabled : false # Disable the CFLAGS check since we're not actually building anything in this stage
steps:
# Source: https://learn.microsoft.com/azure/devops/pipelines/build/run-retention?view=azure-devops&tabs=powershell
- task: PowerShell@2
condition: and(succeeded(), not(canceled()))
displayName: Retain this build
inputs:
failOnStderr: true
targetType: 'inline'
script: |
$contentType = "application/json";
$headers = @{ Authorization = 'Bearer $(System.AccessToken)' };
$rawRequest = @{ daysValid = 365 * 2; definitionId = $(System.DefinitionId); ownerId = 'User:$(Build.RequestedForId)'; protectPipeline = $false; runId = $(Build.BuildId) };
$request = ConvertTo-Json @($rawRequest);
$uri = "$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?api-version=6.0-preview.1";
Invoke-RestMethod -uri $uri -method POST -Headers $headers -ContentType $contentType -Body $request;
# Download the build drop
- task: DownloadPipelineArtifact@2
displayName: Download Bundle artifact
inputs:
artifact: "drop_wsl_build"
path: drop
# copy the appxupload folder to the storebroker folder
- powershell: |
mkdir $(StoreBrokerPath)\appxpackage\
Copy-Item -Path drop\appxupload\* -Destination $(StoreBrokerPath)\appxpackage\ -Recurse -Force
displayName: Copy AppxUpload artifact
# creates a submission package that is published to the store; containers store page information and the WSL appxupload
- task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3
displayName: 'Creating StoreBroker Payload'
inputs:
serviceEndpoint: 'AzureConnection-StoreBroker-WIF'
sbConfigPath: $(StoreBrokerPath)\sbconfig.json
sourceFolder: $(StoreBrokerPath)\appxpackage\
contents: Microsoft.WSL_${{ parameters.packageVersion }}.0_x64_ARM64.appxupload
pdpPath: $(StoreBrokerPath)\PDPs\
pdpInclude: PDP.xml
pdpMediaPath: $(StoreBrokerPath)\Media\
outSBPackagePath: $(StoreBrokerPayloadPath)
outSBName: WindowsSubsystemForLinux
# copy the storebroker submission package to the drop folder so it can be used if needed
- powershell: |
New-Item -ItemType Directory -Force -Path $(ob_outputDirectory)
Copy-Item -Path $(StoreBrokerPayloadPath)\* -Destination $(ob_outputDirectory) -Recurse -Force
Copy-Item -Path SBLog.txt -Destination $(ob_outputDirectory) -Force
displayName: Copy StoreBrokerPayload to drop
# submit the package flight to the WSL SelfHost Flight Group
- task: MS-RDX-MRO.windows-store-publish.flight-task.store-flight@3
displayName: 'Flight StoreBroker Package to Partner Center - WSL SelfHost Flight Group'
condition: and(succeeded(), eq('${{ parameters.publishPackage }}', true))
inputs:
serviceEndpoint: 'AzureConnection-StoreBroker-WIF'
appId: $(AppId)
flightId: $(FlightId)
inputMethod: JsonAndZip
jsonPath: $(StoreBrokerPayloadPath)\WindowsSubsystemForLinux.json
zipPath: $(StoreBrokerPayloadPath)\WindowsSubsystemForLinux.zip
force: true
skipPolling: true # skips polling Partner Centre/store API for the state of the package; skipping will mean that errors in the process will only show up in Partner Center
targetPublishMode: Immediate # on completion of this task, the package will be published to the WSL SelfHost flight once certified (no manual clicking of any buttons in Partner Center)
preserveSubmissionId: false
deletePackages: true
numberOfPackagesToKeep: 0
- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'wsl'
# Create a draft github release
- powershell: |
pip install --user -r tools/devops/requirements.txt
python tools/devops/create-release.py '${{ parameters.packageVersion }}' drop\bundle\Microsoft.WSL_${{ parameters.packageVersion }}.0_x64_ARM64.msixbundle drop\bundle\wsl.${{ parameters.packageVersion }}.0.arm64.msi drop\bundle\wsl.${{ parameters.packageVersion }}.0.x64.msi --no-fetch --github-token "$env:token" ${{ iif(parameters.publishPackage, '--publish --auto-release-notes', '--use-current-ref') }}
displayName: Create GitHub release
env:
token: $(GITHUB_RELEASE_TOKEN)

View File

@ -0,0 +1,48 @@
parameters:
- name: isNightly
type: boolean
default: false
- name: nugetPackages
type: object
default:
- Microsoft.WSL.PluginApi
stages:
- stage: nuget
dependsOn: [build, test]
jobs:
- job: nuget
displayName: 'Publish nuget packages'
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq('${{ parameters.isNightly }}', false)))
dependsOn: [] # The stage handles this dependency
pool:
type: windows
variables:
WSL_NUGET_PACKAGE_VERSION: $[ dependencies.build.outputs['version.WSL_NUGET_PACKAGE_VERSION'] ]
NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS: 60
NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS: 60
ob_outputDirectory: '$(Build.SourcesDirectory)\out'
ob_artifactBaseName: 'drop_wsl'
ob_artifactSuffix: '_nuget'
steps:
- task: DownloadPipelineArtifact@2
displayName: Download nuget artifacts
inputs:
artifact: "drop_wsl_build"
path: drop
# Note: this task might fail if there's been no commits between two nightly pipelines, which is fine.
- ${{ each package in parameters.nugetPackages }}:
- task: NuGetCommand@2
displayName: Push nuget/${{ package }}.$(WSL_NUGET_PACKAGE_VERSION).nupkg
inputs:
command: 'push'
packagesToPush: drop/nuget/${{ package }}.$(WSL_NUGET_PACKAGE_VERSION).nupkg
nuGetFeedType: 'internal'
publishVstsFeed: wsl
allowPackageConflicts: ${{ parameters.isNightly }}

49
.pipelines/test-job.yml Normal file
View File

@ -0,0 +1,49 @@
parameters:
- name: branch
type: string
- name: version
type: string
- name: image
type: string
- name: run
type: boolean
- name: pool
type: string
default: ''
jobs:
- job: test_${{ parameters.branch }}_${{ parameters.version }}
displayName: "${{ parameters.version }} tests - ${{ parameters.branch }}"
dependsOn: []
condition: and(succeeded(), eq('${{ parameters.run }}', true))
variables:
ob_outputDirectory: '$(Build.SourcesDirectory)\out'
ob_artifactBaseName: 'drop_wsl'
ob_artifactSuffix: '_test'
timeoutInMinutes: 360
cancelTimeoutInMinutes: 420
${{ if eq(parameters.pool, '') }}:
pool: {'type': 'cloudtestagentless'}
${{ else }}:
pool: ${{ parameters.pool }}
steps:
- task: CloudTestServerBuildTask@2
inputs:
DisplayName: "${{ parameters.version }} tests - ${{ parameters.branch }}"
connectedServiceName: "CloudTest-PROD"
cloudTestTenant: "wsl"
testMapLocation: 'testbin\x64\cloudtest\wsl-test-image-${{ parameters.image }}-${{ parameters.version}}\TestMap.xml'
pipelineArtifactName: "drop_wsl_build"
pipelineArtifactBuildUrl: '$(System.TaskDefinitionsUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)'
buildDropArtifactName: ""
timeoutInMinutes: 360
cancelTimeoutInMinutes: 420
TestTimeout: "0.05:00:00"
parserProperties: "worker:VsTestVersion=V150;session:HoldTrigger=Failure;VstsTestResultAttachmentUploadBehavior=Always"
notificationSubscribers: $(Build.RequestedForEmail)
scheduleBuildRequesterAlias: "lowdev"

42
.pipelines/test-stage.yml Normal file
View File

@ -0,0 +1,42 @@
parameters:
- name: rs_prerelease_only
type: boolean
default: false
- name: pool
type: string
default: ''
- name: versions
type: object
default:
- wsl1
- wsl2
- name: test_images
type: object
default:
- name: rs_prerelease
image: rs_prerelease-2025-01-30
- name: ni_release
image: win11-23h2-ent-2024-11-18
- name: fe_release
image: 2022-datacenter-g2-2024-09-10
- name: vb_release
image: win10-22h2-ent-g2-2024-09-10
# TODO: ge_release
stages:
- stage: test
dependsOn: [build]
jobs:
- ${{ each version in parameters.versions }}:
- ${{ each image in parameters.test_images }}:
- template: test-job.yml@self
parameters:
branch: "${{ image.name }}"
version: ${{ version }}
image: "${{ image.image }}"
run: ${{ or(not(parameters.rs_prerelease_only), eq(image.name, 'rs_prerelease')) }}
pool: "${{ parameters.pool }}"

View File

@ -0,0 +1,53 @@
trigger:
branches:
include:
- master
paths:
include:
- 'localization/strings/en-US/Resources.resw'
# Schedule nightly build
# Cron syntax: "mm HH DD MM DW" = minutes, hours, days, months, day of week (UTC time)
schedules:
# "0 8" = 8AM UTC = 12AM PST
- cron: "0 8 * * *"
displayName: Nightly Touchdown Build Schedule
branches:
include:
- "master"
always: true
pool:
vmImage: 'windows-latest'
steps:
- checkout : self
persistCredentials: true
- task: TouchdownBuildTask@5
displayName: Touchdown Build Localization
inputs:
environment: 'PRODEXT'
teamId: '38646'
authType: 'FederatedIdentity'
FederatedIdentityServiceConnection: 'Azure-Connection'
isPreview: false
resourceFilePath: |
localization\strings\en-US\Resources.resw;O:localization\strings\
storebroker\PDPs\en-us\PDP.xml;O:storebroker\PDPs\
localizationTarget: true
pseudoSetting: 'Excluded'
cultureMappingType: 'None'
- task: PipAuthenticate@1
inputs:
artifactFeeds: 'wsl'
- powershell: |
pip install --user -r tools/devops/requirements.txt
python tools/devops/create-change.py . "$env:token" "WSL localization" "Localization change from build: $env:buildId" "user/localization/$env:buildId"
displayName: Create pull request
env:
token: $(GithubPRToken)
buildId: $(Build.BuildId)

View File

@ -0,0 +1,52 @@
trigger: none
schedules:
# "0 8" = 8AM UTC = 12AM PST
- cron: "0 8 * * *"
displayName: Nightly build
branches:
include: [master]
always: true
variables:
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest"
WindowsHostVersion: '1ESWindows2022'
resources:
repositories:
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
extends:
template: v2/Microsoft.NonOfficial.yml@templates
parameters:
platform:
name: "windows_undocked"
featureFlags:
EnableCDPxPAT: false
WindowsHostVersion: 1ESWindows2022
globalSdl:
credscan:
enabled: true
perStage:
credscan:
enabled: true
tsa:
enabled: false
git:
fetchDepth: -1
fetchTags: true
stages:
- template: build-stage.yml@self
parameters:
isRelease: false
isNightly: true
vsoOrg: microsoft
vsoProject: Microsoft.WSL
- template: test-stage.yml@self
parameters:
rs_prerelease_only: false

View File

@ -0,0 +1,33 @@
trigger:
branches:
include:
- master
pool:
vmImage: 'windows-latest'
steps:
- checkout : self
persistCredentials: true
- task: ComponentGovernanceComponentDetection@0
displayName: Component Detection
- task: notice@0
displayName: Generate NOTICE file
inputs:
outputfile: $(System.DefaultWorkingDirectory)/NOTICE.txt
outputformat: text
- task: PipAuthenticate@1
inputs:
artifactFeeds: 'wsl'
- powershell: |
pip install --user -r tools/devops/requirements.txt
python tools/devops/create-change.py . "$env:token" "WSL notice" "Notice change from build: $env:buildId" "user/notice/$env:buildId"
displayName: Create pull request
env:
token: $(GithubPRToken)
buildId: $(Build.BuildId)

View File

@ -0,0 +1,52 @@
trigger:
branches:
include:
- master
- release/*
variables:
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest"
WindowsHostVersion: '1ESWindows2022'
resources:
repositories:
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
extends:
template: v2/Microsoft.NonOfficial.yml@templates
parameters:
platform:
name: "windows_undocked"
featureFlags:
EnableCDPxPAT: false
WindowsHostVersion: 1ESWindows2022
globalSdl:
suppression:
suppressionFile: $(Build.SourcesDirectory)\.gdnsuppress
suppressionSet: default
apiscan:
enabled: false
credscan:
enabled: true
perStage:
credscan:
enabled: true
policheck:
enabled: true
break: true
severity: Note
git:
fetchDepth: -1
fetchTags: true
stages:
- template: build-stage.yml@self
parameters:
isRelease: false
- template: test-stage.yml@self
parameters:
rs_prerelease_only: true

View File

@ -0,0 +1,18 @@
trigger:
branches:
include:
- master
- release/*
stages:
- template: build-stage.yml@self
parameters:
isRelease: false
pool: 'wsl-build'
vsoOrg: shine-oss
vsoProject: wsl
- template: test-stage.yml@self
parameters:
rs_prerelease_only: true
pool: server

View File

@ -0,0 +1,71 @@
parameters:
- name: bypassTests
displayName: 'Publish release even if tests fail'
type: boolean
default: false
- name: testVersion
displayName: 'Test the release pipeline'
type: string
default: ''
trigger:
tags:
include: ['*.*.*']
variables:
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest"
WindowsHostVersion: '1ESWindows2022'
resources:
repositories:
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
extends:
template: v2/Microsoft.Official.yml@templates
parameters:
platform:
name: "windows_undocked"
featureFlags:
EnableCDPxPAT: false
WindowsHostVersion: 1ESWindows2022
globalSdl:
credscan:
enabled: true
perStage:
credscan:
enabled: true
tsa:
enabled: false
evidence:
enabled: false
git:
fetchDepth: -1
fetchTags: true
stages:
- template: build-stage.yml@self
parameters:
isRelease: true
packageVersion: ${{ iif(eq(parameters.testVersion, ''), variables['Build.SourceBranchName'], parameters.testVersion) }}
traceLoggingConfig: $(ReleaseTraceLoggingConfig)
vsoOrg: microsoft
vsoProject: Microsoft.WSL
- template: test-stage.yml@self
parameters:
rs_prerelease_only: false
- template: flight-stage.yml@self
parameters:
publishPackage: ${{ iif(eq(parameters.testVersion, ''), true, false) }}
packageVersion: ${{ iif(eq(parameters.testVersion, ''), variables['Build.SourceBranchName'], parameters.testVersion) }}
bypassTests: ${{ parameters.bypassTests }}
- ${{ if eq(parameters.testVersion, '') }}:
- template: nuget-stage.yml@self
parameters:
isNightly: false

441
CMakeLists.txt Normal file
View File

@ -0,0 +1,441 @@
cmake_minimum_required(VERSION 3.25)
set(CMAKE_SYSTEM_VERSION 10.0.26100.0)
project(wsl)
# Rationalize TARGET_PLATFORM
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64" OR "${TARGET_PLATFORM}" STREQUAL "arm64")
set(TARGET_PLATFORM "arm64")
set(TEST_DISTRO_PLATFORM "arm64")
elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64|amd64|" OR "${TARGET_PLATFORM}" MATCHES "x64|amd64|")
set(TARGET_PLATFORM "x64")
set(TEST_DISTRO_PLATFORM "amd64")
else()
message(FATAL_ERROR "Unsupported platform: ${CMAKE_GENERATOR_PLATFORM}")
endif()
if (NOT ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} STREQUAL ${CMAKE_SYSTEM_VERSION})
message(FATAL_ERROR "Incorrect Windows SDK version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}, requires ${CMAKE_SYSTEM_VERSION}")
endif()
include(FetchContent)
# Import GSL and nlohmannjson
set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/_deps/${TARGET_PLATFORM})
FetchContent_Declare(GSL
URL https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz
URL_HASH SHA256=f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9)
FetchContent_MakeAvailable(GSL)
FetchContent_GetProperties(GSL SOURCE_DIR GSL_SOURCE_DIR)
FetchContent_Declare(nlohmannjson
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
URL_HASH SHA256=42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa )
FetchContent_MakeAvailable(nlohmannjson)
FetchContent_GetProperties(nlohmannjson SOURCE_DIR NLOHMAN_JSON_SOURCE_DIR)
# Import modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(IDL REQUIRED)
find_package(LINUXBUILD REQUIRED)
find_package(NUGET REQUIRED)
find_package(VERSION REQUIRED)
find_package(MC REQUIRED)
find_package(Appx REQUIRED)
# Download nuget packages
restore_nuget_packages()
# Load nuget packages versions and paths
parse_nuget_packages_versions()
find_nuget_package(Microsoft.Direct3D.Linux DIRECT3D /build/native)
find_nuget_package(Microsoft.Identity.MSAL.WSL.Proxy MSAL /build/native/bin)
find_nuget_package(Microsoft.RemoteDesktop.Client.MSRDC.SessionHost MSRDC /build/native/bin)
find_nuget_package(Microsoft.Taef TAEF /)
find_nuget_package(Microsoft.Windows.ImplementationLibrary WIL /)
find_nuget_package(Microsoft.WSL.DeviceHost WSL_DEVICE_HOST /build/native)
find_nuget_package(Microsoft.WSL.Kernel KERNEL /build/native)
find_nuget_package(Microsoft.WSL.bsdtar BSDTARD /build/native/bin)
find_nuget_package(Microsoft.WSL.LinuxSdk LINUXSDK /)
find_nuget_package(Microsoft.WSL.TestDistro TEST_DISTRO /)
find_nuget_package(Microsoft.WSLg WSLG /build/native/bin)
find_nuget_package(StrawberryPerl PERL /)
find_nuget_package(vswhere VSWHERE /tools)
find_nuget_package(Wix WIX /tools/net6.0/any)
# Architecture-specific nuget packages from the OS repo.
if (${TARGET_PLATFORM} STREQUAL "x64")
find_nuget_package(Microsoft.DXCore.Linux.amd64fre DXCORE /build/native)
find_nuget_package(Microsoft.WSL.Dependencies.amd64fre WSLDEPS /build/native)
endif()
if (${TARGET_PLATFORM} STREQUAL "arm64")
find_nuget_package(Microsoft.DXCore.Linux.arm64fre DXCORE /build/native)
find_nuget_package(Microsoft.WSL.Dependencies.arm64fre WSLDEPS /build/native)
endif()
# Wsl Settings packages
find_nuget_package(CommunityToolkit.Mvvm CTK_MVVM /)
find_nuget_package(CommunityToolkit.WinUI.Animations CTK_ANIMATIONS /)
find_nuget_package(CommunityToolkit.WinUI.Controls.SettingsControls CTK_STTNGS_CTRLS /)
find_nuget_package(Microsoft.Extensions.Hosting EXTS_HOSTING /)
find_nuget_package(Microsoft.NETCore.App.Runtime.win-${TARGET_PLATFORM} DOTNET_RUNTIME /)
find_nuget_package(Microsoft.WindowsAppSDK WIN_APP_SDK /)
find_nuget_package(Microsoft.Windows.SDK.NET.Ref WINDOWS_SDK_DOTNET /)
find_nuget_package(Microsoft.Xaml.Behaviors.WinUI.Managed XAML_BEHAVIORS /)
find_nuget_package(WinUIEx WINUIEX /)
set(BIN2CPIO ${CMAKE_CURRENT_LIST_DIR}/tools/bin2cpio/bin2cpio.pl)
set(WSLG_TS_PLUGIN_DLL "WSLDVCPlugin.dll")
# Default to debug build if unspecified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
set(SUPPORTED_LANGS cs-CZ;da-DK;de-DE;en-GB;en-US;es-ES;fi-FI;fr-FR;hu-HU;it-IT;ja-JP;ko-KR;nb-NO;nl-NL;pl-PL;pt-BR;pt-PT;ru-RU;sv-SE;tr-TR;zh-CN;zh-TW)
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/UserConfig.cmake")
find_package(USER REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR})
endif()
# Optional target configuration
if (NOT DEFINED WSL_BUILD_WSL_SETTINGS)
set(WSL_BUILD_WSL_SETTINGS false)
endif ()
# Only generate the build configuration that CMake is configured for
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}" CACHE STRING "" FORCE)
find_commit_hash(COMMIT_HASH)
if (NOT PACKAGE_VERSION)
find_version(PACKAGE_VERSION WSL_NUGET_PACKAGE_VERSION) # Fetch the package version from git if not specified
endif ()
if (NOT PACKAGE_VERSION MATCHES "^([0-9]+).([0-9]+).([0-9]+).([0-9]+)$")
message(FATAL_ERROR "PACKAGE_VERSION is invalid: '${PACKAGE_VERSION}'. Needs to match '([0-9]+).([0-9]+).([0-9]+).([0-9]+)'")
endif()
set(PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1})
set(PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2})
set(PACKAGE_VERSION_REVISION ${CMAKE_MATCH_3})
# The store requires the revision number to be 0, so enforce this on official builds
if (OFFICIAL_BUILD AND NOT PACKAGE_VERSION MATCHES "^([0-9]+).([0-9]+).([0-9]+).0$")
message(FATAL_ERROR "PACKAGE_VERSION is invalid: '${PACKAGE_VERSION}'. Needs to match '([0-9]+).([0-9]+).([0-9]+).0' for official builds")
endif()
# Configure output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${TARGET_PLATFORM})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Packaging variables
set(BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
file(MAKE_DIRECTORY ${BIN})
set (GENERATED_DIR ${CMAKE_BINARY_DIR}/generated)
file(MAKE_DIRECTORY ${GENERATED_DIR})
set(PACKAGE_CERTIFICATE ${GENERATED_DIR}/dev-cert.pfx)
file(CREATE_LINK ${WSL_DEVICE_HOST_SOURCE_DIR}/bin/${TARGET_PLATFORM}/wsldevicehost.dll ${BIN}/wsldevicehost.dll)
file(CREATE_LINK ${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/${WSLG_TS_PLUGIN_DLL} ${BIN}/${WSLG_TS_PLUGIN_DLL})
file(CREATE_LINK ${WSLDEPS_SOURCE_DIR}/bin/wsldeps.dll ${BIN}/wsldeps.dll)
if (${SKIP_PACKAGE_SIGNING})
set(PACKAGE_SIGN_COMMAND echo Skipped package signing for:)
else()
if (NOT EXISTS ${PACKAGE_CERTIFICATE})
execute_process(
COMMAND powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive ${CMAKE_CURRENT_LIST_DIR}/tools/create-dev-cert.ps1 -OutputPath ${PACKAGE_CERTIFICATE}
COMMAND_ERROR_IS_FATAL ANY)
endif()
set(PACKAGE_SIGN_COMMAND SignTool.exe sign /a /v /fd SHA256 /f ${PACKAGE_CERTIFICATE})
endif()
# Generate local test script
configure_file(${CMAKE_CURRENT_LIST_DIR}/tools/test/test.bat.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/test.bat)
# Common build flags
set(CMAKE_CXX_STANDARD 20)
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebug)
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
endif()
if (${TARGET_PLATFORM} STREQUAL "x64")
add_compile_definitions(_AMD64_)
endif()
if (${TARGET_PLATFORM} STREQUAL "arm64")
add_compile_definitions(_ARM64_)
endif()
add_definitions(/sdl) # Default-initialize class members
add_definitions(/FS) # Enable parallel PDB access
add_compile_definitions(UNICODE
WIL_SUPPRESS_PRIVATE_API_USE
CPPWINRT_SUPPRESS_STATIC_INITIALIZERS
NOMINMAX
_CRT_SECURE_NO_WARNINGS
KERNEL_VERSION="${KERNEL_VERSION}"
WSLDEPS_VERSION="${WSLDEPS_VERSION}"
WSLG_VERSION="${WSLG_VERSION}"
WSLG_TS_PLUGIN_DLL=L"${WSLG_TS_PLUGIN_DLL}"
WSL_DEVICE_HOST_VERSION="${WSL_DEVICE_HOST_VERSION}"
COMMIT_HASH="${COMMIT_HASH}"
WSL_PACKAGE_VERSION="${PACKAGE_VERSION}"
MSRDC_VERSION="${MSRDC_VERSION}"
DIRECT3D_VERSION="${DIRECT3D_VERSION}"
DXCORE_VERSION="${DXCORE_VERSION}"
WSL_PACKAGE_VERSION_MAJOR=${PACKAGE_VERSION_MAJOR}
WSL_PACKAGE_VERSION_MINOR=${PACKAGE_VERSION_MINOR}
WSL_PACKAGE_VERSION_REVISION=${PACKAGE_VERSION_REVISION}
WSL_BUILD_WSL_SETTINGS=${WSL_BUILD_WSL_SETTINGS})
if (${OFFICIAL_BUILD})
add_compile_definitions(WSL_OFFICIAL_BUILD)
endif()
if (${WSL_BUILD_THIN_PACKAGE})
add_compile_definitions(WSL_DEV_THIN_MSI_PACKAGE="${BIN}/wsl.msi")
endif ()
string(REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) # make sure /Zi is removed from the debug flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /W3 /WX /ZH:SHA_256")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7 -DDEBUG -DDBG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /guard:cf /Qspectre")
# Linker flags
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /debug:full /debugtype:cv,fixup /guard:cf /DYNAMICBASE")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /debug:full /debugtype:cv,fixup /guard:cf /DYNAMICBASE")
if (${TARGET_PLATFORM} STREQUAL "x64")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /CETCOMPAT")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /CETCOMPAT")
endif()
# Common link libraries
link_directories(${WSLDEPS_SOURCE_DIR}/lib/)
set(COMMON_LINK_LIBRARIES
ws2_32.lib
Userenv.lib
RuntimeObject.lib
Pathcch.lib
ntdll.lib
RpcRT4.lib
Mswsock.lib
Shlwapi.lib
synchronization.lib
Bcrypt.lib
Iphlpapi.lib
icu.lib
computecore.lib
computenetwork.lib
MI.lib
Wintrust.lib
msi.lib
wsldeps.lib)
# Linux
if(${TARGET_PLATFORM} STREQUAL "" OR ${TARGET_PLATFORM} STREQUAL "x64")
set(LLVM_ARCH x86_64)
elseif(${TARGET_PLATFORM} STREQUAL "arm64")
set(LLVM_ARCH aarch64)
else()
message(FATAL_ERROR "Unsupported platform: '${TARGET_PLATFORM}'")
endif()
# Determine the Visual Studio installation directory which contains LLVM tools
# N.B. The version is set to VS2022 to ensure local runs match pipeline behavior
execute_process(
COMMAND "${VSWHERE_SOURCE_DIR}/vswhere.exe" -version "[17.0,18.0)" -products * -property installationPath
OUTPUT_VARIABLE VS_INSTALL_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY
)
if (NOT VS_INSTALL_DIR)
message(FATAL_ERROR "Could not determine Visual Studio 2022 installation directory.")
endif()
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
set(LLVM_INSTALL_DIR "${VS_INSTALL_DIR}/VC/Tools/Llvm/x64/bin")
else()
set(LLVM_INSTALL_DIR "${VS_INSTALL_DIR}/VC/Tools/Llvm/${CMAKE_HOST_SYSTEM_PROCESSOR}/bin")
endif()
if (NOT EXISTS ${LLVM_INSTALL_DIR})
message(FATAL_ERROR "C++ Clang Compiler for Windows is not installed. Please install it from the Visual Studio Installer.")
endif()
# Generate the clang-format script which contains a path to clang-format.exe
configure_file(${CMAKE_CURRENT_LIST_DIR}/tools/FormatSource.ps1.in ${CMAKE_BINARY_DIR}/FormatSource.ps1)
cmake_path(COMPARE "${wsl_SOURCE_DIR}" EQUAL "${wsl_BINARY_DIR}" BUILD_IN_SOURCE)
if (NOT ${BUILD_IN_SOURCE}) # Testing on 3.26 project_type_DIR paths appear canonicalized
file(CREATE_LINK ${LLVM_INSTALL_DIR}/clang-format.exe ${wsl_SOURCE_DIR}/tools/clang-format.exe COPY_ON_ERROR)
endif()
set(LINUXSDK_PATH ${LINUXSDK_SOURCE_DIR}/${LLVM_ARCH})
set(LLVM_TARGET "${LLVM_ARCH}-unknown-linux-musl")
set(LINUX_CC ${LLVM_INSTALL_DIR}/clang.exe)
set(LINUX_CXX ${LLVM_INSTALL_DIR}/clang++.exe)
set(LINUX_AR ${LLVM_INSTALL_DIR}/llvm-ar.exe)
set(LINUX_COMMON_FLAGS --gcc-toolchain=${LINUXSDK_PATH}
-fpic
-B${LINUXSDK_PATH}
-isysroot ${LINUXSDK_PATH}
-isystem ${LINUXSDK_PATH}/include/c++/v1
-isystem ${LINUXSDK_PATH}/include
-isystem ${GSL_SOURCE_DIR}/include
-isystem "${WSLDEPS_SOURCE_DIR}/include/lxcore"
-isystem "${WSLDEPS_SOURCE_DIR}/include/schemas"
-I "${CMAKE_CURRENT_LIST_DIR}/src/linux/inc"
-I "${CMAKE_CURRENT_LIST_DIR}/src/linux/mountutil"
-I "${CMAKE_CURRENT_LIST_DIR}/src/linux/plan9"
-I "${CMAKE_CURRENT_LIST_DIR}/src/shared/configfile"
-I "${CMAKE_CURRENT_LIST_DIR}/src/shared/inc"
-I "${NLOHMAN_JSON_SOURCE_DIR}/include"
-I "${CMAKE_BINARY_DIR}/generated"
--no-standard-libraries
-Werror
-Wall
-Wpointer-arith
-D_POSIX_C_SOURCE=200809L
-Dswprintf_s=swprintf
-fms-extensions
-target ${LLVM_TARGET}
-D_GNU_SOURCE=1
-D_LARGEFILE64_SOURCE
-DWSL_PACKAGE_VERSION="${PACKAGE_VERSION}"
-DWSL_PACKAGE_VERSION_MAJOR=${PACKAGE_VERSION_MAJOR}
-DWSL_PACKAGE_VERSION_MINOR=${PACKAGE_VERSION_MINOR}
-DWSL_PACKAGE_VERSION_REVISION=${PACKAGE_VERSION_REVISION}
)
if (${TARGET_PLATFORM} STREQUAL "x64")
set(LINUX_COMMON_FLAGS ${LINUX_COMMON_FLAGS} -D_AMD64_)
endif()
if (${TARGET_PLATFORM} STREQUAL "arm64")
set(LINUX_COMMON_FLAGS ${LINUX_COMMON_FLAGS} -D_ARM64_)
endif()
set(LINUX_CXXFLAGS ${LINUX_COMMON_FLAGS} -std=c++20)
set(LINUX_CFLAGS ${LINUX_COMMON_FLAGS} -std=c99)
string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)
if (build_type STREQUAL debug)
set(LINUX_BUILD_TYPE_FLAGS -g3 -fno-inline-functions -DDEBUG -DDBG)
else()
set(LINUX_BUILD_TYPE_FLAGS -g -O2 -DNDEBUG)
endif()
set(LINUX_LDFLAGS -target ${LLVM_TARGET}
--gcc-toolchain=${LINUXSDK_PATH}
-B${LINUXSDK_PATH}
-isysroot ${LINUXSDK_PATH}
-nostartfiles
--no-standard-libraries
-fuse-ld=lld.exe
-L${LINUXSDK_PATH}/lib
-L${LINUXSDK_PATH}/lib/linux
-L${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}
-lclang_rt.builtins-${LLVM_ARCH}
-l:libc.a
-static)
set(COMMON_LINUX_LINK_LIBRARIES configfile)
if(DEFINED ENV{WSL_DEV_BINARY_PATH})
set(WSL_DEV_BINARY_PATH $ENV{WSL_DEV_BINARY_PATH})
endif()
if (DEFINED WSL_DEV_BINARY_PATH) # Development shortcut to make the package smaller
add_compile_definitions(WSL_SYSTEM_DISTRO_PATH="${WSL_DEV_BINARY_PATH}/system.vhd"
WSL_KERNEL_PATH="${WSL_DEV_BINARY_PATH}/kernel"
WSL_KERNEL_MODULES_PATH="${WSL_DEV_BINARY_PATH}/modules.vhd"
WSL_DEV_INSTALL_PATH="${WSL_DEV_BINARY_PATH}"
WSL_GPU_LIB_PATH="${WSL_DEV_BINARY_PATH}/lib")
endif()
# Common include paths
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/wil/include)
include_directories(${WSLDEPS_SOURCE_DIR}/include)
include_directories(${WSLDEPS_SOURCE_DIR}/include/Windows)
include_directories(${WSLDEPS_SOURCE_DIR}/include/schemas)
include_directories(${WSLDEPS_SOURCE_DIR}/include/lxcore)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/shared/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/windows/inc)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src/windows/service/inc/${TARGET_PLATFORM}/${CMAKE_BUILD_TYPE})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src/windows/wslinstaller/inc/${TARGET_PLATFORM}/${CMAKE_BUILD_TYPE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/linux/init/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/windows/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/shared/configfile)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/localization)
include_directories(${CMAKE_BINARY_DIR}/generated)
include_directories(${WIL_SOURCE_DIR}/include)
include_directories(${GSL_SOURCE_DIR}/include)
include_directories(${TAEF_SOURCE_DIR}/build/include)
include_directories(${NLOHMAN_JSON_SOURCE_DIR}/include)
link_directories(${TAEF_SOURCE_DIR}/build/Library/${TARGET_PLATFORM})
set(TAEF_LINK_LIBRARIES
TE.Common.lib
Wex.Common.lib
Wex.Logger.lib)
# Subprojects
add_subdirectory(nuget)
add_subdirectory(msixgluepackage)
add_subdirectory(msipackage)
add_subdirectory(msixinstaller)
add_subdirectory(src/windows/common)
add_subdirectory(src/windows/service)
add_subdirectory(src/windows/wslinstaller/inc)
add_subdirectory(src/windows/wslinstaller/stub)
add_subdirectory(src/windows/wslinstaller/exe)
add_subdirectory(src/shared/configfile)
add_subdirectory(src/windows/wsl)
add_subdirectory(src/windows/wslg)
add_subdirectory(src/windows/wslhost)
add_subdirectory(src/windows/wslrelay)
add_subdirectory(src/windows/wslinstall)
if (WSL_BUILD_WSL_SETTINGS)
add_subdirectory(src/windows/libwsl)
add_subdirectory(src/windows/wslsettings)
endif()
add_subdirectory(src/linux/netlinkutil)
add_subdirectory(src/linux/mountutil)
add_subdirectory(src/linux/plan9)
add_subdirectory(src/linux/init)
add_subdirectory(localization)
add_subdirectory(test/windows)
if (DEFINED PIPELINE_BUILD_ID)
add_subdirectory(cloudtest)
endif()
if(DEFINED ENV{WSL_POST_BUILD_COMMAND})
set(WSL_POST_BUILD_COMMAND $ENV{WSL_POST_BUILD_COMMAND})
endif ()

View File

@ -1,123 +1,44 @@
Please provide as much information as possible when reporting a bug or filing an issue on the Windows Subsystem for Linux.
# WSL contributing guide
## Important: Reporting BSODs and Security issues
There are a few main ways to contribute to WSL, with guides to each one:
1. [Add a feature or bugfix to WSL](#add-a-feature-or-bugfix-to-wsl)
2. [File a WSL issue](#file-a-wsl-issue)
## Add a feature or bugfix to WSL
We welcome any contributions to the WSL source code to add features or fix bugs! Before you start actually working on the feature, please **[file it as an issue, or a feature request in this repository](https://github.com/microsoft/WSL/issues)** so that we can track it and provide any feedback if necessary.
Once you have done so, please see [the developer docs](./doc/docs/dev-loop.md) for instructions on how to build WSL locally on your machine for development.
When your fix is ready, please [submit it as a pull request in this repository](https://github.com/microsoft/WSL/pulls) and the WSL team will triage and respond to it. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
## File a WSL issue
You can file issues for WSL at the WSL repository, or linked repositories. Before filing an issue please search for any existing issues and upvote or comment on those if possible.
1. If your issue is related to WSL documentation, please file it at [microsoftdocs/wsl](https://github.com/microsoftdocs/WSL/issues)
2. If your issue is related to a Linux GUI app, please file it at [microsoft/wslg](https://github.com/microsoft/wslg/issues)
3. Otherwise, if you have a technical issue related to WSL in general, such as start up issues, etc., please file it at [microsoft/wsl](https://github.com/microsoft/WSL/issues)
Please provide as much information as possible when reporting a bug or filing an issue on the Windows Subsystem for Linux, and be sure to include logs as necessary!
Please see the [notes for collecting WSL logs](#notes-for-collecting-wsl-logs) section below for more info on filing issues.
## Thank you
Thank you in advance for your contribution! We appreciate your help in making WSL a better tool for everyone.
## Notes for collecting WSL logs
### Important: Reporting BSODs and Security issues
**Do not open GitHub issues for Windows crashes (BSODs) or security issues.**. Instead, send Windows crashes or other security-related issues to secure@microsoft.com.
See the `10) Reporting a Windows crash (BSOD)` section below for detailed instructions.
## Reporting issues in Windows Console or WSL text rendering/user experience
### Reporting issues in Windows Console or WSL text rendering/user experience
Note that WSL distro's launch in the Windows Console (unless you have taken steps to launch a 3rd party console/terminal). Therefore, *please file UI/UX related issues in the [Windows Console issue tracker](https://github.com/microsoft/console)*.
## Reporting issues in WSL
A well written bug report will follow the following template:
### 1) Issue Title
A title succinctly describing the issue.
#### Example:
`Traceroute not working.`
### 2) Windows version / build number
Your Windows build number. This can be gathered from the CMD prompt using the `cmd.exe --version` command.
```cmd.exe
C:\ cmd.exe --version
Microsoft Windows [Version 10.0.21354.1]
```
Note: The Windows Insider builds contain many updates and fixes. If you are running on the Creators Update (10.0.15063) please check to see if your issue has been resolved in a later build. If you are running on a Version below (10.0.14393), please try to update your Version.
#### Example:
`Microsoft Windows [Version 10.0.21354.1]`
### 3) Steps required to reproduce
Should include all packages and environmental variables as well as other required configuration.
#### Example: On linux
`$ sudo apt-get install traceroute && traceroute www.microsoft.com`
#### Example: On Windows
``
`$ cmd.exe`
`CD C:\Windows\System32\`
`tracert.exe`
``
### 4) Copy of the terminal output
#### Example:
```
$ traceroute www.microsoft.com
traceroute to www.microsoft.com (23.75.239.28), 30 hops max, 60 byte packets
setsockopt IP_MTU_DISCOVER: Invalid argument
```
### 5) Expected Behavior
What was the expected result of the command? Include examples / documentation if possible.
### 6) Strace of the failing command
Run the failing command under [strace](http://manpages.ubuntu.com/manpages/wily/man1/strace.1.html). Normal command structure is:
```
$ strace -ff <command>
```
> Note: `strace` can produce lengthy output. If the generated trace is more than about 20 lines please paste this into a [Gist](https://gist.github.com/) or another paste service and link in the bug.
#### Example:
```
$ strace traceroute www.microsoft.com
execve("/usr/bin/traceroute", ["traceroute", "www.microsoft.com"], [/* 22 vars */]) = 0
brk(0) = 0x7fffdd3bc000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1f4e820000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
...
...
...
```
### 7) Additional information
Some bugs require additional information such as scripts to reproduce. Please add to this section.
If there are files required, email the files to InsiderSupport@microsoft.com with:
* **Subject**: Forward to WSL Team - RE: github issue <issue #>
* **Body**: "Please forward to WSL Team" and include your attachment.
Common files are:
* Memory dumps found under C:\Windows\MEMORY.DMP
* Additional strace logs if the error occurs within a fork. The following
command generates an output file for every fork created:
```
$ strace -ff -o <outputfile> <command>
```
#### wsl --mount
If the issue is about wsl --mount, please include the output of running `wmic diskdrive get Availability,Capabilities,CapabilityDescriptions,DeviceID,InterfaceType,MediaLoaded,MediaType,Model,Name,Partitions` in an elevated command prompt.
Example:
```
C:\WINDOWS\system32>wmic diskdrive get Availability,Capabilities,CapabilityDescriptions,DeviceID,InterfaceType,MediaLoaded,MediaType,Model,Name,Partitions
Availability Capabilities CapabilityDescriptions DeviceID InterfaceType MediaLoaded MediaType Model Name Partitions
{3, 4} {"Random Access", "Supports Writing"} \\.\PHYSICALDRIVE0 SCSI TRUE Fixed hard disk media SAMSUNG MZVLB512HAJQ-000H2 \\.\PHYSICALDRIVE0 3
{3, 4} {"Random Access", "Supports Writing"} \\.\PHYSICALDRIVE1 SCSI TRUE Fixed hard disk media SAMSUNG MZVLB1T0HALR-000H2 \\.\PHYSICALDRIVE1 1
{3, 4, 10} {"Random Access", "Supports Writing", "SMART Notification"} \\.\PHYSICALDRIVE2 SCSI TRUE Fixed hard disk media ST2000DM001-1ER164 \\.\PHYSICALDRIVE2 1
```
#### Collect WSL logs for networking issues
### Collect WSL logs for networking issues
Install tcpdump in your WSL distribution using the following commands.
Note: This will not work if WSL has Internet connectivity issues.
@ -127,7 +48,7 @@ Note: This will not work if WSL has Internet connectivity issues.
# sudo apt-get -y install tcpdump
```
Install [WPR](https://learn.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-recorder)
Install [WPR](https://learn.microsoft.com/windows-hardware/test/wpt/windows-performance-recorder)
To collect WSL networking logs, do the following steps in an administrative powershell prompt:
@ -142,11 +63,12 @@ The script will output the path of the log file once done.
<!-- Preserving anchors -->
<div id="8-detailed-logs"></div>
<div id="9-networking-logs"></div>
<div id="8-collect-wsl-logs-recommended-method"></div>
### 8) Collect WSL logs (recommended method)
### Collect WSL logs (recommended method)
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue.
If you choose to email these logs instead of attaching them to the bug, please send them to wsl-gh-logs@microsoft.com with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body.
To collect WSL logs, download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an administrative powershell prompt:
@ -157,45 +79,6 @@ Set-ExecutionPolicy Bypass -Scope Process -Force
```
The script will output the path of the log file once done.
### 9) Collect WSL logs with Feedback hub
To collect WSL logs follow these steps:
#### Open Feedback Hub and enter the title and description of your issue
- Open Feedback hub and create a new issue by pressing `Windows Key + F` on your keyboard.
- Enter in the details of your issue:
- In `Summarize your feedback` copy and paste in the title of your Github Issue
- In `Explain in more detail` copy and paste a link to your Github Issue
![GIF Of networking instructions](img/networkinglog1.gif)
#### Choose the WSL category
- Select that your issue is a `Problem`
- Choose the `Developer Platform` category and the `Windows Subsystem for Linux` subcategory
![GIF Of networking instructions](img/networkinglog2.gif)
#### Recreate your problem in the 'Additional Details' section
- Select 'Other' under 'Which of the following best describes your problem'
- Click 'Recreate My Problem' under 'Attachments
- Ensure that `Include Data About:` is checked to 'Windows Subsystem for Linux'
- 'Click Start Recording' to start collecting logs
- Recreate your problem
- Click 'Stop Recording'
![GIF Of networking instructions](img/networkinglog3.gif)
#### Check your attachments and submit
- Verify your recording is attached and whether you would like to send the screenshot that is automatically attached
- Hit Submit
- Get a link to your feedback item by clicking on 'Share my Feedback' and post that link to the Github thread so we can easily get to your feedback!
![GIF Of networking instructions](img/networkinglog4.gif)
### 10) Reporting a Windows crash (BSOD)
To collect a kernel crash dump, first run the following command in an elevated command prompt:
@ -211,14 +94,14 @@ After reboot, the kernel dump will be in `%SystemRoot%\MEMORY.DMP` (unless this
Please send this dump to: secure@microsoft.com .
Make sure that the email body contains:
- The Github issue number, if any
- That this dump is destinated to the WSL team
- The GitHub issue number, if any
- That this dump is intended for the WSL team
### 11) Reporting a WSL process crash
The easiest way to report a WSL process crash is by [collecting a user-mode crash dump](https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps).
The easiest way to report a WSL process crash is by [collecting a user-mode crash dump](https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps).
To collect dumps of all running WSL processe, please open a PowerShell prompt with admin privileges, navigate to a folder where you'd like to put your log files and run these commands:
To collect dumps of all running WSL processes, please open a PowerShell prompt with admin privileges, navigate to a folder where you'd like to put your log files and run these commands:
```
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
@ -251,9 +134,9 @@ reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Repo
To collect time travel debugging traces:
1) [Install Windbg preview](https://apps.microsoft.com/store/detail/windbg-preview/9PGJGD53TN86?hl=en-us&gl=us&rtc=1)
1) [Install WinDbg preview](https://apps.microsoft.com/store/detail/windbg-preview/9PGJGD53TN86?hl=en-us&gl=us&rtc=1)
2) Open windbg preview as administrator by running `windbgx` in an elevated command prompt
2) Open WinDbg preview as administrator by running `windbgx` in an elevated command prompt
3) Navigate to `file` -> `Attach to process`
@ -267,9 +150,9 @@ To collect time travel debugging traces:
7) Reproduce the issue
8) Go back to windbg and click `Stop and Debug`
8) Go back to WinDbg and click `Stop and Debug`
9) Once the trace is done collecting, click `Stop Debugging` and close Windbg
9) Once the trace is done collecting, click `Stop Debugging` and close WinDbg
10) Go to the folder where the trace was collected, and locate the .run file. It should look like: `wslservice*.run`

18
DATA_AND_PRIVACY.md Normal file
View File

@ -0,0 +1,18 @@
# WSL data & privacy
## Overview
WSL collects diagnostic data using Windows telemetry, just like other Windows components. You can disable this by opening Windows Settings, navigating to Privacy and Security -> Diagnostics & Feedback and disabling 'Diagnostic data'. You can also view all diagnostic data that you are sending in that menu using the 'View diagnostic data' option.
For more information please read the [Microsoft privacy statement](https://www.microsoft.com/privacy/privacystatement).
## What does WSL collect?
1. Usage
- Understanding what features and settings are most often used in WSL helps us make decisions on where to focus our time and energy.
2. Stability
- Monitoring bugs and system crashes assists us in prioritizing the most urgent issues.
3. Performance
- Assessing the performance of WSL gives us an understanding of what runtimes / components could be causing slow downs. This supports our commitment in providing you a speedy and effective WSL.
You can search for WSL telemetry events by looking for calls to `WSL_LOG_TELEMETRY` in the source code of this repository.

11
Directory.Build.Props Normal file
View File

@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<UseMultiToolTask>true</UseMultiToolTask>
<EnforceProcessCountAcrossBuilds>true</EnforceProcessCountAcrossBuilds>
</PropertyGroup>
<ItemDefinitionGroup>
<CustomBuild>
<BuildInParallel>true</BuildInParallel>
</CustomBuild>
</ItemDefinitionGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
Images/wsl.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
Images/wslbw.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

818
NOTICE.txt Normal file
View File

@ -0,0 +1,818 @@
NOTICES AND INFORMATION
Do Not Translate or Localize
This software incorporates material from third parties.
Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com,
or you may send a check or money order for US $5.00, including the product name,
the open source component name, platform, and version number, to:
Source Code Compliance Team
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052
USA
Notwithstanding any other terms, you may reverse engineer this software to the extent
required to debug changes to any libraries licensed under the GNU Lesser General Public License.
---------------------------------------------------------
llvm/llvm-project d32170dbd5b0d54436537b6b75beaf44324e0c28 - Apache-2.0 WITH LLVM-exception
(c) (tm)
(c) Value A
(c) auto AS
(c) Value Sd
(c) auto AST
(c) CXType PT
(c) Type I1Ty
(c) Value RHS
(c) X1 ... X1
(c) Type I32Ty
(c) Value Elt0
Copyright 2014
(c) Type Int8Ty
(c) Type V8x8Ty
(c) Value FMSub
(c) unsigned AS
(c) Constant One
(c) Type FloatTy
(c) Type Int16Ty
(c) Type Int32Ty
(c) Type Int64Ty
(c) Value AllocA
(c) Value Alloca
Alloc1 a1 (c) R1
Alloc1 a2 (c) R1
(c) FileID MainID
(c) Lower C Upper
(c) Stmt NumExprs
(c) Type DoubleTy
(c) Type I32PtrTy
(c) Value AllocaA
Coproc, Opc1, CRm
(c) ConstantInt C2
(c) EUR CHECK-NEXT
(c) Scale 1 Offset
(c) State UNQUOTED
(c) Type IndexType
Copyright (c) 2012
Copyright (c) 2013
Copyright (c) 2019
Exprs new (c) Stmt
(c) ExprResult NewE
(c) Metadata Ops MD
(c) SelectInst SelI
(c) SmallVector MDs
(c) TransferBatch B
(c) Type Int32PtrTy
(c) Type Int64PtrTy
(c) BasicBlock Entry
(c) CXXRecordDecl CD
(c) FunctionType FTy
(c) Offset C- Offset
Copyright 2010 INRIA
Copyright 2011 INRIA
Copyright 2012 INRIA
Copyright 2014 INRIA
Copyright 2015 INRIA
Copyright 2016 INRIA
(c) FunctionType FnTy
(c) QualType ResultTy
(c) SourceRange Range
AsmToks new (c) Token
SubExprs new (c) Stmt
(c) 2008 Red Hat, Inc.
(c) 2011 Anthony Green
(c) BasicBlock EntryBB
(c) FunctionType FFnTy
(c) FunctionType IFnTy
(c) SourceLocation Loc
Condition (c) Branches
Context (c) LineToUnit
Copyright (c) 2013 IBM
(c) ErrMsg Stream Error
(c) SmallVector NewVars
(c) SmallVector ToErase
Bbb kind copyright' Bbb
(c) Constant PosDivisorC
CommonPtr new (c) Common
Copyright (c) 2012 CHECK
(c) CharUnits AlignedSize
(c) Constant NullV2I32Ptr
(c) Constant PosDividendC
Copyright 2010-2011 INRIA
Copyright 2014-2015 INRIA
COPYRIGHT,v 1.3 2003/06/02
Coproc, Opc1, Rt, Rt2, CRm
Copyright 2003 Google Inc.
Copyright 2008 Google Inc.
Copyright 2009 Google Inc.
Copyright 2015 Google Inc.
Copyright 2018 Google Inc.
Copyright The LLVM project
coprime. APInt A HugePrime
copyrighted by the author.
(c) IdentifierInfo NumExprs
(c) VectorType Int8PtrVecTy
(c) Willem van Schaik, 1999
Copyright (c) 1997, Phillip
Copyright 2005, Google Inc.
Copyright 2006, Google Inc.
Copyright 2007, Google Inc.
Copyright 2008, Google Inc.
Copyright 2012 Google, Inc.
Copyright 2013, Google Inc.
Copyright 2015, Google Inc.
InitCache (c) TransferBatch
copyright u'2015, LLVM Team
Copyright 2006, Dean Edwards
(c) CHECK-NEXT 194 CHECK-NEXT
(c) CXXBaseSpecifier NumBases
(c) Designator NumDesignators
(c) StringLiteral NumClobbers
Constraints new (c) StringRef
Copyright (c) 2002 Bo Thorsen
Copyright (c) 2010 Apple Inc.
Copyright (c) by P.J. Plauger
Copyright 2010 Zencoder, Inc.
Copyright 2017 Roman Lebedev.
ParamInfo new (c) ParmVarDecl
Copyright (c) 2000 Software AG
Copyright (c) 2002 Roger Sayle
Copyright (c) 2008 David Daney
Copyright (c) 2009 Google Inc.
Copyright (c) 2016 Aaron Watry
Copyright (c) 2017 Google Inc.
Copyright (c) 2018 Jim Ingham.
Copyright 2009 The Go Authors.
Copyright 2010 The Go Authors.
Copyright 2011 The Go Authors.
Copyright 2012 The Go Authors.
Copyright 2013 The Go Authors.
Copyright 2014 The Go Authors.
Copyright 2015 The Go Authors.
(c) (3) educational corporation
(c) CHECK-NEXT foo() CHECK-NEXT
(copr0) ConstantDataVector CDV1
(copr1) ConstantDataVector CDV2
Copyright (c) 1994 X Consortium
Copyright (c) 2008 Matteo Frigo
Copyright (c) 2009 Matteo Frigo
Copyright (c) 2010 CodeSourcery
Copyright (c) 2011 Kyle Moffett
Copyright (c) 2011 Tilera Corp.
Copyright (c) 2011 Timothy Wall
Copyright (c) 2012 Peter Harris
Copyright (c) 2012 Tilera Corp.
Copyright 2008-2010 Apple, Inc.
Copyright 2015 Sven Verdoolaege
Copyright 2016 Sven Verdoolaege
Copyright 2017 Sven Verdoolaege
Copyright 2018 Sven Verdoolaege
Copyright, License, and Patents
Other Coprocessor Instructions.
(c) StringLiteral NumConstraints
Copyright (c) 1996 Red Hat, Inc.
Copyright (c) 2002 Ranjit Mathew
Copyright (c) 2004 Anthony Green
Copyright (c) 2004 Simon Posnjak
Copyright (c) 2008 Anthony Green
Copyright (c) 2008 Red Hat, Inc.
Copyright (c) 2011 Anthony Green
Copyright (c) 2012 Anthony Green
Copyright (c) 2014 Red Hat, Inc.
Copyright 2011 Sven Verdoolaege.
(c) foo() pragma omp target teams
Copyright (c) 1992 Henry Spencer.
Copyright (c) 2000 John Hornkvist
Copyright (c) 2001 John Hornkvist
Copyright (c) 2006 Kirill Simonov
Copyright (c) 2012 Alan Hourihane
Copyright 2001-2004 Unicode, Inc.
copyright u'2003- d, LLVM Project
copyright u'2011- d, LLVM Project
(c) CyclesSaved + LocalCyclesSaved
Copyright (c) 1999-2007 Apple Inc.
Copyright (c) 2009 The Go Authors.
Copyright (c) 2009-2019 Polly Team
Copyright (c) 2012 Thorsten Glaser
Copyright (c) 2013 Tensilica, Inc.
Copyright 2012 Universiteit Leiden
Copyright 2016-2017 Tobias Grosser
copyright u'2007- d, The LLDB Team
copyright u'2013- d, Analyzer Team
Constraint new (c) AtomicConstraint
Copyright (c) 1998 Cygnus Solutions
Copyright (c) 1998 Geoffrey Keating
Copyright (c) 2001 David E. O'Brien
Copyright (c) 2013 Mentor Graphics.
Copyright (c) 2015the LLVM Project.
Copyright 2009-2010 The Go Authors.
copyright u'2007- d, The Clang Team
copyright u'2010- d, The Polly Team
copyright u'2011-2018, LLVM Project
Copyright (C ) Microsoft Corporation
Copyright (c) 2000, 2007 Software AG
Copyright (c) 2001 Alexander Peslyak
Copyright (c) 2012, 2013 Xilinx, Inc
Copyright (c) 2014, 2015 Google Inc.
Copyright (c) 2019 The MLIR Authors.
Copyright (c) Microsoft Corporation.
Copyright 2009, 2010 The Go Authors.
Copyright 2015-2016 Sven Verdoolaege
Copyright 2016, 2017 Tobias Grosser.
Copyright 2016-2017 Sven Verdoolaege
(c) PointerType InitPtrType InitValue
Copyright (c) 1996-2003 Red Hat, Inc.
Copyright (c) 1996-2004 Red Hat, Inc.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2012-2016, Yann Collet.
Copyright 2011,2015 Sven Verdoolaege.
Copyright (c) 1996, 1998 Red Hat, Inc.
Copyright (c) 1998, 2008 Red Hat, Inc.
Copyright (c) 1999, 2008 Red Hat, Inc.
Copyright (c) 2004 Renesas Technology.
Copyright (c) 2008 Christian Haggstrom
Copyright (c) 2008, 2010 Red Hat, Inc.
Copyright (c) 2011, 2012 Anthony Green
Copyright (c) 2011, 2013 Anthony Green
Copyright (c) 2011, 2014 Anthony Green
Copyright (c) 2012, 2013 Anthony Green
Copyright (c) 2012, 2014 Anthony Green
Copyright 2007-2010 by the Sphinx team
(c) 2006 Free Software Foundation, Inc.
(c) CHECK-NEXT T break CHECK-NEXT Preds
Copyright (c) 1998, 2012 Andreas Schwab
Copyright (c) 2002-2004 Tim J. Robbins.
Copyright (c) 2005 Free Standards Group
Copyright 2005-2007 Universiteit Leiden
Copyright 2006-2007 Universiteit Leiden
Copyright 2012 Ecole Normale Superieure
Copyright 2013 Ecole Normale Superieure
Copyright 2014 Ecole Normale Superieure
Copyright 2016 Ismael Jimenez Martinez.
Portions Copyright 2009 The Go Authors.
in LLVM, Diploma Thesis, (c) April 2011
(c) StringRef NumClobbers // FIXME Avoid
Copyright (c) 1996-1998 John D. Polstra.
Copyright (c) 2002-2008, 2012 Kaz Kojima
Copyright (c) 1997-2019 Intel Corporation
Copyright (c) 2005 Axis Communications AB
Copyright (c) 2010-2015 Benjamin Peterson
Copyright 1992, 1993, 1994 Henry Spencer.
coproc_option_imm Operand let PrintMethod
(c) CXXCtorInitializer NumIvarInitializers
Copyright (c) 2000 Hewlett Packard Company
Copyright (c) 2002 Bo Thorsen <bo@suse.de>
Copyright (c) 1996-2003, 2010 Red Hat, Inc.
Copyright (c) 2004 eXtensible Systems, Inc.
Copyright (c) 2009-2014 by the contributors
Copyright (c) 2009-2015 by the contributors
Copyright (c) 2009-2016 by the contributors
Copyright (c) 2009-2019 by the contributors
Copyright (c) 2011 Free Software Foundation
Copyright (c) 2011-2014 by the contributors
Copyright (c) 2011-2019 by the contributors
Copyright (c) 2013 Imagination Technologies
Copyright (c) 2017-2019 by the contributors
(c) CHECK-NEXT Preds (1) B4 CHECK-NEXT Succs
(c) CHECK-NEXT Preds (1) B5 CHECK-NEXT Succs
(c) CHECK-NEXT Preds (1) B7 CHECK-NEXT Succs
CoprocNumAsmOperand AsmOperandClass let Name
CoprocRegAsmOperand AsmOperandClass let Name
Copyright (c) 1993 by Sun Microsystems, Inc.
Copyright (c) 1996, 1998, 2005 Red Hat, Inc.
Copyright (c) 1996, 1998, 2007 Red Hat, Inc.
Copyright (c) 1998, 2008, 2011 Red Hat, Inc.
Copyright (c) 1999, 2007, 2008 Red Hat, Inc.
Copyright (c) 2004 by Sun Microsystems, Inc.
Copyright (c) 2007, 2009, 2010 Red Hat, Inc.
Copyright (c) 2011, 2012, 2013 Anthony Green
Copyright 2012,2014 Ecole Normale Superieure
Copyright 2012-2013 Ecole Normale Superieure
Copyright 2012-2014 Ecole Normale Superieure
Copyright 2013-2014 Ecole Normale Superieure
Copyright (c) 1992, 1993, 1994 Henry Spencer.
Copyright (c) 2002-2007 Michael J. Fromberger
Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
Copyright (c) 2012, 2013 Anthony Green Target
Copyright 2000 Free Software Foundation, Inc.
Copyright 2004 Free Software Foundation, Inc.
Copyright (c) 2008 Ryan McCabe <ryan@numb.org>
(c) 2003-2004 Randolph Chung <tausq@debian.org>
CoprocOptionAsmOperand AsmOperandClass let Name
Copyright (c) 2003, 2004, 2006, 2008 Kaz Kojima
Copyright (c) 2014 Advanced Micro Devices, Inc.
Copyright (c) 2015 Advanced Micro Devices, Inc.
Copyright (c) 1994-1999 Lucent Technologies Inc.
Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
Copyright (c) 2013 Imagination Technologies Ltd.
(c) Designator NumDesigs NumDesignators NumDesigs
Copyright (c) 1992, 1993 UNIX International, Inc.
Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
Copyright (c) 2004 Free Software Foundation, Inc.
Copyright (c) 2006 Free Software Foundation, Inc.
Copyright (c) 2007 Free Software Foundation, Inc.
Copyright (c) 2008 Free Software Foundation, Inc.
Copyright (c) 2009 Free Software Foundation, Inc.
Copyright (c) 2011 Free Software Foundation, Inc.
Copyright (c) 2012 Free Software Foundation, Inc.
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
Copyright (c) 2013-2014, Pexpect development team
Copyright (c) 2013-2016, Pexpect development team
Copyright (c) 2014 Free Software Foundation, Inc.
Copyright (c) 2015 Paul Norman <penorman@mac.com>
Copyright (c) 2016 Aaron Watry <awatry@gmail.com>
Copyright extcopyright~ he year the LLVM Project.
(c) CHECK-NEXT Preds (3) B3 B4 B2 CHECK-NEXT Succs
(c) CHECK-NEXT Preds (3) B3 B5 B6 CHECK-NEXT Succs
Copyright (c) 1996, 2007, 2008, 2011 Red Hat, Inc.
Copyright (c) 1998, 2001, 2007, 2008 Red Hat, Inc.
Copyright (c) 1998, 2007, 2008, 2012 Red Hat, Inc.
Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc.
Copyright (c) 2003-2010 Python Software Foundation
Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
Copyright 1992-2018 Free Software Foundation, Inc.
Copyright 2008-2009 Katholieke Universiteit Leuven
(c) Stmt NumExprs std::copy Exprs, Exprs + NumExprs
Copyright (c) 1996, MPEG Software Simulation Group.
Copyright (c) 2003 Jakub Jelinek <jakub@redhat.com>
Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
Copyright (c) 2008 Stepan Kasal <skasal@redhat.com>
Copyright (c) 2011 Plausible Labs Cooperative, Inc.
Copyright (c) 2012 Qualcomm Innovation Center, Inc.
Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com)
Copyright (c) 2013 Synposys, Inc. (www.synopsys.com)
Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
Copyright (c) 2002, 2003, 2004, 2006, 2008 Kaz Kojima
Copyright (c) 2003, 2004, 2006, 2007, 2012 Kaz Kojima
Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
Copyright (c) 1994-2014 Free Software Foundation, Inc.
Copyright (c) 1994-2017 Free Software Foundation, Inc.
Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc.
Copyright (c) 1996-2014 Free Software Foundation, Inc.
Copyright (c) 1996-2015 Free Software Foundation, Inc.
Copyright (c) 1996-2017 Free Software Foundation, Inc.
Copyright (c) 1997-2014 Free Software Foundation, Inc.
Copyright (c) 1997-2017 Free Software Foundation, Inc.
Copyright (c) 1999-2013 Free Software Foundation, Inc.
Copyright (c) 1999-2014 Free Software Foundation, Inc.
Copyright (c) 1999-2017 Free Software Foundation, Inc.
Copyright (c) 2001-2014 Free Software Foundation, Inc.
Copyright (c) 2001-2017 Free Software Foundation, Inc.
Copyright (c) 2002-2014 Free Software Foundation, Inc.
Copyright (c) 2002-2017 Free Software Foundation, Inc.
Copyright (c) 2003-2014 Free Software Foundation, Inc.
Copyright (c) 2003-2017 Free Software Foundation, Inc.
Copyright (c) 2004-2014 Free Software Foundation, Inc.
Copyright (c) 2004-2015 Free Software Foundation, Inc.
Copyright (c) 2004-2017 Free Software Foundation, Inc.
Copyright (c) 2006-2014 Free Software Foundation, Inc.
Copyright (c) 2006-2017 Free Software Foundation, Inc.
Copyright (c) 2007, 2008 Free Software Foundation, Inc
Copyright (c) 2008 Sven Verdoolaege <skimo@kotnet.org>
Copyright (c) 2009-2014 Free Software Foundation, Inc.
Copyright (c) 2009-2017 Free Software Foundation, Inc.
Copyright (c) 2010-2015 Free Software Foundation, Inc.
Copyright (c) 2010-2017 Free Software Foundation, Inc.
Copyright (c) 2011-2013 Free Software Foundation, Inc.
Copyright (c) 2011-2014 Free Software Foundation, Inc.
Copyright (c) 2012-2014 Free Software Foundation, Inc.
Copyright (c) 2012-2015 Free Software Foundation, Inc.
Copyright (c) 2013-2014 Free Software Foundation, Inc.
Copyright (c) 2013-2015 Free Software Foundation, Inc.
Copyright (c) 2002, 2009 Free Software Foundation, Inc.
Copyright (c) 2004, 2005 Free Software Foundation, Inc.
Copyright (c) 2004, 2010 Free Software Foundation, Inc.
Copyright (c) 2006, 2008 Free Software Foundation, Inc.
Copyright (c) 2008, 2010 Free Software Foundation, Inc.
Copyright (c) 2014 Sebastian Macke <sebastian@macke.de>
Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
Copyright (c) 1996, 1997, 2003, 2004, 2008 Red Hat, Inc.
Copyright (c) 1998, 2001, 2007, 2008, 2011, 2014 Red Hat
Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
Copyright (c) 2013 Jesse Towner <jessetowner@lavabit.com>
Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
(c) Type AtExitFuncArgs VoidStar FunctionType AtExitFuncTy
copyright (c) 1991-2011, Thomas G. Lane, Guido Vollbeding.
(c) GlobalVariable Handle new GlobalVariable M, DsoHandleTy
(c) Type ArgTys Int32Ty, Int32Ty, Int32Ty FunctionType FnTy
Copyright (c) 2004 Scott James Remnant <scott@netsplit.com>
Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
Copyright (c) 2004, 2011-2015 Free Software Foundation, Inc.
Copyright (c) 2007, 2008, 2010 Free Software Foundation, Inc
Copyright (c) 2007, 2009, 2010 Free Software Foundation, Inc
Copyright (c) 2013 Victor Oliveira <victormatheus@gmail.com>
Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier
(c) DeclRefExpr DR M.makeDeclRefExpr(PV) ImplicitCastExpr ICE
(c) IdentifierInfo NumExprs std::copy Names, Names + NumExprs
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
Copyright (c) 2001, 2003, 2005 Free Software Foundation, Inc.
Copyright (c) 2002, 2003, 2009 Free Software Foundation, Inc.
Copyright (c) 2004, 2005, 2012 Free Software Foundation, Inc.
Copyright (c) 2006, 2008, 2010 Free Software Foundation, Inc.
(c) BranchInst BI BranchInst::Create(Exit, Exit, False, Entry)
Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc.
Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005 Red Hat, Inc.
Copyright (c) 1996, 1998, 2005, 2007, 2009, 2010 Red Hat, Inc.
Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
Copyright (c) 1994 The Regents of the University of California.
Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others.
Copyright (c) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Copyright (c) 1996-2001, 2003-2015 Free Software Foundation, Inc.
Copyright (c) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
Copyright (c) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
Copyright (c) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign.
Copyright (c) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Copyright (c) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
Copyright (c) 2007-2018 University of Illinois at Urbana-Champaign.
Copyright (c) 2007-2019 University of Illinois at Urbana-Champaign.
Copyright (c) 2002, 2003, 2004, 2010, Free Software Foundation, Inc.
Copyright (c) 2006-2009 Steven J. Bethard <steven.bethard@gmail.com>
Copyright (c) 1992, 1993 The Regents of the University of California.
(c) StringLiteral NumClobbers std::copy Clobbers, Clobbers + NumClobbers
Copyright (c) 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com).
Copyright (c) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
Copyright (c) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
Copyright (c) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (c) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, Inc.
Copyright (c) 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
Copyright (c) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, Inc.
Copyright (c) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (c) 1992, 1993, 1994 The Regents of the University of California.
Copyright (c) 2004-2005, 2007-2008, 2011-2015 Free Software Foundation, Inc.
Copyright (c) 2004-2005, 2007-2009, 2011-2015 Free Software Foundation, Inc.
Copyright (c) 2004-2005, 2007, 2009, 2011-2015 Free Software Foundation, Inc.
Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>
Copyright (c) 2001, 2002, 2003, 2005, 2008, 2010 Free Software Foundation, Inc.
Copyright (c) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
(c) StringLiteral NumConstraints std::copy Constraints, Constraints + NumConstraints
Copyright (c) 1996, 1997, 2000, 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
Copyright (c) 1999, 2000, 2001, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
Copyright (c) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc.
Copyright (c) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
Copyright (c) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
Copyright (c) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
Copyright (c) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
Copyright (c) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2011 Free Software Foundation, Inc.
Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
Copyright (c) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com> , Paulo Pizarro <paulo.pizarro@gmail.com>
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (c) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (c) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2014 Free Software Foundation, Inc.
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Copyright (c) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Apache-2.0 WITH LLVM-exception
---------------------------------------------------------
---------------------------------------------------------
CommunityToolkit.Mvvm 8.4.0 - MIT
Copyright (c) 2021 Sergio Pedri
Copyright (c) 2020 Michael Dietrich
Copyright (c) Microsoft Corporation
(c) .NET Foundation and Contributors
Copyright (c) 2009 - 2018 Laurent Bugnion
Copyright (c) .NET Foundation and Contributors
Copyright (c) 2017 Pedro Lamas, http://www.pedrolamas.com
# .NET Community Toolkit
Copyright © .NET Foundation and Contributors
All rights reserved.
## MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
CommunityToolkit.WinUI.Animations 8.2.250402 - MIT
(c) .NET Foundation and Contributors
Copyright (c) .NET Foundation and Contributors
# Windows Community Toolkit
Copyright © .NET Foundation and Contributors
All rights reserved.
## MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
CommunityToolkit.WinUI.Controls.SettingsControls 8.2.250402 - MIT
(c) .NET Foundation and Contributors
Copyright (c) .NET Foundation and Contributors
# Windows Community Toolkit
Copyright © .NET Foundation and Contributors
All rights reserved.
## MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
Microsoft.Extensions.Hosting 10.0.0 - MIT
Copyright (c) 2021
Copyright (c) Six Labors
(c) Microsoft Corporation
Copyright (c) 2022 FormatJS
Copyright (c) Andrew Arnott
Copyright 2019 LLVM Project
Copyright (c) 1998 Microsoft
Copyright 2018 Daniel Lemire
Copyright (c) .NET Foundation
Copyright (c) 2011, Google Inc.
Copyright (c) 2020 Dan Shechter
(c) 1997-2005 Sean Eron Anderson
Copyright (c) 2015 Andrew Gallant
Copyright (c) 2022, Wojciech Mula
Copyright (c) 2017 Yoshifumi Kawai
Copyright (c) 2022, Geoff Langdale
Copyright (c) 2005-2020 Rich Felker
Copyright (c) 2012-2021 Yann Collet
Copyright (c) Microsoft Corporation
Copyright (c) 2007 James Newton-King
Copyright (c) 1991-2024 Unicode, Inc.
Copyright (c) 2013-2017, Alfred Klomp
Copyright (c) 2018 Nemanja Mijailovic
Copyright 2012 the V8 project authors
Copyright (c) 1999 Lucent Technologies
Copyright (c) 2008-2016, Wojciech Mula
Copyright (c) 2011-2020 Microsoft Corp
Copyright (c) 2015-2017, Wojciech Mula
Copyright (c) 2015-2018, Wojciech Mula
Copyright (c) 2005-2007, Nick Galbreath
Copyright (c) 2015 The Chromium Authors
Copyright (c) 2018 Alexander Chermyanin
Copyright (c) The Internet Society 1997
Copyright (c) 2004-2006 Intel Corporation
Copyright (c) 2011-2015 Intel Corporation
Copyright (c) 2013-2017, Milosz Krajewski
Copyright (c) 2016-2017, Matthieu Darbois
Copyright (c) The Internet Society (2003)
Copyright (c) .NET Foundation Contributors
(c) 1995-2024 Jean-loup Gailly and Mark Adler
Copyright (c) 2020 Mara Bos <m-ou.se@m-ou.se>
Copyright (c) 2012 - present, Victor Zverovich
Copyright (c) 2006 Jb Evain (jbevain@gmail.com)
Copyright (c) 2008-2020 Advanced Micro Devices, Inc.
Copyright (c) 2019 Microsoft Corporation, Daan Leijen
Copyright (c) 2011 Novell, Inc (http://www.novell.com)
Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors
Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com
Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
Portions (c) International Organization for Standardization 1986
Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang) Disclaimers
Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip
Copyright (c) 1980, 1986, 1993 The Regents of the University of California
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California
Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
Microsoft.NETCore.App.Runtime.win-arm64 10.0.0 - MIT
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
Microsoft.Xaml.Behaviors.WinUI.Managed 3.0.0 - MIT
(c) Microsoft Corporation
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
microsoft/gsl 0f6dbc9e2915ef5c16830f3fa3565738de2a9230 - MIT
Copyright 2008, Google Inc.
Copyright (c) 2015 Microsoft Corporation.
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
This code is licensed under the MIT License (MIT).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
vswhere 3.1.7 - MIT
(c) 2023 GitHub, Inc.
(c) Microsoft Corporation
Copyright (c) by P.J. Plauger
Copyright (c) Microsoft Corporation
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
WinUIEx 2.9.0 - MIT
Copyright (c) Microsoft Corporation
Copyright 2021-2025 - Morten Nielsen
Copyright 2021-2025 - Morten Nielsen A
Copyright (c) 2021-2025 - Morten Nielsen
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
wix 5.0.2 - MS-RL
Copyright James Newton-King 2008
Copyright UpdateUrl DisableModify
Copyright (c) Microsoft Corporation
(c) .NET Foundation and contributors
Copyright James Newton-King 2008 Json.NET
Copyright AssemblyDescription AssemblyProduct
Copyright (c) .NET Foundation and contributors
Microsoft Reciprocal License (Ms-RL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose.
(B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
---------------------------------------------------------

View File

@ -1,73 +1,49 @@
This repo is for:
# Welcome to the Windows Subsystem for Linux (WSL) repository
- Reporting of issues found within and when using Windows Subsystem for Linux.
Please read [CONTRIBUTING.md](https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md) before making an issue submission
<p align="center">
<img src="./Images/Square44x44Logo.targetsize-256.png" alt="WSL logo"/>
</p>
> Do not open Github issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to secure@microsoft.com. Issues with security vulnerabilities may be edited to hide the vulnerability details.
[Learn more about WSL](https://aka.ms/wsldocs) | [Downloads & Release notes](https://github.com/microsoft/WSL/releases) | [Contributing to WSL](./CONTRIBUTING.md)
- Surrounding discussions about the Windows Subsystem for Linux.
## About
## Reporting issues in Windows Console or WSL text rendering/user experience
Windows Subsystem for Linux (WSL) is a powerful way for you to run your Linux command-line tools, utilities and applications, all unmodified and directly on Windows without the overhead of a traditional virtual machine or dual boot setup.
Note that WSL distro's launch in the Windows Console (unless you have taken steps to launch a 3rd party console/terminal). Therefore, *please file UI/UX related issues in the [Windows Console issue tracker](https://github.com/microsoft/console)*.
You can install WSL right away by running this command inside of your Windows command line:
## Labels:
```powershell
wsl --install
```
This is your best way to interact directly with the Windows Subsystem for Linux teams. We will be monitoring and responding to issues as best we can. Please attempt to avoid filing duplicates of open or closed items when possible. Issues may be tagged with with the following labels:
You can learn more about [best practices for setup](https://learn.microsoft.com/windows/wsl/setup/environment), [overviews of WSL](https://learn.microsoft.com/windows/wsl/about) and more at our [WSL documentation page](https://learn.microsoft.com/windows/wsl/).
- **bug** The issue considered to be a bug internally by the dev team. This tag is generally for gaps in implemented (read: intended to be working) WSL behavior. Things marked with **bug** have a corresponding bug in on Microsofts internal bug tracking system. Example: "du -h reports wrong file size on DrvFs" [(#1894)](https://github.com/microsoft/WSL/issues/1894)
## Related repositories
- **feature** Denotes something understood as not working and is not yet implemented. Example: "Cuda can not be installed" [(#327)](https://github.com/microsoft/WSL/issues/327)
WSL also has related open source repositories:
- **fixinbound** / **fixedinNNNN** The bug or feature request originally submitted has been addressed in whole or in part. Related or ongoing bug or feature gaps should be opened as a new issue submission if one does not already exist.
- [microsoft/WSL2-Linux-Kernel](https://github.com/microsoft/WSL2-Linux-Kernel) - The Linux kernel shipped with WSL
- [microsoft/WSLg](https://github.com/microsoft/wslg) - Support for Linux GUI apps in WSL
- [microsoftdocs/wsl](https://github.com/microsoftdocs/wsl) - WSL documentation at aka.ms/wsldocs
- **duplicate** The submission is substantially duplicative of an existing issue, and/or has the same underlying cause.
## Contributing
- **need-repro** The issue submission is missing fields from the issue [template](https://github.com/microsoft/WSL/tree/master/.github/ISSUE_TEMPLATE), cannot be reproduced with the information provided, or is not actionable.
This project welcomes contributions of all types, including coding features / bug fixes, documentation fixes, design proposals and more.
- **discussion** / **question** Submissions which are not a bug report or feature request. Example: Windows Subsystem for Linux is not open source [(#178)](https://github.com/Microsoft/WSL/issues/178)
We ask that before you start working on a contribution, please read our [Contributor's Guide](./CONTRIBUTING.md).
- **bydesign** / **linux-behavior** Denotes that an issue that is considered working as intended or would behave analogously on a native Linux kernel.
For guidance on developing for WSL, please read the [developer docs](./doc/docs/dev-loop.md) for instructions on how to build WSL from source and details on its architecture.
- **console** The submission should be directed to the [console issue tracker](https://github.com/microsoft/console/issues).
## Code of Conduct
- **documentation** The submission should be directed to the [WSL documentation issue tracker](https://github.com/MicrosoftDocs/WSL).
This project has adopted the [Microsoft Open Source Code of Conduct](./CODE_OF_CONDUCT.md)
- **wsl2** - The issue relates specifically to WSL 2.
## Trademarks
- **fixed-in-wsl2** - The issue could be resolved by switching the distro to use the WSL 2 architecture.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsofts Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-partys policies.
Additional tags may be used to denote specific types of issues.
## Privacy and telemetry
- **9p-linux-file-access** - The issue is related to accessing Linux files from Windows.
The application logs basic diagnostic data (telemetry). For more information on privacy and what we collect, see our [data and privacy documentation](DATA_AND_PRIVACY.md).
## Closing:
Issues may be closed by the original poster at any time. We will close issues if:
- The issue is not a bug or feature request
- The issue has been addressed
- The issue is a duplicate of another issue
- Discussions or questions that have ran their course
### Microsoft Links:
- [Microsoft Docs](https://docs.microsoft.com/en-us/windows/wsl/about)
- [Release Notes](https://docs.microsoft.com/en-us/windows/wsl/release-notes)
- [WSL Blog](https://blogs.msdn.microsoft.com/wsl) (Historical)
- [Command Line Blog](https://blogs.msdn.microsoft.com/commandline/) (Active)
### Community Links:
- Stack Overflow: https://stackoverflow.com/questions/tagged/wsl
- Ask Ubuntu: https://askubuntu.com/questions/tagged/wsl
- reddit: https://www.reddit.com/r/bashonubuntuonwindows
- List of programs that work and don't work
- https://github.com/ethanhs/WSL-Programs
- https://github.com/davatron5000/can-i-subsystem-it
- Awesome WSL: https://github.com/sirredbeard/Awesome-WSL
- Tips and guides for new bash users: https://github.com/abergs/ubuntuonwindows
- WSL Utilities (WSLU): https://github.com/wslutilities/wslu
### Troubleshooting:
Common troubleshooting issues and solutions are available on our [MSDN documentation](https://msdn.microsoft.com/en-us/commandline/wsl/troubleshooting).
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsofts privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

View File

@ -10,11 +10,11 @@ If you believe you have found a security vulnerability in any Microsoft-owned re
**Please do not report security vulnerabilities through public GitHub issues.**
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
Instead, please [report them to the Microsoft Security Response Center (MSRC)](https://aka.ms/opensource/security/create-report).
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [Microsoft Security Response Center](https://aka.ms/opensource/security/msrc).
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
@ -38,4 +38,4 @@ We prefer all communications to be in English.
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
<!-- END MICROSOFT SECURITY.MD BLOCK -->
<!-- END MICROSOFT SECURITY.MD BLOCK -->

36
UserConfig.cmake.sample Normal file
View File

@ -0,0 +1,36 @@
# Sample user configuration
message(STATUS "Loading user configuration")
# # Uncomment to enable development packages (smaller, faster to install)
# # Note: system.vhd fails to mount if symlink / hardlink, so COPY is needed.
# set(WSL_DEV_BINARY_PATH "C:/wsldev")
# file(MAKE_DIRECTORY ${WSL_DEV_BINARY_PATH})
# file(CREATE_LINK "${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/kernel" "${WSL_DEV_BINARY_PATH}/kernel" SYMBOLIC)
# file(COPY_FILE "${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/system.vhd" "${WSL_DEV_BINARY_PATH}/system.vhd" ONLY_IF_DIFFERENT)
# file(COPY_FILE "${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/modules.vhd" "${WSL_DEV_BINARY_PATH}/modules.vhd" ONLY_IF_DIFFERENT)
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/msrdc.exe" "${WSL_DEV_BINARY_PATH}/msrdc.exe" SYMBOLIC)
# file(CREATE_LINK "${WSLG_SOURCE_DIR}/wslg.rdp" "${WSL_DEV_BINARY_PATH}/wslg.rdp" SYMBOLIC)
# file(CREATE_LINK "${WSLG_SOURCE_DIR}/wslg_desktop.rdp" "${WSL_DEV_BINARY_PATH}/wslg_desktop.rdp" SYMBOLIC)
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdclientax.dll" "${WSL_DEV_BINARY_PATH}/rdclientax.dll" SYMBOLIC)
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdpnanoTransport.dll" "${WSL_DEV_BINARY_PATH}/rdpnanoTransport.dll" SYMBOLIC)
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/RdpWinStlHelper.dll" "${WSL_DEV_BINARY_PATH}/RdpWinStlHelper.dll" SYMBOLIC)
# file(CREATE_LINK "${MSAL_SOURCE_DIR}/${TARGET_PLATFORM}/msal.wsl.proxy.exe" "${WSL_DEV_BINARY_PATH}/msal.wsl.proxy.exe" SYMBOLIC)
# file(CREATE_LINK "${BIN}/wsldevicehost.dll" "${WSL_DEV_BINARY_PATH}/wsldevicehost.exe" SYMBOLIC)
# file(CREATE_LINK "${DIRECT3D_SOURCE_DIR}/lib/${TARGET_PLATFORM}" "${WSL_DEV_BINARY_PATH}/lib" SYMBOLIC)
# foreach(LANG ${SUPPORTED_LANGS})
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/${LANG}" "${WSL_DEV_BINARY_PATH}/${LANG}" SYMBOLIC)
# endforeach()
# # Uncomment to skip building, packaging and installing wslsettings
# set(WSL_BUILD_WSL_SETTINGS false)
# # Uncomment to generate a "thin" MSI package which builds and installs faster
# set(WSL_BUILD_THIN_PACKAGE true)
# # Uncomment to install the package as part of the build
# set(WSL_POST_BUILD_COMMAND "powershell;-ExecutionPolicy;Bypass;-NoProfile;-NonInteractive;./tools/deploy/deploy-to-host.ps1")
# # Uncomment to reduce the verbosity of the appx package build
# set(WSL_SILENT_APPX_BUILD true)

35
cgmanifest.json Normal file
View File

@ -0,0 +1,35 @@
{
"version": 1,
"$schema": "https://json.schemastore.org/component-detection-manifest.json",
"registrations": [
{
"component": {
"type": "git",
"git": {
"repositoryUrl": "https://github.com/microsoft/GSL",
"commitHash": "0f6dbc9e2915ef5c16830f3fa3565738de2a9230"
}
}
},
{
"component": {
"type": "git",
"git": {
"repositoryUrl": "https://github.com/llvm/llvm-project",
"commitHash": "d32170dbd5b0d54436537b6b75beaf44324e0c28"
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "libarchive",
"version": "3.7.7",
"downloadUrl": "https://github.com/libarchive/libarchive/releases/download/v3.7.7/libarchive-3.7.7.tar.gz",
"hash": "sha1:918692098b11db61aff23684ab04f375e4a68f69"
}
}
}
]
}

39
cloudtest/CMakeLists.txt Normal file
View File

@ -0,0 +1,39 @@
set(OUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cloudtest)
file(MAKE_DIRECTORY ${OUT})
if (${TARGET_PLATFORM} STREQUAL x64)
set(CLOUDTEST_IMAGES
"wsl-test-image-rs_prerelease-2025-01-30"
"wsl-test-image-win11-23h2-ent-2024-11-18"
"wsl-test-image-2022-datacenter-g2-2024-09-10"
"wsl-test-image-win10-22h2-ent-g2-2024-09-10")
set(CLOUDTEST_TEST_PACKAGES "Test_Packages_2025_07_28")
set(DUMPTOOL_DROP "DumpTool_X64_2025-01-27")
elseif (${TARGET_PLATFORM} STREQUAL arm64)
set(CLOUDTEST_IMAGES)
else()
message(FATAL_ERROR "Unsupported target platform: ${TARGET_PLATFORM}")
endif()
# Passed down to test-setup.ps1 to determine if -AllowUnsigned should be passed to Add-AppxPackage
if (OFFICIAL_BUILD)
set(ALLOW_UNSIGNED_PACKAGE "0")
else()
set(ALLOW_UNSIGNED_PACKAGE "1")
endif()
function(add_test_group image version)
set(DIR ${OUT}/${image}-wsl${version})
file(MAKE_DIRECTORY ${DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestMap.xml.in ${DIR}/TestMap.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestGroup.xml.in ${DIR}/TestGroup.xml)
endfunction()
foreach(image ${CLOUDTEST_IMAGES})
add_test_group("${image}" "1")
add_test_group("${image}" "2")
endforeach()

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<TestJobGroup EnableProcessJobObjectBreakaway="true">
<ResourceSpec>
<Resource SKU="Standard_D4_v3" Image="${image}"/>
</ResourceSpec>
<Setup TimeoutMins="30">
<BuildFiles>
<Copy Src="[drop]\bundle\Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle" Dest="[WorkingDirectory]" IsRecursive="false"/>
<Copy Src="[drop]\testbin\${TARGET_PLATFORM}\release\*" Dest="[WorkingDirectory]\" IsRecursive="true" Writable="true"/>
<Copy Src="[drop]\testbin\${TARGET_PLATFORM}\test_distro.tar.xz" Dest="[WorkingDirectory]" IsRecursive="false" Writable="true"/>
<Copy Src="[drop]\testbin\test-setup.ps1" Dest="[WorkingDirectory]\" IsRecursive="false" />
<Copy Src="[drop]\testbin\CloudTest-Setup.bat" Dest="[WorkingDirectory]\" IsRecursive="false" />
<Copy Src="[drop]\testbin\wsl.wprp" Dest="[WorkingDirectory]\" IsRecursive="false" />
<Copy Src="[drop]\testbin\unit_tests\*" Dest="[WorkingDirectory]\unit_tests" IsRecursive="true" Writable="true"/>
<Copy Src="[test_packages]\*" Dest="[WorkingDirectory]" IsRecursive="false" />
<Copy Src="[dump_tool]\DumpTool.exe" Dest="[WorkingDirectory]" IsRecursive="false" />
</BuildFiles>
<Scripts>
<Script Path="[WorkingDirectory]\CloudTest-Setup.bat" Args="[WorkingDirectory] [LoggingDirectory]" />
</Scripts>
</Setup>
<TestJob Name="CloudTest.Taef" TimeoutMins="240">
<Execution Type="TAEF" Path="[WorkingDirectory]\wsltests.dll" Args="/p:bugReportDirectory=[LoggingDirectory]\BugReportOutput /errorOnCrash /testmode:etwlogger /EtwLogger:WPRProfileFile=[WorkingDirectory]\wsl.wprp /EtwLogger:WPRProfile=WSL /EtwLogger:SavePoint=ExecutionComplete /EtwLogger:RecordingScope=Execution /p:SetupScript=.\test-setup.ps1 /p:Package=[WorkingDirectory]\Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle /p:Version=${version} /p:AllowUnsigned=${ALLOW_UNSIGNED_PACKAGE} /p:UnitTestsPath=[WorkingDirectory]\unit_tests /p:DistroPath=[WorkingDirectory]\test_distro.tar.xz /p:DistroName=test_distro /logOutput:High /p:RedirectStdout=[LoggingDirectory]\stdout.txt /p:RedirectStderr=[LoggingDirectory]\stderr.txt /p:KernelLogs=[LoggingDirectory]\dmesg.txt /p:DumpFolder=[LoggingDirectory] /p:WerReport /p:LogDmesg /p:PipelineBuildId=${PIPELINE_BUILD_ID} /p:DumpTool=DumpTool.exe" />
</TestJob>
</TestJobGroup>

34
cloudtest/TestMap.xml.in Normal file
View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<TestMap>
<TestJobGroup Name="TaefTestsGroup" TestSystem="Default" ConfigPath="[BuildRoot]\testbin\${TARGET_PLATFORM}\cloudtest\${image}-wsl${version}\TestGroup.xml" IsActive="true"/>
<Providers>
<Provider Type="PipelineArtifacts">
<Properties>
<Add Name="CloudTest.ProviderCustomName" Value="[drop]" />
<Add Name="PipelineArtifactBuildUrl" Value="https://${VSO_ORG}.visualstudio.com/${VSO_PROJECT}/_build/results?buildId=${PIPELINE_BUILD_ID}"/>
<Add Name="PipelineArtifactName" Value="drop_wsl_build"/>
</Properties>
</Provider>
<Provider Type="VSODrop">
<Properties>
<Add Name="CloudTest.ProviderCustomName" Value="[test_distro]" />
<!-- When updating the drops for this make sure the retention is set to never expire -->
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${CLOUDTEST_TEST_DISTRO_DROP}"/>
</Properties>
</Provider>
<Provider Type="VSODrop">
<Properties>
<Add Name="CloudTest.ProviderCustomName" Value="[test_packages]" />
<!-- When updating the drops for this make sure the retention is set to never expire -->
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${CLOUDTEST_TEST_PACKAGES}"/>
</Properties>
</Provider>
<Provider Type="VSODrop">
<Properties>
<Add Name="CloudTest.ProviderCustomName" Value="[dump_tool]" />
<!-- When updating the drops for this make sure the retention is set to never expire -->
<Add Name="DropURL" Value="https://${VSO_ORG}.artifacts.visualstudio.com/_apis/drop/drops/WSL/${DUMPTOOL_DROP}"/>
</Properties>
</Provider>
</Providers>
</TestMap>

67
cmake/FindIDL.cmake Normal file
View File

@ -0,0 +1,67 @@
function(add_idl target idl_files_with_proxy idl_files_no_proxy)
set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PLATFORM}/${CMAKE_BUILD_TYPE})
file(MAKE_DIRECTORY ${OUTPUT_DIR})
set(TARGET_OUTPUTS)
set(IDL_DEFINITIONS "")
get_directory_property(IDL_DEFS COMPILE_DEFINITIONS )
foreach(e ${IDL_DEFS})
set(IDL_DEFINITIONS ${IDL_DEFINITIONS} /D${e})
endforeach()
string(TOLOWER ${TARGET_PLATFORM} IDL_ENV)
foreach(idl_file ${idl_files_with_proxy})
cmake_path(GET idl_file STEM IDL_NAME)
set(IDL_HEADER ${OUTPUT_DIR}/${IDL_NAME}.h)
# Adding a _${TARGET_PLATFORM} to work around object files having
# the same paths regardless of TARGET_PLATFORM, which can cause the linker to fail with:
# "fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'ARM64'"
set(IDL_I ${OUTPUT_DIR}/${IDL_NAME}_i_${TARGET_PLATFORM}.c)
set(IDL_P ${OUTPUT_DIR}/${IDL_NAME}_p_${TARGET_PLATFORM}.c)
set(IDL_DLLDATA ${OUTPUT_DIR}/dlldata_${TARGET_PLATFORM}.c)
set(MIDL_OUTPUT ${IDL_HEADER} ${IDL_I} ${IDL_C} ${IDL_DLLDATA})
add_custom_command(
OUTPUT ${MIDL_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}
COMMAND midl /nologo /target NT100 /env "${IDL_ENV}" /Zp8 /char unsigned /ms_ext /c_ext /h ${IDL_HEADER} /iid ${IDL_I} /proxy ${IDL_P} /dlldata ${IDL_DLLDATA} ${idl_file} ${IDL_DEFINITIONS}
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}"
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS ${idl_file}
MAIN_DEPENDENCY ${idl_file}
VERBATIM
)
set_source_files_properties(${MIDL_OUTPUT} PROPERTIES GENERATED TRUE)
list(APPEND TARGET_OUTPUTS ${MIDL_OUTPUT})
endforeach()
foreach(idl_file ${idl_files_no_proxy})
cmake_path(GET idl_file STEM IDL_NAME)
set(IDL_HEADER ${OUTPUT_DIR}/${IDL_NAME}.h)
add_custom_command(
OUTPUT ${IDL_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}
COMMAND midl /nologo /target NT100 /env "${IDL_ENV}" /Zp8 /char unsigned /ms_ext /c_ext /h ${IDL_HEADER} ${idl_file} ${IDL_DEFINITIONS}
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}"
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS ${idl_file}
MAIN_DEPENDENCY ${idl_file}
VERBATIM
)
set_source_files_properties(${IDL_HEADER} PROPERTIES GENERATED TRUE)
list(APPEND TARGET_OUTPUTS ${IDL_HEADER})
endforeach()
add_custom_target(${target} DEPENDS ${TARGET_OUTPUTS} SOURCES ${idl_files_with_proxy} ${idl_files_no_proxy})
endfunction()

104
cmake/FindLINUXBUILD.cmake Normal file
View File

@ -0,0 +1,104 @@
function(build_linux_objects sources headers)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PLATFORM}/${CMAKE_BUILD_TYPE})
foreach(e ${sources})
cmake_path(GET e FILENAME object_name)
set(object "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PLATFORM}/${CMAKE_BUILD_TYPE}/${object_name}.o")
set(objects ${objects} ${object})
if("${e}" MATCHES "^.*\.c$")
set(compiler ${LINUX_CC})
set(flags ${LINUX_CFLAGS})
else()
set(compiler ${LINUX_CXX})
set(flags ${LINUX_CXXFLAGS})
endif()
add_custom_command(
OUTPUT ${object}
COMMAND ${compiler} ${flags} ${LINUX_BUILD_TYPE_FLAGS} ${e} -c -o ${object}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
MAIN_DEPENDENCY ${e}
DEPENDS ${headers} # Every object depends on all headers to trigger a rebuild if a header is changed
VERBATIM
)
endforeach()
set(objects ${objects} PARENT_SCOPE)
endfunction()
function(add_linux_library_impl target sources headers add_sources)
set(ar_output "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target}.a")
build_linux_objects("${sources}" "${headers}")
add_custom_command(
OUTPUT ${ar_output} ${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}
COMMAND ${LINUX_AR} crus ${ar_output} ${objects}
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${objects}
VERBATIM
)
if (${add_sources})
add_custom_target(${target} DEPENDS ${ar_output} SOURCES ${sources} ${headers})
else()
add_custom_target(${target} DEPENDS ${ar_output})
endif()
set_source_files_properties(${ar_output} PROPERTIES GENERATED TRUE)
endfunction()
function(add_linux_library target sources headers)
add_linux_library_impl(${target} "${sources}" "${headers}" TRUE)
endfunction()
function(add_linux_library_no_sources target sources headers)
add_linux_library_impl(${target} "${sources}" "${headers}" FALSE)
endfunction()
function(add_linux_executable target sources headers libraries)
set(output "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target}")
set(output_unstripped "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target}.unstripped")
build_linux_objects("${sources}" "${headers}")
set(libs -lunwind -lc++abi -lc++)
foreach(e ${libraries})
set(libs ${libs} -l${e})
# Note: This makes the assumption that all libraries are static (.a and not .so).
# Executables need to depend on both the target and the underlying library file, so that
# the libraries target get analyzed for changes, and the executable gets linked again if the .a files changed.
list(APPEND lib_targets "lib${e}")
list(APPEND lib_files "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${e}.a")
endforeach()
if (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(stripped_output "${output}")
set(output "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target}.debug")
add_custom_command(
OUTPUT ${stripped_output}
COMMAND ${LLVM_INSTALL_DIR}/llvm-strip.exe "${output}" -o "${stripped_output}"
COMMAND ${LLVM_INSTALL_DIR}/llvm-objcopy.exe --add-gnu-debuglink "${output}" "${stripped_output}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${output}
VERBATIM
)
endif()
add_custom_command(
OUTPUT ${output}
COMMAND ${LINUX_CXX} -o ${output} ${LINUXSDK_PATH}/lib/crti.o ${LINUXSDK_PATH}/lib/crt1.o ${objects} ${LINUXSDK_PATH}/lib/crtn.o ${LINUX_LDFLAGS} ${libs}
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${objects} ${lib_files}
VERBATIM
)
add_custom_target(${target} DEPENDS ${output} ${stripped_output} SOURCES ${sources} ${headers})
add_dependencies(${target} ${lib_targets})
endfunction()

23
cmake/FindMC.cmake Normal file
View File

@ -0,0 +1,23 @@
function(add_mc target mc_file)
cmake_path(GET mc_file STEM MC_NAME)
set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}\\${TARGET_PLATFORM}\\${CMAKE_BUILD_TYPE})
set(RC_FILE ${OUTPUT_DIR}/${MC_NAME}.rc)
set(HEADER_FILE ${OUTPUT_DIR}/${MC_NAME}.h)
add_custom_command(
OUTPUT ${RC_FILE} ${HEADER_FILE} ${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}
COMMAND mc.exe -A -b -c -h ${OUTPUT_DIR} -r ${OUTPUT_DIR} ${mc_file}
COMMAND rc.exe -nologo -fo${OUTPUT_DIR}\\${MC_NAME}.res ${RC_FILE}
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}"
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS ${mc_file}
MAIN_DEPENDENCY ${mc_file}
VERBATIM
)
add_custom_target(${target} DEPENDS ${RC_FILE} SOURCES ${mc_file})
set_source_files_properties(${RC_FILE} PROPERTIES GENERATED TRUE)
endfunction()

84
cmake/findAppx.cmake Normal file
View File

@ -0,0 +1,84 @@
function(add_appx_target target binaries manifest_in output_package dependencies)
set(PACKAGE_LAYOUT "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PLATFORM}/package_layout")
set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/AppxManifest.xml")
set(PRI_CONF "${CMAKE_CURRENT_BINARY_DIR}/priconf.xml")
set(OUTPUT_RESOURCES_PRI "${CMAKE_CURRENT_BINARY_DIR}/resources.pri")
# generate the list of languages for the appxmanifest
set(SUPPORTED_LANGS_MANIFEST_ENTRIES "")
foreach(LANG ${SUPPORTED_LANGS})
string(TOUPPER "${LANG}" LANG)
set(SUPPORTED_LANGS_MANIFEST_ENTRIES "${SUPPORTED_LANGS_MANIFEST_ENTRIES}\n <Resource Language=\"${LANG}\"/>")
endforeach()
configure_file(${manifest_in} ${MANIFEST})
file(MAKE_DIRECTORY ${PACKAGE_LAYOUT})
# images
file(MAKE_DIRECTORY ${PACKAGE_LAYOUT}/Images)
set(RESOURCES_DEPENDENCY)
file(GLOB IMAGES RELATIVE ${PROJECT_SOURCE_DIR}/ "${PROJECT_SOURCE_DIR}/images/*.png")
foreach(e ${IMAGES})
file(CREATE_LINK ${PROJECT_SOURCE_DIR}/${e} ${PACKAGE_LAYOUT}/${e} SYMBOLIC)
list(APPEND RESOURCES_DEPENDENCY ${PROJECT_SOURCE_DIR}/${e})
endforeach()
# Localization. Note: these files aren't added to the resource map, so they aren't added to the package,
# but they are used by makepri to generate resources.pri
file(CREATE_LINK ${PROJECT_SOURCE_DIR}/localization/strings ${PACKAGE_LAYOUT}/Strings SYMBOLIC)
foreach(binary ${binaries})
set(BINARY_SRC "${BIN}/${binary}")
set(BINARY_DEST "${PACKAGE_LAYOUT}/${binary}")
add_custom_command(
OUTPUT ${BINARY_DEST}
COMMAND ${CMAKE_COMMAND} -E create_symlink "${BINARY_SRC}" "${BINARY_DEST}"
DEPENDS ${BINARY_SRC}
)
list(APPEND BINARIES_DEPENDENCY ${BINARY_DEST})
endforeach()
# Reduce the output of makeappx unless WSL_APPX_DEBUG is set to make the build output nicer to read
if (WSL_SILENT_APPX_BUILD)
set(COMMAND_SUFFIX "2>NUL;>;NUL")
endif ()
# generate priconf.xml
string(REPLACE ";" "_" SUPPORTED_LANGS_STR "${SUPPORTED_LANGS}")
add_custom_command(
OUTPUT ${PRI_CONF}
COMMAND makepri.exe createconfig /cf ${PRI_CONF} /dq ${SUPPORTED_LANGS_STR} /pv 10.0 /o ${COMMAND_SUFFIX}
COMMAND_EXPAND_LISTS
)
# generate resources.pri
add_custom_command(
OUTPUT ${OUTPUT_RESOURCES_PRI} ${CMAKE_CURRENT_BINARY_DIR}/resources.map.txt
COMMAND makepri.exe new /pr ${PACKAGE_LAYOUT} /cf ${PRI_CONF} /of ${OUTPUT_RESOURCES_PRI} /mn ${MANIFEST} /mf AppX /o /IndexOptions +lf ${COMMAND_SUFFIX}
COMMAND_EXPAND_LISTS
DEPENDS ${PRI_CONF} ${MANIFEST} ${BINARIES_DEPENDENCY} ${RESOURCES_DEPENDENCY} # Make sure the package is rebuilt if any of the resources change
)
# make appx
add_custom_command(
OUTPUT ${output_package}
COMMAND makeappx.exe pack /m ${MANIFEST} /f ${CMAKE_CURRENT_BINARY_DIR}/resources.map.txt /p ${output_package} /o ${COMMAND_SUFFIX}
COMMAND ${PACKAGE_SIGN_COMMAND} ${output_package} ${COMMAND_SUFFIX}
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND_EXPAND_LISTS
DEPENDS ${MANIFEST} ${BINARIES_DEPENDENCY} ${OUTPUT_RESOURCES_PRI} ${CMAKE_CURRENT_BINARY_DIR}/resources.map.txt # Make sure the package is rebuilt if any of the binaries or resources change
)
add_custom_target(${target} DEPENDS ${output_package})
foreach(e ${dependencies})
add_dependencies(${target} ${e})
endforeach()
set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL FALSE SOURCES ${manifest_in})
set_source_files_properties(${output_package} PROPERTIES GENERATED TRUE)
endfunction()

42
cmake/findNuget.cmake Normal file
View File

@ -0,0 +1,42 @@
function(find_nuget_package name var_name path)
string(JSON "${var_name}_VERSION" GET ${NUGET_PACKAGES_JSON} "${name}")
set(${var_name}_SOURCE_DIR "${CMAKE_BINARY_DIR}/packages/${name}.${${var_name}_VERSION}${path}" PARENT_SCOPE)
set(${var_name}_VERSION "${${var_name}_VERSION}" PARENT_SCOPE)
endfunction()
function (restore_nuget_packages)
# Fetch nuget.exe
FILE(DOWNLOAD
https://dist.nuget.org/win-x86-commandline/v5.10.0/nuget.exe
${CMAKE_BINARY_DIR}/_deps/nuget.exe
EXPECTED_HASH SHA256=852b71cc8c8c2d40d09ea49d321ff56fd2397b9d6ea9f96e532530307bbbafd3)
set_property(
DIRECTORY
APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS
${CMAKE_CURRENT_LIST_DIR}/packages.config
${CMAKE_CURRENT_LIST_DIR}/nuget.config)
# Restore nuget packages
execute_process(COMMAND
${CMAKE_BINARY_DIR}/_deps/nuget.exe restore packages.config -SolutionDirectory ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMAND_ERROR_IS_FATAL ANY)
endfunction()
function (parse_nuget_packages_versions)
# Parse the list of available packages
set(CMD "$packages=@{}; (Select-Xml -path ${CMAKE_SOURCE_DIR}/packages.config /packages).Node.ChildNodes | Where-Object { $_.name -ne '#whitespace'} | % {$packages.add($_.id, $_.Attributes['version'].Value) }; $packages | ConvertTo-Json | Write-Host")
execute_process(
COMMAND powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -Command "${CMD}"
OUTPUT_VARIABLE output
COMMAND_ERROR_IS_FATAL ANY)
set(NUGET_PACKAGES_JSON ${output} PARENT_SCOPE)
endfunction()

26
cmake/findVersion.cmake Normal file
View File

@ -0,0 +1,26 @@
function(get_version_impl command var_name)
execute_process(
COMMAND powershell.exe
-NoProfile
-NonInteractive
-ExecutionPolicy Bypass
-Command "$env:Path += ';${GITVERSION_SOURCE_DIR}' ; . .\\tools\\devops\\version_functions.ps1 ; ${command}"
OUTPUT_VARIABLE OUTPUT_VERSION
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND_ERROR_IS_FATAL ANY)
string(STRIP "${OUTPUT_VERSION}" OUTPUT_VERSION)
SET(${var_name} ${OUTPUT_VERSION} PARENT_SCOPE)
endfunction()
function(find_commit_hash var_name)
get_version_impl("Get-Current-Commit-Hash" "command_output")
SET(${var_name} ${command_output} PARENT_SCOPE)
endfunction()
function(find_version msix_var_name nuget_var_name)
get_version_impl("Get-VersionInfo -Nightly $false | ConvertTo-Json" "command_output")
string(JSON "${msix_var_name}" GET "${command_output}" MsixVersion)
string(JSON "${nuget_var_name}" GET "${command_output}" NugetVersion)
return(PROPAGATE ${msix_var_name} ${nuget_var_name})
endfunction()

View File

@ -244,7 +244,7 @@ try
183 # Application 2
$Key = $null
while (($Key -Eq $null -Or $Key.VirtualKeyCode -Eq $null -Or $KeysToIgnore -Contains $Key.VirtualKeyCode) -and ($null -eq $tcpdumpProcess -or $tcpdumpProcess.HasExited -eq $false))
while ($Key -Eq $null -Or $Key.VirtualKeyCode -Eq $null -Or $KeysToIgnore -Contains $Key.VirtualKeyCode)
{
if ([console]::KeyAvailable)
{

View File

@ -21,6 +21,10 @@ if ($LogProfile -eq $null -Or ![System.IO.File]::Exists($LogProfile))
{
$url = "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/wsl_storage.wprp"
}
elseif ($LogProfile -eq "hvsocket")
{
$url = "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/wsl_hvsocket.wprp"
}
else
{
Write-Error "Unknown log profile: $LogProfile"
@ -52,6 +56,8 @@ if (Test-Path $wslconfig)
Copy-Item $wslconfig $folder | Out-Null
}
Copy-Item "C:\Windows\temp\wsl-install-log.txt" $folder -ErrorAction ignore
get-appxpackage MicrosoftCorporationII.WindowsSubsystemforLinux -ErrorAction Ignore > $folder/appxpackage.txt
get-acl "C:\ProgramData\Microsoft\Windows\WindowsApps" -ErrorAction Ignore | Format-List > $folder/acl.txt
Get-WindowsOptionalFeature -Online > $folder/optional-components.txt

View File

@ -3,35 +3,71 @@
set -ue
if [ $(whoami) != "root" ]; then
echo "This script must be run as root in the system distro (via wsl.exe -u root --system)"
echo "This script must be run as root in the debug shell (via wsl.exe -u root --debug-shell)"
exit 1
fi
ts=$(date +%F_%H-%M-%S)
target="/mnt/c/wsl-init-dump-$ts"
dmesg
mkdir -p "$target"
# Try to install gdb
tdnf install -y gdb
if [ "${dump:-0}" == 1 ]; then
tdnf install -y gdb || true
fi
bash -c "cd $target && gcore -a \$(pgrep init)"
declare -a pids_to_dump
for proc in /proc/[0-9]*; do
read -a stats < "$proc/stat" # Skip kernel threads to make the output easier to read
flags=${stats[8]}
if (( ("$flags" & 0x00200000) == 0x00200000 )); then
continue
fi
pid=$(basename "$proc")
if [ "${dump:-0}" == 1 ]; then
pids_to_dump+=("$pid")
fi
parent=$(ps -o ppid= -p "$pid")
echo -e "\nProcess: $pid (parent: $parent) "
echo -en "cmd: "
cat "/proc/$pid/cmdline" || true
echo -e "\nstat: "
cat "/proc/$pid/stat" || true
stack_log="$target/stacks.txt"
fd_log="$target/fd.txt"
for pid in $(pgrep init); do
echo -e "\nProcess: $pid" >> "$stack_log"
echo -e "\nProcess: $pid" >> "$fd_log"
for tid in $(ls "/proc/$pid/task" || true); do
echo "tid: $tid" >> "$stack_log"
cat "/proc/$pid/task/$tid/stack" >> "$stack_log" || true
echo -n "tid: $tid - "
cat "/proc/$pid/task/$tid/comm" || true
cat "/proc/$pid/task/$tid/stack" || true
done
ls -la "/proc/$pid/fd" >> "$fd_log" || true
echo "fds: "
ls -la "/proc/$pid/fd" || true
done
for pid in "${pids_to_dump[@]}" ; do
name=$(ps -p "$pid" -o comm=)
if [[ "$name" =~ ^(bash|login)$ ]]; then
echo "Skipping dump for process: $name"
continue
fi
ss -lap --vsock > "/$target/sockets.txt"
dmesg > "/$target/dmesg.txt"
cat /proc/meminfo > "/$target/meminfo.txt"
echo "Dumping process: $name ($pid) "
if gcore -a -o core "$pid" ; then
if ! /wsl-capture-crash 0 "$name" "$pid" 0 < "core.$pid" ; then
echo "Failed to dump process $pid"
fi
echo "Logs and dumps written in $target"
rm "core.$pid"
fi
done
echo "hvsockets: "
ss -lap --vsock
echo "meminfo: "
cat /proc/meminfo

View File

@ -43,6 +43,8 @@
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch" Name="08FACCFA-125D-4ED6-B0B7-B4A1A912E693" />
<EventProvider Id="EventProvider_Microsoft.Windows.EMPS.Enrollment" Name="E74EFD1A-B62D-4B83-AB00-66F4A166A2D3" />
<EventProvider Id="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment" Name="F9E3B648-9AF1-4DC3-9A8E-BF42C0FBCE9A" />
<EventProvider Id="Microsoft.Windows.HyperV.Vid" Name="1111450B-DACC-40A3-84AB-F7DBA4A6E63A" NonPagedMemory="true"/>
<EventProvider Id="Microsoft-Windows-HyperV-Vid" Name="5931D877-4860-4ee7-A95C-610A5F0D1407" NonPagedMemory="true" />
<EventProvider Id="virtdisk_wpp" Name="e14dcdd9-d1ec-4dc3-8395-a606df8ef115" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
@ -143,6 +145,8 @@
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EMPS.Enrollment"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Vid"/>
<EventProviderId Value="Microsoft-Windows-HyperV-Vid"/>
<EventProviderId Value="virtdisk"/>
<EventProviderId Value="virtdisk_wpp"/>
<EventProviderId Value="vhdmp"/>

View File

@ -0,0 +1,172 @@
<?xml version="1.0"?>
<WindowsPerformanceRecorder Version="1">
<Profiles>
<EventCollector Id="Collector" Name="Collector">
<BufferSize Value="512" />
<Buffers Value="10" PercentageOfTotalMemory="true"/>
</EventCollector>
<EventProvider Id="EventProvider_HvSocketTraceProvider" Name="B2ED3BDB-CD74-5B2C-F660-85079CA074B3" NonPagedMemory="true">
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="lxcore_kernel" Name="0CD1C309-0878-4515-83DB-749843B3F5C9"/>
<EventProvider Id="lxcore_user" Name="D90B9468-67F0-5B3B-42CC-82AC81FFD960"/>
<EventProvider Id="lxcore_service" Name="B99CDB5A-039C-5046-E672-1A0DE0A40211"/>
<EventProvider Id="wsl_devicehost" Name="9d6c7b9e-2581-4d8a-b8c5-b90b4a17094a"/>
<EventProvider Id="wslclient" Name="8cbb7724-7223-5d6f-8137-564dac45104d"/>
<EventProvider Id="wslapi" Name="beb94edf-1a7b-5058-0696-ff9e6b1798d1"/>
<EventProvider Id="vm_chipset" Name="de9ba731-7f33-4f44-98c9-6cac856b9f83"/>
<EventProvider Id="vmcompute_dll" Name="AF7FD3A7-B248-460C-A9F5-FEC39EF8468C"/>
<EventProvider Id="vmcompute" Name="17103E3F-3C6E-4677-BB17-3B267EB5BE57"/>
<EventProvider Id="vmmm" Name="6066F867-7CA1-4418-85FD-36E3F9C0600C"/>
<EventProvider Id="vmwp" Name="51DDFA29-D5C8-4803-BE4B-2ECB715570FE"/>
<EventProvider Id="9p" Name="e13c8d52-b153-571f-78c5-1d4098af2a1e"/>
<EventProvider Id="9p_errors" Name="06C601B3-6957-4F8C-A15F-74875B24429D" />
<EventProvider Id="p9rdr" Name="bb1d36f0-e0e0-48cc-9493-fef0e3d0b28c" />
<EventProvider Id="mup" Name="20c46239-d059-4214-a11e-7d6769cbe020" />
<EventProvider Id="rfsmon" Name="51734B23-5B7E-4892-BA8E-45BC110B735C" />
<EventProvider Id="hyperv_storage" Name="c7ad62c6-5c99-5a1b-bbc4-0821ae5b765e" />
<EventProvider Id="hns" Name="0c885e0d-6eb6-476c-a048-2457eed3a5c1" />
<EventProvider Id="netmgmt" Name="93f693dc-9163-4dee-af64-d855218af242" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.AppDownload" Name="0BBE6221-EF09-4A3F-82EE-BE00DBB6A98A" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.Datastore" Name="42C60CEA-0FE7-4541-A86B-9E11F95BD9BF" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.PhoneProvisioner" Name="B876B1FC-C7F1-443E-9012-86677F7DE580" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.PPOEM" Name="7EDBED09-1FF7-4FEE-B8C3-5DB694420830" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.API" Name="82ADD491-01D7-4B85-9EAD-192C3CAACA23" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CSP" Name="16E12400-A2D8-44B7-9479-004568EC7819" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Engine" Name="A6A847B7-4429-49AA-BBA6-2AD8C191AC8C" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Handlers" Name="0383D92C-2337-4F25-A0B5-A51767F04746" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Migration" Name="A0AF985E-83F9-4E1A-B658-338DCFE27893" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Operations" Name="7F99598F-B2C1-4371-9911-63DEE13B9EB1" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Platform" Name="B1F30020-8BC3-4888-BB1B-4DD681F24209" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Plugin.Engine" Name="55239D60-0EB6-495B-874E-15DE5D5F9A70" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Plugin.RemovableMedia" Name="B55883E6-6C45-45C2-AB9D-800BB7B66B13" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvTool" Name="2BF4B6BA-556E-4D05-8534-CAFEDF19FED8" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CommandCsp" Name="00BB69FC-60BC-4502-9438-25608F375CCB" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch" Name="08FACCFA-125D-4ED6-B0B7-B4A1A912E693" />
<EventProvider Id="EventProvider_Microsoft.Windows.EMPS.Enrollment" Name="E74EFD1A-B62D-4B83-AB00-66F4A166A2D3" />
<EventProvider Id="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment" Name="F9E3B648-9AF1-4DC3-9A8E-BF42C0FBCE9A" />
<EventProvider Id="Microsoft.Windows.HyperV.Vid" Name="1111450B-DACC-40A3-84AB-F7DBA4A6E63A" NonPagedMemory="true"/>
<EventProvider Id="Microsoft-Windows-HyperV-Vid" Name="5931D877-4860-4ee7-A95C-610A5F0D1407" NonPagedMemory="true" />
<EventProvider Id="virtdisk_wpp" Name="e14dcdd9-d1ec-4dc3-8395-a606df8ef115" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="virtdisk" Name="4D20DF22-E177-4514-A369-F1759FEEDEB3" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp" Name="E2816346-87F4-4F85-95C3-0C79409AA89D" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFD" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp_wpp" Name="3c70c3b0-2fae-41d3-b68d-8f7fcaf79adb" NonPagedMemory="true" Level="5">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="storvsp" Name="10b3d268-9782-49a4-aacc-a93c5482cb6f" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="HyperV_SyntheticStorage" Name="EDACD782-2564-4497-ADE6-7199377850F2" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="HyperV_EmulatedStorage" Name="86E15E01-EDF1-4AC7-89CF-B19563FD6894" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Telemetry_StorVSP" Name="544d0787-9f6d-432e-8414-e035a8b0541d">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Trace_Vhdmp" Name="dc284fb3-1eab-4854-828a-b25417280280" Level="3">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<Profile
Id="WSL.Verbose.File"
Name="WSL"
Description="Traces for all WSL components"
LoggingMode="File"
DetailLevel="Verbose"
>
<Collectors>
<EventCollectorId Value="Collector">
<EventProviders>
<EventProviderId Value="lxcore_kernel"/>
<EventProviderId Value="lxcore_user"/>
<EventProviderId Value="lxcore_service"/>
<EventProviderId Value="wsl_devicehost"/>
<EventProviderId Value="wslclient"/>
<EventProviderId Value="wslapi"/>
<EventProviderId Value="vm_chipset"/>
<EventProviderId Value="vmcompute_dll"/>
<EventProviderId Value="vmcompute"/>
<EventProviderId Value="vmmm"/>
<EventProviderId Value="vmwp"/>
<EventProviderId Value="9p"/>
<EventProviderId Value="9p_errors"/>
<EventProviderId Value="p9rdr"/>
<EventProviderId Value="mup"/>
<EventProviderId Value="rfsmon"/>
<EventProviderId Value="hyperv_storage"/>
<EventProviderId Value="hns"/>
<EventProviderId Value="netmgmt"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.AppDownload"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.Datastore"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.PhoneProvisioner"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.PPOEM"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CSP"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Engine"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Migration"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Platform"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Operations"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Plugin.Engine"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Plugin.RemovableMedia"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvTool"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Operations"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CommandCsp"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EMPS.Enrollment"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Vid"/>
<EventProviderId Value="Microsoft-Windows-HyperV-Vid"/>
<EventProviderId Value="virtdisk"/>
<EventProviderId Value="virtdisk_wpp"/>
<EventProviderId Value="vhdmp"/>
<EventProviderId Value="vhdmp_wpp"/>
<EventProviderId Value="storvsp"/>
<EventProviderId Value="HyperV_SyntheticStorage"/>
<EventProviderId Value="HyperV_EmulatedStorage"/>
<EventProviderId Value="EventProvider_Telemetry_StorVSP"/>
<EventProviderId Value="EventProvider_Trace_Vhdmp"/>
<EventProviderId Value="EventProvider_HvSocketTraceProvider" />
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
</Profiles>
</WindowsPerformanceRecorder>

View File

@ -6,12 +6,12 @@
"FriendlyName": "Ubuntu",
"Default": true,
"Amd64Url": {
"Url": "https://releases.ubuntu.com/noble/ubuntu-24.04.2-wsl-amd64.wsl",
"Sha256": "5d1eea52103166f1c460dc012ed325c6eb31d2ce16ef6a00ffdfda8e99e12f43"
"Url": "https://releases.ubuntu.com/24.04.3/ubuntu-24.04.3-wsl-amd64.wsl",
"Sha256": "c74833a55e525b1e99e1541509c566bb3e32bdb53bf27ea3347174364a57f47c"
},
"Arm64Url": {
"Url": "https://cdimages.ubuntu.com/releases/24.04.2/release/ubuntu-24.04.2-wsl-arm64.wsl",
"Sha256": "75e6660229fabb38a6fdc1c94eec7d834a565fa58a64b7534e540da5319b2576"
"Url": "https://cdimages.ubuntu.com/releases/24.04.3/release/ubuntu-24.04.3-wsl-arm64.wsl",
"Sha256": "edaf375ea0d1319da08e7154e9bc64cd4eead5af21ea032f2edaa335fadf0970"
}
},
{
@ -19,12 +19,12 @@
"FriendlyName": "Ubuntu 24.04 LTS",
"Default": false,
"Amd64Url": {
"Url": "https://releases.ubuntu.com/noble/ubuntu-24.04.2-wsl-amd64.wsl",
"Sha256": "5d1eea52103166f1c460dc012ed325c6eb31d2ce16ef6a00ffdfda8e99e12f43"
"Url": "https://releases.ubuntu.com/24.04.3/ubuntu-24.04.3-wsl-amd64.wsl",
"Sha256": "c74833a55e525b1e99e1541509c566bb3e32bdb53bf27ea3347174364a57f47c"
},
"Arm64Url": {
"Url": "https://cdimages.ubuntu.com/releases/24.04.2/release/ubuntu-24.04.2-wsl-arm64.wsl",
"Sha256": "75e6660229fabb38a6fdc1c94eec7d834a565fa58a64b7534e540da5319b2576"
"Url": "https://cdimages.ubuntu.com/releases/24.04.3/release/ubuntu-24.04.3-wsl-arm64.wsl",
"Sha256": "edaf375ea0d1319da08e7154e9bc64cd4eead5af21ea032f2edaa335fadf0970"
}
}
],
@ -34,37 +34,45 @@
"FriendlyName": "openSUSE Tumbleweed",
"Default": true,
"Amd64Url": {
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250110.0/openSUSE-Tumbleweed-20250108.x86_64-7.31-Build7.31.tar.xz",
"Sha256": "0x8c89f858145e2ff778eb061817d91d31ee5bee3b2797af7e4000d236553872b0"
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250923.0/openSUSE-Tumbleweed-20250922.x86_64-22.59-Build22.59.wsl",
"Sha256": "0x31124e3645d88b079469a57062af795b04922d3baacfb70c6dad2524c2bfc8c0"
},
"Arm64Url": {
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250923.0/openSUSE-Tumbleweed-20250922.aarch64-22.124-Build22.124.wsl",
"Sha256": "0x0202195a7e03bb45e7ff95e9929b977db899ce85ccaa1195bdab4a74783e9bf7"
}
},
{
"Name": "openSUSE-Leap-15.6",
"FriendlyName": "openSUSE Leap 15.6",
"Name": "openSUSE-Leap-16.0",
"FriendlyName": "openSUSE Leap 16.0",
"Default": false,
"Amd64Url": {
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250110.0/openSUSE-Leap-15.6-15.6.x86_64-7.19-Build7.19.tar.xz",
"Sha256": "0x81d1abf44ab438e5333ff7da09baa101a7c9b64873bb37cfeaf5bf5f0cbed57a"
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20251001.0/openSUSE-Leap-16.0-16.0.x86_64-22.57-Build22.57.wsl",
"Sha256": "0x0d1faa095153beee0a9b5089b0f9aa3d2aec95e2cdcffdeeff84dd54c48b8393"
},
"Arm64Url": {
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20251001.0/openSUSE-Leap-16.0-16.0.aarch64-22.57-Build22.57.wsl",
"Sha256": "0x91bcdc7e9f42d7a60a4464ad867d91243aaaecab7b3a057039f77a989daac51e"
}
}
],
"SUSE": [
{
"Name": "SUSE-Linux-Enterprise-15-SP5",
"FriendlyName": "SUSE Linux Enterprise 15 SP5",
"Name": "SUSE-Linux-Enterprise-15-SP7",
"FriendlyName": "SUSE Linux Enterprise 15 SP7",
"Default": false,
"Amd64Url": {
"Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20250123.0/SUSE-Linux-Enterprise-15-SP5-15.5.x86_64-11.1-Build11.1.wsl",
"Sha256": "0x64ae138a1cdaff5fdc578d8ea92176d2939146932ca7ce2bff685d974ec34932"
"Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20251201.0/SUSE-Linux-Enterprise-15-SP7-15.7.x86_64-30.1-Build30.1.wsl",
"Sha256": "0x60924e13286ed15bdcf9069e3a24d3394fb858954de3bdfcb1ea576900b81b2e"
}
},
{
"Name": "SUSE-Linux-Enterprise-15-SP6",
"FriendlyName": "SUSE Linux Enterprise 15 SP6",
"Name": "SUSE-Linux-Enterprise-16.0",
"FriendlyName": "SUSE Linux Enterprise 16.0",
"Default": true,
"Amd64Url": {
"Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20250123.0/SUSE-Linux-Enterprise-15-SP6-15.6.x86_64-11.1-Build11.1.wsl",
"Sha256": "0x8edc5a47003d06e72b17d35d169c5b8b0e7e4285d59110c4f3c73863fb578136"
"Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20251201.0/SUSE-Linux-Enterprise-16.0-16.0.x86_64-1.9-Build1.9.wsl",
"Sha256": "0xf0fc07ed3543d3dc24cfb35b4194bbecf98485cefdd720c521034ac1c54bffd3"
}
}
],
@ -74,12 +82,12 @@
"FriendlyName": "Kali Linux Rolling",
"Default": true,
"Amd64Url": {
"Url": "https://kali.download/wsl-images/current/kali-linux-2025.1-wsl-rootfs-amd64.wsl",
"Sha256": "717cd5a665f5b37f8dab2929d8323a03e0eaf85eba9b4577bcd356015045d33c"
"Url": "https://kali.download/wsl-images/kali-2025.3/kali-linux-2025.3-wsl-rootfs-amd64.wsl",
"Sha256": "dda0ff3ffe4465cf2af1061262e44cec5a90c1eccb71fe5ccfb1b0fceb5e23a8"
},
"Arm64Url": {
"Url": "https://kali.download/wsl-images/current/kali-linux-2025.1-wsl-rootfs-arm64.wsl",
"Sha256": "114f746e3bbe9174aaa9ad1a4bdfa629b088b81c74f74f62d66263b5943cd091"
"Url": "https://kali.download/wsl-images/kali-2025.3/kali-linux-2025.3-wsl-rootfs-arm64.wsl",
"Sha256": "e175688d9c305b621e701bb11e54f57ac772aed7fa1d94e3f6cb812c1e5e806f"
}
}
],
@ -89,12 +97,12 @@
"FriendlyName": "Debian GNU/Linux",
"Default": true,
"Amd64Url": {
"Url": "https://salsa.debian.org/debian/WSL/-/jobs/7130915/artifacts/raw/Debian_WSL_AMD64_v1.20.0.0.wsl",
"Sha256": "51a0c7af534929305238bd356a217b371562e6a0fcdfab65c7e49fb8252e2f23"
"Url": "https://salsa.debian.org/debian/WSL/-/jobs/7949331/artifacts/raw/Debian_WSL_AMD64_v1.22.0.0.wsl",
"Sha256": "543123ccc5f838e63dac81634fb0223dc8dcaa78fdb981387d625feb1ed168c7"
},
"Arm64Url": {
"Url": "https://salsa.debian.org/debian/WSL/-/jobs/7130915/artifacts/raw/Debian_WSL_ARM64_v1.20.0.0.wsl",
"Sha256": "ceb883ce1c016f7bc01c2f58dfa3224684d49efb0d1b2a216ce889cac2738bc5"
"Url": "https://salsa.debian.org/debian/WSL/-/jobs/7949331/artifacts/raw/Debian_WSL_ARM64_v1.22.0.0.wsl",
"Sha256": "5701f1add55f8cf3b56528109a6220ae5c89f2189d7ae97b9a4b5302b80e967c"
}
}
],
@ -104,25 +112,25 @@
"FriendlyName": "AlmaLinux OS 8",
"Default": false,
"Amd64Url": {
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v8.10.20250307.0/AlmaLinux-8.10_x64_20250307.0.wsl",
"Sha256": "a25b758445d309550dc9bb71dcb87757e378eb2861e78e8817efb4ed9f8ff09e"
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v8.10.20250415.0/AlmaLinux-8.10_x64_20250415.0.wsl",
"Sha256": "34c3bc6d3ac693968737c65db52b67f68b8c1a6f8b024450819841a967f59a3d"
},
"Arm64Url": {
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v8.10.20250307.0/AlmaLinux-8.10_ARM64_20250307.0.wsl",
"Sha256": "0d692a6d23164f91727e2fe57c6bf6ca7162fa9aba0d31abafba48ffad616771"
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v8.10.20250415.0/AlmaLinux-8.10_ARM64_20250415.0.wsl",
"Sha256": "bd34f64b4822f6f115058f79cdbba85a1560360efbec14c3d699695023f8ca19"
}
},
{
"Name": "AlmaLinux-9",
"FriendlyName": "AlmaLinux OS 9",
"Default": true,
"Default": false,
"Amd64Url": {
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v9.5.20250307.0/AlmaLinux-9.5_x64_20250307.0.wsl",
"Sha256": "99a28c9340a5bee943758191391bee8a16a0b4c4360ec0b743f6e23249c35cd2"
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v9.7.20251119.0/AlmaLinux-9.7_x64_20251119.0.wsl",
"Sha256": "0a6588f4f723fcb3edbc37dd3e3e13be8ffe0a5027e47513e3d4d2a4451794e7"
},
"Arm64Url": {
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v9.5.20250307.0/AlmaLinux-9.5_ARM64_20250307.0.wsl",
"Sha256": "790ff4d6026053cea01396b7238a96f05eeb76a004396bc7cd91fe73011bdb19"
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v9.7.20251119.0/AlmaLinux-9.7_ARM64_20251119.0.wsl",
"Sha256": "b3e2632efe029a81db1ae7a914ea3b7e9e6e20d8c71c158270c331e6fea39bf8"
}
},
{
@ -130,12 +138,64 @@
"FriendlyName": "AlmaLinux OS Kitten 10",
"Default": false,
"Amd64Url": {
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v10-kitten.20250307.0/AlmaLinux-Kitten-10_x64_20250307.0.wsl",
"Sha256": "53ffba9cd052921da0f67e13f91e16c1bacdda6f96b67a0e4900e01ce965c949"
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v10-kitten.20251030.0/AlmaLinux-Kitten-10_x64_20251030.0.wsl",
"Sha256": "d765d65076b041f3a67ba60edc37d056eeab2a260aed8e077684e05b78ecd9f5"
},
"Arm64Url": {
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v10-kitten.20250307.0/AlmaLinux-Kitten-10_ARM64_20250307.0.wsl",
"Sha256": "9c5804fc58108a138f53ff111961e17217b1cf429f8e5c8365b52062b621e8e5"
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v10-kitten.20251030.0/AlmaLinux-Kitten-10_ARM64_20251030.0.wsl",
"Sha256": "90c30b0adbf8d414c4b0a02eaeb6a5d8e488a2187a67dbaf11f4a3e843baae53"
}
},
{
"Name": "AlmaLinux-10",
"FriendlyName": "AlmaLinux OS 10",
"Default": true,
"Amd64Url": {
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v10.1.20251124.0/AlmaLinux-10.1_x64_20251124.0.wsl",
"Sha256": "24e8fa286a4081979d97e83a227fb89f332bcf731fe4b422679a3b455ab0be37"
},
"Arm64Url": {
"Url": "https://github.com/AlmaLinux/wsl-images/releases/download/v10.1.20251124.0/AlmaLinux-10.1_ARM64_20251124.0.wsl",
"Sha256": "20700a4467214074f8a1a3d4e0e1cad25af36b8127d047ab6d5b4a1355e998b8"
}
}
],
"archlinux": [
{
"Name": "archlinux",
"FriendlyName": "Arch Linux",
"Default": true,
"Amd64Url": {
"Url": "https://fastly.mirror.pkgbuild.com/wsl/2025.12.01.153427/archlinux-2025.12.01.153427.wsl",
"Sha256": "8dfe92910a188f191b0af2972bd4bda661178b769ce820a8921e8b7aeae9a517"
}
}
],
"Fedora": [
{
"Name": "FedoraLinux-43",
"FriendlyName": "Fedora Linux 43",
"Default": true,
"Amd64Url": {
"Url": "https://download.fedoraproject.org/pub/fedora/linux/releases/43/Container/x86_64/images/Fedora-WSL-Base-43-1.6.x86_64.wsl",
"Sha256": "220780af9cf225e9645313b4c7b0457a26a38a53285eb203b2ab6188d54d5b82"
},
"Arm64Url": {
"Url": "https://download.fedoraproject.org/pub/fedora/linux/releases/43/Container/aarch64/images/Fedora-WSL-Base-43-1.6.aarch64.wsl",
"Sha256": "7eef7a83260218d8c878b3c7bbdaf11772103145184d0c65df27557f4cd49548"
}
},
{
"Name": "FedoraLinux-42",
"FriendlyName": "Fedora Linux 42",
"Default": false,
"Amd64Url": {
"Url": "https://download.fedoraproject.org/pub/fedora/linux/releases/42/Container/x86_64/images/Fedora-WSL-Base-42-1.1.x86_64.tar.xz",
"Sha256": "99fb3d05d78ca17c6815bb03cf528da8ef82ebc6260407f2b09461e0da8a1b8d"
},
"Arm64Url": {
"Url": "https://download.fedoraproject.org/pub/fedora/linux/releases/42/Container/aarch64/images/Fedora-WSL-Base-42-1.1.aarch64.tar.xz",
"Sha256": "a5a2ceb8ca56b7245b909d021b0fd620427db349f02b8ef3b82b741bcb5611cd"
}
}
]
@ -172,16 +232,6 @@
"Arm64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/KaliLinux_1.13.1.0.AppxBundle",
"PackageFamilyName": "KaliLinux.54290C8133FEE_ey8k8hqnwqnmg"
},
{
"Name": "Ubuntu-18.04",
"FriendlyName": "Ubuntu 18.04 LTS",
"StoreAppId": "9PNKSF5ZN4SW",
"Amd64": true,
"Arm64": true,
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/Ubuntu1804-230608_x64.appx",
"Arm64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/Ubuntu1804-230608_ARM64.appx",
"PackageFamilyName": "CanonicalGroupLimited.Ubuntu18.04LTS_79rhkp1fndgsc"
},
{
"Name": "Ubuntu-20.04",
"FriendlyName": "Ubuntu 20.04 LTS",
@ -223,52 +273,42 @@
"PackageFamilyName": "3810OracleAmericaInc.OracleLinux7.9_dm28ctvqnhe9g"
},
{
"Name": "OracleLinux_8_7",
"FriendlyName": "Oracle Linux 8.7",
"StoreAppId": "9NGGZVB0BKD9",
"Name": "OracleLinux_8_10",
"FriendlyName": "Oracle Linux 8.10",
"StoreAppId": "9MVFWTCT78ZN",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/OracleLinux_8.7-230428.Appx",
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/OracleLinux_8.10-250708.Appx",
"Arm64PackageUrl": null,
"PackageFamilyName": "3810OracleAmericaInc.51946E772388_dm28ctvqnhe9g"
"PackageFamilyName": "3810OracleAmericaInc.OracleLinux8.10_dm28ctvqnhe9g"
},
{
"Name": "OracleLinux_9_1",
"FriendlyName": "Oracle Linux 9.1",
"StoreAppId": "9N6CN5STZRX6",
"Name": "OracleLinux_9_5",
"FriendlyName": "Oracle Linux 9.5",
"StoreAppId": "9NL3F53JZ3HX",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/OracleLinux_9.1-230428.Appx",
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/OracleLinux_9.5-250708.Appx",
"Arm64PackageUrl": null,
"PackageFamilyName": "3810OracleAmericaInc.62074632F71C9_dm28ctvqnhe9g"
"PackageFamilyName": "3810OracleAmericaInc.OracleLinux9.5_dm28ctvqnhe9g"
},
{
"Name": "openSUSE-Leap-15.6",
"FriendlyName": "openSUSE Leap 15.6",
"StoreAppId": "9PDTJHBQRQPF",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/SUSELeap15p6-240801_x64.Appx",
"Arm64PackageUrl": null,
"Arm64": true,
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/openSUSELeap15p6-250320_x64.Appx",
"Arm64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/openSUSELeap15p6-250320_ARM64.Appx",
"PackageFamilyName": "46932SUSE.openSUSELeap15.6_022rs5jcyhyac"
},
{
"Name": "SUSE-Linux-Enterprise-15-SP5",
"FriendlyName": "SUSE Linux Enterprise 15 SP5",
"StoreAppId": "9N648JDGXK2D",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/SUSELinuxEnterprise15_SP5-240801.Appx",
"Arm64PackageUrl": null,
"PackageFamilyName": "46932SUSE.SUSELinuxEnterprise15SP5_022rs5jcyhyac"
},
{
"Name": "SUSE-Linux-Enterprise-15-SP6",
"FriendlyName": "SUSE Linux Enterprise 15 SP6",
"StoreAppId": "9N738KZGNB91",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/SUSELinuxEnterprise15SP6-241001_x64.Appx",
"Amd64PackageUrl": "https://github.com/SUSE/WSL-instarball/releases/download/v20250618.0/SUSE-Linux-Enterprise-15-SP6-15.6-WSL.x86_64-156.3.148.0-Build3.148.appx",
"Arm64PackageUrl": null,
"PackageFamilyName": "46932SUSE.SUSELinuxEnterprise15SP6_022rs5jcyhyac"
},
@ -278,8 +318,8 @@
"StoreAppId": "9MSSK2ZXXN11",
"Amd64": true,
"Arm64": true,
"Amd64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/openSUSETumbleweed-241001_x64.Appx",
"Arm64PackageUrl": "https://publicwsldistros.blob.core.windows.net/wsldistrostorage/openSUSETumbleweed-241001_ARM64.Appx",
"Amd64PackageUrl": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250923.0/openSUSE-Tumbleweed-20250922-WSL.x86_64-25265.9.1077.0-Build9.1077.appx",
"Arm64PackageUrl": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250923.0/openSUSE-Tumbleweed-20250922-WSL.aarch64-25265.9.542.0-Build9.542.appx",
"PackageFamilyName": "46932SUSE.openSUSETumbleweed_022rs5jcyhyac"
}
]

View File

@ -10,6 +10,7 @@ import magic
import os.path
import git
import re
import sys
from github import Github
@ -32,7 +33,31 @@ DISCOURAGED_SYSTEM_UNITS = ['systemd-resolved.service',
'systemd-tmpfiles-setup-dev.service',
'tmp.mount',
'NetworkManager.service',
'networking.service']
'networking.service',
'hypervkvpd.service']
WSL1_UNSUPPORTED_XATTRS = ['security.selinux', 'security.ima', 'security.evm']
WSL_CONF_KEYS = ['automount.enabled',
'automount.ldconfig',
'automount.mountfstab',
'automount.options',
'automount.root',
'boot.command',
'boot.protectbinfmt',
'boot.systemd',
'fileserver.enabled',
'filesystem.umask',
'general.hostname',
'gpu.appendlibpath',
'gpu.enabled',
'interop.appendwindowspath',
'interop.enabled',
'network.generatehosts',
'network.generateresolvconf',
'network.hostname',
'time.usewindowstimezone',
'user.default']
errors = {}
warnings = {}
@ -127,10 +152,12 @@ def main(manifest: str, tar: str, compare_with_branch: str, repo_path: str, arm6
default_entries = sum(1 for e in versions if 'Default' in e and e['Default']())
if default_entries != 1:
error(e, 'Found no default distribution' if default_entries == 0 else 'Found multiple default distributions')
error(e, f'Found no default distribution for "{flavor}"' if default_entries == 0 else f'Found multiple default distributions for "{flavor}"')
report_status_on_pr(manifest)
sys.exit(1 if errors else 0)
except:
if debug:
import traceback
@ -152,10 +179,12 @@ def report_status_on_pr(manifest: str):
return output
for line, text in errors.items():
print(f'::error file={manifest},line={line}::Error: {format_list(text).replace('\n', '%0A')}')
escaped = format_list(text).replace('\n', '%0A')
print(f'::error file={manifest},line={line}::Error: {escaped}')
for line, text in warnings.items():
print(f'::warning file={manifest},line={line}::Warning: {format_list(text).replace('\n', '%0A')}')
escaped = format_list(text).replace('\n', '%0A')
print(f'::warning file={manifest},line={line}::Warning: {escaped}')
def read_config_keys(config: configparser.ConfigParser) -> dict:
@ -193,7 +222,7 @@ def read_passwd(node, default_uid: int, fd):
entries[uid] = fields
if 0 not in entries:
error(flavor, name, f'No root (uid=0) found in /etc/passwd')
error(node, f'No root (uid=0) found in /etc/passwd')
elif entries[0][0] != 'root':
error(node, f'/etc/passwd has a uid=0, but it is not root: {entries[0][0]}')
@ -322,6 +351,21 @@ def get_tar_file(tar, path: str, follow_symlink=False, symlink_depth=10):
return None, None
def find_unsupported_attrs(tar):
found_xattrs = set()
first_file = None
for e in tar.getmembers():
for name in e.pax_headers:
if any(name.startswith('SCHILY.xattr.' + xattr) for xattr in WSL1_UNSUPPORTED_XATTRS):
found_xattrs.add(name.replace('SCHILY.xattr.', ''))
if first_file is None:
first_file = e.name
return first_file, found_xattrs
def read_tar(node, file, elf_magic: str):
with tarfile.open(fileobj=file) as tar:
@ -330,7 +374,7 @@ def read_tar(node, file, elf_magic: str):
if info is None:
if not optional:
error(flavor, name, f'File "{path}" not found in tar')
error(node, f'File "{path}" not found in tar')
return False
permissions = oct(info.mode)
@ -373,7 +417,7 @@ def read_tar(node, file, elf_magic: str):
keys = read_config_keys(config)
unexpected_keys = [e for e in keys if e.lower() not in valid_keys]
unexpected_keys = [e for e in keys if e.casefold() not in valid_keys]
if unexpected_keys:
error(node, f'Found unexpected_keys in "{path}": {unexpected_keys}')
else:
@ -383,7 +427,7 @@ def read_tar(node, file, elf_magic: str):
defaultUid = None
if validate_mode('/etc/wsl-distribution.conf', [oct(0o664), oct(0o644)], 0, 0, follow_symlink=True):
config = validate_config('/etc/wsl-distribution.conf', ['oobe.command', 'oobe.defaultuid', 'shortcut.icon', 'oobe.defaultname', 'windowsterminal.profiletemplate'])
config = validate_config('/etc/wsl-distribution.conf', ['oobe.command', 'oobe.defaultuid', 'shortcut.icon', 'shortcut.enabled', 'oobe.defaultname', 'windowsterminal.profiletemplate'])
if oobe_command := config.get('oobe.command', None):
validate_mode(oobe_command, [oct(0o775), oct(0o755)], 0, 0)
@ -412,20 +456,27 @@ def read_tar(node, file, elf_magic: str):
warning(node, f'value for windowsterminal.profileTemplate is not under {USR_LIB_WSL}: "{terminal_profile}"')
if validate_mode('/etc/wsl.conf', [oct(0o664), oct(0o644)], 0, 0, optional=True, follow_symlink=True):
config = validate_config('/etc/wsl.conf', ['boot.systemd'])
config = validate_config('/etc/wsl.conf', WSL_CONF_KEYS)
if config.get('boot.systemd', False):
validate_mode('/sbin/init', [oct(0o775), oct(0o755)], 0, 0, magic=elf_magic, follow_symlink=True)
validate_mode('/sbin/init', [oct(0o775), oct(0o755), oct(0o555)], 0, 0, magic=elf_magic, follow_symlink=True)
if (default_user := config.get('user.default')) is not None:
warning(node, f'Found discouraged wsl.conf key: user.default={default_user}')
validate_mode('/etc/passwd', [oct(0o664), oct(0o644)], 0, 0, parse_method = lambda fd: read_passwd(node, defaultUid, fd))
validate_mode('/etc/shadow', [oct(0o640), oct(0o600), oct(0)], 0, None)
validate_mode('/bin/bash', [oct(0o755), oct(0o775)], 0, 0, magic=elf_magic, follow_symlink=True)
validate_mode('/bin/sh', [oct(0o755), oct(0o775)], 0, 0, magic=elf_magic, follow_symlink=True)
validate_mode('/bin/bash', [oct(0o755), oct(0o775), oct(0o555)], 0, 0, magic=elf_magic, follow_symlink=True, optional=True)
validate_mode('/bin/sh', [oct(0o755), oct(0o775), oct(0o555)], 0, 0, magic=elf_magic, follow_symlink=True)
enabled_systemd_units = read_systemd_enabled_units(node, tar)
for unit, path in enabled_systemd_units.items():
if unit in DISCOURAGED_SYSTEM_UNITS:
warning(node, f'Found discouraged system unit: {path}')
first_file, found_xattrs = find_unsupported_attrs(tar)
if first_file is not None:
warning(node, f'Found extended attributes that are not supported in WSL1: {found_xattrs}. Sample file: {first_file}')
def read_url(url: dict, elf_magic):
hash = hashlib.sha256()
address = url['Url']()
@ -511,4 +562,4 @@ def warning(node, message: str):
warnings[line] = warnings.get(line, []) + [message]
if __name__ == "__main__":
main()
main()

View File

@ -3,6 +3,7 @@ import json
import sys
import hashlib
import base64
import difflib
from urllib.request import urlretrieve
from xml.etree import ElementTree
import tempfile
@ -65,7 +66,16 @@ if __name__ == "__main__":
exit(1)
with open(sys.argv[1]) as fd:
content = json.loads(fd.read())
data = fd.read()
content = json.loads(data)
diff = difflib.unified_diff(
data.splitlines(keepends=True),
(json.dumps(content, indent=4) + "\n").splitlines(keepends=True),
fromfile="a" + sys.argv[1],
tofile="b" + sys.argv[1],
)
diff = "".join(diff)
assert diff == "", diff
distros = content['Distributions']
assert is_unique([e.get('StoreAppId') for e in distros if e])

10
doc/README.md Normal file
View File

@ -0,0 +1,10 @@
# WSL open source documentation
Build instructions:
```
$ pip install mkdocs mkdocs-mermaid2-plugin
$ mkdocs serve
```
You can then view the documentation at `http://127.0.0.1:8000/`.

66
doc/docs/debugging.md Normal file
View File

@ -0,0 +1,66 @@
# Debugging WSL
## Logging
There are multiple sources of logging in WSL. The main one is the ETL trace that is emitted from Windows processes.
To collect an ETL trace, run ([link to wsl.wprp](https://github.com/microsoft/WSL/blob/master/diagnostics/wsl.wprp)):
```
wpr -start wsl.wprp -filemode
[reproduce the issue]
wpr -stop logs.ETL
```
Once the log file is saved, you can use [WPA](https://apps.microsoft.com/detail/9n58qrw40dfw?hl=en-US&gl=US) to view the logs.
Notable ETL providers:
- `Microsoft.Windows.Lxss.Manager`: Logs emitted from wslservice.exe
Important events:
- `GuestLog`: Logs from the vm's dmesg
- `Error`: Unexpected errors
- `CreateVmBegin`, `CreateVmEnd`: Virtual machine lifetime
- `CreateNetworkBegin`, `CreateNetworkEnd`: Networking configuration
- `SentMessage`, `ReceivedMessage`: Communication on the hvsocket channels with Linux.
- `Microsoft.Windows.Subsystem.Lxss`: Other WSL executables (wsl.exe, wslg.exe, wslconfig.exe, wslrelay.exe, ...)
Important events:
- `UserVisibleError`: An error was displayed to the user
- `Microsoft.Windows.Plan9.Server`: Logs from the Windows plan9 server (used when accessing /mnt/ shares and running Windows)
On the Linux side, the easiest way to access logs is to look at `dmesg` or use the debug console, which can enabled by writing:
```
[wsl2]
debugConsole=true
```
to `%USERPROFILE%/.wslconfig` and restarting WSL
## Attaching debuggers
Usermode can be attached to WSL Windows processes (wsl.exe, wslservice.exe, wslrelay.exe, ...). The symbols are available under the `bin/<platform>/<target>` folder.
You can also use [this trick](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#11-reporting-a-wsl-process-crash) to automatically collect crash dumps when processes crash.
## Linux debugging
`gdb` can be attached to Linux processes (see [man gdb](https://man7.org/linux/man-pages/man1/gdb.1.html)).
The simplest way to debug a WSL process with gdb is to use the `/mnt` mountpoints to access the code from gdb.
Once started, just use `dir /path/to/wsl/source` in gdb to connect the source files.
## Root namespace debugging
Some WSL process such as `gns` or `mini_init` aren't accessible from within WSL distributions. To attach a debugger to those, use the debug shell via:
```
wsl --debug-shell
```
You can then install `gdb` by running `tdnf install gdb` and start debugging processes.

74
doc/docs/dev-loop.md Normal file
View File

@ -0,0 +1,74 @@
# Building WSL
## Prerequisites
The following tools are required to build WSL:
- CMake >= 2.25
- Can be installed with `winget install Kitware.CMake`
- Visual Studio with the following components:
- Windows SDK 26100
- MSBuild
- Universal Windows platform support for v143 build tools (X64 and ARM64)
- MSVC v143 - VS 2020 C++ ARM64 build tools (Latest + Spectre) (X64 and ARM64)
- C++ core features
- C++ ATL for latest v143 tools (X64 and ARM64)
- C++ Clang compiler for Windows
- .NET desktop development
- .NET WinUI app development tools
- Building WSL requires support for symbolic links. To ensure this capability, enable [Developer Mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development) in Windows Settings or execute the build process with Administrator privileges.
## Building WSL
Once you have cloned the repository, generate the Visual Studio solution by running:
```
cmake .
```
This will generate a `wsl.sln` file that you can build either with Visual Studio, or via `cmake --build .`.
Build parameters:
- `cmake . -A arm64`: Build a package for ARM64
- `cmake . -DCMAKE_BUILD_TYPE=Release`: Build for release
- `cmake . -DBUILD_BUNDLE=TRUE`: Build a bundle msix package (requires building ARM64 first)
Note: To build and deploy faster during development, see options in `UserConfig.cmake`.
## Deploying WSL
Once the build is complete, you can install WSL by installing the MSI package found under `bin\<platform>\<target>\wsl.msi`, or by running `powershell tools\deploy\deploy-to-host.ps1`.
To deploy on a Hyper-V virtual machine, you can use `powershell tools\deploy\deploy-to-vm.ps1 -VmName <vm> -Username <username> -Password <password>`
## Running tests
To run unit tests, run: `bin\<platform>\<target>\test.bat`. There's quite a lot of tests so you probably don't want to run everything. Here's a reasonable subset:
`bin\<platform>\<target>\test.bat /name:*UnitTest*`
To run a specific test case run:
`bin\<platform>\<target>\test.bat /name:<class>::<test>`
Example: `bin\x64\debug\test.bat /name:UnitTests::UnitTests::ModernInstall`
To run the tests for WSL1, add `-Version 1`.
Example: `bin\x64\debug\test.bat -Version 1`
After running the tests once, you can add `-f` to skip the package installation, which makes the tests faster (this requires test_distro to be the default WSL distribution).
Example:
```
wsl --set-default test_distro
bin\x64\debug\test.bat /name:*UnitTest* -f
```
## Debugging tests
See [debugging](debugging.md) for general debugging instructions.
To attach a debugger to the unit test process, use: `/waitfordebugger` when calling `test.bat`.
Use `/breakonfailure` to automatically break on the first test failure.

10
doc/docs/index.md Normal file
View File

@ -0,0 +1,10 @@
# WSL open source documentation
This site contains the developer documentation for the Windows Subsystem for Linux.
For user documentation, including installation and configuration, see [https://learn.microsoft.com/windows/wsl/](https://learn.microsoft.com/windows/wsl/).
To get started developing (building, testing and deploying), see [Getting started](dev-loop.md).
To learn more about how WSL works, see [technical documentation](technical-documentation/index.md)

View File

@ -0,0 +1,116 @@
# The WSL2 boot process
This page describes the steps in the WSL2 process, from the user invoking [wsl.exe](wsl.exe.md) to the user's Linux shell (bash in this example), in the WSL2 distribution.
## Overview
The below diagram shows the sequence of events to start bash within a WSL2 distribution. See [WSL architecture](index.md) for details about what each process does.
```mermaid
sequenceDiagram
wsl.exe->>wslservice.exe: CreateInstance(<distro>)
wslservice.exe->>wsl.exe: S_OK
wsl.exe->>wslservice.exe: CreateLxProcess(<distro>, <command line>, <env>, ...)
create participant mini_init
wslservice.exe->>mini_init: LxMiniInitMessageEarlyConfig
create participant gns
mini_init-->>gns: fork(), exec("/gns")
wslservice.exe->>gns: LxGnsMessageInterfaceConfiguration
gns->>wslservice.exe: LxGnsMessageResult
wslservice.exe->>mini_init: LxMiniInitMessageInitialConfig
wslservice.exe->>mini_init: LxMiniInitMessageLaunchInit
create participant init
mini_init-->>init: fork(), exec("/init")
init->>wslservice.exe: LxMiniInitMessageCreateInstanceResult
wslservice.exe->>init: LxInitMessageCreateSession
create participant session leader
init-->>session leader: fork()
session leader->>wslservice.exe: LxInitMessageCreateSessionResponse
wslservice.exe->>session leader: InitCreateProcessUtilityVm
create participant relay
session leader-->>relay: fork()
relay->>wslservice.exe: LxMessageResultUint32 (hvsocket connect port)
wslservice.exe->>relay: connect hvsockets for STDIN, STDOUT, STDERR
create participant bash
relay-->>bash: fork(), exec("/bin/bash")
relay<<-->>bash: relay STDIN, STDOUT, STDERR
wslservice.exe-->>wsl.exe: S_OK + hvsockets for STDIN, STDOUT, STDERR
wsl.exe<<->>relay: Relay STDIN, STDOUT, STDERR
destroy bash
relay-->>bash: waitpid()
relay->>wsl.exe: LxInitMessageExitStatus (process exit code)
```
## CreateInstance()
When [wslservice.exe](wslservice.exe.md) receives the CreateInstance() call via COM, it will:
1) Identify which distribution the user wants to create. This is done by looking up the `DistributionRegistration` (see `src/windows/service/exe/DistributionRegistration.cpp`) in the Windows registry, matching either on the distribution ID, or using the default if none is provided.
2) Based on the type of distribution (WSL1 or WSL2), either create a WSL1 instance, or start up a WSL2 virtual machine.
3) Associate the newly creating distribution to the calling process (see `src/windows/service/exe/Lifetime.cpp`)
## Starting the WSL2 virtual machine
To start a WSL2 distribution, [wslservice.exe](wslservice.exe.md) needs a virtual machine. If the virtual machine isn't already running, it will be created as part of the `CreateInstance()` call.
The WSL2 virtual machine is created via the [Host Compute System (HCS) service](https://learn.microsoft.com/virtualization/api/hcs/overview) (see `src/windows/service/exe/WslCoreVm.cpp`).
To create a new virtual machine, [wslservice.exe](wslservice.exe.md) generates a JSON string, which describes the virtual machine configuration. This JSON is then passed to [HcsCreateComputeSystem()](https://learn.microsoft.com/virtualization/api/hcs/reference/hcscreatecomputesystem) to create a new virtual machine.
See `src/windows/common/hcs_schema.h` for more details on the HCS JSON schema.
Part of the JSON configuration includes:
- The kernel: WSL will use its built-in kernel, usually installed `C:/Program Files/WSL/tools/kernel`, or a custom kernel if overridden via [.wslconfig](https://learn.microsoft.com/windows/wsl/wsl-config)
- The initramfs: WSL uses its own initramfs (usually installed in `C:\Program Files\WSL\tools\initrd.img`). It's an image that only contains the [mini_init](mini_init.md) binary
- The resources accessible to the virtual machine such as CPU, RAM, GPU, etc
When started, the virtual machine will boot into the provided kernel, and then execute [mini_init](mini_init.md).
## The Linux boot process
[mini_init](mini_init.md) is the process that performs usermode initialization inside the virtual machine. After performing various configurations, `mini_init` receives a `LxMiniInitMessageEarlyConfig` message from the [wslservice.exe](wslservice.exe.md) which contains the following information:
- Identifiers for the system VHD, swap VHD and kernel modules VHD if any
- The machine's hostname
- The configured memory reclaim mode and page reporting order
[mini_init](mini_init.md) then creates the [gns process](gns.md), which is responsible for networking configuration and then receives a `LxMiniInitMessageInitialConfig` message, which contains:
- An entropy buffer, to seed the virtual machine's entropy
- Information about the GPU drivers shares to mount, if any
- Whether [wslg](https://github.com/microsoft/wslg) is enabled
After applying all the configuration requested by [wslservice.exe](wslservice.exe.md), the virtual machine is ready to start Linux distributions.
## Starting a Linux distribution
To start a new distribution, [wslservice.exe](wslservice.exe.md) sends a `LxMiniInitMessageLaunchInit` message to [mini_init](mini_init.md), which then mounts the distribution vhd and starts [init](init.md). See ([init](init.md) for more details on WSL2 distributions configuration)
Once running, [wslservice.exe](wslservice.exe.md) can then send a `LxInitMessageCreateSession` message to start a new [session leader](session-leader.md) inside that distribution, which can be used to launch linux processes
## Relaying the linux process's input and output to Windows
Once the user's linux process has been created, [wslservice.exe](wslservice.exe.md) can return from `CreateLxProcess()` back to [wsl.exe](wsl.exe.md). In the case of WSL2, [wsl.exe](wsl.exe.md) receives the following HANDLES:
- STDIN
- STDOUT
- STDERR
- Control channel
- Interop channel
The `STDIN`, `STDOUT` and `STDERR` handles are used to relay input and output from the Linux process to the Windows terminal. Depending on the type of handle (terminal, pipe, file, ...), [wsl.exe](wsl.exe.md) will apply different relaying logics (see `src/windows/common/relay.cpp`) to achieve the best compatibility between Windows & Linux.
The `Control channel` is used to notify the linux process of a change in the terminal (for instance when [wsl.exe's](wsl.exe.md) terminal window is resized) so these changes can be applied to the Linux process as well.
The `Interop channel` has two usages:
- Create Windows processes from Linux (see [interop](interop.md))
- Notify [wsl.exe](wsl.exe.md) when the Linux process has exited (see `LxInitMessageExitStatus`)
Once the Linux process has exited, [wsl.exe](wsl.exe.md) flushes all remaining IO, and exits with the same exit code as the Linux process.
If [wsl.exe](wsl.exe.md) is terminated before the Linux process exits, [wslhost.exe](wslhost.exe.md) will take over the `Interop channel` and continue to handle requests to execute Windows processes.

View File

@ -0,0 +1,35 @@
# Accessing Windows drives from Linux
WSL offers mountpoints to access Windows drives from Linux. These mountpoints are mounted under `/mnt` by default, and point to the root of Windows drives.
## Elevated vs non-elevated mountpoints
Within a distribution, WSL separates between Linux processes that have been created from an elevated (as in administrator level) and from a non-elevated (user level) context.
This is done by having two separate [mount namespaces](https://man7.org/linux/man-pages/man7/mount_namespaces.7.html) within the distribution. One of them offers an elevated access to Windows drives, and the other offers a non-elevated access to Windows drives.
When a Linux process is created, [wslservice.exe](wslservice.exe.md) determines its elevation status, and then tell [init](init.md) to create the process in the appropriate mount namespace.
## Mounting a Windows drive
*Note: This section only applies to WSL2 distributions. *
When a [session leader](session-leader.md) is created, [wslservice.exe](wslservice.exe.md) starts a [plan9](https://9fans.github.io/plan9port/man/man9/intro.html) file server. This file server can be connected to from the WSL2 virtual machine to mount Windows drives.
When the WSL distribution is created, [wslservice.exe](wslservice.exe.md) uses the `LX_INIT_CONFIGURATION_INFORMATION` message to indicate whether the process that created the distribution is elevated or not. Based on this, [init](init.md) will mount either the elevated, or un-elevated version of the plan9 server.
Later when the first command is created in the namespace that hasn't been mounted yet, (either elevated, or non-elevated), [wslservice.exe](wslservice.exe.md) sends a `LxInitMessageRemountDrvfs` to [init](init.md), which tell `init` to mount the other namespace.
See: `src/windows/service/exe/WslCoreInstance.cpp` and `src/linux/drvfs.cpp`.
## Mounting a drive from Linux
As long as the Windows plan9 server is running, drives can be mounted simply by calling [mount](https://linux.die.net/man/8/mount). For instance mounting the C: drive manually can be done via:
```
mount -t drvfs C: /tmp/my-mount-point
```
Internally, this is handled by `/usr/sbin/mount.drvfs`, which is a symlink to `/init`. When `/init` starts, it looks at `argv[0]` to determine which entrypoint to run. If `argv[0]` is `mount.drvfs`, then `/init` runs the `mount.drvfs` entrypoint (see `MountDrvfsEntry()` in `src/linux/init/drvfs.cpp`).
Depending on the distribution configuration, `mount.drvfs` will either mount the drive as `drvfs` (WSL1), or `plan9`, `virtio-plan9` or `virtiofs` (WSL), depending on [.wslconfig](https://learn.microsoft.com/windows/wsl/wsl-config).

View File

@ -0,0 +1,16 @@
# GNS
`gns` is a process created by `mini_init`. Its job is to configure networking within the WSL2 virtual machine.
## Networking configuration
Networking settings are shared by all WSL2 distributions. While WSL2 is running, `gns` maintains an hvsocket channel to [wslservice.exe](wslservice.exe.md), which is used to send various networking related configurations such as:
- Interface IP configuration
- Routing table entries
- DNS configuration
- MTU size configuration
When DNS tunneling is enabled, `gns` is also responsible for replying to DNS requests.
See `src/linux/init/GnsEngine.cpp` and `src/windows/service/exe/GnsChannel.cpp`

View File

@ -0,0 +1,46 @@
# WSL Overview
WSL is comprised of a set of executables, API's and protocols. This page offers an overview of the different components, and how they're connected.
Click on any component to get more details.
```mermaid
%%{ init: {
'flowchart': { 'curve': 'stepBefore' },
'theme': 'neutral'
}
}%%
graph
subgraph Windows["<b><p style="font-size:30px">Windows</p></b>"]
C:\Windows\System32\wsl.exe["C:\Windows\System32\wsl.exe"]---|"CreateProcess()"|wsl.exe;
wsl.exe[<a href="wsl.exe">wsl.exe</a>]---|COM|wslservice.exe;
wslg.exe[<a href="wslg.exe">wslg.exe</a>]---|COM|wslservice.exe;
wslconfig.exe[<a href="wslconfig.exe">wslconfig.exe</a>]---|COM|wslservice.exe;
wslapi.dll[<a href="https://learn.microsoft.com/windows/win32/api/wslapi/">wslapi.dll</a>]---|COM|wslservice.exe;
id[debian.exe, ubuntu.exe, ]---|"LoadLibrary()"|wslapi.dll;
wslservice.exe[<a href="wslservice.exe">wslservice.exe</a>]---|"CreateProcessAsUser()"|wslrelay.exe[<a href="wslrelay.exe">wslrelay.exe</a>];
wslservice.exe---|"CreateProcessAsUser()"|wslhost.exe[<a href="wslhost.exe">wslhost.exe</a>];
fs["Windows filesystem (//wsl.localhost)"]
end
wslservice.exe -----|hvsocket| mini_init
wslservice.exe -----|hvsocket| gns
fs---|hvsocket|plan9
wsl.exe---|hvsocket|relay
subgraph Linux["<b><p style="font-size:30px">Linux</p></b>"]
mini_init[<a href="mini_init">mini_init</a>]---|"exec()"|gns[<a href="gns">gns</a>]
mini_init---|"exec()"|init[<a href="init">init</a>];
mini_init---|"exec()"|localhost[<a href="localhost">localhost</a>];
subgraph "Linux Distribution"["<b><p style="font-size:23px">Linux Distribution</p></b>"]
init[<a href="init">init</a>]---|"exec()"|plan9[<a href="plan9">plan9</a>];
init---|"exec()"|sid[session leader];
sid[<a href="session-leader">session leader</a>]---|"exec()"|relay
relay[<a href="relay">relay</a>]---|"exec()"|cid["User command (bash, curl)"]
end
end
```

View File

@ -0,0 +1,36 @@
# Init
Init is top level process of a WSL distribution. For WSL1 distributions, it is launched by [wslservice](wslservice.exe.md) (see `src/windows/service/LxssInstance.cpp`) and for WSL2 distributions, it is launched by [mini_init](mini_init.md).
## WSL2 specific distributions startup
Each WSL2 distributions runs in a separate mount, pid and UTS namespace. This allows distributions to run in parallel, without "seeing" each other.
When a WSL2 distribution starts, [mini_init](mini_init.md):
- Mounts the distribution VHD
- Clones into a child namespace
- Chroots in the VHD mountpoint
- Executes init (see the `LxMiniInitMessageLaunchInit` message).
While each distribution runs in its own mount namespace, the `/mnt/wsl` mountpoint is shared between all distributions.
## Distribution initialization
Once started, the `init` process performs various initialization tasks such as:
- Mounting `/proc`, `/sys` and `/dev`
- Configuring cgroups
- Registering the binfmt interpreter (see [interop](interop.md))
- Parsing [/etc/wsl.conf](https://learn.microsoft.com/windows/wsl/wsl-config)
- Starting systemd (see [systemd](systemd.md))
- Mounting `drvfs` drives (See [drvfs](drvfs.md))
- Configuring `wslg` (see [wslg](https://github.com/microsoft/wslg))
## Running the distribution
Once ready, `init` establishes either an `lxbus` (WSL1) or an `hvsocket` (WSL2) connection to [wslservice](wslservice.exe.md). This channel is used to transmit various commands to `init` (see `src/shared/inc/lxinitshared.h`), such as:
- `LxInitMessageInitialize`: Configure the distribution
- `LxInitMessageCreateSession`: Create a new session leader. See [session leader](session-leader.md)
- `LxInitMessageTerminateInstance`: Terminate the distribution

View File

@ -0,0 +1,30 @@
# Running Windows executables from Linux
The ability to launch Windows processes from Linux is controlled by 2 different levels of settings:
- The `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager\DistributionFlags` registry value, which controls the settings for all Windows users (setting the lowest significance bit disables interop)
- The `[interop]` section in [/etc/wsl.conf](https://learn.microsoft.com/windows/wsl/wsl-config#wslconf), which controls the setting for a given WSL distribution.
## binfmt interpreters for Windows executables
To allow Windows process creation from Linux, WSL registers a [binfmt interpreter](https://docs.kernel.org/admin-guide/binfmt-misc.html), which tells the kernel to execute an arbitrary command when a specific type of executable is launched via `exec*()` system calls.
To perform the registration, WSL writes to `/proc/sys/fs/binfmt_misc` and creates a `WSLInterop` entry, which points to `/init`. For WSL1 registration, the entry is written by [init](init.md) for each distribution, for WSL2 [mini_init](mini_init.md) registers the binfmt interpreter at the virtual machine level.
Note: The `/init` executable is the entrypoint for different WSL processes ([init](init.md), [plan9](plan9.md), [localhost](localhost.md), etc). This executable looks at `argv[0]` to determine which logic to run. In the case of interop, `/init` will run the Windows process creation logic if its `argv[0]` value doesn't match any of the known entrypoints.
See: `WslEntryPoint()` in `src/linux/init.cpp`.
## Connecting to interop servers
When the user tries to execute a Windows process, the kernel will launch `/init` with the Windows process's command line as arguments.
To start a new Windows process `/init` needs to connect to an interop server. Interop servers are special Linux processes that act as bridges between Linux and Windows. They maintain secure communication channels (through hvsocket connections) with Windows processes ([wsl.exe](wsl.exe.md) or [wslhost.exe](wslhost.exe.md)) to launch Windows executables.
Inside Linux, each [session leader](session-leader.md), and each instance of [init](init.md) has an associated interop server, which is serving via an unix socket under `/run/WSL`.
`/init` uses the `$WSL_INTEROP` environment variable to know which server to connect to. If the variable is not set, `/init` will try to connect to `/run/WSL/${pid}_interop`, with its own PID. If that doesn't work, `/init` will try its parent's pid, and then will continue to go up the chain until it reached [init](init.md).
Once connected `/init` sends a `LxInitMessageCreateProcess` (WSL1) or a `LxInitMessageCreateProcessUtilityVm` (WSL2), which then forwards that message to the associated Windows process, which will launch the requested command and relay its output to `/init`.
See `src/linux/init/binfmt.cpp`

View File

@ -0,0 +1,14 @@
# Localhost
`localhost` is a WSL2 linux process, created by [mini_init](mini_init.md). Its role is to forward network traffic between the WSL2 virtual machine, and Windows.
## NAT networking
When `wsl2.networkingMode` is set to NAT, `localhost` will watch for bound TCP ports, and relay the network traffic to Windows via [wslrelay.exe](wslrelay.exe.md)
## Mirrored networking
In mirrored mode, `localhost` registers a BPF program to intercept calls to `bind()`, and forward the calls to Windows via [wslservice.exe](wslservice.exe.md) so Windows can route the network traffic directly to the WSL2 virtual machine.
See `src/linux/localhost.cpp`.

View File

@ -0,0 +1,36 @@
# mini_init
mini_init is the first executable that's launched when the WSL2 virtual machine starts. See [WSL2 boot process](boot-process.md) for more details.
## Virtual machine setup
mini_init is started when the kernel is done booting, and calls `/init`, which is `mini_init`. Like other standard linux `init` executables, `mini_init` starts by mounting `/proc`, `/sys`, `/dev` and other standard mountpoints.
`mini_init` then performs various configuration such as enabling crash dump collection, configuring logging via `/dev/console` and tty configuration.
Once everything is ready, `mini_init` connects two hvsockets to [wslservice](wslservice.exe.md).
One of them, called the "mini_init" channel is used for messages sent by `wslservice.exe`. See `src/shared/inc/lxinitshared.h` for a list of messages and responses. Common messages are:
- `LxMiniInitMessageLaunchInit`: Mount a virtual disk and start a new distribution. See [`init`](init.md) for more details
- `LxMiniInitMessageMount`: Mount a disk in `/mnt/wsl` (used for wsl --mount)
- `EJECT_VHD_MESSAGE`: Eject a disk
- `LxMiniInitMessageImport`: Import a distribution
- `LxMiniInitMessageExport`: Export a distribution
The other hvsocket channel is used to send notifications to [wslservice.exe](wslservice.exe.md). This is used mainly to report when linux processes exit (which wslservice uses to know when distributions are terminated).
## Networking configuration
As part of the boot process, `mini_init` also launches the [gns binary](gns.md) which manages networking configuration
## Other tasks
`mini_init` performs various other maintenance tasks such as:
- Reclaiming unused memory
- Launching the debug shell tty
- Synchronizing IO when the virtual machine terminates
- Resizing filesystem (for wsl --manage <distro> --resize)
- Formatting disks (used when installing new distributions)

View File

@ -0,0 +1,19 @@
# Plan 9
Plan9 is a linux process that hosts a plan9 filesystem server for WSL1 and WSL2 distributions. It's created by [init](init.md) in each distribution.
## WSL 1
In WSL1 distributions, `plan9` serves its filesystem through a unix socket, which can then be connected to from Windows.
## WSL2
In WSL2 distributions, `plan9` runs its filesystem through an `hvsocket`
## Accessing the distribution files from Windows
From Windows, a special redirector driver (p9rdr.sys) registers both `\\wsl$` and `\\wsl.localhost`. When either of those paths are accessed, `p9rdr.sys` calls [wslservice.exe](wslservice.exe.md) to list the available distributions for a given Windows user.
When a distribution path is accessed (like `\\wsl.localhost\debian`), `p9rdr.sys` calls into [wslservice.exe](wslservice.exe.md) via COM to start the distribution, and connect to its plan9 server, which allows the files to be accessed from Windows.
See `src/linux/init/plan9.cpp`

View File

@ -0,0 +1,18 @@
# Relay
Relay is a WSL2 linux process created by a [session leader](session-leader.md). Its job is to create a linux process on behalf of the user, and relay its output back to Windows.
## Creating a user process
A relay is created when a `LxInitMessageCreateProcessUtilityVm` message is sent to a [session leader](session-leader.md). Once created, the `relay` creates multiple `hvsocket` channels with [wslservice.exe](wslservice.exe.md).
These channels are used to:
- Relay standard file descriptors (stdin, stdout, stderr)
- Relay information about the terminal (for instance when the terminal window is resized from Windows)
- Notify Windows when the linux process exits
Once those channels are configured, the `relay` forks() into two processes:
- The parent, which will read & write to the child's standard file descriptors and relay it to Windows
- The child, which calls `exec()` and starts the user process

Some files were not shown because too many files have changed in this diff Show More