microsoft / microsoft/WSL

wslc doesn't strip \r in << redirection

Open
#40,996 2 comments 0 reactions 1 assignee Claimed by @dkbennett View on GitHub
bug wslc
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

### Windows Version

Microsoft Windows [Version 10.0.26300.8758]

### WSL Version

wslc 2.9.3.0

### Are you using WSL 1 or WSL 2?

- [x] WSL 2
- [ ] WSL 1

### Kernel Version

_No response_

### Distro Version

_No response_

### Other Software

_No response_

### Repro Steps

1. Create a Dockerfile that uses < wslc build -f Dockerfile.test .
Building image from directory: .

[1/2] FROM docker.io/library/debian:trixie
[2/2] RUN < wslc build -f Dockerfile.test .
Building image from directory: .

[1/2] FROM docker.io/library/debian:trixie
[2/2] RUN <>> RUN <>> set -e
4 | >>> touch /tmp/foo
5 | >>> EOF
6 |
--------------------
ERROR: failed to solve: process "/bin/sh -c set -e\r\ntouch /tmp/foo\r\n" did not complete successfully: exit code: 2

Error code: E_FAIL
```

### Diagnostic Logs

[WslLogs-2026-07-04_14-45-53.tar.gz](https://github.com/user-attachments/files/29665735/WslLogs-2026-07-04_14-45-53.tar.gz)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.