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

Add wsl2 support for warden #213

Merged
merged 4 commits into from
Aug 25, 2020
Merged

Conversation

ihor-sviziev
Copy link
Contributor

@ihor-sviziev ihor-sviziev commented Aug 19, 2020

Fixes #212

As a workaround now we can add following lines in order to have working xdebug with warden on WSL2:

XDEBUG_CONNECT_BACK_HOST=host.docker.internal
WARDEN_ENV_DEBUG_HOST=host.docker.internal

After this change warden debug works fine without adding any new params to .env file.

this is retrieved from wsl2:

$ echo "$(< /proc/sys/kernel/osrelease)"
4.19.104-microsoft-standard

@ihor-sviziev ihor-sviziev changed the title Add wsl2 support for warden debug command Add wsl2 support for warden Aug 19, 2020
@davidalger davidalger added this to the Warden 0.9.1 milestone Aug 20, 2020
@davidalger
Copy link
Collaborator

Very nice, thank you! I tweaked the checks a bit to be case-insensitive using grep to avoid an error on Darwin/MacOS where /proc files do not exist:

/opt/warden/commands/env.cmd: line 32: /proc/sys/kernel/osrelease: No such file or directory

Verified this is working as expected on WSL2, Darwin, Linux via following checks:

warden debug -c 'printenv XDEBUG_REMOTE_HOST'
warden env exec nginx grep HTTP_X_DEBUG_HOST /etc/nginx/fastcgi_params

On WSL2 and Darwin both are host.docker.internal as expected and neither contain that value on Fedora Linux (as expected).

Going to get this merged and tag a release here shortly. Thanks for the contribution @ihor-sviziev!

@davidalger davidalger merged commit 56899ef into wardenenv:develop Aug 25, 2020
@ihor-sviziev ihor-sviziev deleted the patch-1 branch August 25, 2020 15:47
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

Successfully merging this pull request may close these issues.

XDebug on WSL2/Ubuntu 18.04
2 participants