python-launcher icon indicating copy to clipboard operation
python-launcher copied to clipboard

Support Windows `PATH`

Open brettcannon opened this issue 5 years ago • 8 comments
trafficstars

Also requires getting compilation to work.

brettcannon avatar Jun 27 '20 03:06 brettcannon

It doesn't compile on Windows due to the use of nix crate.

messense avatar May 11 '22 02:05 messense

Correct, no attempt has been made at Windows support yet.

brettcannon avatar May 11 '22 20:05 brettcannon

Maybe I'm misunderstanding, but it seems like the nix dependency is only used for the py binary. The library could still implement support for PATH, right?

cnpryer avatar Jan 26 '23 03:01 cnpryer

Maybe I'm misunderstanding, but it seems like the nix dependency is only used for the py binary. The library could still implement support for PATH, right?

There isn't really a separate library yet, but there are plans to create one. In that instance there shouldn't be an issue with Windows support. I do still hope to eventually make the binary work with Windows as well.

brettcannon avatar Jan 26 '23 18:01 brettcannon

Cool! Are you open to PRs to help support Windows even if it's just library changes? I looked into options for the py changes, but I couldn't find anything low-hanging that'd replace the process for you instead of just spawning a second one.

Referring to https://github.com/brettcannon/python-launcher/pull/2#discussion_r209390085 specifically.

cnpryer avatar Jan 27 '23 02:01 cnpryer

Are you open to PRs to help support Windows even if it's just library changes?

Not at this moment as I would worry it wouldn't get tested appropriately until it is a separate crate. But once the separate crate exists I will definitely take a PR!

I couldn't find anything low-hanging that'd replace the process for you instead of just spawning a second one.

I honestly don't think such an option exists on Windows, so it will just require launching a second process. I haven't delved into that because if you look at https://github.com/python/cpython/blob/main/PC/launcher2.c you will notice it isn't a simple "launch another process" thing.

brettcannon avatar Jan 27 '23 20:01 brettcannon

FWIW it looks like cargo tries to do this with a Ctrl-C signal https://github.com/rust-lang/cargo/blob/4a3c588b1f0a8e2dc8dd8789dbf3b6a71b02ed49/crates/cargo-util/src/process_builder.rs#L259-L276

cnpryer avatar Mar 14 '23 15:03 cnpryer

It doesn't compile on Windows due to the use of nix crate.

Maybe "Compile and run on Windows" (or similar) should be a separate issue in this milestone? The current list of milestones implies that it's already compiling and running and there are some unmet features.

Not at this moment as I would worry it wouldn't get tested appropriately until it is a separate crate.

Perhaps this should also be a separate issue in the milestone?

jaraco avatar Jun 02 '24 09:06 jaraco