As some of you might be aware from the Dependency Audit v1 thread and
#status-core, there’s a PR in review to ditch most of the package managers we use in favor of Nix (e.g. Homebrew, apt-get and
npm install -g). While I still have your attention , let me say that this is a high-impact PR, and therefore we need as many devs as possible to test it and report any issues that they may find, and not wait before it reaches the
develop branch before trying it out. I’m planning to merge the PR by the end of next week (Feb 22), and from then on, you’ll need to call
make shell to enter this special child shell to work on status-react.
Why migrate to Nix?
We currently have a mess of different package managers, each with different stacks, guarantees in terms of reproducible builds, and impact on the user’s system. Nix has been coming up as a potential candidate several times over the last months (from people like @cammellos and @arnetheduck and a few others). This migration will allow us to focus on a single package manager across Linux and macOS, while at the same time:
- gaining a predictable environment (i.e. we know exactly which tool versions we get as they’re identified by a cryptographic hash which comprises their dependencies and configuration);
- better management of downloads, avoiding ad-hoc scripts and getting us garbage-collection for free;
- having much less of a footprint/side effects on the user’s environment (we’ll build on Nix by opening up a child shell that’s fully configured for status-react, and Nix packages are kept separate from the user’s normal environment. We won’t be installing, upgrading or downgrading tools against the devs wishes);
- achieving much better consistency between the desktop dev environment and our CI server (we’ll use the NixOS Docker image with the same script as for desktop dev environment);
- In this PR, for the sake of keeping it as simple as possible, we haven’t yet made changes to Jenkins. That will be done in a separate follow-up PR;
- A few larger dependencies are still installed outside of Nix, namely
Qt for Linux/macOS, Android SDK and NDK. Qt certainly sticks out as a sore thumb, since it relies on the user to download it and correctly install it on his/her system. We can do much better than that by following the example of the Qt for Windows package which is delivered by Conan;
- Update: the current PR will also include Qt and NDK, as well as some bundling tools we’re using for Desktop;
- Conan itself could eventually be replaced by Nix, if we port the Qt for Windows (and associated cross-compiler toolchain) to Nix;
- Please let me know of any issues you come across while testing this, and be prepared to send me the log output.