From 56eaab04ae7d8d85410124f70eabfb28ceb981f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20Wallin=20=28=E9=9F=8B=E5=98=89=E8=AA=A0=29?= Date: Fri, 9 Mar 2018 19:36:52 +0800 Subject: [PATCH 1/4] Problem: racket-index failing Unable to find "Modern" type. I've digged around a bit. Building gui-lib together with it didn't help. Solution: Don't set up for now, add to the exception list. --- nix/racket2nix.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/racket2nix.rkt b/nix/racket2nix.rkt index 555270c..6a48e78 100755 --- a/nix/racket2nix.rkt +++ b/nix/racket2nix.rkt @@ -164,7 +164,7 @@ let mkRacketDerivation = lib.makeOverridable (attrs: stdenv.mkDerivation (rec { if [ -z "${circularBuildInputsStr}" ]; then for install_name in $install_names; do case ''${install_name#./} in - racket-doc|drracket) ;; + drracket|racket-doc|racket-index) ;; *) ${raco} setup --no-user --no-pkg-deps --fail-fast --only --pkgs ''${install_name#./} # | # sed -ne '/updating info-domain/,$p' From b77675b5f1d71121a986c1433bd74f6f3f9ae12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20Wallin=20=28=E9=9F=8B=E5=98=89=E8=AA=A0=29?= Date: Sat, 10 Mar 2018 03:41:43 +0800 Subject: [PATCH 2/4] Problem: reverse circular dependencies not removed When we changed config.rktd in 318f237 one detail was lost: When the top circular package wants to install a lower package within the top's derivation, it needs to remove the lower package from its config.rktd dependencies. Otherwise 'raco pkg install' give us the error message that the package is already installed in a larger scope. Solution: Add the filtering mechanism on the nix side. racket-doc doesn't build yet. --- nix/racket2nix.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/racket2nix.rkt b/nix/racket2nix.rkt index 6a48e78..bcf7ed4 100755 --- a/nix/racket2nix.rkt +++ b/nix/racket2nix.rkt @@ -39,6 +39,8 @@ let mkRacketDerivation = lib.makeOverridable (attrs: stdenv.mkDerivation (rec { buildInputs = [ unzip racket attrs.racketBuildInputs ]; circularBuildInputsStr = lib.concatStringsSep " " attrs.circularBuildInputs; racketBuildInputsStr = lib.concatStringsSep " " attrs.racketBuildInputs; + racketConfigBuildInputs = builtins.filter (input: ! builtins.elem input attrs.reverseCircularBuildInputs) attrs.racketBuildInputs; + racketConfigBuildInputsStr = lib.concatStringsSep " " racketConfigBuildInputs; srcs = [ attrs.src ] ++ (map (input: input.src) attrs.reverseCircularBuildInputs); inherit racket; @@ -137,7 +139,7 @@ let mkRacketDerivation = lib.makeOverridable (attrs: stdenv.mkDerivation (rec { mkdir -p $out/etc/racket $out/share/racket # Don't use racket-cmd as config.rktd doesn't exist yet. - racket ${make-config-rktd} $out ${racket} ${racketBuildInputsStr} > $out/etc/racket/config.rktd + racket ${make-config-rktd} $out ${racket} ${racketConfigBuildInputsStr} > $out/etc/racket/config.rktd remove_deps="${circularBuildInputsStr}" if [[ -n $remove_deps ]]; then From 1cb3d111f6c3c68f62c06ecccdcba7c7d04f7bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20Wallin=20=28=E9=9F=8B=E5=98=89=E8=AA=A0=29?= Date: Sat, 10 Mar 2018 03:45:22 +0800 Subject: [PATCH 3/4] Problem: racket-index patch is not applied consistently Now that we are setting up packages in all kinds of derivations, we need to detect that the racket-index patch should be applied any time the package is being set up, not detecting just on derivation name. --- nix/racket2nix.rkt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nix/racket2nix.rkt b/nix/racket2nix.rkt index bcf7ed4..672130a 100755 --- a/nix/racket2nix.rkt +++ b/nix/racket2nix.rkt @@ -75,11 +75,9 @@ let mkRacketDerivation = lib.makeOverridable (attrs: stdenv.mkDerivation (rec { ''; patchPhase = '' - case $name in - racket-index) + if [ -d racket-index ]; then ( cd racket-index && patch -p3 < ${racketIndexPatch} ) - ;; - esac + fi ''; racket-cmd = "${racket.out}/bin/racket -G $out/etc/racket -U -X $out/share/racket/collects"; From 61fe3b5ac3b3c9fcfa8ddbad8de446d34849f658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20Wallin=20=28=E9=9F=8B=E5=98=89=E8=AA=A0=29?= Date: Sat, 10 Mar 2018 03:47:59 +0800 Subject: [PATCH 4/4] Problem: racket-doc deps don't build due to circularity Solution: Add manual descriptions of the cycles. This gives us a green build again. From here we can work on the real solution. I have a plan. We are still not trying to build racket-doc itself. I put hours into adding manual cycles, and it led nowhere. We need to do this properly. --- nix/racket2nix.rkt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nix/racket2nix.rkt b/nix/racket2nix.rkt index 672130a..c8b08df 100755 --- a/nix/racket2nix.rkt +++ b/nix/racket2nix.rkt @@ -8,8 +8,19 @@ (define never-dependency-names '("racket")) (define terminal-package-names '("racket-lib")) (define force-reverse-circular-build-inputs #hash( - ["racket-doc" . ("deinprogramm-signature")] - ["htdp-lib" . ("deinprogramm-signature")])) + ["drracket-tool-lib" . ("racket-index")] + ["plai-lib" . ("racket-index" "drracket-tool-lib")] + ["rackunit-typed" . ("racket-index")] + ["typed-racket-more" . ("racket-index" "rackunit-typed")] + ["htdp-lib" . ("deinprogramm-signature" "racket-index" "plai-lib" "drracket-tool-lib" + "rackunit-typed" "typed-racket-more")] + + ["math-lib" . ("racket-index" "rackunit-typed" "typed-racket-more")] + ["data-enumerate-lib" . ("racket-index" "rackunit-typed" "typed-racket-more" "math-lib")] + ["plot-lib" . ("racket-index" "rackunit-typed" "typed-racket-more" "math-lib")] + ["plot-gui-lib" . ("racket-index" "rackunit-typed" "typed-racket-more" "math-lib" "plot-lib")] + ["plot-compat" . ("racket-index" "rackunit-typed" "typed-racket-more" "math-lib" "plot-lib" + "plot-gui-lib")])) (define header-template #< {}