Skip to content
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

WSL: unquoted $PATH value breaks under WSL #17

Open
nbuwe opened this issue Mar 19, 2024 · 5 comments
Open

WSL: unquoted $PATH value breaks under WSL #17

nbuwe opened this issue Mar 19, 2024 · 5 comments

Comments

@nbuwe
Copy link

nbuwe commented Mar 19, 2024

criu/Makefile

Line 252 in daeef8f

$(Q) env -i PATH=$$PATH make CC=$(CC) CFLAGS="$(CFLAGS)" -C lz4 lib lz4

Under WSL PATH may contain Windows directories with spaces in their names. Windows apps installed under C:\Program Files that add themselves to the Windows PATH has their entries visible/inherited on the Linux side as /mnt/c/Program Files/... entries in the Linux PATH.

The value of PATH passed to the env command should be quoted.

@wkia
Copy link
Contributor

wkia commented Mar 22, 2024

Hi @nbuwe,
Thank you for reporting the issue. Actually criu is not intended to be built on WSL, so you may want to use a Linux container. May I ask why are you trying to build on WSL?

@nbuwe
Copy link
Author

nbuwe commented Mar 22, 2024

I may be mistaken, but WSL2 is a Linux container, isn't it? As far as I understand it uses a real Linux kernel (microsoft/WSL2-Linux-Kernel) and individual WSL guests are run as containers under the main Linux instance that runs microsoft/azurelinux internally.

@wkia
Copy link
Contributor

wkia commented Mar 22, 2024

Sorry for miscommunication, I meant docker Linux container of course, that you may want to use building criu.
However, I'm wondering why are you trying to build criu on WSL. Is there a rational reason or a special use case? It'd be great if you share your scenarios for better understanding.

@nbuwe
Copy link
Author

nbuwe commented Mar 22, 2024

I'm not sure how familiar with WSL are you. If not - just think s/on WSL/under docker/. It's just a way to run almost any linux distro of your choice.

I'm not trying to "build criu on WSL", I'm just trying to "build criu". The "on WSL" part is tangential (it could have been "build criu under Ubuntu 22 under VirtualBox", "build criu on Alpine inside docker" and many other things). I just happened to be on WSL in that particular moment in time, b/c for $reasons I was traveling with the windows laptop, not the linux laptop, and not the macbook (where I can use VirtualBox). It's a red herring. Any environment that happens to have a directory with a space in its name in PATH will run into this problem. It just happens that in most linux environments that is not the case by convention, and under WSL it's very likely to be the case, that's all.

I don't really want the trivial quoting bug to diverge into a philosophical discussion of relative merits of dockerized builds vs. free-ranging builds.

@rvansa
Copy link
Member

rvansa commented Mar 26, 2024

Here I agree with @nbuwe , despite spaces in path being evil. I've also cloned CRIU into /tmp/foo bar (with space) and I can't build from there either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants