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

Usage of import commands and powershell command prevents cross-compile #171

Closed
gbraad opened this issue Nov 29, 2022 · 7 comments
Closed

Comments

@gbraad
Copy link
Collaborator

gbraad commented Nov 29, 2022

In ./build.sh there is a reliance on:

USERPROFILE="$(powershell.exe -c 'Write-Host -NoNewline $env:USERPROFILE')"

and

wsl-vpnkit/build.sh

Lines 17 to 20 in a074e1c

# reinstall
wsl.exe --unregister wsl-vpnkit || :
wsl.exe --import wsl-vpnkit --version 2 "$USERPROFILE\\wsl-vpnkit" $DUMP
rm $DUMP

to determine and run specific Windows settings and commands.

@gbraad gbraad changed the title Usage of import statements and powershell command prevents cross-compile Usage of import coamnds and powershell command prevents cross-compile Nov 29, 2022
@gbraad gbraad changed the title Usage of import coamnds and powershell command prevents cross-compile Usage of import commands and powershell command prevents cross-compile Nov 29, 2022
@gbraad
Copy link
Collaborator Author

gbraad commented Nov 30, 2022

Would it be possible to break this up, or perhaps adopt a Makefile that can be used on a automated pipeline? More than willing to help with this. WDYT?

@josesa-xx
Copy link
Contributor

Actually since build.sh is meant to be run inside WSL, line 6 could just be replaced with:
USERPROFILE=$(wslvar USERPROFILE)

@gbraad
Copy link
Collaborator Author

gbraad commented Dec 1, 2022

The build.sh serves two purposes. one of them is the actual build that happens in the Docker container, the other is the import into the WSL environment. Several things can be improved:

  • container runtime independent; as I run builds on Podman
  • add a Makefile; use make to perform the build
  • and the build.sh doing a rebuild invoking make and the unregister and import

And you are right, as invoking 'powershell' to get an environment variable is mpt as clean as wslvar.

@josesa-xx
Copy link
Contributor

I've made some changes to my current pull request #169 to split build and import into different scripts and also allow build with podman as alternative.

@gbraad
Copy link
Collaborator Author

gbraad commented Dec 2, 2022 via email

@gbraad
Copy link
Collaborator Author

gbraad commented Dec 2, 2022

@josesa-xx for gvisor-tap-vsock we are adding a systemd service instead as it is more robust.
For our podman-machine implementation we are already using a systemd patch, so with the newer release of 22H2 this is fixed for future setups.

@sakai135
Copy link
Owner

sakai135 commented Jan 4, 2023

I'll close this issue since #169 seems to resolve the issue.

@sakai135 sakai135 closed this as completed Jan 4, 2023
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