-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
progress: if not escaped, backslashes \
not printed on the progress stream dockerfile steps
#5250
Labels
Comments
It can also be reproduced on Linux:
|
profnandaa
changed the title
WCOW: if not escaped, backslashes
progress: if not escaped, backslashes Aug 22, 2024
\
not printed on the progress stream dockerfile steps\
not printed on the progress stream dockerfile steps
profnandaa
added
area/cli
buildctl CLI
and removed
area/windows
area/windows-wcow
labels
Aug 22, 2024
@ardrabczyk -- good catch, thanks! Updated the title and description. |
I have narrowed down to this,
I'm not really conversant with this lexer, will appreciate any tips? @tonistiigi |
profnandaa
added a commit
to profnandaa/buildkit
that referenced
this issue
Aug 22, 2024
`shlex` in was treating single backslash "\\" in string as escape sequence, hence stripping them off. Modify `processCmdEnv` to double escape `\\`. This was in turn affecting the vertex `Name`, and mostly pronounced on Windows where backslashes are prevalent in path names. For example `C:\hello\world\path` was being rendered as `C:helloworldpath`, hence confusing users. Fixes moby#5250 Build progress before fix: ``` moby#5 [2/4] RUN echo C:helloworldpath moby#5 1.359 C:\hello\world\path moby#5 DONE 1.7s moby#6 [3/4] RUN echo C:\hello\escaped\path moby#6 1.734 C:\\hello\\escaped\\path moby#6 DONE 2.1s moby#7 [4/4] RUN echo "C:\hello\quoted\path" moby#7 1.765 "C:\hello\quoted\path" moby#7 DONE 2.1s ``` Build progress after fix: ``` moby#5 [2/4] RUN echo C:\hello\world\path moby#5 1.458 C:\hello\world\path moby#5 DONE 1.8s moby#6 [3/4] RUN echo C:\\hello\\escaped\\path moby#6 1.730 C:\\hello\\escaped\\path moby#6 DONE 2.1s moby#7 [4/4] RUN echo "C:\hello\quoted\path" moby#7 1.702 "C:\hello\quoted\path" moby#7 DONE 2.1s ``` You can also see that now paths in the step/vertex names now match those in the log lines right after the name. Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa
added a commit
to profnandaa/buildkit
that referenced
this issue
Aug 22, 2024
`shlex` in was treating single backslash "\\" in string as escape sequence, hence stripping them off. Modify `processCmdEnv` to double escape `\\`. This was in turn affecting the vertex `Name`, and mostly pronounced on Windows where backslashes are prevalent in path names. For example `C:\hello\world\path` was being rendered as `C:helloworldpath`, hence confusing users. Fixes moby#5250 Build progress before fix: ``` moby#5 [2/4] RUN echo C:helloworldpath moby#5 1.359 C:\hello\world\path moby#5 DONE 1.7s moby#6 [3/4] RUN echo C:\hello\escaped\path moby#6 1.734 C:\\hello\\escaped\\path moby#6 DONE 2.1s moby#7 [4/4] RUN echo "C:\hello\quoted\path" moby#7 1.765 "C:\hello\quoted\path" moby#7 DONE 2.1s ``` Build progress after fix: ``` moby#5 [2/4] RUN echo C:\hello\world\path moby#5 1.458 C:\hello\world\path moby#5 DONE 1.8s moby#6 [3/4] RUN echo C:\\hello\\escaped\\path moby#6 1.730 C:\\hello\\escaped\\path moby#6 DONE 2.1s moby#7 [4/4] RUN echo "C:\hello\quoted\path" moby#7 1.702 "C:\hello\quoted\path" moby#7 DONE 2.1s ``` You can also see that now paths in the step/vertex names now match those in the log lines right after the name. Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa
added a commit
to profnandaa/buildkit
that referenced
this issue
Sep 9, 2024
`shlex` in was treating single backslash "\\" in string as escape sequence, hence stripping them off. Modify `processCmdEnv` to double escape `\\`. This was in turn affecting the vertex `Name`, and mostly pronounced on Windows where backslashes are prevalent in path names. For example `C:\hello\world\path` was being rendered as `C:helloworldpath`, hence confusing users. Fixes moby#5250 Build progress before fix: ``` moby#5 [2/4] RUN echo C:helloworldpath moby#5 1.359 C:\hello\world\path moby#5 DONE 1.7s moby#6 [3/4] RUN echo C:\hello\escaped\path moby#6 1.734 C:\\hello\\escaped\\path moby#6 DONE 2.1s moby#7 [4/4] RUN echo "C:\hello\quoted\path" moby#7 1.765 "C:\hello\quoted\path" moby#7 DONE 2.1s ``` Build progress after fix: ``` moby#5 [2/4] RUN echo C:\hello\world\path moby#5 1.458 C:\hello\world\path moby#5 DONE 1.8s moby#6 [3/4] RUN echo C:\\hello\\escaped\\path moby#6 1.730 C:\\hello\\escaped\\path moby#6 DONE 2.1s moby#7 [4/4] RUN echo "C:\hello\quoted\path" moby#7 1.702 "C:\hello\quoted\path" moby#7 DONE 2.1s ``` You can also see that now paths in the step/vertex names now match those in the log lines right after the name. Signed-off-by: Anthony Nandaa <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
However, prints when escaped or put within
".."
:Minimal repro dockerfile:
Result:
With classic
docker build
:Result:
The text was updated successfully, but these errors were encountered: