windmill-labs / windmill

Open-source developer platform to turn scripts into workflows and UIs. Fastest workflow engine (5x vs Airflow). Open-source alternative to Airplane and Retool.
https://windmill.dev
Other
9.6k stars 439 forks source link

feature: make windmill compilable from windows #3089

Open AudriusButkevicius opened 7 months ago

AudriusButkevicius commented 7 months ago

Describe the bug

I was trying to build this on Windows, and there are a few steps that fail.

  1. First one was that openapi-client generation fails, because I didn't have any sort of "/bin/sh" equivalent (does a sh bundle.sh). Given the bundle.sh mostly just invokes npx, and pipes output, surely that can be done in rust, and not need a shell script?
  2. NPX bundle generation just hung forever, because we just pipe the output without disabling any interactivity:
    Need to install the following packages:
    swagger-cli@4.0.4
    Ok to proceed? (y) 
  3. The build requires to have a database available?
    C:/apps/.cargo/bin/cargo.exe build --color=always --message-format=json-diagnostic-rendered-ansi --all --all-targets
    Compiling windmill-common v1.254.0 (C:\code\windmill\backend\windmill-common)
    Compiling windmill-worker v1.254.0 (C:\code\windmill\backend\windmill-worker)
    Compiling windmill-api-client v1.254.0 (C:\code\windmill\backend\windmill-api-client)
    Compiling windmill-parser-wasm v1.254.0 (C:\code\windmill\backend\parsers\windmill-parser-wasm)
    error: error communicating with database: No such host is known. (os error 11001)
    --> windmill-common\src\db.rs:82:9
    |
    82 | /         sqlx::query!(
    83 | |             "SELECT set_config('session.user', $1, true)",
    84 | |             authed.username()
    85 | |         )
    | |_________^
    |
    = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query` (in Nightly builds, run with -Z macro-backtrace for more info)

At this point I'm not longer sure what I'm supposed to do, as it's not clear what it's trying to connect to, how or why.

To reproduce

  1. Get a fresh windows computer without all the tools it expects to be there
  2. Try to build it

Expected behavior

  1. I can build it

Screenshots

No response

Browser information

No response

Application version

No response

Additional Context

No response

rubenfiszel commented 7 months ago

We do not support building from source on Windows, editing the issue to feature

AudriusButkevicius commented 7 months ago

Sure, however I'm not sure the issues I've hit are windows specific.

Perhaps I'm just bad at looking but I couldn't find a build guide, what versions of toolchains I need etc.

Npx hanging on a prompt, needing some sql database is not windows specific.

The only unsupported thing as it stands is using /bin/sh which I'm arguing doesn't need to exist in the first place and can be done in rust itself.

shad00m commented 6 months ago

The Backend is now compilable under windows however, the worker does not run properly on Windows. I'm not sure if I should open another Issue or comment here. If I'm in the wrong, feel free to delete this and I will create a new issue.

Most importantly Powershell Scripts don't work. I have set the environment Variable "POWERSHELL_PATH" (which is not described in the Readme) to the correct path. I have tried the default Powershell.exe and the pwsh.exe (PS7):

Powershell.exe:

ExecutionErr: ExitCode: -65536, last log lines:
Interner Windows PowerShell-Fehler. Fehler 8009001d beim Laden der verwalteten Windows PowerShell.

searches for but not found: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\powershell.exe

pwsh.exe (PS7): (needed to manually create c:\tmp\windmill\cache\powershell\ or it would say "path not found" - there seems to be no TMP env variable)

Set-Alias: The term 'Set-Alias' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
... thousands of these...
Set-Alias: The term 'Set-Alias' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Write-Output: C:\tmp\windmill\wk-windows-pc-3tst4\018dd0e1-8483-827c-2089-4814e19bba05\main.ps1:12
Line |
  12 |  Write-Output "Hello $Msg"
     |  ~~~~~~~~~~~~
     | The term 'Write-Output' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Go Scripts end in:

ExecutionErr: error during execution of the script:
Lockfile generation failed: ExitStatus(2)

Python Scripts end in:

ExecutionErr: error during execution of the script:
pip compile failed: IO error: program not found

After adding pip-compile.exe manually it errors at:

ExecutionErr: error during execution of the script:
IO error: Das System kann den angegebenen Pfad nicht finden. (os error 3)
resolving dependencies...
content of requirements:
wmill

found cached resolution: py-4174e7f6203eebdf2788d6ff419f4b84b53ac5480f630daf7d5f04c291098084
--- PIP INSTALL ---

anyio==4.3.0 is being installed for the first time.
 It will be cached for all ulterior uses.

I know windows is not (yet) officially supported but I hope someone else has an Idea or had some success with a windows worker