You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❯ pixi -vvv shell-hook --shell bash | grep GOROOT
DEBUG pixi::config: Loading config from C:\ProgramData\pixi\config.toml
DEBUG pixi::config: Failed to load system config: C:\ProgramData\pixi\config.toml (error: failed to read config from 'C:\ProgramData\pixi\config.toml')
DEBUG pixi::config: Loading config from C:\Users\user2\.config\pixi\config.toml
DEBUG pixi::config: Failed to load global config: C:\Users\user2\.config\pixi\config.toml (error: failed to read config from 'C:\Users\user2\.config\pixi\config.toml')
DEBUG pixi::config: Loading config from C:\Users\user2\AppData\Roaming\pixi\config.toml
DEBUG pixi::config: Failed to load global config: C:\Users\user2\AppData\Roaming\pixi\config.toml (error: failed to read config from 'C:\Users\user2\AppData\Roaming\pixi\config.toml')
DEBUG pixi::config: Loading config from C:\Users\user2\.pixi\config.toml
DEBUG pixi::config: Failed to load global config: C:\Users\user2\.pixi\config.toml (error: failed to read config from 'C:\Users\user2\.pixi\config.toml')
DEBUG pixi::config: Loading config from C:\Users\user2\bla\.pixi\config.toml
DEBUG pixi::config: Failed to load local config: C:\Users\user2\bla\.pixi\config.toml (error: failed to read config from 'C:\Users\user2\bla\.pixi\config.toml')
INFO pixi::environment: verifying prefix location is unchanged, with prefix file: C:\Users\user2\bla\.pixi\envs\default\conda-meta\pixi_env_prefix
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: _go_select
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: go
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: go-task
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: just
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-gcc-libgfortran
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-gcc-libs
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-gcc-libs-core
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-gmp
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-libwinpthread-git
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: msys2-conda-epoch
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: nodejs
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: _go_select
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: _libgcc_mutex
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: _openmp_mutex
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: ca-certificates
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: go
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: go-task
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: icu
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: just
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libgcc-ng
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libgfortran-ng
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libgfortran5
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libgomp
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libstdcxx-ng
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libuv
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libzlib
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: nodejs
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: openssl
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: zlib
INFO pixi::lock_file::update: the lock-file is up-to-date
DEBUG pixi::environment: Wrote environment file to: "C:\\Users\\user2\\bla\\.pixi\\envs\\default\\conda-meta\\pixi"
INFO pixi::environment: Creating prefix file at: C:\Users\user2\bla\.pixi\envs\default\conda-meta\pixi_env_prefix
INFO pixi::environment: No update needed for the prefix file.
INFO pixi::environment: Checking ifhistory file exists: C:\Users\user2\bla\.pixi\envs\default\conda-meta\history
INFO pixi::lock_file::resolve::uv_resolution_context: uv keyring provider is disabled
❯ pixi -vvv run env | grep GOROOT
DEBUG pixi::config: Loading config from C:\ProgramData\pixi\config.toml
DEBUG pixi::config: Failed to load system config: C:\ProgramData\pixi\config.toml (error: failed to read config from 'C:\ProgramData\pixi\config.toml')
DEBUG pixi::config: Loading config from C:\Users\user2\.config\pixi\config.toml
DEBUG pixi::config: Failed to load global config: C:\Users\user2\.config\pixi\config.toml (error: failed to read config from 'C:\Users\user2\.config\pixi\config.toml')
DEBUG pixi::config: Loading config from C:\Users\user2\AppData\Roaming\pixi\config.toml
DEBUG pixi::config: Failed to load global config: C:\Users\user2\AppData\Roaming\pixi\config.toml (error: failed to read config from 'C:\Users\user2\AppData\Roaming\pixi\config.toml')
DEBUG pixi::config: Loading config from C:\Users\user2\.pixi\config.toml
DEBUG pixi::config: Failed to load global config: C:\Users\user2\.pixi\config.toml (error: failed to read config from 'C:\Users\user2\.pixi\config.toml')
DEBUG pixi::config: Loading config from C:\Users\user2\bla\.pixi\config.toml
DEBUG pixi::config: Failed to load local config: C:\Users\user2\bla\.pixi\config.toml (error: failed to read config from 'C:\Users\user2\bla\.pixi\config.toml')
INFO pixi::environment: verifying prefix location is unchanged, with prefix file: C:\Users\user2\bla\.pixi\envs\default\conda-meta\pixi_env_prefix
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: _go_select
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: _libgcc_mutex
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: _openmp_mutex
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: ca-certificates
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: go
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: go-task
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: icu
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: just
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libgcc-ng
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libgfortran-ng
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libgfortran5
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libgomp
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libstdcxx-ng
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libuv
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: libzlib
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: nodejs
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: openssl
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: zlib
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: _go_select
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: go
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: go-task
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: just
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-gcc-libgfortran
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-gcc-libs
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-gcc-libs-core
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-gmp
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: m2w64-libwinpthread-git
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: msys2-conda-epoch
DEBUG pixi::lock_file::package_identifier: Using backwards compatibility purl logic for conda package: nodejs
INFO pixi::lock_file::update: the lock-file is up-to-date
DEBUG pixi::cli::run: Task parsed from run command: ["env"]
INFO pixi::cli::run: Task graph: TaskGraph: number of nodes: 1, nodes: task: CUSTOM COMMAND, environment: default, command: `env`, additional arguments: ``, depends-on: ``
INFO pixi::task::executable_task: Checking if task can be skipped
DEBUG pixi::environment: Wrote environment file to: "C:\\Users\\user2\\bla\\.pixi\\envs\\default\\conda-meta\\pixi"
INFO pixi::environment: Creating prefix file at: C:\Users\user2\bla\.pixi\envs\default\conda-meta\pixi_env_prefix
INFO pixi::environment: No update needed for the prefix file.
INFO pixi::environment: Checking ifhistory file exists: C:\Users\user2\bla\.pixi\envs\default\conda-meta\history
INFO pixi::lock_file::resolve::uv_resolution_context: uv keyring provider is disabled
GOROOT=C:\Users\user2\bla\.pixi\envs\default\go
# Export activation environment - applying broken path fix on Git Bash (MSYS2)
❯ eval"$(pixi shell-hook --shell bash | sed 's/^export [Pp][Aa][Tt][Hh]=/export PATH=/I; s/;/:/g')"
❯ which go
/c/Users/user2/bla/.pixi/envs/default/bin/go
❯ env | grep GOROOT
❯ go version
go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
❯ pixi run which go
/c/Users/user2/bla/.pixi/envs/default/bin/go
❯ pixi run env | grep GOROOT
GOROOT=C:\Users\user2\sdl\labs\sdl-web\sdl-web-demo-7\.pixi\envs\default\go
❯ pixi run go version
go version go1.22.3 windows/amd64
Issue description
I'm running in a Git Bash environment (i.e. MSYS2) on Windows.
I apply the above mentioned sed to the shell-hook output, to fixup the PATH: #417
I expect that go version and pixi run go version should produce the same results.
I expect that env | grep GOROOT and pixi run env | grep GOROOT should produce the same results.
After a little debugging I found that the reason is that the GOROOT variable is set by an activation script. The activation script for windows is not found by the Activator when creating a shell-hook script for bash. For bash the activation script must be a bash activation script.
When using pixi run we run the activation with CmdExe behind the scenes which is why with pixi run the variable is set.
You can observe this behavior when you run pixi shell-hook --shell cmd an extra line is added to the shell hook that looks something like:
We could streamline this behavior between shell-hook and run by also running the activation in the background for shell-hook for the OSes native shell. This is slower though and might not capture all the intricacies of the activation scripts. E.g. if a package does something special for bash this wont be included.
We could leave as is. Perhaps updating the go feedstock to not use activation scripts?
If we allow to turn off the activation (which counts for all activating tools), point one should be the best options. As it's in the conda spec we should implement it as best we can.
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
Issue description
I'm running in a Git Bash environment (i.e. MSYS2) on Windows.
I apply the above mentioned
sed
to the shell-hook output, to fixup the PATH: #417I expect that
go version
andpixi run go version
should produce the same results.I expect that
env | grep GOROOT
andpixi run env | grep GOROOT
should produce the same results.Maybe this PR is related: #1507
Expected behavior
The behaviour after a shell-hook export and inside a pixi run should be the same:
The
GOROOT
environment variable must be present in both environments.The text was updated successfully, but these errors were encountered: