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 deno just invokes pixi again #2982

Open
2 tasks done
gsa-tspaere opened this issue Jan 22, 2025 · 4 comments
Open
2 tasks done

pixi run deno just invokes pixi again #2982

gsa-tspaere opened this issue Jan 22, 2025 · 4 comments
Labels
area:tasks Related to pixi tasks 🐞 bug Something isn't working

Comments

@gsa-tspaere
Copy link

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

$ pixi init
✔ Created /dev/shm/deno-break/pixi.toml
$ pixi add deno
✔ Added deno >=2.1.6,<2.2
$ pixi run deno
Pixi [version 0.40.2] - Developer Workflow and Environment Management for Multi-Platform, Language-Agnostic Projects.

Pixi is a versatile developer workflow tool designed to streamline the management of your project's dependencies, tasks, and environments.
Built on top of the Conda ecosystem, Pixi offers seamless integration with the PyPI ecosystem.

Basic Usage:
    Initialize pixi for a project:
    $ pixi init
    $ pixi add python numpy pytest

    Run a task:
    $ pixi task add test 'pytest -s'
    $ pixi run test

Found a Bug or Have a Feature Request?
Open an issue at: https://github.com/prefix-dev/pixi/issues

Need Help?
Ask a question on the Prefix Discord server: https://discord.gg/kKV8ZxyzY4

For more information, see the documentation at: https://pixi.sh

Usage: pixi [OPTIONS] <COMMAND>

Commands:
  init         Creates a new project
  add          Adds dependencies to the project [aliases: a]
  remove       Removes dependencies from the project [aliases: rm]
  install      Install all dependencies [aliases: i]
  update       Update dependencies as recorded in the local lock file
  upgrade      Update the version of packages to the latest possible version, disregarding the manifest version constraints
  run          Runs task in project [aliases: r]
  exec         Run a command in a temporary environment [aliases: x]
  shell        Start a shell in the pixi environment of the project [aliases: s]
  shell-hook   Print the pixi environment activation script
  project      Modify the project configuration file through the command line
  task         Interact with tasks in the project
  list         List project's packages [aliases: ls]
  tree         Show a tree of project dependencies [aliases: t]
  global       Subcommand for global package management actions [aliases: g]
  auth         Login to prefix.dev or anaconda.org servers to access private channels
  config       Configuration management
  info         Information about the system, project and environments for the current machine
  upload       Upload a conda package
  search       Search a conda package
  self-update  Update pixi to the latest version or a specific version
  clean        Clean the parts of your system which are touched by pixi. Defaults to cleaning the environments and task cache. Use the `cache` subcommand to clean the cache
  completion   Generates a completion script for a shell
  build        Project configuration
  help         Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose...     Increase logging verbosity
  -q, --quiet...       Decrease logging verbosity
      --color <COLOR>  Whether the log needs to be colored [env: PIXI_COLOR=] [default: auto] [possible values: always, never, auto]
      --no-progress    Hide all progress bars, always turned on if stderr is not a terminal [env: PIXI_NO_PROGRESS=]
  -h, --help           Print help
  -V, --version        Print version
$ pixi run which deno
/dev/shm/deno-break/.pixi/envs/default/bin/deno
$ pixi shell
(deno-break) $ deno --version
deno 2.1.6 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2
(deno-break) $ exit
$ echo '#!/bin/bash' > wrapper.sh
$ echo 'deno $@' >> wrapper.sh
$ chmod +x wrapper.sh
$ pixi run ./wrapper.sh --version
deno 2.1.6 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2

Issue description

It's not possible to run deno with pixi run directly, which is a real pain. I don't know why this is, but when adding a wrapper script it works again.

This is the work around for me, but it would obviously be ideal if we could skip that step.

Expected behavior

For me to be able to just run pixi run deno without the wrapper.

@ruben-arts
Copy link
Contributor

We use deno_task_shell as the underlying shell. So they probably hardcoded some logic to spawn the current binary to run instead of calling deno. We'll take a look!

@ruben-arts ruben-arts added 🐞 bug Something isn't working area:tasks Related to pixi tasks labels Jan 22, 2025
@riccardoporreca
Copy link

Hi there, knowing this was working in older versions of Pixi, I did a quick "binary search" to identify the issue was introduced in 0.39.3

pixi self-update --version 0.39.2
pixi run deno

works correctly

Deno 2.1.6
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
>
pixi self-update --version 0.39.3
pixi run deno

shows the pixi help

Pixi [version 0.39.3] - Developer Workflow and Environment Management for Multi-Platform, Language-Agnostic Projects.
[...]

Hope this helps

@ruben-arts
Copy link
Contributor

Thank you, that was the release we bumped deno_task_shell from v0.16.0 to v0.20.2. This is of great help to the issue!

@ruben-arts
Copy link
Contributor

This code is part of the issue: denoland/deno_task_shell#123

We'll check if we can make a work around.

Hofer-Julian added a commit to Hofer-Julian/deno_task_shell that referenced this issue Jan 24, 2025
At [pixi](https://github.com/prefix-dev/pixi) we use the `deno_task_shell` in a very similar way as deno does.
Like deno, `pixi` can manage packages, including deno.
However, with the current setup `pixi run deno` leads to pixi being called rather than deno.
Therefore, we'd appreciate if we could configure the executable name.
This allows us to configure it like this in `config.toml`:
```toml
[env]
# Needed so that `pixi run deno`, calls deno instead of pixi
DENO_EXECUTABLE_NAME = "pixi"
```

Related issue: prefix-dev/pixi#2982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tasks Related to pixi tasks 🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants