Open certik opened 1 week ago
Yes, as soon as pixi build
is out we plan to add this functionality
Hey @certik,
I didn't figure out how to pass arguments to it (is there a way?)
All words after pixi run
will be forwarded to the run shell. So pixi run YOUR_TASK this-is-appended-to-your-task
.
We don't have a way yet to do this between depending tasks.
Goal
I want to build a 3rd party project locally and expose the binary into my
~/bin
directory. I am on Windows (but I think the issue applies to all platforms).Workarounds
Here is what I do today, which works, but is too manual, I would like pixi to automate many of these steps.
Let's take
ledger
(https://github.com/ledger/ledger). I add manualpixi.toml
: https://github.com/certik/ledger/blob/9e9d599eb63935129056399c2e524448ac38785c/pixi.toml:I build it, which creates a binary in
build/ledger.exe
:If I do
pixi r run
then the binary works, however there are two issues:.dll
libraries from.pixi/envs/default/Library/bin/
. So I copybuild/ledger.exe
into the bin directory, so that it lives next to the.dll
files:Now the
ledger.exe
works out of the box. Next step is to create a.bat
script in~/bin
(since Windows doesn't seem to allow symlinks), so I create~/bin/ledger.bat
:Now when I start a new
shell
, I can just typeledger
and everything just works (I have~/bin
in my$PATH
).Feature Requests
pixi
to automate theinstall = "cp build/ledger.exe .pixi/envs/default/Library/bin/"
part. For example, I can justcmake install
into some prefix as part of some task. However modifying thedefault
environment manually is probably not the right approach?pixi
to automatically create the "symlink" (.bat
file) above to expose the binary.Pixi can almost do this with
pixi global
, it puts these binaries as.bat
files into~/.pixi/bin
which I have in my path. However it seems to only work with existing conda packages, not my current project. So if theglobal
feature could be extended to just work for a local project, as well as ensuring the binary lives with the.dll
libraries in the same directory, then that would fix everything.