Conversation
DS-215 Pre-build an fsm which runs on ubuntu without any nix dependencies
Ideally we can either build with musl or patchelf the binary to run on Ubuntu. We can't ask the user to build fsm themselves, it takes too much time to the runthrough and wastes time. Let's do this as part of the Github Actions so every PR / merge gets a prebuilt executable. |
|
This works on Ubuntu? |
|
This doesn't quite work yet on an Ubuntu machine without Nix installed. Note that it is trying to find the interpreter in the Nix store: I think this should be using patchelf to point its interpreter to |
|
It seems weird to me that we want to make it work on machines without Nix? How will |
|
It isn't necessarily about having Nix / not having Nix, but more that this specific path to the interpreter is not likely to actually be present, it just happens to be so today. |
It's my impression a mature version of |
2c5f7a1 to
c42c731
Compare
| ''; | ||
|
|
||
| cargoLock.lockFile = ./Cargo.lock; | ||
| override = { preBuild ? "", ... }: { |
There was a problem hiding this comment.
This should be overrideMain since we don't really want to propagate this to all dependencies, but for some reason, it doesn't appear to work with our setup. Once we open-source this repo, I'll be able to file an issue for this, but I can't reproduce on any of their example projects (maybe it's an interaction with naersk and fenix that's being problematic?).
| in | ||
| { | ||
| package = pkgs.rustPlatform.buildRustPackage rec { | ||
| package = naerskLib.buildPackage rec { |
There was a problem hiding this comment.
Is moving to Naersk required for this?
There was a problem hiding this comment.
Yes -- old nixpkgs versions don't have good support for building fast-changing repos from source (cargoLock.lockFile is very new functionality that is definitely not present in 20.09; otherwise).
ETA: And we need an old nixpkgs to build against an old gllibc.
There was a problem hiding this comment.
Note that the cargoLock.lockFile functionaly in Nixpkgs was just copied from my import-cargo flake so we could also use that.
|
Can't we provide a statically linked |
|
(We're going to try making this actually-static.) |
|
The fsm I downloaded from the build runs perfectly well on an Ubuntu 22.04 machine, nicely done! |
* nixos-20.09 for glibc 2.31 * fenix for the toolchain stuff (since 20.09 is old and some of our dependencies specify a newer MSRV) * naersk for building Rust (since 20.09 is missing some of the nice things for rustPlatform.buildRustPackage)
…s a library This allows us to have an actually-successful build of fsmStatic without weirdness due to openssl.


This is now built completely statically :)