Skip to content

Commit

Permalink
Check WSL exists first
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Jul 29, 2024
1 parent 0d7e715 commit cd96eb5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 4 additions & 1 deletion conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,10 @@ def bundle_conda(
if (
# WSL bash is always the same path, it is an alias to the default
# distribution as configured by the user
on_win and Path("C:\\Windows\\System32\\bash.exe").samefile(args[0])
on_win
# check if WSL is installed before calling Path.samefile/os.stat
and (wsl_bash := Path("C:\\Windows\\System32\\bash.exe")).exists()
and wsl_bash.samefile(args[0])
):
raise CondaBuildUserError(
"WSL bash.exe is not supported. Please use MSYS2 packages. Add "
Expand Down
19 changes: 19 additions & 0 deletions news/5434-check-for-WSL
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Check for WSL existence before calling `os.stat`. (#5433 via #5434)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>

0 comments on commit cd96eb5

Please sign in to comment.