From 0f55588885d9e93d8cb860545822a6ad3dc8bb00 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 30 Jul 2021 19:11:50 +0300 Subject: [PATCH 1/7] shards: 0.14 -> 0.15 --- pkgs/development/tools/build-managers/shards/default.nix | 9 ++++++++- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/build-managers/shards/default.nix b/pkgs/development/tools/build-managers/shards/default.nix index 16b2967e632d..d280c252fc50 100644 --- a/pkgs/development/tools/build-managers/shards/default.nix +++ b/pkgs/development/tools/build-managers/shards/default.nix @@ -2,6 +2,7 @@ , fetchFromGitHub , crystal_0_34 , crystal_0_36 +, crystal_1_0 }: let generic = @@ -49,5 +50,11 @@ rec { crystal = crystal_0_36; }; - shards = shards_0_14; + shards_0_15 = generic { + version = "0.15.0"; + sha256 = "sha256-/C6whh5RbTBkFWqpn0GqyVe0opbrklm8xPv5MIG99VU="; + crystal = crystal_1_0; + }; + + shards = shards_0_15; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4a7e1eb4c6bd..5d174cc824a9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14723,6 +14723,7 @@ with pkgs; inherit (callPackage ../development/tools/build-managers/shards { }) shards_0_11 shards_0_14 + shards_0_15 shards; shellcheck = callPackage ../development/tools/shellcheck {}; From 6900e4773d270b8ba37a5088dd71e05f9acf2cbd Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 7 Sep 2021 00:14:23 +0300 Subject: [PATCH 2/7] crystal_0_36: add a binary bootstrap variant fixes crystal on darwin --- pkgs/development/compilers/crystal/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index 8fc4a15efced..3cbf0bb1ba5a 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -214,8 +214,7 @@ let license = licenses.asl20; maintainers = with maintainers; [ david50407 fabianhjr manveru peterhoeg ]; platforms = builtins.attrNames archs; - # Error running at_exit handler: Nil assertion failed - broken = lib.versions.minor version == "32" && stdenv.isDarwin; + broken = lib.versionOlder version "0.36.1" && stdenv.isDarwin; }; }) ); @@ -264,10 +263,19 @@ rec { extraBuildInputs = [ git ]; }; + binaryCrystal_0_36 = genericBinary { + version = "0.36.1"; + sha256s = { + x86_64-linux = "065vzq34g7hgzl2mrzy9gwwsfikc78nj7xxsbrk67r6rz0a7bk1q"; + i686-linux = "18m4b1lnd682i5ygbg6cljqjny60nn2mlrzrk765h2ip6fljqbm1"; + x86_64-darwin = "0xggayk92zh64pb5sz77n12hkcd1hg8kw90z7gb18594q551sf1v"; + }; + }; + crystal_0_36 = generic { version = "0.36.1"; sha256 = "sha256-5rjrvwZKM4lHpmxLyUVbi0Zw98xT+iJKonxwfUwS/Wk="; - binary = crystal_0_35; + binary = binaryCrystal_0_36; }; crystal_1_0 = generic { From 51e3c659a08a742c1ce83f955cd039b02eb293b3 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 7 Sep 2021 02:02:21 +0300 Subject: [PATCH 3/7] crystal: increase build cores crystal: remove obsolete substituteInPlace crystal: patchShebangs in genericBinary crystal: use mktemp --- .../development/compilers/crystal/default.nix | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index 3cbf0bb1ba5a..0edb38db92ca 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -56,6 +56,7 @@ let buildCommand = '' mkdir -p $out tar --strip-components=1 -C $out -xf ${src} + patchShebangs $out/bin/crystal ''; }; @@ -93,6 +94,10 @@ let outputs = [ "out" "lib" "bin" ]; postPatch = '' + export TMP=$(mktemp -d) + export HOME=$TMP + mkdir -p $HOME/test + # Add dependency of crystal to docs to avoid issue on flag changes between releases # https://github.com/crystal-lang/crystal/pull/8792#issuecomment-614004782 substituteInPlace Makefile \ @@ -103,39 +108,35 @@ let ln -sf spec/compiler spec/std - # Dirty fix for when no sandboxing is enabled - rm -rf /tmp/crystal - mkdir -p /tmp/crystal + mkdir -p $TMP/crystal substituteInPlace spec/std/file_spec.cr \ --replace '/bin/ls' '${coreutils}/bin/ls' \ - --replace '/usr/share' '/tmp/crystal' \ - --replace '/usr' '/tmp' + --replace '/usr/share' "$TMP/crystal" \ + --replace '/usr' "$TMP" \ + --replace '/tmp' "$TMP" substituteInPlace spec/std/process_spec.cr \ --replace '/bin/cat' '${coreutils}/bin/cat' \ --replace '/bin/ls' '${coreutils}/bin/ls' \ --replace '/usr/bin/env' '${coreutils}/bin/env' \ --replace '"env"' '"${coreutils}/bin/env"' \ - --replace '"/usr"' '"/tmp"' - - substituteInPlace spec/std/socket/tcp_server_spec.cr \ - --replace '{% if flag?(:gnu) %}"listen: "{% else %}"bind: "{% end %}' '"bind: "' + --replace '/usr' "$TMP" \ + --replace '/tmp' "$TMP" substituteInPlace spec/std/system_spec.cr \ --replace '`hostname`' '`${hostname}/bin/hostname`' - # See https://github.com/crystal-lang/crystal/pull/8640 - substituteInPlace spec/std/http/cookie_spec.cr \ - --replace '01 Jan 2020' '01 Jan #{Time.utc.year + 2}' - # See https://github.com/crystal-lang/crystal/issues/8629 substituteInPlace spec/std/socket/udp_socket_spec.cr \ --replace 'it "joins and transmits to multicast groups"' 'pending "joins and transmits to multicast groups"' + ''; - # See https://github.com/crystal-lang/crystal/pull/8699 - substituteInPlace spec/std/xml/xml_spec.cr \ - --replace 'it "handles errors"' 'pending "handles errors"' + # Defaults are 4 + preBuild = '' + export CRYSTAL_WORKERS=$NIX_BUILD_CORES + export threads=$NIX_BUILD_CORES + export CRYSTAL_CACHE_DIR=$TMP ''; buildInputs = commonBuildInputs extraBuildInputs; @@ -197,9 +198,6 @@ let checkTarget = "compiler_spec"; preCheck = '' - export HOME=/tmp - mkdir -p $HOME/test - export LIBRARY_PATH=${lib.makeLibraryPath checkInputs}:$LIBRARY_PATH export PATH=${lib.makeBinPath checkInputs}:$PATH ''; From 9a3ed0e8c501bc4631d7dedaa06e8393704bf146 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 7 Sep 2021 02:41:15 +0300 Subject: [PATCH 4/7] buildCrystalPackage: redirect stdout to /dev/null makes build errors easier to diagnose --- pkgs/development/compilers/crystal/build-package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/crystal/build-package.nix b/pkgs/development/compilers/crystal/build-package.nix index 67c8128f6b5d..8c788b80bf0c 100644 --- a/pkgs/development/compilers/crystal/build-package.nix +++ b/pkgs/development/compilers/crystal/build-package.nix @@ -120,7 +120,7 @@ stdenv.mkDerivation (mkDerivationArgs // { installCheckPhase = args.installCheckPhase or '' for f in $out/bin/*; do - $f --help + $f --help > /dev/null done ''; From 946154fdb77cea5898e281393c731966c09b10a6 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 7 Sep 2021 20:33:03 +0300 Subject: [PATCH 5/7] thicket: 0.1.4 -> 0.1.5 --- .../version-management/git-and-tools/thicket/default.nix | 4 ++-- .../version-management/git-and-tools/thicket/shards.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/version-management/git-and-tools/thicket/default.nix b/pkgs/applications/version-management/git-and-tools/thicket/default.nix index d8420b1cb33c..0fd180c441a6 100644 --- a/pkgs/applications/version-management/git-and-tools/thicket/default.nix +++ b/pkgs/applications/version-management/git-and-tools/thicket/default.nix @@ -1,10 +1,10 @@ { lib , fetchFromGitHub -, crystal_0_33 +, crystal_1_0 }: let - crystal = crystal_0_33; + crystal = crystal_1_0; in crystal.buildCrystalPackage rec { pname = "thicket"; diff --git a/pkgs/applications/version-management/git-and-tools/thicket/shards.nix b/pkgs/applications/version-management/git-and-tools/thicket/shards.nix index c8839651a26d..1c035d332e53 100644 --- a/pkgs/applications/version-management/git-and-tools/thicket/shards.nix +++ b/pkgs/applications/version-management/git-and-tools/thicket/shards.nix @@ -2,7 +2,7 @@ ameba = { owner = "veelenga"; repo = "ameba"; - rev = "v0.10.0"; - sha256 = "1yjxzwdhigsyjn0qp362jkj85qvg4dsyzal00pgr1srnh2xry912"; + rev = "v0.14.3"; + sha256 = "1cfr95xi6hsyxw1wlrh571hc775xhwmssk3k14i8b7dgbwfmm5x1"; }; } From 9bd941c5d2627f0cac739aab90c22e8e34733273 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 7 Sep 2021 20:07:17 +0300 Subject: [PATCH 6/7] crystal,shards: remove old versions --- .../development/compilers/crystal/default.nix | 42 ------------------- .../tools/build-managers/shards/default.nix | 14 ------- pkgs/top-level/all-packages.nix | 5 --- 3 files changed, 61 deletions(-) diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index 0edb38db92ca..11bf1cc96365 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -219,48 +219,6 @@ let in rec { - binaryCrystal_0_31 = genericBinary { - version = "0.31.1"; - sha256s = { - x86_64-linux = "0r8salf572xrnr4m6ll9q5hz6jj8q7ff1rljlhmqb1r26a8mi2ih"; - i686-linux = "0hridnis5vvrswflx0q67xfg5hryhz6ivlwrb9n4pryj5d1gwjrr"; - x86_64-darwin = "1dgxgv0s3swkc5cwawzgpbc6bcd2nx4hjxc7iw2h907y1vgmbipz"; - }; - }; - - crystal_0_31 = generic { - version = "0.31.1"; - sha256 = "1dswxa32w16gnc6yjym12xj7ibg0g6zk3ngvl76lwdjqb1h6lwz8"; - doCheck = false; # 5 checks are failing now - binary = binaryCrystal_0_31; - }; - - crystal_0_32 = generic { - version = "0.32.1"; - sha256 = "120ndi3nhh2r52hjvhwfb49cdggr1bzdq6b8xg7irzavhjinfza6"; - binary = crystal_0_31; - }; - - crystal_0_33 = generic { - version = "0.33.0"; - sha256 = "1zg0qixcws81s083wrh54hp83ng2pa8iyyafaha55mzrh8293jbi"; - binary = crystal_0_32; - }; - - crystal_0_34 = generic { - version = "0.34.0"; - sha256 = "110lfpxk9jnqyznbfnilys65ixj5sdmy8pvvnlhqhc3ccvrlnmq4"; - binary = crystal_0_33; - }; - - crystal_0_35 = generic { - version = "0.35.1"; - sha256 = "0p51bjl1nsvwsm64lqq421dcsxa201w7wwq8plw4r8wqarpq0g69"; - binary = crystal_0_34; - # Needs git to build as per https://github.com/crystal-lang/crystal/issues/9789 - extraBuildInputs = [ git ]; - }; - binaryCrystal_0_36 = genericBinary { version = "0.36.1"; sha256s = { diff --git a/pkgs/development/tools/build-managers/shards/default.nix b/pkgs/development/tools/build-managers/shards/default.nix index d280c252fc50..084225a8f5e8 100644 --- a/pkgs/development/tools/build-managers/shards/default.nix +++ b/pkgs/development/tools/build-managers/shards/default.nix @@ -1,7 +1,5 @@ { lib , fetchFromGitHub -, crystal_0_34 -, crystal_0_36 , crystal_1_0 }: let @@ -37,18 +35,6 @@ let in rec { - # needed for anything that requires the old v1 shards format - shards_0_11 = generic { - version = "0.11.1"; - sha256 = "05qnhc23xbmicdl4fwyxfpcvd8jq4inzh6v7jsjjw4n76vzb1f71"; - crystal = crystal_0_34; - }; - - shards_0_14 = generic { - version = "0.14.1"; - sha256 = "sha256-/C6whh5RbTBkFWqpn0GqyVe0opbrklm8xPv5MIG99VU="; - crystal = crystal_0_36; - }; shards_0_15 = generic { version = "0.15.0"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5d174cc824a9..0eee4baebeff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11118,9 +11118,6 @@ with pkgs; inherit (callPackages ../development/compilers/crystal { llvmPackages = llvmPackages_10; }) - crystal_0_33 - crystal_0_34 - crystal_0_35 crystal_0_36 crystal_1_0 crystal; @@ -14721,8 +14718,6 @@ with pkgs; shallot = callPackage ../tools/misc/shallot { }; inherit (callPackage ../development/tools/build-managers/shards { }) - shards_0_11 - shards_0_14 shards_0_15 shards; From afb755e7067f83beadc5b290f153d77b77326be0 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 10 Sep 2021 23:24:51 +0300 Subject: [PATCH 7/7] buildCrystalPackage: use --no-debug it was causing problems with the installCheckPhase due to it generating .dwarf files --- pkgs/development/compilers/crystal/build-package.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/crystal/build-package.nix b/pkgs/development/compilers/crystal/build-package.nix index 8c788b80bf0c..2328e76ad770 100644 --- a/pkgs/development/compilers/crystal/build-package.nix +++ b/pkgs/development/compilers/crystal/build-package.nix @@ -10,7 +10,7 @@ , format ? "make" , installManPages ? true # Specify binaries to build in the form { foo.src = "src/foo.cr"; } - # The default `crystal build` options can be overridden with { foo.options = [ "--no-debug" ]; } + # The default `crystal build` options can be overridden with { foo.options = [ "--optionname" ]; } , crystalBinaries ? { } , ... }@args: @@ -32,8 +32,7 @@ let }) (import shardsFile)); - # we previously had --no-debug here but that is not recommended by upstream - defaultOptions = [ "--release" "--progress" "--verbose" ]; + defaultOptions = [ "--release" "--progress" "--verbose" "--no-debug" ]; buildDirectly = shardsFile == null || crystalBinaries != { };