1. 14

Does anybody know a cross-platform language-agnostic, environment-oriented package manager? Cross-platform means it can be used on Linux, Mac, and Windows (natively, not Cygwin, WSL, etc). Language-agnostic means it can be used for arbitrary libraries and binaries. Environment-oriented means packages are installed into some folder like Python virtualenv and not system- or user-wide.

The is a list on Wikipedia. The “hybrid systems” are the closest ones. Apart from GoFish they focus on Unix-like though. GoFish looks interesting but is not environment-oriented.

  1.  

  2. 21

    I could say Docker and not be sure if I’m trolling or being realistic.

    1. 4

      It sounds like a defeat: giving up on trying to find a bridge between the various operating systems.

      But targetting both Windows and Linux makes no sense, as they do not have the same syscalls on the first place. This will reduce the packages to only the ones that Windows can support Windows, Mac OS, Linux.

      Windows approach to this was to adapt syscalls through an emulation layer. Why go against Microsoft in its own effort to improve portability?

      1. 1

        I should have said: makes no sense [to me].

        1. 1

          Now I realize: maybe the aim of the author is to package software that already supports Windows and Mac OS explicitly…

        2. 2

          Hm.

          Docker would be a way to define complete environments and deploy them. It provides no help for the integration.

        3. 15

          Have you heard the good word about pkgsrc?

          1. 2

            I don’t seem to see Windows mentioned as supported on the linked page, while I it’s listed as an explicit need by the OP?

            1. 2

              oops, missed the negation.

              1. 1

                They do support windows via cygwin. Not ideal, definitely. Also I’m sure it works under WSL(but have never tried it).

                Also, it comes ready to go with 22.5k packages, and can handle env oriented(as it does on macOS) or OS oriented(as it does on NetBSD and friends) installations..

            2. 11

              This is difficult:

              There is a huge semantic gap between

              • OS-level managers which excel at keeping a system-wide install conflict-free, in which each library can only be installed once
              • language-specific managers which are usually restricted to a single language, can sometimes do user-level installs (worse: sometimes limited to project-level), can resolve complex and dynamic dependency situations and support more than one version at the same time.

              Most existing tools for one of those categories suck. There are only very few tools that don’t suck in the category they target.

              You are basically asking for a tool that does both, and doesn’t suck.

              Such a tool sadly doesn’t exist, but https://distr1.org/ is trying an interesting combination of new things which might be interesting to you.

              1. 11

                git? What you’re really describing though is kinda the holy grail of software atm. I don’t know of anything that really does it, or if it’s really even possible to do it.

                1. 2

                  Unfortunately, git sucks for maintaining and deploying larger binaries. My experience with git-lfs was not good.

                2. 8
                  1. 2

                    Interesting. I remember zero install as Linux only (like FlatPack, Snap, etc). However, they provide a Windows-specific .Net implementation.

                    1. 2

                      Looked some more as I was missing the “environment-oriented” part. Found 0env to enable it.

                      1. 2

                        You said “Environment-oriented means packages are installed into some folder like Python virtualenv and not system- or user-wide”, but it’s not quite clear to me what you’re trying to achieve with that.

                        If you just want to avoid conflicts (e.g. ~/project1 and ~/project2 need different versions of a library) then 0install will handle that by default even with a user-wide cache.

                        If you really want completely isolated caches, you can set $ZEROINSTALL_PORTABLE_BASE to the directory to use.

                        BTW, we’re currently in the process of updating the documentation - you might find http://docs.0install.net/ slightly more up-to-date.

                  2. 10

                    I think Nix is this. Nix works rather well most of the time.

                    1. 6

                      Except that it does not work natively on Windows. Without knowing more details, it does tick off the other requirements:

                      cross-platform language-agnostic,

                      nixpkgs has the usual applications, C libraries, and language-specific package/derivation sets. Of the listed platforms, it supports Linux well, macOS reasonably well (stuff breaks fairly frequently on master, but work well on stable releases).

                      environment-oriented package manager? […] Environment-oriented means packages are installed into some folder like Python virtualenv and not system- or user-wide.

                      The nix store (/nix) is system-wide, but users decide what packages to install in their own profile (and thus do not occur in the profile of other users). More over, you can use nix run or nix-shell to get a shell with a specific set of dependencies that are only visible within that shell. Moreover, for projects, you can crate a shell.nix that specifies dependencies (to use with nix-shell) or set up direnv to automatically use shell.nix when switching to a project directory/subdirectory.

                      For me the latter is one of the ‘superpowers’ of Nix: cd alpinocorpus and I have an environment CMake, make, Boost, dbxml, Xerces-C, XQilla, etc. cd ../reductive and I have an environment with a Rust compiler, cargo, and Intel MKL.

                      Of course, a system is never perfect, Nix also has many sharp edges. Moreover, it becomes particularly useful if you are willing to learn the Nix language (which is a small, lazy functional language).

                      1. 2

                        I found no evidence that Nix works well on Windows. It only seems to be possible with some Unix emulation (Msys, Cygwin, WSL, etc).

                        1. 3

                          I was kinda trying to port a part of Nix to native (non-WSL) Windows (as one of my too many hobby projects). One thing I found out, that I believe is especially annoying there for such an effort, is Nix’s heavy use of symbolic links. AFAIK, in default configuration of Windows, creating those requires Administrator prompt/elevated permissions.

                      2. 5

                        Maybe you want conda and the packages on conda-forge?

                        1. 2

                          Yes, conda looks good. The fact that it is advertised for Python and R suggests some genericity. It is hard to find documentation about anything not Python though.

                        2. 5

                          pkgsrc https://pkgsrc.org

                          Handles 23 supported platforms. It doesn’t natively handle Windows, but does support cygwin. pkgsrc can install to it’s own place(does on macOS) or can install to system places like it does on NetBSD.

                          Comes ready to go with 22,500 packages.

                          1. 5

                            There’s esy, which runs natively on Linux, Mac, and Windows (but does require admin privileges on Windows because it uses symlinks). Right now it only has JS and OCaml packages on it, but their goal is to support pretty much any language in the future (and I think they’re targeting C++ next).

                            1. 4

                              This is difficult:

                              There is a huge semantic gap between

                              • OS-level managers which excel at keeping a system-wide install conflict-free, in which each library can only be installed once
                              • language-specific managers which are usually restricted to a single language, can sometimes do user-level installs (worse: sometimes limited to project-level), can resolve complex and dynamic dependency situations and support more than one version at the same time.

                              Most existing tools for one of those categories suck. There are only very few tools that don’t suck in the category they target.

                              You are basically asking for a tool that does both, and doesn’t suck.

                              Such a tool sadly doesn’t exist, but distri is trying an interesting combination of new things which might be interesting to you.

                              1. 4

                                Why would you want that? Other than being really complex to implement I don’t see any reason why you’d want to handle development libraries globally instead of on a per-project basis using a separate manager that vendors them like npm or ruby’s bundler.

                                1. 3

                                  What are your needs? Why do you need all of these requirements?

                                  A product, even, open-source, like this, would have a massive testing matrix and footprint.

                                  Another “closest you’ll get” is the JVM ecosystem. It’s cross-platform and can be environment-oriented (e.g. tell maven, gradle, or sbt and friends where to put libraries), but language agnosticism is limited to JVM languages (Java, Scala, Kotlin, Clojure, Jython, JRuby, Freige (Haskell), Javascript, Groovy, etc.) and languages that can expose internals via FFI and JNI (C, C++, Rust easily; Go, Nim probably).

                                  1. 2

                                    Well, ZeroInstall seems to meet the requirements. We’ll see if it works in a practice test.

                                    I’m willing to relax on convenience, for example. Pip/Conda are probably easier for Python packages, but the advantage to also handle C++, Perl, Binaries with a single tool might outweigh that.

                                    1. 3

                                      Package managers are more than package formats. Windows is the blocker here, and spack documents it well although I think the same applies to brew, nix and distri, and the inverse would apply to chocolatey.

                                      https://github.com/spack/spack/issues/9323

                                      1. 2

                                        ZeroInstall looks pretty cool. I can say that I’ve never had a reason to install ZeroInstall, flatpak, or anything like it. I’ve used snappy only to try it out on a Raspberry Pi installation of Ubuntu Server.

                                        Keep in mind though that a user will hesitate to install another package management system, especially if it’s just to install your software. It’ll be a source of friction. It’s not clear what your intended audience is, so that might not really affect you or you may desire that friction to scare off users for whom you’re unprepared to support. ZeroInstall may be adequate for now but if you intend to grow a userbase, it may become a liability or a blocker to adoption unless your use provides adequate momentum to encourage users to install ZeroInstall first.

                                        The more you meet a user in the middle, the more likely they are to use your software. Consider using existing automation that packages your software for distribution in existing formats. nebula os-package or setupbuilder in the Gradle world handle this without much effort for all of your target OSes. Maybe there’s something in your ecosystem that handles this for you.

                                        1. 2

                                          Ah, I do not care so much about the user but about our development environment here. ;)

                                          The use case is development of embedded products in a large company. Development requires a range of tools where some are Open Source, some internal, some bought. Essentially we write C++, but something like Conan is not fit to deliver simulation or modelling tools for example. Reproducibility is important, so the precise Python, Perl, bash, etc versions are necessary.

                                          Currently, we use a Windows-only home-grown installation tool which cannot even do dependencies or uninstall. We increasingly use Linux for our testing infrastructure and this brings a second configuration tooling. Using the same would be an improvement.

                                          (Using a monorepo is also considered but that is much more disruptive a people would have to change their version control system.)

                                    2. 3

                                      Yes, I have just written one - If you are interested in trying it you can message me, it is still private. Windows support is wip however. I haven’t ruled it out.

                                      1. 3

                                        You reminded me of gx. Seems to fit the bill, but I’m not sure how far along they are. It was originally meant for Golang and uses IPFS.

                                        1. 2

                                          While I can almost certainly say that this isn’t what you actually want, there is an option that checks all of the boxes list. Wasmer.

                                          It is

                                          • Platform agnostic: Supports Linux, Mac, Windows, and BSD.
                                          • Architecture agnostic
                                          • Mostly Language-agnostic (caveat explained below).

                                          So Wasmer, or it packaging system wapm, works by compiling into web-assembly application that runs in a runtime with OS independent abstractions. There are actually a surprising number of applications that has a wasmer version including nginx & sqlite.

                                          So about that caveat I said earlier. LLVM can target web-assembly, so most compiled languages are supported. But because of how this works dynamic languages can’t compile to a web-assembly binary. Ruby and python are supported though by basically shipping the interpreter with the application. While this is no prohibitively expensive it does add weight.

                                          1. 2

                                            pacman, ArchLinux’ package manager, runs on Windows as well. MSYS2 uses it.

                                            1. 2

                                              Like FlatPack but for other systems than Linux?

                                              Like encrypted filesystems, these seem to be very OS specific.