From a214c74e02a604af054dc42339114dfd561d933a Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Mon, 1 Jun 2020 18:38:57 +0300 Subject: [PATCH 1/7] CI: build.sh: rm empty args from nix-build M build.sh --- build.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 41ba821..d7eed18 100755 --- a/build.sh +++ b/build.sh @@ -109,8 +109,7 @@ if [ "$GHCVERSION" = "ghcjs" ] --arg buildStackProject "$buildStackProject" \ "$generateOptparseApplicativeCompletion" \ --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ - ghcjs \ - "$@" + ghcjs else @@ -134,8 +133,7 @@ if [ "$GHCVERSION" = "ghcjs" ] --arg disableOptimization "$disableOptimization" \ --arg buildStackProject "$buildStackProject" \ "$generateOptparseApplicativeCompletion" \ - --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ - "$@" + --arg allowInconsistentDependencies "$allowInconsistentDependencies" fi } From ad99540ff5e6cacea200f5c28e4898eea5bb1a98 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Mon, 1 Jun 2020 18:43:26 +0300 Subject: [PATCH 2/7] CI: build.sh: update Nix after its installation Nix that installs through Nix installer is 2.0.4. Current Nix release is 2.3.5. To to have a less of old bugs, and more of new bugs - Nix after installation needs an update right away. Old Nix literally prevented importing Nix channels on Linux Nix installations. M build.sh --- build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.sh b/build.sh index d7eed18..cf2fc29 100755 --- a/build.sh +++ b/build.sh @@ -140,6 +140,15 @@ fi MAIN() { + +# 2020-06-01: NOTE: Nix installer installs old Nix version that has bugs that prevented importing Nixpks repository channels, updating to latest Nix since it does not have that bug +# NOTE: Overall it is useful to have in CI test builds the latest stable Nix +# NOTE: User-run update for Linux setup +nix upgrade-nix || true +# NOTE: Superuser update for macOS setup +sudo nix upgrade-nix || true + + # NOTE: Secrets are not shared to PRs from forks # NOTE: nix-build | cachix push - uploads binaries, runs&works only in the branches of the main repository, so for PRs - else case runs From 5ae47df2c9b17ed05db06b681ffa108adc2a2e33 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Mon, 1 Jun 2020 18:46:04 +0300 Subject: [PATCH 3/7] default.nix: to allow use of current channels remove hash guarding M default.nix --- default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/default.nix b/default.nix index c7846e9..7605461 100644 --- a/default.nix +++ b/default.nix @@ -31,14 +31,10 @@ , rev ? "29d57de30101b51b016310ee51c2c4ec762f88db" # 2020-05-23: NOTE: UTC 17:00 -, sha256 ? "1wjljkffb3gzdvpfc4v98mrhzack6k9i7860n8cf5nipyab6jbq9" - , pkgs ? if builtins.compareVersions builtins.nixVersion "2.0" < 0 then abort "hnix requires at least nix 2.0" - else import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; - inherit sha256; }) { + else import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz") { config.allowBroken = true; # config.packageOverrides = pkgs: rec { # nix = pkgs.nixStable.overrideDerivation (attrs: with pkgs; rec { From cf0007c09ed78ad9817c80ea75913786fb9d7016 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Mon, 1 Jun 2020 18:47:42 +0300 Subject: [PATCH 4/7] default.nix: set `rev` default to `nixpkgs-unstable` M default.nix --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 7605461..ff87924 100644 --- a/default.nix +++ b/default.nix @@ -29,7 +29,7 @@ , withHoogle ? true -, rev ? "29d57de30101b51b016310ee51c2c4ec762f88db" # 2020-05-23: NOTE: UTC 17:00 +, rev ? "nixpkgs-unstable" , pkgs ? if builtins.compareVersions builtins.nixVersion "2.0" < 0 From 637f6641d45288b9d6907e2c5218339a5227aebd Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Mon, 1 Jun 2020 18:48:31 +0300 Subject: [PATCH 5/7] default.nix: for import form separate explicit override set M default.nix --- default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index ff87924..8878358 100644 --- a/default.nix +++ b/default.nix @@ -34,7 +34,8 @@ , pkgs ? if builtins.compareVersions builtins.nixVersion "2.0" < 0 then abort "hnix requires at least nix 2.0" - else import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz") { + else import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz") {} + // { config.allowBroken = true; # config.packageOverrides = pkgs: rec { # nix = pkgs.nixStable.overrideDerivation (attrs: with pkgs; rec { From f25a5034f09d6bdc007fdc09e9a961ddd5d22c72 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Mon, 1 Jun 2020 18:55:42 +0300 Subject: [PATCH 6/7] default.nix: add if useRev - then use rev, else use M default.nix --- default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 8878358..a843da9 100644 --- a/default.nix +++ b/default.nix @@ -29,14 +29,21 @@ , withHoogle ? true + +, useRev ? false +# Accepts Nixpkgs channel name and Git revision , rev ? "nixpkgs-unstable" , pkgs ? if builtins.compareVersions builtins.nixVersion "2.0" < 0 then abort "hnix requires at least nix 2.0" - else import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz") {} + else + if useRev + then import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz") {} + # Please not guard with hash, so we able to use current channels (rolling `rev`) of Haskell&Nixpkgs + else import {} // { - config.allowBroken = true; + config.allowBroken = true; # config.packageOverrides = pkgs: rec { # nix = pkgs.nixStable.overrideDerivation (attrs: with pkgs; rec { # src = if builtins.pathExists ./data/nix/.version @@ -73,7 +80,7 @@ # outputs = builtins.filter (s: s != "doc" && s != "man" ) attrs.outputs; # }); # }; - } + } , mkDerivation ? null }: From f9f38563c459e2529bdd14ebba646d9f06b4b0b5 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Mon, 1 Jun 2020 19:08:37 +0300 Subject: [PATCH 7/7] CI: build.sh: MAIN: add the channel update M build.sh --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index cf2fc29..2909a82 100755 --- a/build.sh +++ b/build.sh @@ -148,6 +148,10 @@ nix upgrade-nix || true # NOTE: Superuser update for macOS setup sudo nix upgrade-nix || true +# NOTE: Make channels current +nix-channel --update || true +sudo nix-channel --update || true + # NOTE: Secrets are not shared to PRs from forks # NOTE: nix-build | cachix push - uploads binaries, runs&works only in the branches of the main repository, so for PRs - else case runs