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

pixi run confusing error when a command with spaces is passed inside a vector #853

Open
traversaro opened this issue Feb 26, 2024 · 3 comments
Assignees
Labels
✨ enhancement Feature request 👋 good first issue Good for newcomers

Comments

@traversaro
Copy link
Contributor

traversaro commented Feb 26, 2024

Problem description

Reproduce:

git clone -b patch-3 https://github.com/traversaro/pixi
cd pixi/examples/ctypes-factorial/
pixi run compile

The resulting error is:

traversaro@IITBMP014LW012:~/pixi/examples/ctypes-factorial$ pixi run compile
✨ Pixi task (default): "gcc -shared -o src/factorial.so src/factorial.c"
Error launching 'gcc -shared -o src/factorial.so src/factorial.c': No such file or directory (os error 2)

The actual problem is that the command with space is contained in a vector instead of being directly assigned to cmd (I created this on purpouse in traversaro@9a5c2ce), however it is not obvious to understand this from the error (at least, not to me that I spent some time to understand this in a similar example).

@traversaro traversaro added the ✨ enhancement Feature request label Feb 26, 2024
@ruben-arts
Copy link
Contributor

I think you want the same thing as this issue #837

@traversaro
Copy link
Contributor Author

traversaro commented Feb 26, 2024

I think you want the same thing as this issue #837

To be honest, I am not sure how to solve, I just spent ~10 minutes tryng to figure out what this error was about, and I thought it was worth reporting it. I guess possible solution are either:

  • Have a more clear error message (something like "space detected in element of command vector?, this is is not supported?")
  • Have compile = {cmd = ["gcc -shared -o src/factorial.so src/factorial.c"]} be equivalent to compile = {cmd = "gcc -shared -o src/factorial.so src/factorial.c"}

I guess from the point of view of this issue, both are solutions are fine.

@ruben-arts
Copy link
Contributor

Ah yeah, I meant that it can read the list of commands without acting weird on the spaces. The actual multi command is an extra feature indeed!

@ruben-arts ruben-arts added the 👋 good first issue Good for newcomers label Feb 29, 2024
@baszalmstra baszalmstra self-assigned this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement Feature request 👋 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants