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

task with an env exports the environment variable ? #3287

Open
2 tasks done
saraedum opened this issue Mar 6, 2025 · 1 comment
Open
2 tasks done

task with an env exports the environment variable ? #3287

saraedum opened this issue Mar 6, 2025 · 1 comment

Comments

@saraedum
Copy link
Contributor

saraedum commented Mar 6, 2025

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

$ cat pixi.toml
[project]
name = "noname"
platforms = ["linux-64"]
channels = ["conda-forge"]

[tasks]
with = { cmd = "/usr/bin/env | grep '?'", env = { ARGUMENT = "hello" } }
without = { cmd = "/usr/bin/env | grep '?'" }
$ pixi run without
✨ Pixi task (without): /usr/bin/env | grep '?'
$ pixi run with
✨ Pixi task (with): /usr/bin/env | grep '?'
?=0

Issue description

Setting an environment variable on the task level also sets the environment variable ?. This breaks tools such as automake.

Expected behavior

Only the environment variables specified in the env should be set.

@saraedum
Copy link
Contributor Author

saraedum commented Mar 6, 2025

This also happens when putting an && into the command:

[project]
name = "noname"
platforms = ["linux-64"]
channels = ["conda-forge"]

[tasks]
with = { cmd = "/bin/true && /usr/bin/env | grep '?'" }
without = { cmd = "/usr/bin/env | grep '?'" }

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

No branches or pull requests

1 participant