Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that pixi run commands work across different platforms. #165

Closed
Hofer-Julian opened this issue Jul 1, 2023 · 2 comments · Fixed by #173
Closed

Ensure that pixi run commands work across different platforms. #165

Hofer-Julian opened this issue Jul 1, 2023 · 2 comments · Fixed by #173
Assignees

Comments

@Hofer-Julian
Copy link
Contributor

At the moment, executing pixi run means that your system shell executes the specified command:

let shell: ShellEnum = ShellEnum::default();

That is similar to how npm or just works, and it suffers from the same problems.
Users have to either:

I suggest getting inspired by Deno instead. Deno uses its own cross-platform shell, which is a subset of sh/bash: https://deno.land/[email protected]/tools/task_runner

The task runner is written in Rust and published on crates.io: https://github.com/jinjor/deno-task-runner
pixi could therefore directly depend on it.
It's also only about 6000 lines of code. If you don't like their direction, you could probably fork it and maintain it within this org.
To be extra sure, you could also ask Deno developers if they feel that the deno task runner is a good crate for other projects to depend on.

Alternatives:

  • use nushell, you will probably want to wait until 1.0 and even then it will not be a lightweight dependency
  • stick with the status quo, after all it seems to work okayish for npm and just too
@baszalmstra
Copy link
Contributor

This is a fantastic idea! 💯

The current implementation is also cross-platform but it is very limited. We don't allow shell commands to be run. The first argument has to be an existing executable file and all other arguments are quoted. This is very limited in what it can do and we were already planning on enabling some form or running shell commands so your idea sounds great!

We still need the platform-specific shell though because we need to run conda activation scripts which are platform specific. However, we are already working on caching the result of the activation scripts so we can run that independently of the running commands with pixi.

It would also be very interesting to use something like this in the conda ecosystem in general though. It's a real pain in the ass to write different build scripts for windows and UNIX.

We'll investigate this further!

@Hofer-Julian
Copy link
Contributor Author

The current implementation is also cross-platform but it is very limited. We don't allow shell commands to be run. The first argument has to be an existing executable file and all other arguments are quoted. This is very limited in what it can do and we were already planning on enabling some form or running shell commands so your idea sounds great!

Thanks for the clarification @baszalmstra! Seems like I should have looked more closely at the code :)
I am also happy to hear that you are open to the idea, very excited about a future where pixi manages my projects!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants