Uthar / nix-cl

Utilities for packaging ASDF systems using Nix
BSD 2-Clause "Simplified" License
15 stars 6 forks source link

McCLIM build fails #32

Open lukego opened 1 year ago

lukego commented 1 year ago

McCLIM build is not working. I don't understand exactly why yet.

There seem to be a couple of issues:

Reproduce on master branch:

$ lwp sbcl mcclim-bezier
error: builder for '/nix/store/1nhzagh6w25zsy2vzfmf128yvs654jfv-mcclim-bezier-20221106-git.drv' failed with exit code 1;
       last 10 log lines:
       > ; compiling file "/nix/store/8612lj65srfmy9a59l0l0f2w4igz0ir8-source/Extensions/fonts/ttf-medium-mixin.lisp" (written 01 JAN 1970 12:00:01 AM):
       >
       > ; wrote /build/source/Extensions/fonts/ttf-medium-mixin-tmpJAIDFZTC.fasl
       > ; compilation finished in 0:00:00.033
       > ;
       > ; compilation unit aborted
       > ;   caught 1 fatal ERROR condition
       > BUILD FAILED: Error opening #P"/nix/store/k7kcqlpc7a7p20bcarfxn7alyvryw98p-mcclim-render-20221106-git/Extensions/render/package-tmp8V3J6PE9.fasl":
       >
       >                 Permission denied
       For full logs, run 'nix log /nix/store/1nhzagh6w25zsy2vzfmf128yvs654jfv-mcclim-bezier-20221106-git.drv'.
error: 1 dependencies of derivation '/nix/store/p07vdqm699c6di1irnlp7skalwnnfhhm-sbcl-with-packages.drv' failed to build
lukego commented 1 year ago

Thinking aloud...

The mcclim-render package seems to compile fine including Extensions/render/package.fasl:

[luke@snowy:~/git/nix-cl]$ nix build .#sbcl.pkgs.mcclim-render
warning: Git tree '/home/luke/git/nix-cl' is dirty

[luke@snowy:~/git/nix-cl]$ ls result
Apps      Copyright  data                Documentation  Experimental  INSTALL    NEWS         README.md  TODO
Backends  Core       default-icons.lisp  Examples       Extensions    Libraries  nix-support  Tests      Tools

[luke@snowy:~/git/nix-cl]$ find result/ -name '*.fasl'
result/Extensions/fonts/ttf-port-mixin.fasl
result/Extensions/fonts/mcclim-native-ttf.fasl
result/Extensions/fonts/fontconfig.fasl
result/Extensions/fonts/truetype-package.fasl
result/Extensions/fonts/ttf-medium-mixin.fasl
result/Extensions/render/vectors.fasl
result/Extensions/render/types.fasl
result/Extensions/render/utilities.fasl
result/Extensions/render/render/prim-arc.fasl
result/Extensions/render/render/prim-text.fasl
result/Extensions/render/package.fasl
result/Extensions/render/backend/mirror.fasl
result/Extensions/render/backend/fonts.fasl
result/Extensions/render/backend/medium.fasl
result/Extensions/render/backend/pixmap.fasl
result/Extensions/render/backend/port.fasl
result/Extensions/render/image.fasl

So it seems like mcclim-bezier is somehow attempting to recompile mcclim-render in a nix store directory where it is already precompiled? That's a new one for me :)

Uthar commented 1 year ago

mcclim/render depends on mcclim-fonts/truetype : Quicklisp ignores slashy systems in dependencies ,so we have to put it there manually

I got something to build using this patch, I don't know how to test it though:

diff --git a/imported.nix b/imported.nix
index a450468..bfc9131 100644
--- a/imported.nix
+++ b/imported.nix
@@ -39316,7 +39316,7 @@ in lib.makeScope pkgs.newScope (self: {
     systems = [ "mcclim-bezier" ];
     lispLibs = [ (getAttr "clim" self) (getAttr "clim-pdf" self) (getAttr "clim-postscript" self) (getAttr "flexichain" self) (getAttr "mcclim-clx" self) (getAttr "mcclim-null" self) (getAttr "mcclim-render" self) ];
     meta = {
-      broken = true;
+      broken = false;
     };
   });
   mcclim-bitmaps = (build-asdf-system {
diff --git a/ql.nix b/ql.nix
index 5b7987d..4559d06 100644
--- a/ql.nix
+++ b/ql.nix
@@ -193,6 +193,21 @@ let
     cl-sat_dot_minisat = super.cl-sat_dot_minisat.overrideLispAttrs (o: {
       propagatedBuildInputs = [ pkgs.minisat ];
     });
+    mcclim-fonts = super.mcclim-fonts.overrideLispAttrs (o: {
+      lispLibs = o.lispLibs ++ [
+        super.cl-dejavu
+        super.zpb-ttf
+        super.cl-vectors
+        super.cl-paths-ttf
+        super.flexi-streams
+      ];
+      systems = [ "mcclim-fonts" "mcclim-fonts/truetype" ];
+    });
+    mcclim-render = super.mcclim-render.overrideLispAttrs (o: {
+      lispLibs = o.lispLibs ++ [
+        self.mcclim-fonts
+      ];
+    });
   });

   qlpkgs =
lukego commented 1 year ago

Thanks!

That patch builds for me, I'll let you know how it goes in practice.