Closed savannidgerinel closed 1 year ago
Having now banged my head against this for many hours, I have found a solution. Maybe not the intended one.
Even with the documentation in the readme I had trouble setting up the crate overrides to add the relevant native builds. I would like to submit some documentation illustrating the problem above and the solution.
Which, btw, looks like this:
packages."x86_64-linux" =
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
standardOverride = attrs: {
nativeBuildInputs = [
pkgs.pkg-config
pkgs.gtk4
pkgs.glib
];
verbose = true;
};
customBuildInfo = pkgs: pkgs.buildRustCrate.override {
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
cairo-sys-rs = standardOverride;
graphene-sys = standardOverride;
gobject-sys = standardOverride;
pango-sys = standardOverride;
gio-sys = standardOverride;
gdk-pixbuf-sys = standardOverride;
gdk4-sys = standardOverride;
gsk4-sys = standardOverride;
gtk4-sys = standardOverride;
};
};
in {
# gobject-sys = pkgs.buildRustCrate cargo.internal.crates.gobject-sys;
kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix {
inherit pkgs;
buildRustCrateForPkgs = customBuildInfo;
}).rootCrate.build;
};
I think that, unless there is something wrong in what I wrote, this is the final solution.
Shouldn't this be reopened to at least provide some meaningful error message or link to this issue?
I have a GTK application that I am trying to build with crate2nix, and I am consistently getting this sort of error message on three different crates that the app depends upon.
The repository in question is https://git.luminescent-dreams.com/savanni/tools . I am working on the
feature/build-tools
branch.The following error occurs for gobject-sys, graphene-sys, and cairo-sys. Which one appears in any given build attempt is random.
Here is the full log from the build:
I get the same error with
graphene-sys
andgobject-sys
. The order of the build execution is non-deterministic, so I may hit any one of these on any given build.I'm building from a flake. Eliding the entire devShell, I'm down to just this:
I run the build from the root of my repository with this: