feat(wsl-setup): explicitly enable WSL interop in wsl.conf#17801
Conversation
There was a problem hiding this comment.
Pull request overview
This PR explicitly enables WSL interop in the /etc/wsl.conf shipped by the wsl-setup component. It adds an [interop] section (enabled=true, appendWindowsPath=true) via a file-search-replace overlay on the upstream Fedora wsl-setup component, anchored on the existing [boot] systemd=true line to keep divergence minimal. Because the component now carries an overlay, it is promoted from an inline entry in components.toml to a dedicated wsl-setup.comp.toml.
Changes:
- Add a dedicated
wsl-setup.comp.tomlwith afile-search-replaceoverlay that appends an[interop]section towsl.conf, and remove the inline[components.wsl-setup]entry fromcomponents.toml. - Re-render the spec/config:
wsl.confgains the[interop]section, andwsl-setup.specbumps Release12→13with a new changelog entry. - Refresh
locks/wsl-setup.lockinput-fingerprintto reflect the new component config.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
base/comps/wsl-setup/wsl-setup.comp.toml |
New dedicated component file with the file-search-replace overlay that appends the [interop] section. |
base/comps/components.toml |
Removes the now-redundant inline [components.wsl-setup] entry. |
specs/w/wsl-setup/wsl.conf |
Rendered config output now contains the [interop] section. |
specs/w/wsl-setup/wsl-setup.spec |
rpmautospec Release bump (12→13) and new changelog entry. |
locks/wsl-setup.lock |
Updated input-fingerprint reflecting the new overlay config. |
| # this line deliberately keeps the overlay in lockstep with upstream: if Fedora | ||
| # changes the [boot] body the overlay fails loudly at render time rather than | ||
| # silently dropping the interop config. | ||
| regex = 'systemd=true' |
There was a problem hiding this comment.
regexes are generally the last resort. Can this not be appended to the end of the file?
There was a problem hiding this comment.
Sure, let me use file-prepend-lines here.
IMHO, the only file overlay functions i am aware of are:
[file-prepend-lines, file-search-replace, file-add, file-remove, file-rename]
https://github.com/microsoft/azure-linux-dev-tools/blob/main/docs/user/reference/config/overlays.md#file-overlays
What do you suggest, should we add another function file-append-lines ?
| [components.wsl-setup] | ||
|
|
||
| # Explicitly enable WSL interop in the shipped /etc/wsl.conf. Interop (and | ||
| # Windows PATH appending) is enabled by default in WSL, but pinning both keys |
There was a problem hiding this comment.
What do other WSL images (from other distros) do? Do they do this as well? If so, should we be pushing this upstream to Fedora?
There was a problem hiding this comment.
It is actually supposed to be a default, but for some versions of WSL it does not work.
I took insipiration from this WSL github issue: microsoft/WSL#13872 (comment)
Add an [interop] section to the wsl.conf shipped by wsl-setup, pinning both interop keys explicitly: [interop] enabled=true appendWindowsPath=true This is needed for WSL to spawn a windows process. Implemented as a file-search-replace overlay on the upstream Fedora wsl-setup component (anchored on the [boot] systemd line) to keep divergence minimal. Promotes wsl-setup from an inline entry in components.toml to a dedicated comp.toml since it now carries an overlay. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Add an [interop] section to the wsl.conf shipped by wsl-setup, pinning
both interop keys explicitly:
[interop]
enabled=true
appendWindowsPath=true
This is needed for WSL to spawn a windows process.
Implemented as a file-search-replace overlay on the upstream Fedora
wsl-setup component (anchored on the [boot] systemd line) to keep
divergence minimal. Promotes wsl-setup from an inline entry in
components.toml to a dedicated comp.toml since it now carries an overlay.
Signed-off-by: Muhammad Falak R Wani falakreyaz@gmail.com