Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lispPackages_new: fixed a bunch of packages #200573

Merged
merged 3 commits into from
Nov 13, 2022

Conversation

Uthar
Copy link
Contributor

@Uthar Uthar commented Nov 10, 2022

Description of changes

This should fix another ~50 builds on hydra.

Fixed the lisp packages:

  • magicl
  • cl-cairo2
  • cl-ana
  • gsll
  • cl-libyaml
  • cl-libxml2
  • cl-readline

@Uthar Uthar changed the title fixed a bunch of packages lispPackages_new: fixed a bunch of packages Nov 10, 2022
@Uthar Uthar force-pushed the lisp-packages-multiple-fixes branch from 58b6875 to 2327eb1 Compare November 10, 2022 18:53
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ labels Nov 10, 2022
magicl, cl-cairo2, cl-ana, gsll, cl-libyaml, cl-libxml2, cl-readline
@Uthar
Copy link
Contributor Author

Uthar commented Nov 11, 2022

@vcunat sounds like a good deal? let me know if I should stop bugging you

@vcunat vcunat mentioned this pull request Nov 12, 2022
13 tasks
@divanorama
Copy link
Contributor

divanorama commented Nov 12, 2022

gsll builds fine for me on x86_64-linux and aarch64-linux so makes sense to also revert #200285

@divanorama
Copy link
Contributor

divanorama commented Nov 12, 2022

on x86_64-darwin and aarch64-darwin lispPackages_new.sbclPackages.gsll gets an error though (cffi-libffi dependency fails)

; wrote /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source/libffi/libffi-tmpGHU3ALSV.fasl
; compilation finished in 0:00:00.001
; pkg-config libffi --cflags
; ERROR: Couldn't execute "pkg-config": No such file or directory


; Attempting to continue anyway.
; clang -o /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source/libffi/libffi-types__grovel-tmpAAURSO1.o -c -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -mmacosx-version-min=10.6 -D_DARWIN_USE_64_BIT_INODE -arch x86_64 -fno-omit-frame-pointer -I/opt/local/include/ -fPIC -I/nix/store/lacv9ayg6kvyghrh7kh3vm4rgys2nhzc-cffi-grovel-0.24.1/ /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source/libffi/libffi-types__grovel.c
/private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source/libffi/libffi-types__grovel.c:6:10: fatal error: 'ffi/ffi.h' file not found
#include <ffi/ffi.h>
         ^~~~~~~~~~~

@divanorama
Copy link
Contributor

with following patch

diff --git a/pkgs/development/lisp-modules-new/ql.nix b/pkgs/development/lisp-modules-new/ql.nix
index 8e281f6b2c5..36490990e55 100644
--- a/pkgs/development/lisp-modules-new/ql.nix
+++ b/pkgs/development/lisp-modules-new/ql.nix
@@ -53,7 +53,7 @@ let
       nativeLibs = [ openblas ];
     };
     cffi-libffi = pkg: {
-      nativeBuildInputs = [ libffi ];
+      nativeBuildInputs = [ libffi pkg-config ];
       nativeLibs = [ libffi ];
     };
     cl-rabbit = pkg: {

it gets a little further on darwin, but still fails

building
; compiling file "/nix/store/ghz8dmxx4hahlzzq5kpxd18alm1mzigh-source/libffi/libffi.lisp" (written 01 JAN 1970 12:00:01 AM):

; wrote /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source/libffi/libffi-tmpGHU3ALSV.fasl
; compilation finished in 0:00:00.001
; pkg-config libffi --cflags
-I/nix/store/hnpbq34ak4r9xa4zaxn8pmzdsmbs2xkf-libffi-3.4.4-dev/include
; clang -o /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source/libffi/libffi-types__grovel-tmpAAURSO1.o -c -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -mmacosx-version-min=10.6 -D_DARWIN_USE_64_BIT_INODE -arch x86_64 -fno-omit-frame-pointer -I/opt/local/include/ -I/nix/store/hnpbq34ak4r9xa4zaxn8pmzdsmbs2xkf-libffi-3.4.4-dev/include -fPIC -I/nix/store/lacv9ayg6kvyghrh7kh3vm4rgys2nhzc-cffi-grovel-0.24.1/ /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source/libffi/libffi-types__grovel.c
/private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source/libffi/libffi-types__grovel.c:6:10: fatal error: 'ffi/ffi.h' file not found
#include <ffi/ffi.h>
         ^~~~~~~~~~~
1 error generated.

ffi.h exists directly under /nix/store/hnpbq34ak4r9xa4zaxn8pmzdsmbs2xkf-libffi-3.4.4-dev/include so not as ffi/ffi.h

@Uthar
Copy link
Contributor Author

Uthar commented Nov 12, 2022

I'll check it out, thanks for testing.

@Uthar
Copy link
Contributor Author

Uthar commented Nov 12, 2022

I think we should patch cffi-libffi to make this work:

--- /home/kasper/repos/github/nix-cl/result/libffi/libffi-types.lisp
+++ #<buffer libffi-types.lisp>
@@ -43,9 +43,6 @@
 
 (pkg-config-cflags "libffi" :optional t)
 
-#+darwin
-(include "ffi/ffi.h")
-#-darwin
 (include "ffi.h")
 
 (cenum status

Diff finished.  Sun Nov 13 00:23:10 2022

@Uthar
Copy link
Contributor Author

Uthar commented Nov 12, 2022

Do you want to test @divanorama ?

@divanorama
Copy link
Contributor

building
; compiling file "/nix/store/ghz8dmxx4hahlzzq5kpxd18alm1mzigh-source/libffi/libffi.lisp" (written 01 JAN 1970 12:00:01 AM):

; wrote /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source-patched/libffi/libffi-tmpGHU3ALSV.fasl
; compilation finished in 0:00:00.001
; pkg-config libffi --cflags
; ERROR: Couldn't execute "pkg-config": No such file or directory


; Attempting to continue anyway.
; clang -o /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source-patched/libffi/libffi-types__grovel-tmpAAURSO1.o -c -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -fno-omit-frame-pointer -I/opt/local/include/ -fPIC -I/nix/store/mfb0x7w99xyxq82h7zp3i1y8r5258bbq-cffi-grovel-0.24.1/ /private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source-patched/libffi/libffi-types__grovel.c
/private/tmp/nix-build-cffi-libffi-0.24.1.drv-0/source-patched/libffi/libffi-types__grovel.c:6:10: fatal error: 'ffi/ffi.h' file not found
#include <ffi/ffi.h>
         ^~~~~~~~~~~
1 error generated.

maybe that's not the way to patch it 🤔

@divanorama
Copy link
Contributor

@ofborg build lispPackages_new.sbclPackages.gsll

@divanorama
Copy link
Contributor

patch seems to be applied

$ nix show-derivation  /nix/store/5b8rhw698my30k9v1sa93nvii2yim4nb-cffi-libffi-0.24.1.drv | grep '"src"'
      "src": "/nix/store/p1b6ijcwkw5swifzy1agd5zcv0ydrsck-source-patched",
$ grep ffi.h /nix/store/p1b6ijcwkw5swifzy1agd5zcv0ydrsck-source-patched/libffi/libffi-types.lisp 
(include "ffi.h")

but maybe some other version of libffi-types gets pulled in too

@divanorama
Copy link
Contributor

hmm, inside the build

$ grep ffi.h libffi/libffi-types.lisp 
(include "ffi.h")
$ grep -B 5 ffi.h libffi/libffi-types__grovel.c 
/*
 * This file has been automatically generated by cffi-grovel.
 * Do not edit it by hand.
 */

#include <ffi/ffi.h>

so probably cffi-grovel needs to be patched too

@Uthar
Copy link
Contributor Author

Uthar commented Nov 13, 2022

very weird

@Uthar
Copy link
Contributor Author

Uthar commented Nov 13, 2022

unfortunately fixing cffi-libffi like here will probably cause much more rebuilds on hydra

@divanorama
Copy link
Contributor

I think it comes from /nix/store/kfzj91blvyiy966z7p1ghs633fyjnyl0-cffi-0.24.1//libffi/libffi-types.lisp
in build script (nix-shell --pure -A lispPackages_new.sbclPackages.cffi-libffi on linux too):

echo $CL_SOURCE_REGISTRY | tr : "\n"    
/nix/store/lvijpsh5ism8gfkvixp4wibh4hcwwwiz-alexandria-20220707-git//
/nix/store/22bmr1lsrqxfxz0whyxwn5419206sl4m-babel-20200925-git//
/nix/store/kfzj91blvyiy966z7p1ghs633fyjnyl0-cffi-0.24.1//
/nix/store/k0ypdlfyzx0ab1a4sin3ry19r2sac06k-cffi-grovel-0.24.1//
/nix/store/ykhys5nhrzr0ng8xy466brawdi2lkjns-cffi-toolchain-0.24.1//
/nix/store/sxxn64hsf0dnfikp7zjzgfil68gqkipf-trivial-features-20211209-git//
/nix/store/ghz8dmxx4hahlzzq5kpxd18alm1mzigh-source//

and

grep ffi.h /nix/store/kfzj91blvyiy966z7p1ghs633fyjnyl0-cffi-0.24.1//libffi/*
/nix/store/kfzj91blvyiy966z7p1ghs633fyjnyl0-cffi-0.24.1//libffi/libffi-types.lisp:(include "ffi/ffi.h")
/nix/store/kfzj91blvyiy966z7p1ghs633fyjnyl0-cffi-0.24.1//libffi/libffi-types.lisp:(include "ffi.h")

@Uthar
Copy link
Contributor Author

Uthar commented Nov 13, 2022

Can you try with this commit? f9e9336
The issue maybe was in the $buildPhase setting the wrong CL_SOURCE_REGISTRY

@divanorama
Copy link
Contributor

Can you try with this commit? f9e9336
The issue maybe was in the $buildPhase setting the wrong CL_SOURCE_REGISTRY

Nice! Works for me on linux&darwin aarch64&x86_64 for gsll package

@Uthar
Copy link
Contributor Author

Uthar commented Nov 13, 2022

yeah, borg added 5000+ rebuilds label )-:

@Uthar
Copy link
Contributor Author

Uthar commented Nov 13, 2022

I don't think it's needed to merge it right now, unless you want the fixes of course, because I'm thinking to do some major changes anyway which will cause another round of rebuilds. See the docs for what I mean rougly to do https://github.com/Uthar/nix-cl/blob/master/doc/api.md

@vcunat vcunat changed the base branch from master to staging-next November 13, 2022 15:50
@vcunat vcunat merged commit f3da70c into NixOS:staging-next Nov 13, 2022
@vcunat
Copy link
Member

vcunat commented Nov 13, 2022

OK, sounds like definite improvement overall, though lispPackages_new.sbclPackages.magicl still won't build for me on x86_64-linux.

@Uthar
Copy link
Contributor Author

Uthar commented Nov 13, 2022

Thanks for checking. Yes, it crashes on sbcl due to too small default heap. The api breaking changes I mentioned will remedy this by allowing to set heap flags. In the meantime you could use ccl, which does not have this problem

@ofborg ofborg bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ labels Nov 13, 2022
divanorama added a commit to divanorama/nixpkgs that referenced this pull request Nov 13, 2022
Currently broken, should be fixed a bit later
see last comments in NixOS#200573

ZHF: NixOS#199919
rtimush pushed a commit to rtimush/nixpkgs that referenced this pull request Sep 21, 2023
Currently broken, should be fixed a bit later
see last comments in NixOS#200573

ZHF: NixOS#199919
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants