-
Notifications
You must be signed in to change notification settings - Fork 152
CLI fails to deploy when building python wheels on Windows with WSL installed #1159
Description
Describe the issue
When using a Wheel task eg:
python_wheel_task:
package_name: default_python
entry_point: main
libraries:
- whl: ../dist/*.whl
Validation completes, but deployment fails with:
Error: build failed default, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec3488002273.sh: No such file or directory
Configuration
Please provide a minimal reproducible configuration for the issue
Steps to reproduce the behavior
- Install Windows with WSL enabled (https://learn.microsoft.com/en-us/windows/wsl/install)
- Download the zip file from GitHub and add to path
- Grab the default_python folder (https://github.com/databricks/bundle-examples)
- Change directory into the default_python folder, fix up the target destinations and run databricks bundle deploy
- See the error
Error: build failed default, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
Expected Behavior
The wheel builds and deployment completes successfully.
Actual Behavior
The wheel fails to build and deployment completes successfully.
OS and CLI version
- Databricks CLI v0.212.2 (From GitHub releases)
- Windows 11 23H2 (10.0.22631.3085)
- Python 3.12.1
Is this a regression?
Yes - this was working with v0.211.0
Logs
Having a look at code that looks a bit suspicious:
Line 26 in af618f7
| out, err := osexec.LookPath("bash") |
It looks like it checks if the path "bash" exists, that unfortunately isn't enough to detect if bash for Windows is installed as WSL (Windows Subsystem for Linux) will route all commands sent to bash to the Linux subsystem, but that's not what we want in this case!
I believe the best solution is to just use CMD on Windows - that way if developers have WSL installed it won't cause issues.
Building default_python...
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
pid=37912 mutator=seq mutator=build mutator=seq mutator=artifacts.BuildAll mutator=seq mutator=artifacts.Build(default_python) mutator=artifacts.whl.Build(default_python)
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
pid=37912 mutator=seq mutator=build mutator=seq mutator=artifacts.BuildAll mutator=seq mutator=artifacts.Build(default_python)
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
pid=37912 mutator=seq mutator=build mutator=seq mutator=artifacts.BuildAll mutator=seq
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
pid=37912 mutator=seq mutator=build mutator=seq mutator=artifacts.BuildAll
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
pid=37912 mutator=seq mutator=build mutator=seq
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
pid=37912 mutator=seq mutator=build
18:10:56 ERROR Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory
pid=37912 mutator=seq
Error: build failed default_python, error: exit status 1, output: /bin/bash: C:UsersnathanAppDataLocalTempcli-exec944438467.sh: No such file or directory