-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hey, not sure what has changed on Windows OS' side, but it seems to be ignoring the shebangs (if they were ever a thing there) and executing the shims as a standard .exe file following some users of mine reports, causing errors like these:
PowerShell:
❯ uvx --from rustup cargo
error: Failed to spawn: `cargo`
Caused by: This version of %1 is not compatible with the version of Windows you're running.
Check your computer's system information and then contact the software publisher. (os error 216)
cmd: A popup modal dialog:
I'm 100% positive they worked at least two weeks ago as .exes, but no code has changed ever since, which is weird.
No issues on Linux/macOS as they know it's a python script via contents.
Potential solution
Easy way out is doing something similar to my reference repo for issue #2 defining the entry points in [project.scripts] and letting the package manager create files. On lin/mac they are basically name = "package.module:main" -> from package.module import main; main() as venv/bin/name metaprogrammed python scripts, but for windows, files like black.exe, gradio.exe seems to be native platform executables.
Also, instead of a unique file per shim, bundling a main script with multiple functions works much nicer 🙂