pixi global on windows can expose too much
Checks
-
[x] I have checked that this issue has not already been reported.
-
[x] I have confirmed this bug exists on the latest version of pixi, using
pixi --version.
Reproducible example
use a windows system and do
pixi global install git
and when you have this
pixi global install vim
Issue description
The problem on installing vim or git on windows is that they expose a ton of commands. And because one already exists the other can't get installed.
pixi global install git
Global environments as specified in 'C:\Users\r.bauer\.pixi\manifests\pixi-global.toml'
└── git: 2.48.1 (installed)
└─ exposes: [, arch, awk, b2sum, base32, base64, basename, basenc, bash, bunzip2, bzcat, bzip2, bzip2recover, captoinfo, cat, chattr, chcon, chgrp, chmod, chown, chroot, cksum, clear, cmp, column, comm, cp, csplit, cut, cygcheck, cygpath, cygwin-console-helper, d2u, dash, date, dd, df, diff, diff3, dir, dircolors, dirmngr-client, dirmngr, dirname, dos2unix, du, dumpsexp, echo, env, ex, expand, expr, factor, false, file, find, fmt, fold, funzip, gawk-5.0.0, gawk, gencat, getconf, getfacl, getopt, gkill, gmondump, gpg-agent, gpg-card, gpg-connect-agent, gpg-error, gpg-wks-client, gpg-wks-server, gpg, gpgconf, gpgparsemail, gpgscm, gpgsm, gpgsplit, gpgtar, gpgv, grep, groups, gzip, head, hmac256, hostid, hostname, iconv, id, infocmp, infotocap, install, join, kbxutil, kill, ldd, ldh, less, lessecho, lesskey, link, ln, locale, locate, logname, ls, lsattr, mac2unix, md5sum, minidumper, mintty, mkdir, mkfifo, mkgroup, mknod, mkpasswd, mktemp, mount, mpicalc, mv, nano, nettle-hash, nettle-lfib-stream, nettle-pbkdf2, newgrp, nice, nl, nohup, nproc, numfmt, od, openssl, p11-kit, passwd, paste, patch, pathchk, perl, perl5.38.2, pinentry-w32, pinentry, pinky, pkcs1-conv, pldd, pluginviewer, pr, printenv, printf, profiler, ps, psl, ptx, pwd, readlink, realpath, rebase, regtool, reset, rm, rmdir, rnano, runcon, rview, rvim, scp, sdiff, sed, seq, setfacl, setmetamode, sexp-conv, sftp, sh, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, shred, shuf, sleep, sort, split, ssh-add, ssh-agent, ssh-keygen, ssh-keyscan, ssh-pageant, ssh, ssp, stat, stdbuf, strace, stty, sum, sync, tabs, tac, tail, tar, tee, test, tic, tig, timeout, toe, touch, tput, tr, true, truncate, trust, tset, tsort, tty, tzset, u2d, umount, uname, unexpand, uniq, unix2dos, unix2mac, unlink, unzip, unzipsfx, users, vdir, view, vim, vimdiff, watchgnupg, wc, which, who, whoami, winpty-agent, winpty-debugserver, winpty, xargs, xxd, yat2m, yes, zipinfo, git
Any of these will block other packages global installed
Expected behavior
I would expect a similiar amount as on my Mac or Linux System
pixi global install git
Global environments as specified in '/Users/reimarbauer/.pixi/manifests/pixi-global.toml'
└── git: 2.48.1 (installed)
└─ exposes: git, git-credential-osxkeychain, git-cvsserver, git-receive-pack, git-shell, git-upload-archive, git-upload-pack, gitk, scalar
I don't know if the fix needs to be done in the https://github.com/conda-forge/git-feedstock/issues/159
or if this is a pixi windows issue.
I'd indeed expect that the git feedstock should be adapted instead.
Until then, you can run pixi global install --expose git git in order to only expose git itself.
There are more which creates that problem, the vim-feedstock at least too. Each blocks the other to become without options global installed. Maybe a scan for that problem will find a lot more.
I am not sure there is a lot we can do, besides maybe offering a sort of terminal user interface to make selecting the binaries to expose easier. But users can always edit the .toml file to select only a subset … And ideally, the packages are going to be adapted to make them more granular.
when I download and unzip https://anaconda.org/conda-forge/git/2.49.0/download/win-64/git-2.49.0-h57928b3_0.conda
and afterwards tar --zstd -xf pkg-git-2.49.0-h57928b3_0.tar.zst
I see on windows a
ls Library/bin
bash.exe git.exe sh.exe
on linux
ls bin
git git-cvsserver git-shell git-upload-pack scalar
git-credential-osxkeychain git-receive-pack git-upload-archive gitk
on mac
ls bin
git git-cvsserver git-shell git-upload-pack scalar
git-credential-osxkeychain git-receive-pack git-upload-archive gitk
windows has the shortest amount of commands in the conda package. It is valid that they offer different commands. But how or why does an installation on windows expose all the others?
Can you also check the Scripts/ folder and the mingw folder (I think under Library/mingw-.../...
Holy cow, it’s basically Linux!
ls -S -1 Library/mingw64/bin/*.exe | sort -k5
Library/mingw64/bin/WhoUses.exe
Library/mingw64/bin/adig.exe
Library/mingw64/bin/ahost.exe
Library/mingw64/bin/antiword.exe
Library/mingw64/bin/blocked-file-util.exe
Library/mingw64/bin/brotli.exe
Library/mingw64/bin/bunzip2.exe
Library/mingw64/bin/bzcat.exe
Library/mingw64/bin/bzip2.exe
Library/mingw64/bin/bzip2recover.exe
Library/mingw64/bin/connect.exe
Library/mingw64/bin/create-shortcut.exe
Library/mingw64/bin/curl.exe
Library/mingw64/bin/edit_test.exe
Library/mingw64/bin/edit_test_dll.exe
Library/mingw64/bin/envsubst.exe
Library/mingw64/bin/gettext.exe
Library/mingw64/bin/git-askpass.exe
Library/mingw64/bin/git-askyesno.exe
Library/mingw64/bin/git-credential-helper-selector.exe
Library/mingw64/bin/git-credential-manager.exe
Library/mingw64/bin/git-lfs.exe
Library/mingw64/bin/git-receive-pack.exe
Library/mingw64/bin/git-upload-archive.exe
Library/mingw64/bin/git-upload-pack.exe
Library/mingw64/bin/git.exe
Library/mingw64/bin/lzmadec.exe
Library/mingw64/bin/lzmainfo.exe
Library/mingw64/bin/odt2txt.exe
Library/mingw64/bin/openssl.exe
Library/mingw64/bin/p11-kit.exe
Library/mingw64/bin/pdftotext.exe
Library/mingw64/bin/pkcs1-conv.exe
Library/mingw64/bin/proxy-lookup.exe
Library/mingw64/bin/psl.exe
Library/mingw64/bin/scalar.exe
Library/mingw64/bin/sexp-conv.exe
Library/mingw64/bin/tclsh.exe
Library/mingw64/bin/tclsh86.exe
Library/mingw64/bin/trust.exe
Library/mingw64/bin/unxz.exe
Library/mingw64/bin/wish.exe
Library/mingw64/bin/wish86.exe
Library/mingw64/bin/x86_64-w64-mingw32-agrep.exe
Library/mingw64/bin/xmlwf.exe
Library/mingw64/bin/xz.exe
Library/mingw64/bin/xzcat.exe
Library/mingw64/bin/xzdec.exe
ls -S -1 Library/cmd | sort -k5
git-gui.exe
git-receive-pack.exe
git-upload-pack.exe
git.exe
gitk.exe
scalar.exe
start-ssh-agent.cmd
start-ssh-pageant.cmd
tig.exe
ls -S -1 Library/usr/bin/*.exe | sort -k5
Library/usr/bin/[.exe
Library/usr/bin/arch.exe
Library/usr/bin/awk.exe
Library/usr/bin/b2sum.exe
Library/usr/bin/base32.exe
Library/usr/bin/base64.exe
Library/usr/bin/basename.exe
Library/usr/bin/basenc.exe
Library/usr/bin/bash.exe
Library/usr/bin/bunzip2.exe
Library/usr/bin/bzcat.exe
Library/usr/bin/bzip2.exe
Library/usr/bin/bzip2recover.exe
Library/usr/bin/captoinfo.exe
Library/usr/bin/cat.exe
Library/usr/bin/chattr.exe
Library/usr/bin/chcon.exe
Library/usr/bin/chgrp.exe
Library/usr/bin/chmod.exe
Library/usr/bin/chown.exe
Library/usr/bin/chroot.exe
Library/usr/bin/cksum.exe
Library/usr/bin/clear.exe
Library/usr/bin/cmp.exe
Library/usr/bin/column.exe
Library/usr/bin/comm.exe
Library/usr/bin/cp.exe
Library/usr/bin/csplit.exe
Library/usr/bin/cut.exe
Library/usr/bin/cygcheck.exe
Library/usr/bin/cygpath.exe
Library/usr/bin/cygwin-console-helper.exe
Library/usr/bin/d2u.exe
Library/usr/bin/dash.exe
Library/usr/bin/date.exe
Library/usr/bin/dd.exe
Library/usr/bin/df.exe
Library/usr/bin/diff.exe
Library/usr/bin/diff3.exe
Library/usr/bin/dir.exe
Library/usr/bin/dircolors.exe
Library/usr/bin/dirmngr-client.exe
Library/usr/bin/dirmngr.exe
Library/usr/bin/dirname.exe
Library/usr/bin/dos2unix.exe
Library/usr/bin/du.exe
Library/usr/bin/dumpsexp.exe
Library/usr/bin/echo.exe
Library/usr/bin/env.exe
Library/usr/bin/ex.exe
Library/usr/bin/expand.exe
Library/usr/bin/expr.exe
Library/usr/bin/factor.exe
Library/usr/bin/false.exe
Library/usr/bin/file.exe
Library/usr/bin/find.exe
Library/usr/bin/fmt.exe
Library/usr/bin/fold.exe
Library/usr/bin/funzip.exe
Library/usr/bin/gawk-5.0.0.exe
Library/usr/bin/gawk.exe
Library/usr/bin/gencat.exe
Library/usr/bin/getconf.exe
Library/usr/bin/getfacl.exe
Library/usr/bin/getopt.exe
Library/usr/bin/gkill.exe
Library/usr/bin/gmondump.exe
Library/usr/bin/gpg-agent.exe
Library/usr/bin/gpg-card.exe
Library/usr/bin/gpg-connect-agent.exe
Library/usr/bin/gpg-error.exe
Library/usr/bin/gpg-mail-tube.exe
Library/usr/bin/gpg-wks-client.exe
Library/usr/bin/gpg-wks-server.exe
Library/usr/bin/gpg.exe
Library/usr/bin/gpgconf.exe
Library/usr/bin/gpgparsemail.exe
Library/usr/bin/gpgscm.exe
Library/usr/bin/gpgsm.exe
Library/usr/bin/gpgsplit.exe
Library/usr/bin/gpgtar.exe
Library/usr/bin/gpgv.exe
Library/usr/bin/grep.exe
Library/usr/bin/groups.exe
Library/usr/bin/gzip.exe
Library/usr/bin/head.exe
Library/usr/bin/hmac256.exe
Library/usr/bin/hostid.exe
Library/usr/bin/hostname.exe
Library/usr/bin/iconv.exe
Library/usr/bin/id.exe
Library/usr/bin/infocmp.exe
Library/usr/bin/infotocap.exe
Library/usr/bin/install.exe
Library/usr/bin/join.exe
Library/usr/bin/kbxutil.exe
Library/usr/bin/kill.exe
Library/usr/bin/ldd.exe
Library/usr/bin/ldh.exe
Library/usr/bin/less.exe
Library/usr/bin/lessecho.exe
Library/usr/bin/lesskey.exe
Library/usr/bin/link.exe
Library/usr/bin/ln.exe
Library/usr/bin/locale.exe
Library/usr/bin/locate.exe
Library/usr/bin/logname.exe
Library/usr/bin/ls.exe
Library/usr/bin/lsattr.exe
Library/usr/bin/mac2unix.exe
Library/usr/bin/md5sum.exe
Library/usr/bin/minidumper.exe
Library/usr/bin/mintty.exe
Library/usr/bin/mkdir.exe
Library/usr/bin/mkfifo.exe
Library/usr/bin/mkgroup.exe
Library/usr/bin/mknod.exe
Library/usr/bin/mkpasswd.exe
Library/usr/bin/mktemp.exe
Library/usr/bin/mount.exe
Library/usr/bin/mpicalc.exe
Library/usr/bin/mv.exe
Library/usr/bin/nano.exe
Library/usr/bin/nettle-hash.exe
Library/usr/bin/nettle-lfib-stream.exe
Library/usr/bin/nettle-pbkdf2.exe
Library/usr/bin/newgrp.exe
Library/usr/bin/nice.exe
Library/usr/bin/nl.exe
Library/usr/bin/nohup.exe
Library/usr/bin/nproc.exe
Library/usr/bin/numfmt.exe
Library/usr/bin/od.exe
Library/usr/bin/openssl.exe
Library/usr/bin/p11-kit.exe
Library/usr/bin/passwd.exe
Library/usr/bin/paste.exe
Library/usr/bin/patch.exe
Library/usr/bin/pathchk.exe
Library/usr/bin/perl.exe
Library/usr/bin/perl5.38.2.exe
Library/usr/bin/pinentry-w32.exe
Library/usr/bin/pinentry.exe
Library/usr/bin/pinky.exe
Library/usr/bin/pkcs1-conv.exe
Library/usr/bin/pldd.exe
Library/usr/bin/pluginviewer.exe
Library/usr/bin/pr.exe
Library/usr/bin/printenv.exe
Library/usr/bin/printf.exe
Library/usr/bin/profiler.exe
Library/usr/bin/ps.exe
Library/usr/bin/psl.exe
Library/usr/bin/ptx.exe
Library/usr/bin/pwd.exe
Library/usr/bin/readlink.exe
Library/usr/bin/realpath.exe
Library/usr/bin/rebase.exe
Library/usr/bin/regtool.exe
Library/usr/bin/reset.exe
Library/usr/bin/rm.exe
Library/usr/bin/rmdir.exe
Library/usr/bin/rnano.exe
Library/usr/bin/runcon.exe
Library/usr/bin/rview.exe
Library/usr/bin/rvim.exe
Library/usr/bin/scp.exe
Library/usr/bin/sdiff.exe
Library/usr/bin/sed.exe
Library/usr/bin/seq.exe
Library/usr/bin/setfacl.exe
Library/usr/bin/setmetamode.exe
Library/usr/bin/sexp-conv.exe
Library/usr/bin/sftp.exe
Library/usr/bin/sh.exe
Library/usr/bin/sha1sum.exe
Library/usr/bin/sha224sum.exe
Library/usr/bin/sha256sum.exe
Library/usr/bin/sha384sum.exe
Library/usr/bin/sha512sum.exe
Library/usr/bin/shred.exe
Library/usr/bin/shuf.exe
Library/usr/bin/sleep.exe
Library/usr/bin/sort.exe
Library/usr/bin/split.exe
Library/usr/bin/ssh-add.exe
Library/usr/bin/ssh-agent.exe
Library/usr/bin/ssh-keygen.exe
Library/usr/bin/ssh-keyscan.exe
Library/usr/bin/ssh-pageant.exe
Library/usr/bin/ssh.exe
Library/usr/bin/ssp.exe
Library/usr/bin/stat.exe
Library/usr/bin/stdbuf.exe
Library/usr/bin/strace.exe
Library/usr/bin/stty.exe
Library/usr/bin/sum.exe
Library/usr/bin/sync.exe
Library/usr/bin/tabs.exe
Library/usr/bin/tac.exe
Library/usr/bin/tail.exe
Library/usr/bin/tar.exe
Library/usr/bin/tee.exe
Library/usr/bin/test.exe
Library/usr/bin/tic.exe
Library/usr/bin/tig.exe
Library/usr/bin/timeout.exe
Library/usr/bin/toe.exe
Library/usr/bin/touch.exe
Library/usr/bin/tput.exe
Library/usr/bin/tr.exe
Library/usr/bin/true.exe
Library/usr/bin/truncate.exe
Library/usr/bin/trust.exe
Library/usr/bin/tset.exe
Library/usr/bin/tsort.exe
Library/usr/bin/tty.exe
Library/usr/bin/tzset.exe
Library/usr/bin/u2d.exe
Library/usr/bin/umount.exe
Library/usr/bin/uname.exe
Library/usr/bin/unexpand.exe
Library/usr/bin/uniq.exe
Library/usr/bin/unix2dos.exe
Library/usr/bin/unix2mac.exe
Library/usr/bin/unlink.exe
Library/usr/bin/unzip.exe
Library/usr/bin/unzipsfx.exe
Library/usr/bin/users.exe
Library/usr/bin/vdir.exe
Library/usr/bin/view.exe
Library/usr/bin/vim.exe
Library/usr/bin/vimdiff.exe
Library/usr/bin/watchgnupg.exe
Library/usr/bin/wc.exe
Library/usr/bin/which.exe
Library/usr/bin/who.exe
Library/usr/bin/whoami.exe
Library/usr/bin/winpty-agent.exe
Library/usr/bin/winpty-debugserver.exe
Library/usr/bin/winpty.exe
Library/usr/bin/xargs.exe
Library/usr/bin/xxd.exe
Library/usr/bin/yat2m.exe
Library/usr/bin/yes.exe
Library/usr/bin/zipinfo.exe
Perhaps an option would be to add an --exposes git=git option to pixi global install to allow overwriting this default behavior of exposing all executables?
Perhaps an option would be to add an
--exposes git=gitoption topixi global installto allow overwriting this default behavior of exposing all executables?
That option already exists :) It can be done even shorter:
pixi global install --expose=git git
It would still be good to change the default behaviour, but I think that has to be fixed on the git-feedstock side
We think this should actually properly fixed in the feedstock.