You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose bundled perf through WSL-owned paths - #41904
Bind-mounting bundled perf over /usr/bin/perf breaks package upgrades because package managers cannot create hard-link backups across the mount boundary. Expose bundled perf through WSL-owned paths instead, leaving distro packages untouched.
PR Checklist
Closes: No linked issue.
Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
Tests: Added/updated if needed and all pass
Localization: All end user facing strings can be localized
Dev docs: Added/updated if needed
Documentation updated: If checked, please file a pull request on our docs repo and link it here: N/A (developer documentation only).
Detailed Description of the Pull Request / Additional comments
Mount artifacts read-only under /usr/lib/wsl/perf/<release> and generate /run/wsl/perf to configure helper resolution. A managed /usr/local/bin/perf symlink supports ordinary and standard sudo lookup without changing PATH, preserves user-owned entries, and is removed when artifacts are unavailable.
Validation Steps Performed
cmake --build . -- -m: passed.
bin\x64\Debug\test.bat /name:*KernelArtifacts*: passed (1/1), covering package-file replacement, read-only mounts, sanitized environments, user overrides, and custom-kernel transitions.
Keep perf artifacts read-only and expose them through a per-distro wrapper and managed local symlink without modifying distro packages or session search paths.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dc502fd6-021a-4a35-8227-e3688decebda
Default the runtime wrapper's PERF_EXEC_PATH only when unset or empty, and cover empty values and inherited overrides.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dc502fd6-021a-4a35-8227-e3688decebda
Bundled perf unavailable after read-only WSL startup fallback
src/linux/init/config.cpp:1288
This setup cannot expose bundled perf when WSL takes its supported read-only/full-filesystem startup fallback. SpawnDistribution remounts the temporary root overlay read-only before exec (main.cpp:1537-1555, 1670-1676), so on the first boot using this new path MoveTemporaryMount cannot create /usr/lib/wsl/perf/<release>; even if that directory already exists, UpdatePerfSymlink cannot create /usr/local/bin/perf. The errors are swallowed by the helper-level CATCH_LOGs, leaving perf unavailable. Please create the WSL-owned entries before that remount or retain a read-only-safe exposure fallback.
🧠 Review effort: Balanced
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Bind-mounting bundled perf over
/usr/bin/perfbreaks package upgrades because package managers cannot create hard-link backups across the mount boundary. Expose bundled perf through WSL-owned paths instead, leaving distro packages untouched.PR Checklist
Detailed Description of the Pull Request / Additional comments
Mount artifacts read-only under
/usr/lib/wsl/perf/<release>and generate/run/wsl/perfto configure helper resolution. A managed/usr/local/bin/perfsymlink supports ordinary and standard sudo lookup without changing PATH, preserves user-owned entries, and is removed when artifacts are unavailable.Validation Steps Performed
cmake --build . -- -m: passed.bin\x64\Debug\test.bat /name:*KernelArtifacts*: passed (1/1), covering package-file replacement, read-only mounts, sanitized environments, user overrides, and custom-kernel transitions..\FormatSource.ps1 -Verify $true: passed.python3 -m mkdocs build -f doc/mkdocs.yml: passed with repository documentation dependencies.env -u PERF_EXEC_PATH sudo -n perf --versionandenv -u PERF_EXEC_PATH sudo -n perf --exec-path: passed.