prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.33k stars 188 forks source link

Can a toml file built on Windows be reconstructed on Linux? #1951

Closed mht2953658596 closed 2 months ago

mht2953658596 commented 2 months ago

Problem description

I have a project that I initially built on a Windows machine using pixi, which generated a pixi.toml file. Now, I want to know if it is possible to reconstruct the environment on a Linux machine using the same pixi.toml file. Steps to Reproduce:

  1. Build a project on Windows using pixi to generate a pixi.toml file.
  2. Copy the pixi.toml file to a Linux machine.
  3. Run pixi install on the Linux machine to reconstruct the environment.

Expected Behavior: The environment should be successfully reconstructed on Linux using the pixi.toml file from the Windows machine.

Actual Behavior: (Please fill in if you have already tried this process and encountered issues)

Additional Context: Are there any platform-specific considerations that I should be aware of when using pixi to generate a toml file on Windows and reconstructing the environment on Linux?

mht2953658596 commented 2 months ago

I used Micromamba on Windows to create a virtual environment and then exported this environment to a YAML file. When I tried to reproduce this environment on Linux using the YAML file, it didn't work because the YAML file specifies platform-specific builds for each package. Can Pixi reproduce the same environment across different platforms using the TOML file?

tdejager commented 2 months ago

Yes, for example: https://github.com/prefix-dev/pixi/blob/main/examples/multi-machine/pixi.toml

mht2953658596 commented 2 months ago

@tdejager So, by simply setting the platforms attribute under the [project] section in the TOML file to ["win-64", "linux-64", "osx-64", "osx-arm64"], will running pixi install on the Linux platform automatically install the specified versions of the libraries that were installed on the Windows platform?

tdejager commented 2 months ago

So it really depends on the libaries, but if they are all availab le for all platforms then yes. Of course things like cuda and such make this a bit more difficult.

tdejager commented 2 months ago

I'm closing this, feel free to open a specific issue when things are not working out as you expected! :)