From fe14d02a18ecb4280f50da4706ac682b5543271c Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 13 Oct 2021 22:36:18 +1300 Subject: [PATCH 1/8] Update haskell.nix, ghc and nixpkgs --- nix/haskell.nix | 2 +- nix/sources.json | 24 ++++++--- nix/sources.nix | 132 ++++++++++++++++++++++++++++++----------------- 3 files changed, 105 insertions(+), 53 deletions(-) diff --git a/nix/haskell.nix b/nix/haskell.nix index 80d07c15..cf7b1a1c 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -7,7 +7,7 @@ , buildPackages , config ? {} # GHC attribute name -, compiler ? config.haskellNix.compiler or "ghc865" +, compiler ? config.haskellNix.compiler or "ghc8107" # Enable profiling , profiling ? config.haskellNix.profiling or false # Enable coverage diff --git a/nix/sources.json b/nix/sources.json index 07c4aeee..ff76a414 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "https://input-output-hk.github.io/haskell.nix", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "48b8674f5f726cfb5083c025d3c53ff01fef009a", - "sha256": "0b90xnxn72kv5qskp3gxfcmql8cqbank7nlp0m6353yhqp6kr5mc", + "rev": "89a69afd820506f6032cd805bc18e127c2af47a5", + "sha256": "0qr5wlypvxwqy8kqd7524xdbqcd9s47rhnpvsa2wf60jrs4axbb9", "type": "tarball", - "url": "https://github.com/input-output-hk/haskell.nix/archive/48b8674f5f726cfb5083c025d3c53ff01fef009a.tar.gz", + "url": "https://github.com/input-output-hk/haskell.nix/archive/89a69afd820506f6032cd805bc18e127c2af47a5.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "iohk-nix": { @@ -17,10 +17,22 @@ "homepage": null, "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "f4790863d0d4e3f9018f012ec6575432c7952a48", - "sha256": "0jds3j5fqcwbgpmbddrp9cxia5mxz8kw7sqsw6jcq9bq5mv1x00d", + "rev": "1e51437aac8a0e49663cb21e781f34163c81ebfb", + "sha256": "03slpwazvnhn9kd37dpxc55bq5xn841v616xmw8j6nkqklmw2vzc", "type": "tarball", - "url": "https://github.com/input-output-hk/iohk-nix/archive/f4790863d0d4e3f9018f012ec6575432c7952a48.tar.gz", + "url": "https://github.com/input-output-hk/iohk-nix/archive/1e51437aac8a0e49663cb21e781f34163c81ebfb.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs": { + "branch": "nixpkgs-unstable", + "description": "Nix Packages collection", + "homepage": "", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a3a23d9599b0a82e333ad91db2cdc479313ce154", + "sha256": "05xmgrrnw6j39lh3d48kg064z510i0w5vvrm1s5cdwhdc2fkspjq", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a3a23d9599b0a82e333ad91db2cdc479313ce154.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs-19.03": { diff --git a/nix/sources.nix b/nix/sources.nix index 8a725cb4..1938409d 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -6,52 +6,63 @@ let # The fetchers. fetch_ fetches specs of type . # - fetch_file = pkgs: spec: - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; } - else - pkgs.fetchurl { inherit (spec) url sha256; }; - - fetch_tarball = pkgs: spec: - if spec.builtin or true then - builtins_fetchTarball { inherit (spec) url sha256; } - else - pkgs.fetchzip { inherit (spec) url sha256; }; + fetch_file = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; name = name'; } + else + pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; - fetch_git = spec: - builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; }; + fetch_tarball = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchTarball { name = name'; inherit (spec) url sha256; } + else + pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; - fetch_builtin-tarball = spec: - builtins.trace - '' - WARNING: - The niv type "builtin-tarball" will soon be deprecated. You should - instead use `builtin = true`. + fetch_git = name: spec: + let + ref = + if spec ? ref then spec.ref else + if spec ? branch then "refs/heads/${spec.branch}" else + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + in + builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; - $ niv modify -a type=tarball -a builtin=true - '' - builtins_fetchTarball { inherit (spec) url sha256; }; + fetch_local = spec: spec.path; - fetch_builtin-url = spec: - builtins.trace - '' - WARNING: - The niv type "builtin-url" will soon be deprecated. You should - instead use `builtin = true`. + fetch_builtin-tarball = name: throw + ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=tarball -a builtin=true''; - $ niv modify -a type=file -a builtin=true - '' - (builtins_fetchurl { inherit (spec) url sha256; }); + fetch_builtin-url = name: throw + ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=file -a builtin=true''; # # Various helpers # + # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 + sanitizeName = name: + ( + concatMapStrings (s: if builtins.isList s then "-" else s) + ( + builtins.split "[^[:alnum:]+._?=-]+" + ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) + ) + ); + # The set of packages used when specs are fetched using non-builtins. - mkPkgs = sources: + mkPkgs = sources: system: let sourcesNixpkgs = - import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {}; + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; hasThisAsNixpkgsPath = == ./.; in @@ -71,14 +82,27 @@ let if ! builtins.hasAttr "type" spec then abort "ERROR: niv spec ${name} does not have a 'type' attribute" - else if spec.type == "file" then fetch_file pkgs spec - else if spec.type == "tarball" then fetch_tarball pkgs spec - else if spec.type == "git" then fetch_git spec - else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec - else if spec.type == "builtin-url" then fetch_builtin-url spec + else if spec.type == "file" then fetch_file pkgs name spec + else if spec.type == "tarball" then fetch_tarball pkgs name spec + else if spec.type == "git" then fetch_git name spec + else if spec.type == "local" then fetch_local spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball name + else if spec.type == "builtin-url" then fetch_builtin-url name else abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + # If the environment variable NIV_OVERRIDE_${name} is set, then use + # the path directly as opposed to the fetched source. + replace = name: drv: + let + saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; + ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; + in + if ersatz == "" then drv else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; + # Ports of functions for older nix versions # a Nix version of mapAttrs if the built-in doesn't exist @@ -87,23 +111,37 @@ let listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) ); + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 + range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 + stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); + concatMapStrings = f: list: concatStrings (map f list); + concatStrings = builtins.concatStringsSep ""; + + # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 + optionalAttrs = cond: as: if cond then as else {}; + # fetchTarball version that is compatible between all the versions of Nix - builtins_fetchTarball = { url, sha256 }@attrs: + builtins_fetchTarball = { url, name ? null, sha256 }@attrs: let inherit (builtins) lessThan nixVersion fetchTarball; in if lessThan nixVersion "1.12" then - fetchTarball { inherit url; } + fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) else fetchTarball attrs; # fetchurl version that is compatible between all the versions of Nix - builtins_fetchurl = { url, sha256 }@attrs: + builtins_fetchurl = { url, name ? null, sha256 }@attrs: let inherit (builtins) lessThan nixVersion fetchurl; in if lessThan nixVersion "1.12" then - fetchurl { inherit url; } + fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) else fetchurl attrs; @@ -115,14 +153,15 @@ let then abort "The values in sources.json should not have an 'outPath' attribute" else - spec // { outPath = fetch config.pkgs name spec; } + spec // { outPath = replace name (fetch config.pkgs name spec); } ) config.sources; # The "config" used by the fetchers mkConfig = - { sourcesFile ? ./sources.json - , sources ? builtins.fromJSON (builtins.readFile sourcesFile) - , pkgs ? mkPkgs sources + { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null + , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) + , system ? builtins.currentSystem + , pkgs ? mkPkgs sources system }: rec { # The sources, i.e. the attribute set of spec name to spec inherit sources; @@ -130,5 +169,6 @@ let # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers inherit pkgs; }; + in mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } From 2d93508a7c986a7a0b08cc912e3abc7908137e49 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Thu, 14 Oct 2021 13:11:59 +1300 Subject: [PATCH 2/8] Update dependencies in cabal.project and fix warnigns --- cabal.project | 63 ++++++++++-------------------------- cardano-launcher/app/Main.hs | 3 +- 2 files changed, 18 insertions(+), 48 deletions(-) diff --git a/cabal.project b/cabal.project index 1c20b1a3..20772302 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,4 @@ -index-state: 2020-05-15T00:00:00Z +index-state: 2021-10-10T00:00:00Z packages: cardano-shell @@ -28,21 +28,17 @@ constraints: async-timer >= 0.2.0.0 source-repository-package type: git location: https://github.com/input-output-hk/cardano-sl-x509 - tag: 43a036c5bbe68ca2e9cbe611eab7982e2348fe49 - --sha256: 1aw7ns8lv51fjf45k8yzils2j7a6bqzy8hn65kb3z0dn1qsm8x88 + tag: 12925934c533b3a6e009b61ede555f8f26bac037 + --sha256: 1kma25g8sl6m3pgsihja7fysmv6vjdfc0x7dyky9g5z156sh8z7i source-repository-package type: git location: https://github.com/input-output-hk/cardano-prelude - tag: 316c854d1d3089f480708ad5cd5ecf8a74423ddd - --sha256: 1srbl3jrkmpwypdz0yrx4nmah3qcsr93dp48zx2bamg51c4hcsyj - -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-prelude - tag: 316c854d1d3089f480708ad5cd5ecf8a74423ddd - --sha256: 1srbl3jrkmpwypdz0yrx4nmah3qcsr93dp48zx2bamg51c4hcsyj - subdir: test + tag: c7fc9fba236972c27a55e0f3d34c2758cf616bfc + --sha256: 0sg1hhnifqxfc5n5f9ikbxyrjlg77hynbhsql0h4smqniw29dbwk + subdir: + cardano-prelude + cardano-prelude-test source-repository-package type: git @@ -52,42 +48,17 @@ source-repository-package source-repository-package type: git - location: https://github.com/input-output-hk/ouroboros-network - tag: 1361bb92814c65e5964732777fc7f8ec9ebdccfe - --sha256: 1znl9zzw5hswcd09zcvmgq50ppp46nbzjmw67wm4wpnw5lhnlwfy - subdir: Win32-network - -source-repository-package - type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: efa4b5ecd7f0a13124616b12679cd42517cd905a - --sha256: 0h1h5ifl5d7dl3y6fym9pjd6rfrbh5rbyxs0xw5las503pibv2bf - subdir: iohk-monitoring - -source-repository-package - type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: efa4b5ecd7f0a13124616b12679cd42517cd905a - --sha256: 0h1h5ifl5d7dl3y6fym9pjd6rfrbh5rbyxs0xw5las503pibv2bf - subdir: contra-tracer + location: https://github.com/input-output-hk/Win32-network + tag: 3825d3abf75f83f406c1f7161883c438dac7277d + --sha256: 19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx source-repository-package type: git location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: efa4b5ecd7f0a13124616b12679cd42517cd905a - --sha256: 0h1h5ifl5d7dl3y6fym9pjd6rfrbh5rbyxs0xw5las503pibv2bf - subdir: tracer-transformers + tag: 808724ff8a19a33d0ed06f9ef59fbd900b08553c + --sha256: 0298dpl29gxzs9as9ha6y0w18hqwc00ipa3hzkxv7nlfrjjz8hmz + subdir: + iohk-monitoring + contra-tracer + tracer-transformers -source-repository-package - type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: efa4b5ecd7f0a13124616b12679cd42517cd905a - --sha256: 0h1h5ifl5d7dl3y6fym9pjd6rfrbh5rbyxs0xw5las503pibv2bf - subdir: tracer-transformers - -source-repository-package - type: git - location: https://github.com/input-output-hk/ouroboros-network - tag: 1361bb92814c65e5964732777fc7f8ec9ebdccfe - --sha256: 1znl9zzw5hswcd09zcvmgq50ppp46nbzjmw67wm4wpnw5lhnlwfy - subdir: Win32-network diff --git a/cardano-launcher/app/Main.hs b/cardano-launcher/app/Main.hs index 81e0f337..3eab3cce 100644 --- a/cardano-launcher/app/Main.hs +++ b/cardano-launcher/app/Main.hs @@ -14,7 +14,6 @@ import Data.Text.Lazy.Builder (fromString, fromText) import Distribution.System (OS (Windows), buildOS) import System.Environment (setEnv) -import System.Exit (exitWith) import System.IO.Silently (hSilence) import System.Process (proc, waitForProcess, withCreateProcess) @@ -23,7 +22,7 @@ import Formatting.Buildable (Buildable (..)) import Options.Applicative (Parser, ParserInfo, auto, execParser, fullDesc, header, help, helper, info, - long, metavar, option, optional, progDesc) + long, metavar, option, progDesc) import Cardano.BM.Setup (withTrace) import qualified Cardano.BM.Trace as Trace From 7611765aec76d0a2cc8252d1f0474bc5a4570b3c Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Sat, 26 Mar 2022 01:27:57 +1300 Subject: [PATCH 3/8] Bump haskell.nix and nixpkgs to latest commits --- nix/sources.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index ff76a414..a0bafe8f 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "https://input-output-hk.github.io/haskell.nix", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "89a69afd820506f6032cd805bc18e127c2af47a5", - "sha256": "0qr5wlypvxwqy8kqd7524xdbqcd9s47rhnpvsa2wf60jrs4axbb9", + "rev": "4b6ee9767daaf5fc1d5419e07733ab006b95ec93", + "sha256": "03hkqrdjbab0m16y3bpmcg4nvrnpajkbaa595v67r77hhqja3nqj", "type": "tarball", - "url": "https://github.com/input-output-hk/haskell.nix/archive/89a69afd820506f6032cd805bc18e127c2af47a5.tar.gz", + "url": "https://github.com/input-output-hk/haskell.nix/archive/4b6ee9767daaf5fc1d5419e07733ab006b95ec93.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "iohk-nix": { @@ -29,10 +29,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a3a23d9599b0a82e333ad91db2cdc479313ce154", - "sha256": "05xmgrrnw6j39lh3d48kg064z510i0w5vvrm1s5cdwhdc2fkspjq", + "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", + "sha256": "0zg7ak2mcmwzi2kg29g4v9fvbvs0viykjsg2pwaphm1fi13s7s0i", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a3a23d9599b0a82e333ad91db2cdc479313ce154.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/1882c6b7368fd284ad01b0a5b5601ef136321292.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs-19.03": { From 01f441568830811f1d699eb510a49e5bcb122390 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Sat, 26 Mar 2022 01:45:14 +1300 Subject: [PATCH 4/8] Bump nixpkgs to latest nixpkgs-unstable --- nix/sources.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index a0bafe8f..595ee576 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -29,10 +29,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", - "sha256": "0zg7ak2mcmwzi2kg29g4v9fvbvs0viykjsg2pwaphm1fi13s7s0i", + "rev": "4d60081494259c0785f7e228518fee74e0792c1b", + "sha256": "15vxvzy9sxsnnxn53w2n44vklv7irzxvqv8xj9dn78z9zwl17jhq", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/1882c6b7368fd284ad01b0a5b5601ef136321292.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/4d60081494259c0785f7e228518fee74e0792c1b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs-19.03": { From 9a9d28ddfa8eee4c9804da3cdec1d576864ce6b9 Mon Sep 17 00:00:00 2001 From: Michal Rus Date: Fri, 25 Mar 2022 16:10:28 +0100 Subject: [PATCH 5/8] =?UTF-8?q?Try=20to=20update=20haskell.nix,=20iohk-nix?= =?UTF-8?q?=20(and=20via=20those=20=E2=86=92=20Nixpkgs)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cabal.project | 64 +++++++----------------- cardano-launcher/app/Main.hs | 3 +- cardano-launcher/app/Mocks/Daedalus.hs | 3 +- cardano-launcher/test/EnvironmentSpec.hs | 1 - cardano-launcher/test/LauncherSMSpec.hs | 4 +- cardano-launcher/test/TemplateSpec.hs | 1 - cardano-shell/test/NodeIPCSMSpec.hs | 4 +- default.nix | 7 ++- nix/haskell.nix | 2 +- nix/sources.json | 12 ++--- 10 files changed, 33 insertions(+), 68 deletions(-) diff --git a/cabal.project b/cabal.project index 1c20b1a3..0c50f37c 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,4 @@ -index-state: 2020-05-15T00:00:00Z +index-state: 2021-10-10T00:00:00Z packages: cardano-shell @@ -28,21 +28,17 @@ constraints: async-timer >= 0.2.0.0 source-repository-package type: git location: https://github.com/input-output-hk/cardano-sl-x509 - tag: 43a036c5bbe68ca2e9cbe611eab7982e2348fe49 - --sha256: 1aw7ns8lv51fjf45k8yzils2j7a6bqzy8hn65kb3z0dn1qsm8x88 + tag: 12925934c533b3a6e009b61ede555f8f26bac037 + --sha256: 1kma25g8sl6m3pgsihja7fysmv6vjdfc0x7dyky9g5z156sh8z7i source-repository-package type: git location: https://github.com/input-output-hk/cardano-prelude - tag: 316c854d1d3089f480708ad5cd5ecf8a74423ddd - --sha256: 1srbl3jrkmpwypdz0yrx4nmah3qcsr93dp48zx2bamg51c4hcsyj - -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-prelude - tag: 316c854d1d3089f480708ad5cd5ecf8a74423ddd - --sha256: 1srbl3jrkmpwypdz0yrx4nmah3qcsr93dp48zx2bamg51c4hcsyj - subdir: test + tag: c7fc9fba236972c27a55e0f3d34c2758cf616bfc + --sha256: 0sg1hhnifqxfc5n5f9ikbxyrjlg77hynbhsql0h4smqniw29dbwk + subdir: + cardano-prelude + cardano-prelude-test source-repository-package type: git @@ -52,42 +48,16 @@ source-repository-package source-repository-package type: git - location: https://github.com/input-output-hk/ouroboros-network - tag: 1361bb92814c65e5964732777fc7f8ec9ebdccfe - --sha256: 1znl9zzw5hswcd09zcvmgq50ppp46nbzjmw67wm4wpnw5lhnlwfy - subdir: Win32-network - -source-repository-package - type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: efa4b5ecd7f0a13124616b12679cd42517cd905a - --sha256: 0h1h5ifl5d7dl3y6fym9pjd6rfrbh5rbyxs0xw5las503pibv2bf - subdir: iohk-monitoring + location: https://github.com/input-output-hk/Win32-network + tag: 3825d3abf75f83f406c1f7161883c438dac7277d + --sha256: 19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx source-repository-package type: git location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: efa4b5ecd7f0a13124616b12679cd42517cd905a - --sha256: 0h1h5ifl5d7dl3y6fym9pjd6rfrbh5rbyxs0xw5las503pibv2bf - subdir: contra-tracer - -source-repository-package - type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: efa4b5ecd7f0a13124616b12679cd42517cd905a - --sha256: 0h1h5ifl5d7dl3y6fym9pjd6rfrbh5rbyxs0xw5las503pibv2bf - subdir: tracer-transformers - -source-repository-package - type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: efa4b5ecd7f0a13124616b12679cd42517cd905a - --sha256: 0h1h5ifl5d7dl3y6fym9pjd6rfrbh5rbyxs0xw5las503pibv2bf - subdir: tracer-transformers - -source-repository-package - type: git - location: https://github.com/input-output-hk/ouroboros-network - tag: 1361bb92814c65e5964732777fc7f8ec9ebdccfe - --sha256: 1znl9zzw5hswcd09zcvmgq50ppp46nbzjmw67wm4wpnw5lhnlwfy - subdir: Win32-network + tag: 808724ff8a19a33d0ed06f9ef59fbd900b08553c + --sha256: 0298dpl29gxzs9as9ha6y0w18hqwc00ipa3hzkxv7nlfrjjz8hmz + subdir: + iohk-monitoring + contra-tracer + tracer-transformers diff --git a/cardano-launcher/app/Main.hs b/cardano-launcher/app/Main.hs index 81e0f337..3eab3cce 100644 --- a/cardano-launcher/app/Main.hs +++ b/cardano-launcher/app/Main.hs @@ -14,7 +14,6 @@ import Data.Text.Lazy.Builder (fromString, fromText) import Distribution.System (OS (Windows), buildOS) import System.Environment (setEnv) -import System.Exit (exitWith) import System.IO.Silently (hSilence) import System.Process (proc, waitForProcess, withCreateProcess) @@ -23,7 +22,7 @@ import Formatting.Buildable (Buildable (..)) import Options.Applicative (Parser, ParserInfo, auto, execParser, fullDesc, header, help, helper, info, - long, metavar, option, optional, progDesc) + long, metavar, option, progDesc) import Cardano.BM.Setup (withTrace) import qualified Cardano.BM.Trace as Trace diff --git a/cardano-launcher/app/Mocks/Daedalus.hs b/cardano-launcher/app/Mocks/Daedalus.hs index c430cf0a..5b990c80 100644 --- a/cardano-launcher/app/Mocks/Daedalus.hs +++ b/cardano-launcher/app/Mocks/Daedalus.hs @@ -3,7 +3,6 @@ module Main where import Cardano.Prelude -import System.Exit (exitWith) seconds :: Int seconds = 1000000 @@ -13,4 +12,4 @@ main = do putTextLn $ "Starting Daedalus" threadDelay $ 5 * seconds putText $ "Exiting for update" - exitWith $ ExitFailure 20 \ No newline at end of file + exitWith $ ExitFailure 20 diff --git a/cardano-launcher/test/EnvironmentSpec.hs b/cardano-launcher/test/EnvironmentSpec.hs index 9980befc..cc9d4b1b 100644 --- a/cardano-launcher/test/EnvironmentSpec.hs +++ b/cardano-launcher/test/EnvironmentSpec.hs @@ -8,7 +8,6 @@ module EnvironmentSpec ) where import Cardano.Prelude -import Data.Char (isAlphaNum) import qualified Data.HashMap.Strict as HM import qualified Data.Vector as V import qualified Data.Yaml as Y diff --git a/cardano-launcher/test/LauncherSMSpec.hs b/cardano-launcher/test/LauncherSMSpec.hs index 810a3969..fbfb4ab4 100644 --- a/cardano-launcher/test/LauncherSMSpec.hs +++ b/cardano-launcher/test/LauncherSMSpec.hs @@ -18,8 +18,6 @@ module LauncherSMSpec import Cardano.Prelude -import Data.TreeDiff (ToExpr (..)) - import Test.Hspec (Spec, describe, it) import Test.QuickCheck (Gen, Property, oneof, (===)) @@ -165,7 +163,7 @@ launcherSM = StateMachine , shrinker = mShrinker , semantics = mSemantics , mock = mMock - , distribution = Nothing + , cleanup = const (pure ()) } where -- | Let's handle just Ping/Pong for now. diff --git a/cardano-launcher/test/TemplateSpec.hs b/cardano-launcher/test/TemplateSpec.hs index eb660911..2d340d50 100644 --- a/cardano-launcher/test/TemplateSpec.hs +++ b/cardano-launcher/test/TemplateSpec.hs @@ -9,7 +9,6 @@ module TemplateSpec ) where import Cardano.Prelude -import Data.Char (isAlphaNum) import System.Environment (lookupEnv, setEnv, unsetEnv) import System.IO.Error (userError) import Test.Hspec (Spec) diff --git a/cardano-shell/test/NodeIPCSMSpec.hs b/cardano-shell/test/NodeIPCSMSpec.hs index 0aaa60de..f24861dd 100644 --- a/cardano-shell/test/NodeIPCSMSpec.hs +++ b/cardano-shell/test/NodeIPCSMSpec.hs @@ -18,8 +18,6 @@ module NodeIPCSMSpec import Cardano.Prelude -import Data.TreeDiff (ToExpr (..)) - import Test.Hspec (Spec, describe, it) import Test.QuickCheck (Gen, Property, arbitrary, generate, oneof, @@ -188,7 +186,7 @@ nodeIPCSM serverHandles = StateMachine , shrinker = mShrinker , semantics = mSemantics , mock = mMock - , distribution = Nothing + , cleanup = const (pure ()) } where -- | Let's handle just Ping/Pong for now. diff --git a/default.nix b/default.nix index 262cdace..437c2e88 100644 --- a/default.nix +++ b/default.nix @@ -17,6 +17,9 @@ with pkgs; with commonLib; let + # FIXME: I really don’t know if this ↓ is right… – @michalrus + hpc-coveralls = cardanoShellHaskellPackages.tool "hpc-coveralls" "0.7.0"; + haskellPackages = recRecurseIntoAttrs # the Haskell.nix package set, reduced to local packages. (selectProjectPackages cardanoShellHaskellPackages); @@ -26,7 +29,7 @@ let projectPkgs = selectProjectPackages pkgSet; projectCoverageReport = pkgSet.projectCoverageReport; in writeShellScriptBin "uploadCoveralls.sh" '' - ${commonLib.hpc-coveralls}/bin/hpc-coveralls all \ + ${hpc-coveralls}/bin/hpc-coveralls all \ ${concatStringsSep "\n " (mapAttrsToList (_: p: "--package-dir .${p.src.origSubDir} \\") projectPkgs)} --hpc-dir ${projectCoverageReport}/share/hpc/vanilla \ --coverage-mode StrictlyFullLines \ @@ -54,7 +57,7 @@ let tests = collectChecks haskellPackages; }; - inherit (commonLib) hpc-coveralls; + inherit hpc-coveralls; uploadCoverallsScript = uploadCoverallsScript cardanoShellHaskellPackages; shell = import ./shell.nix { diff --git a/nix/haskell.nix b/nix/haskell.nix index 80d07c15..cf7b1a1c 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -7,7 +7,7 @@ , buildPackages , config ? {} # GHC attribute name -, compiler ? config.haskellNix.compiler or "ghc865" +, compiler ? config.haskellNix.compiler or "ghc8107" # Enable profiling , profiling ? config.haskellNix.profiling or false # Enable coverage diff --git a/nix/sources.json b/nix/sources.json index 07c4aeee..fafb7fb4 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "https://input-output-hk.github.io/haskell.nix", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "48b8674f5f726cfb5083c025d3c53ff01fef009a", - "sha256": "0b90xnxn72kv5qskp3gxfcmql8cqbank7nlp0m6353yhqp6kr5mc", + "rev": "308c937bfc68071d8ab0206b44e0f3dde35a401e", + "sha256": "03hkqrdjbab0m16y3bpmcg4nvrnpajkbaa595v67r77hhqja3nqj", "type": "tarball", - "url": "https://github.com/input-output-hk/haskell.nix/archive/48b8674f5f726cfb5083c025d3c53ff01fef009a.tar.gz", + "url": "https://github.com/input-output-hk/haskell.nix/archive/4b6ee9767daaf5fc1d5419e07733ab006b95ec93.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "iohk-nix": { @@ -17,10 +17,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "f4790863d0d4e3f9018f012ec6575432c7952a48", - "sha256": "0jds3j5fqcwbgpmbddrp9cxia5mxz8kw7sqsw6jcq9bq5mv1x00d", + "rev": "0a0126d8fb1bdc61ce1fd2ef61cf396de800fdad", + "sha256": "09jrhq48h5vwl6vyf4q8d38vlaqmbd00m550rwxz79k90bxb7q6y", "type": "tarball", - "url": "https://github.com/input-output-hk/iohk-nix/archive/f4790863d0d4e3f9018f012ec6575432c7952a48.tar.gz", + "url": "https://github.com/input-output-hk/iohk-nix/archive/5e667b374153327c7bdfdbfab8ef19b1f27d4aac.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs-19.03": { From 2478d5403bf0d5ba86de19817032dee24ff436d8 Mon Sep 17 00:00:00 2001 From: Michal Rus Date: Mon, 28 Mar 2022 16:29:49 +0200 Subject: [PATCH 6/8] Fix `hTryLock` in newer Haskell (OFD locks on Linux); fix imports --- cardano-launcher/src/Cardano/Shell/Application.hs | 2 +- cardano-launcher/src/Cardano/Shell/Launcher.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cardano-launcher/src/Cardano/Shell/Application.hs b/cardano-launcher/src/Cardano/Shell/Application.hs index 2f763831..1828a512 100644 --- a/cardano-launcher/src/Cardano/Shell/Application.hs +++ b/cardano-launcher/src/Cardano/Shell/Application.hs @@ -63,7 +63,7 @@ checkIfApplicationIsRunning lockFilePath = do when (not fileExist) $ writeFile lockFilePath "" - lockfileHandle <- openFile lockFilePath ReadMode + lockfileHandle <- openFile lockFilePath ReadWriteMode isAlreadyRunning <- hTryLock lockfileHandle ExclusiveLock -- We need to inform the user if the application version is already running. diff --git a/cardano-launcher/src/Cardano/Shell/Launcher.hs b/cardano-launcher/src/Cardano/Shell/Launcher.hs index c1158ff5..98d340a7 100644 --- a/cardano-launcher/src/Cardano/Shell/Launcher.hs +++ b/cardano-launcher/src/Cardano/Shell/Launcher.hs @@ -29,7 +29,7 @@ module Cardano.Shell.Launcher import Cardano.Prelude hiding (onException) import Prelude (Show (..)) -import Data.Aeson (FromJSON, ToJSON(toJSON), genericParseJSON, genericToJSON, defaultOptions) +import Data.Aeson (genericParseJSON, genericToJSON, defaultOptions) import Data.Yaml as Y import qualified System.Process as Process import Turtle (system) From 298bd351df6a19deaa325cfc4d031b39bd5e596e Mon Sep 17 00:00:00 2001 From: Michal Rus Date: Tue, 12 Apr 2022 14:39:09 +0200 Subject: [PATCH 7/8] Allow passing `pkgs` to `haskell.nix` to let `cardano-shell` build as a nix flake input --- nix/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index a3ee3ce8..9c6c90fe 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -6,8 +6,12 @@ let sources = import ./sources.nix { inherit pkgs; } // sourcesOverride; - iohkNix = import sources.iohk-nix {}; - haskellNix = import sources."haskell.nix" {}; + iohkNix = import sources.iohk-nix { inherit system crossSystem; }; + haskellNix = import sources."haskell.nix" { + # Without that, haskell.nilx tries to call builtins.currentSystem, which fails inside flake builds: + pkgs = import nixpkgs { inherit system crossSystem; }; + inherit system crossSystem; + }; # use our own nixpkgs if it exists in our sources, # otherwise use iohkNix default nixpkgs. nixpkgs = if (sources ? nixpkgs) From 79f48aa3aa8007a1597cbedc22031eab1f05decd Mon Sep 17 00:00:00 2001 From: Michal Rus Date: Wed, 1 Oct 2025 16:23:58 +0200 Subject: [PATCH 8/8] chore: switch to Nix flakes, and update all dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves https://github.com/input-output-hk/daedalus/issues/3292 It’s been long overdue. The version currently used by Daedalus (0d1d5f036c73d18e641412d2c58d4acda592d493) doesn’t even build on Hydra… There supposedly is some indeterminism in its build. --- .buildkite/pipeline.yml | 22 --- cabal | 5 - cabal.project | 84 +++++---- cardano-launcher/app/Main.hs | 2 +- .../src/Cardano/Shell/Application.hs | 1 + .../src/Cardano/Shell/Environment.hs | 1 + .../src/Cardano/Shell/Update/Lib.hs | 5 +- cardano-launcher/test/TemplateSpec.hs | 1 + ci/check-hydra.sh | 31 ---- ci/check-regenerate-nix.sh | 20 -- default.nix | 68 ------- flake.lock | 62 +++++++ flake.nix | 58 ++++++ lockfile | 0 nix/.stack.nix/cardano-crypto.nix | 88 --------- nix/.stack.nix/cardano-launcher.nix | 86 --------- nix/.stack.nix/cardano-prelude-test.nix | 49 ----- nix/.stack.nix/cardano-prelude.nix | 77 -------- nix/.stack.nix/cardano-shell.nix | 61 ------ nix/.stack.nix/cardano-sl-x509.nix | 61 ------ nix/.stack.nix/contra-tracer.nix | 31 ---- nix/.stack.nix/default.nix | 32 ---- nix/.stack.nix/hedgehog.nix | 68 ------- nix/.stack.nix/iohk-monitoring.nix | 100 ---------- nix/.stack.nix/plutus-prototype.nix | 44 ----- nix/default.nix | 61 ------ nix/haskell.nix | 95 ---------- nix/iohk-common.nix | 14 -- nix/iohk-nix-src.json | 7 - nix/pkgs.nix | 11 -- nix/regenerate.sh | 5 - nix/sources.json | 38 ---- nix/sources.nix | 174 ------------------ nix/update-iohk-nix.sh | 9 - nix/util.nix | 14 -- nixpkgs.nix | 4 - release.nix | 95 ---------- scripts/buildkite/cache-s3.nix | 25 --- scripts/buildkite/default.nix | 20 -- scripts/buildkite/rebuild.hs | 166 ----------------- scripts/buildkite/stack-cabal-sync.sh | 26 --- shell.nix | 72 -------- stack-shell.nix | 1 - stack.yaml | 42 ----- test.nix | 28 --- updater-test-win.nix | 26 --- 46 files changed, 180 insertions(+), 1810 deletions(-) delete mode 100644 .buildkite/pipeline.yml delete mode 100755 cabal delete mode 100755 ci/check-hydra.sh delete mode 100755 ci/check-regenerate-nix.sh delete mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 lockfile delete mode 100644 nix/.stack.nix/cardano-crypto.nix delete mode 100644 nix/.stack.nix/cardano-launcher.nix delete mode 100644 nix/.stack.nix/cardano-prelude-test.nix delete mode 100644 nix/.stack.nix/cardano-prelude.nix delete mode 100644 nix/.stack.nix/cardano-shell.nix delete mode 100644 nix/.stack.nix/cardano-sl-x509.nix delete mode 100644 nix/.stack.nix/contra-tracer.nix delete mode 100644 nix/.stack.nix/default.nix delete mode 100644 nix/.stack.nix/hedgehog.nix delete mode 100644 nix/.stack.nix/iohk-monitoring.nix delete mode 100644 nix/.stack.nix/plutus-prototype.nix delete mode 100644 nix/default.nix delete mode 100644 nix/haskell.nix delete mode 100644 nix/iohk-common.nix delete mode 100644 nix/iohk-nix-src.json delete mode 100644 nix/pkgs.nix delete mode 100755 nix/regenerate.sh delete mode 100644 nix/sources.json delete mode 100644 nix/sources.nix delete mode 100755 nix/update-iohk-nix.sh delete mode 100644 nix/util.nix delete mode 100644 nixpkgs.nix delete mode 100644 release.nix delete mode 100644 scripts/buildkite/cache-s3.nix delete mode 100644 scripts/buildkite/default.nix delete mode 100644 scripts/buildkite/rebuild.hs delete mode 100755 scripts/buildkite/stack-cabal-sync.sh delete mode 100644 shell.nix delete mode 100644 stack-shell.nix delete mode 100644 stack.yaml delete mode 100644 test.nix delete mode 100644 updater-test-win.nix diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index d1db4274..00000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,22 +0,0 @@ -steps: - - label: 'coveralls coverage' - command: - - '$(nix-build -A uploadCoverallsScript --arg config "{ haskellNix = { coverage = true; }; }")/bin/uploadCoveralls.sh' - agents: - system: x86_64-linux - - - label: 'check-cabal-project' - command: 'nix-build ./nix -A iohkNix.checkCabalProject -o check-cabal-project.sh && ./check-cabal-project.sh' - agents: - system: x86_64-linux - - - label: 'stack-cabal-sync' - command: 'nix-shell ./nix -A iohkNix.stack-cabal-sync-shell --run scripts/buildkite/stack-cabal-sync.sh' - agents: - system: x86_64-linux - - - label: 'stack2nix' - command: 'ci/check-regenerate-nix.sh' - agents: - system: x86_64-linux - diff --git a/cabal b/cabal deleted file mode 100755 index 6afa45d0..00000000 --- a/cabal +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - -nix-shell $DIR/shell.nix --add-root $DIR/dist-newstyle/gc-roots/gc-root --indirect --run "cabal $(printf "%q " "$@")" diff --git a/cabal.project b/cabal.project index 0c50f37c..6cbe19a9 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,20 @@ -index-state: 2021-10-10T00:00:00Z +-- Custom repository for cardano haskell packages, see CONTRIBUTING for more +repository cardano-haskell-packages + url: https://chap.intersectmbo.org/ + secure: True + root-keys: + 3e0cce471cf09815f930210f7827266fd09045445d65923e6d0238a6cd15126f + 443abb7fb497a134c343faf52f0b659bd7999bc06b7f63fa76dc99d631f9bea1 + a86a1f6ce86c449c46666bda44268677abf29b5b2d2eb5ec7af903ec2f117a82 + bcec67e8e99cabfa7764d75ad9b158d72bfacf70ca1d0ec8bc6b4406d1bf8413 + c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56 + d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee + +-- See CONTRIBUTING for information about these, including some Nix commands +-- you need to run if you change them +index-state: + , hackage.haskell.org 2025-04-16T18:30:40Z + , cardano-haskell-packages 2025-04-29T14:14:35Z packages: cardano-shell @@ -19,45 +35,51 @@ package cardano-shell package cardano-launcher tests: True +-- See +-- disable c++ nonsense on bitvec, to make it compile. The windows linker/loader +-- chokes on c++ dependencies. +package bitvec + flags: -simd + -- --------------------------------------------------------- -- The iohk-monitoring requires async-timer >= 0.2.0.0 but does not -- list this constraint in it's cabal file. -constraints: async-timer >= 0.2.0.0 +-- constraints: async-timer >= 0.2.0.0 source-repository-package type: git location: https://github.com/input-output-hk/cardano-sl-x509 - tag: 12925934c533b3a6e009b61ede555f8f26bac037 - --sha256: 1kma25g8sl6m3pgsihja7fysmv6vjdfc0x7dyky9g5z156sh8z7i + tag: a91add165152fa36f08e95fafe7da24f1dba4690 + --sha256: 1ia8vlqghis92cla8qmqa6kh8f3jn29b01fshyk5hmgy5373s684 -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-prelude - tag: c7fc9fba236972c27a55e0f3d34c2758cf616bfc - --sha256: 0sg1hhnifqxfc5n5f9ikbxyrjlg77hynbhsql0h4smqniw29dbwk - subdir: - cardano-prelude - cardano-prelude-test +-- source-repository-package +-- type: git +-- location: https://github.com/input-output-hk/cardano-prelude +-- tag: c7fc9fba236972c27a55e0f3d34c2758cf616bfc +-- --sha256: 0sg1hhnifqxfc5n5f9ikbxyrjlg77hynbhsql0h4smqniw29dbwk +-- subdir: +-- cardano-prelude +-- cardano-prelude-test -source-repository-package - type: git - location: http://github.com/well-typed/canonical-json - tag: ddfe3593b80b5ceb88842bb7a6f2268df75d2c2f - --sha256: 02fzn1xskis1lc1pkz0j92v6ipd89ww0k2p3dvwpm3yap5dpnm7k +-- source-repository-package +-- type: git +-- location: http://github.com/well-typed/canonical-json +-- tag: ddfe3593b80b5ceb88842bb7a6f2268df75d2c2f +-- --sha256: 02fzn1xskis1lc1pkz0j92v6ipd89ww0k2p3dvwpm3yap5dpnm7k -source-repository-package - type: git - location: https://github.com/input-output-hk/Win32-network - tag: 3825d3abf75f83f406c1f7161883c438dac7277d - --sha256: 19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx +-- source-repository-package +-- type: git +-- location: https://github.com/input-output-hk/Win32-network +-- tag: 3825d3abf75f83f406c1f7161883c438dac7277d +-- --sha256: 19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx -source-repository-package - type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: 808724ff8a19a33d0ed06f9ef59fbd900b08553c - --sha256: 0298dpl29gxzs9as9ha6y0w18hqwc00ipa3hzkxv7nlfrjjz8hmz - subdir: - iohk-monitoring - contra-tracer - tracer-transformers +-- source-repository-package +-- type: git +-- location: https://github.com/input-output-hk/iohk-monitoring-framework +-- tag: 808724ff8a19a33d0ed06f9ef59fbd900b08553c +-- --sha256: 0298dpl29gxzs9as9ha6y0w18hqwc00ipa3hzkxv7nlfrjjz8hmz +-- subdir: +-- iohk-monitoring +-- contra-tracer +-- tracer-transformers diff --git a/cardano-launcher/app/Main.hs b/cardano-launcher/app/Main.hs index 3eab3cce..7bff5d6c 100644 --- a/cardano-launcher/app/Main.hs +++ b/cardano-launcher/app/Main.hs @@ -5,7 +5,7 @@ module Main where -import Cardano.Prelude hiding (option) +import Cardano.Prelude import qualified Prelude -- Yes, we should use these seldomly but here it seems quite acceptable. diff --git a/cardano-launcher/src/Cardano/Shell/Application.hs b/cardano-launcher/src/Cardano/Shell/Application.hs index 1828a512..a34d0f76 100644 --- a/cardano-launcher/src/Cardano/Shell/Application.hs +++ b/cardano-launcher/src/Cardano/Shell/Application.hs @@ -10,6 +10,7 @@ import Control.Exception.Safe (throwM) import GHC.IO.Handle.Lock (LockMode (..), hTryLock) import System.Directory (doesFileExist) +import System.IO (writeFile) -------------------------------------------------------------------------------- -- Types diff --git a/cardano-launcher/src/Cardano/Shell/Environment.hs b/cardano-launcher/src/Cardano/Shell/Environment.hs index f70f7cae..dfe47904 100644 --- a/cardano-launcher/src/Cardano/Shell/Environment.hs +++ b/cardano-launcher/src/Cardano/Shell/Environment.hs @@ -11,6 +11,7 @@ import Cardano.Shell.Template (substituteA) import Data.Yaml (Value (..)) import Prelude (Show (..)) import System.Environment (lookupEnv) +import Data.Text.Lazy (toStrict) -- | Substitute envrionment variable with value of its name. -- diff --git a/cardano-launcher/src/Cardano/Shell/Update/Lib.hs b/cardano-launcher/src/Cardano/Shell/Update/Lib.hs index ca55d792..072bad75 100644 --- a/cardano-launcher/src/Cardano/Shell/Update/Lib.hs +++ b/cardano-launcher/src/Cardano/Shell/Update/Lib.hs @@ -31,10 +31,11 @@ import Prelude (String) import System.Directory (doesFileExist, removeFile) import System.Process (CreateProcess (..), StdStream (..), proc, waitForProcess, withCreateProcess) +import System.IO (writeFile) #ifdef mingw32_HOST_OS import qualified Data.Text as T -import System.Environment (getExecutablePath) +import System.Environment (getExecutablePath, getArgs) import System.Win32.Process (getCurrentProcessId) #endif @@ -240,7 +241,7 @@ writeWindowsUpdaterRunner runnerPath = do launcherArgs <- getArgs selfPid <- getCurrentProcessId - writeFile (toS runnerPath) $ T.unlines + writeFile (toS runnerPath) . T.unpack $ T.unlines -- What info can this file supply if it fails? -- How can you make this scream if it fails -- Checksum of the updater exe? diff --git a/cardano-launcher/test/TemplateSpec.hs b/cardano-launcher/test/TemplateSpec.hs index 2d340d50..1f2d2b7d 100644 --- a/cardano-launcher/test/TemplateSpec.hs +++ b/cardano-launcher/test/TemplateSpec.hs @@ -15,6 +15,7 @@ import Test.Hspec (Spec) import Test.Hspec.QuickCheck (modifyMaxSuccess, prop) import Test.QuickCheck (Arbitrary (..), elements, listOf1, suchThat) import Test.QuickCheck.Monadic (assert, monadicIO, run) +import Data.Text.Lazy (toStrict) import Cardano.Shell.Template (substituteA) diff --git a/ci/check-hydra.sh b/ci/check-hydra.sh deleted file mode 100755 index 14e2c60f..00000000 --- a/ci/check-hydra.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -p jq hydra -i bash -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/09195057114a0a8d112c847a9a8f52957420857d.tar.gz - -echo '~~~ Evaluating release.nix' -command time --format '%e' -o eval-time.txt \ - hydra-eval-jobs \ - --option allowed-uris "https://github.com/NixOS https://github.com/input-output-hk" \ - -I . release.nix \ - --arg supportedSystems '["x86_64-linux"]' > eval.json -EVAL_EXIT_CODE="$?" -if [ "$EVAL_EXIT_CODE" != 0 ] -then - rm eval.json eval-time.txt - echo -e "\\e[31;1mERROR: Failed to evaluate release.nix\\e[0m" - exit 1 -fi -EVAL_TIME=$(cat eval-time.txt) -jq . < eval.json -ERRORS=$(jq -r 'map_values(.error)|to_entries[]|select(.value)|@text "\(.key): \(.value)"' < eval.json) -NUM_ERRORS=$(jq -r '[ map_values(.error)|to_entries[]|select(.value) ] |length' < eval.json) -rm eval.json eval-time.txt - -if [ "$NUM_ERRORS" != 0 ] -then - echo -e "\\e[31;1mERROR: evaluation completed in $EVAL_TIME seconds with $NUM_ERRORS errors\\e[0m" - echo "$ERRORS" - exit 1 -else - echo -e "\\e[32;1mOK: evaluation completed in $EVAL_TIME seconds with no errors\\e[0m" - exit 0 -fi diff --git a/ci/check-regenerate-nix.sh b/ci/check-regenerate-nix.sh deleted file mode 100755 index 1b6ec564..00000000 --- a/ci/check-regenerate-nix.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p git bash nixStable - -# Check and warn if stack-to-nix auto-generated code is out of date. - -set -xe - -fail_stack2nix_check() { - git diff -w --text > /tmp/stack2nix.patch - buildkite-agent artifact upload /tmp/stack2nix.patch --job "$BUILDKITE_JOB_ID" - echo "ERROR: you need to (run ./nix/regenerate.sh or apply the patch in the buildkite artifact) and commit the changes" >&2 - exit 1 -} - -# Get relative path to script directory -scriptDir=$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")") - -"${scriptDir}/../nix/regenerate.sh" - -git diff -w --text --exit-code || fail_stack2nix_check diff --git a/default.nix b/default.nix deleted file mode 100644 index 437c2e88..00000000 --- a/default.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ system ? builtins.currentSystem -, crossSystem ? null -# allows to cutomize haskellNix (ghc and profiling, see ./nix/haskell.nix) -, config ? {} -# override scripts with custom configuration -, customConfig ? {} -# allows to override dependencies of the project without modifications, -# eg. to test build against local checkout of nixpkgs and iohk-nix: -# nix build -f default.nix cardano-shell '{ -# iohk-nix = ../iohk-nix; -# }' -, sourcesOverride ? {} -# pinned version of nixpkgs augmented with overlays (iohk-nix and our packages). -, pkgs ? import ./nix { inherit system crossSystem config sourcesOverride; } -, gitrev ? pkgs.iohkNix.commitIdFromGitRepoOrZero ./.git -}: -with pkgs; with commonLib; -let - - # FIXME: I really don’t know if this ↓ is right… – @michalrus - hpc-coveralls = cardanoShellHaskellPackages.tool "hpc-coveralls" "0.7.0"; - - haskellPackages = recRecurseIntoAttrs - # the Haskell.nix package set, reduced to local packages. - (selectProjectPackages cardanoShellHaskellPackages); - - uploadCoverallsScript = pkgSet: - let - projectPkgs = selectProjectPackages pkgSet; - projectCoverageReport = pkgSet.projectCoverageReport; - in writeShellScriptBin "uploadCoveralls.sh" '' - ${hpc-coveralls}/bin/hpc-coveralls all \ - ${concatStringsSep "\n " (mapAttrsToList (_: p: "--package-dir .${p.src.origSubDir} \\") projectPkgs)} - --hpc-dir ${projectCoverageReport}/share/hpc/vanilla \ - --coverage-mode StrictlyFullLines \ - --repo-token=$COVERALLS_REPO_TOKEN - ''; - - self = { - inherit cardanoShellHaskellPackages; - inherit haskellPackages hydraEvalErrors; - - inherit (haskellPackages.cardano-shell.identifier) version; - # Grab the executable component of our package. - inherit (haskellPackages.cardano-shell.components.exes) node-ipc; - inherit (haskellPackages.cardano-launcher.components.exes) cardano-launcher; - - inherit (pkgs.iohkNix) checkCabalProject; - - # `tests` are the test suites which have been built. - tests = collectComponents' "tests" haskellPackages; - # `benchmarks` (only built, not run). - benchmarks = collectComponents' "benchmarks" haskellPackages; - - checks = recurseIntoAttrs { - # `checks.tests` collect results of executing the tests: - tests = collectChecks haskellPackages; - }; - - inherit hpc-coveralls; - uploadCoverallsScript = uploadCoverallsScript cardanoShellHaskellPackages; - - shell = import ./shell.nix { - inherit pkgs; - withHoogle = true; - }; - }; -in self diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..9b2c3b4e --- /dev/null +++ b/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "cardano-node": { + "flake": false, + "locked": { + "lastModified": 1752857436, + "narHash": "sha256-YAAwDfzMMTeEQa0zHin7yo2nMdxONJ983tJ3NrP7K6E=", + "owner": "IntersectMBO", + "repo": "cardano-node", + "rev": "ca1ec278070baf4481564a6ba7b4a5b9e3d9f366", + "type": "github" + }, + "original": { + "owner": "IntersectMBO", + "ref": "10.5.1", + "repo": "cardano-node", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1759143472, + "narHash": "sha256-TvODmeR2W7yX/JmOCmP+lAFNkTT7hAxYcF3Kz8SZV3w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5ed4e25ab58fd4c028b59d5611e14ea64de51d23", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "cardano-node": "cardano-node", + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..f518c148 --- /dev/null +++ b/flake.nix @@ -0,0 +1,58 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; + + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; + + # Just for a reasonable `haskell-nix`: + cardano-node = { + url = "github:IntersectMBO/cardano-node/10.5.1"; + flake = false; # otherwise, +2k dependencies we don’t really use + }; + }; + + outputs = inputs: let + inherit (inputs.nixpkgs) lib; + in { + packages = lib.genAttrs ["x86_64-linux" "x86_64-darwin" "aarch64-darwin"] (system: let + cardanoNodeFlake = (import inputs.flake-compat { src = inputs.cardano-node; }).defaultNix; + inherit (cardanoNodeFlake.project.${system}.pkgs) haskell-nix; + project = haskell-nix.project { + compiler-nix-name = "ghc96"; + projectFileName = "cabal.project"; + inputMap = { "https://chap.intersectmbo.org/" = cardanoNodeFlake.inputs.CHaP; }; + src = ./.; + }; + in { + cardano-launcher = { + x86_64-linux = project.projectCross.musl64.hsPkgs.cardano-launcher.components.exes.cardano-launcher; + x86_64-darwin = project.hsPkgs.cardano-launcher.components.exes.cardano-launcher; + aarch64-darwin = project.hsPkgs.cardano-launcher.components.exes.cardano-launcher; + }.${system}; + } // lib.optionalAttrs (system == "x86_64-linux") { + cardano-launcher-x86_64-windows = project.projectCross.mingwW64.hsPkgs.cardano-launcher.components.exes.cardano-launcher; + }); + hydraJobs = { + cardano-launcher = { + x86_64-linux = inputs.self.packages.x86_64-linux.cardano-launcher; + x86_64-darwin = inputs.self.packages.x86_64-darwin.cardano-launcher; + aarch64-darwin = inputs.self.packages.aarch64-darwin.cardano-launcher; + x86_64-windows = inputs.self.packages.x86_64-linux.cardano-launcher-x86_64-windows; + }; + required = inputs.nixpkgs.legacyPackages.x86_64-linux.releaseTools.aggregate { + name = "github-required"; + meta.description = "All jobs required to pass CI"; + constituents = __attrValues inputs.self.hydraJobs.cardano-launcher; + }; + }; + }; + + nixConfig = { + extra-substituters = ["https://cache.iog.io"]; + extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="]; + allow-import-from-derivation = "true"; + }; +} diff --git a/lockfile b/lockfile deleted file mode 100644 index e69de29b..00000000 diff --git a/nix/.stack.nix/cardano-crypto.nix b/nix/.stack.nix/cardano-crypto.nix deleted file mode 100644 index 30bdba93..00000000 --- a/nix/.stack.nix/cardano-crypto.nix +++ /dev/null @@ -1,88 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = { golden-tests = false; golden-tests-exe = false; }; - package = { - specVersion = "1.10"; - identifier = { name = "cardano-crypto"; version = "1.1.0"; }; - license = "MIT"; - copyright = "2016-2017 IOHK"; - maintainer = "contact@typed.io"; - author = "Vincent Hanquez"; - homepage = "https://github.com/input-output-hk/cardano-crypto#readme"; - url = ""; - synopsis = "Cryptography primitives for cardano"; - description = ""; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.base) - (hsPkgs.memory) - (hsPkgs.deepseq) - (hsPkgs.bytestring) - (hsPkgs.basement) - (hsPkgs.foundation) - (hsPkgs.cryptonite) - (hsPkgs.cryptonite-openssl) - (hsPkgs.hashable) - (hsPkgs.integer-gmp) - ]; - }; - exes = { - "golden-tests" = { - depends = [ - (hsPkgs.base) - (hsPkgs.basement) - (hsPkgs.foundation) - (hsPkgs.memory) - (hsPkgs.bytestring) - (hsPkgs.cryptonite) - (hsPkgs.cardano-crypto) - ] ++ (pkgs.lib).optional (flags.golden-tests-exe) (hsPkgs.inspector); - }; - }; - tests = { - "cardano-crypto-test" = { - depends = [ - (hsPkgs.base) - (hsPkgs.bytestring) - (hsPkgs.memory) - (hsPkgs.cryptonite) - (hsPkgs.cardano-crypto) - (hsPkgs.basement) - (hsPkgs.foundation) - ]; - }; - "cardano-crypto-golden-tests" = { - depends = [ - (hsPkgs.base) - (hsPkgs.basement) - (hsPkgs.foundation) - (hsPkgs.memory) - (hsPkgs.bytestring) - (hsPkgs.cryptonite) - (hsPkgs.cardano-crypto) - ] ++ (pkgs.lib).optional (flags.golden-tests) (hsPkgs.inspector); - }; - }; - benchmarks = { - "cardano-crypto-bench" = { - depends = [ - (hsPkgs.base) - (hsPkgs.bytestring) - (hsPkgs.memory) - (hsPkgs.cryptonite) - (hsPkgs.cardano-crypto) - (hsPkgs.gauge) - ]; - }; - }; - }; - } // { - src = (pkgs.lib).mkDefault (pkgs.fetchgit { - url = "https://github.com/input-output-hk/cardano-crypto"; - rev = "3c707936ba0a665375acf5bd240dc4b6eaa6c0bc"; - sha256 = "0g8ln8k8wx4csdv92bz09pr7v9dp4lcyv1334b09c9rgwdwhqg1b"; - }); - } \ No newline at end of file diff --git a/nix/.stack.nix/cardano-launcher.nix b/nix/.stack.nix/cardano-launcher.nix deleted file mode 100644 index 4963e669..00000000 --- a/nix/.stack.nix/cardano-launcher.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = {}; - package = { - specVersion = "2.2"; - identifier = { name = "cardano-launcher"; version = "0.1.0.0"; }; - license = "Apache-2.0"; - copyright = "2018 IOHK"; - maintainer = "operations@iohk.io"; - author = "IOHK"; - homepage = "https://github.com/input-output-hk/cardano-shell#readme"; - url = ""; - synopsis = ""; - description = "Please see the README on GitHub at "; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.aeson) - (hsPkgs.base) - (hsPkgs.Cabal) - (hsPkgs.cardano-prelude) - (hsPkgs.containers) - (hsPkgs.directory) - (hsPkgs.filepath) - (hsPkgs.process) - (hsPkgs.QuickCheck) - (hsPkgs.text) - (hsPkgs.turtle) - (hsPkgs.yaml) - (hsPkgs.time-units) - (hsPkgs.mtl) - (hsPkgs.optparse-applicative) - (hsPkgs.cardano-sl-x509) - (hsPkgs.safe-exceptions) - (hsPkgs.x509-validation) - ] ++ (pkgs.lib).optional (system.isWindows) (hsPkgs.Win32); - }; - exes = { - "cardano-launcher" = { - depends = [ - (hsPkgs.base) - (hsPkgs.cardano-prelude) - (hsPkgs.cardano-launcher) - (hsPkgs.cardano-sl-x509) - (hsPkgs.filepath) - (hsPkgs.formatting) - (hsPkgs.iohk-monitoring) - (hsPkgs.safe-exceptions) - (hsPkgs.text) - (hsPkgs.silently) - (hsPkgs.Cabal) - (hsPkgs.process) - (hsPkgs.optparse-applicative) - (hsPkgs.directory) - ]; - }; - "mock-daedalus-frontend" = { - depends = [ (hsPkgs.base) (hsPkgs.cardano-prelude) ]; - }; - "mock-installer" = { - depends = [ (hsPkgs.base) (hsPkgs.cardano-prelude) ]; - }; - }; - tests = { - "cardano-launcher-test" = { - depends = [ - (hsPkgs.base) - (hsPkgs.cardano-launcher) - (hsPkgs.cardano-prelude) - (hsPkgs.directory) - (hsPkgs.QuickCheck) - (hsPkgs.quickcheck-state-machine) - (hsPkgs.tree-diff) - (hsPkgs.hspec) - (hsPkgs.yaml) - (hsPkgs.unordered-containers) - (hsPkgs.vector) - (hsPkgs.temporary) - (hsPkgs.filepath) - ]; - }; - }; - }; - } // rec { src = (pkgs.lib).mkDefault ../../././cardano-launcher; } \ No newline at end of file diff --git a/nix/.stack.nix/cardano-prelude-test.nix b/nix/.stack.nix/cardano-prelude-test.nix deleted file mode 100644 index ca1d8d09..00000000 --- a/nix/.stack.nix/cardano-prelude-test.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = { development = false; }; - package = { - specVersion = "1.10"; - identifier = { name = "cardano-prelude-test"; version = "0.1.0.0"; }; - license = "MIT"; - copyright = "2018 IOHK"; - maintainer = "operations@iohk.io"; - author = "IOHK"; - homepage = ""; - url = ""; - synopsis = "Utility types and functions for testing Cardano"; - description = "Utility types and functions for testing Cardano"; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.base) - (hsPkgs.aeson) - (hsPkgs.aeson-pretty) - (hsPkgs.attoparsec) - (hsPkgs.base16-bytestring) - (hsPkgs.bytestring) - (hsPkgs.canonical-json) - (hsPkgs.cardano-prelude) - (hsPkgs.containers) - (hsPkgs.cryptonite) - (hsPkgs.formatting) - (hsPkgs.hedgehog) - (hsPkgs.hspec) - (hsPkgs.pretty-show) - (hsPkgs.QuickCheck) - (hsPkgs.quickcheck-instances) - (hsPkgs.text) - (hsPkgs.template-haskell) - (hsPkgs.time) - ]; - }; - }; - } // { - src = (pkgs.lib).mkDefault (pkgs.fetchgit { - url = "https://github.com/input-output-hk/cardano-prelude"; - rev = "3c40edcf5bdba8721d3430d0aaaeea8770ce9bec"; - sha256 = "1z77nwjxj0v9gxhs3mlmqfq705mkkcpnwgr0d8shykjvf0iqdkcn"; - }); - postUnpack = "sourceRoot+=/test; echo source root reset to \$sourceRoot"; - } \ No newline at end of file diff --git a/nix/.stack.nix/cardano-prelude.nix b/nix/.stack.nix/cardano-prelude.nix deleted file mode 100644 index ea0248a4..00000000 --- a/nix/.stack.nix/cardano-prelude.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = { development = false; }; - package = { - specVersion = "1.10"; - identifier = { name = "cardano-prelude"; version = "0.1.0.0"; }; - license = "MIT"; - copyright = "2018 IOHK"; - maintainer = "operations@iohk.io"; - author = "IOHK"; - homepage = ""; - url = ""; - synopsis = "A Prelude replacement for the Cardano project"; - description = "A Prelude replacement for the Cardano project"; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.base) - (hsPkgs.aeson) - (hsPkgs.array) - (hsPkgs.base16-bytestring) - (hsPkgs.bytestring) - (hsPkgs.canonical-json) - (hsPkgs.cborg) - (hsPkgs.containers) - (hsPkgs.formatting) - (hsPkgs.ghc-heap) - (hsPkgs.ghc-prim) - (hsPkgs.hashable) - (hsPkgs.integer-gmp) - (hsPkgs.mtl) - (hsPkgs.nonempty-containers) - (hsPkgs.protolude) - (hsPkgs.tagged) - (hsPkgs.text) - (hsPkgs.time) - (hsPkgs.vector) - ]; - }; - tests = { - "cardano-prelude-test" = { - depends = [ - (hsPkgs.base) - (hsPkgs.aeson) - (hsPkgs.aeson-pretty) - (hsPkgs.attoparsec) - (hsPkgs.base16-bytestring) - (hsPkgs.bytestring) - (hsPkgs.canonical-json) - (hsPkgs.cardano-prelude) - (hsPkgs.containers) - (hsPkgs.cryptonite) - (hsPkgs.formatting) - (hsPkgs.ghc-heap) - (hsPkgs.ghc-prim) - (hsPkgs.hedgehog) - (hsPkgs.hspec) - (hsPkgs.pretty-show) - (hsPkgs.QuickCheck) - (hsPkgs.quickcheck-instances) - (hsPkgs.random) - (hsPkgs.text) - (hsPkgs.template-haskell) - (hsPkgs.time) - ]; - }; - }; - }; - } // { - src = (pkgs.lib).mkDefault (pkgs.fetchgit { - url = "https://github.com/input-output-hk/cardano-prelude"; - rev = "3c40edcf5bdba8721d3430d0aaaeea8770ce9bec"; - sha256 = "1z77nwjxj0v9gxhs3mlmqfq705mkkcpnwgr0d8shykjvf0iqdkcn"; - }); - } \ No newline at end of file diff --git a/nix/.stack.nix/cardano-shell.nix b/nix/.stack.nix/cardano-shell.nix deleted file mode 100644 index 8e63ecc0..00000000 --- a/nix/.stack.nix/cardano-shell.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = {}; - package = { - specVersion = "2.2"; - identifier = { name = "cardano-shell"; version = "0.1.0.0"; }; - license = "Apache-2.0"; - copyright = "2018 IOHK"; - maintainer = "operations@iohk.io"; - author = "IOHK"; - homepage = "https://github.com/input-output-hk/cardano-shell#readme"; - url = ""; - synopsis = ""; - description = "Please see the README on GitHub at "; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.aeson) - (hsPkgs.base) - (hsPkgs.binary) - (hsPkgs.bytestring) - (hsPkgs.Cabal) - (hsPkgs.cardano-prelude) - (hsPkgs.concurrency) - (hsPkgs.containers) - (hsPkgs.formatting) - (hsPkgs.process) - (hsPkgs.QuickCheck) - (hsPkgs.safe-exceptions) - (hsPkgs.async) - (hsPkgs.text) - (hsPkgs.transformers) - ] ++ (pkgs.lib).optional (system.isWindows) (hsPkgs.Win32); - }; - exes = { - "node-ipc" = { - depends = [ - (hsPkgs.base) - (hsPkgs.cardano-shell) - (hsPkgs.cardano-prelude) - ]; - }; - }; - tests = { - "cardano-shell-test" = { - depends = [ - (hsPkgs.aeson) - (hsPkgs.base) - (hsPkgs.cardano-shell) - (hsPkgs.cardano-prelude) - (hsPkgs.QuickCheck) - (hsPkgs.quickcheck-state-machine) - (hsPkgs.tree-diff) - (hsPkgs.hspec) - ]; - }; - }; - }; - } // rec { src = (pkgs.lib).mkDefault ../../././cardano-shell; } \ No newline at end of file diff --git a/nix/.stack.nix/cardano-sl-x509.nix b/nix/.stack.nix/cardano-sl-x509.nix deleted file mode 100644 index 6299a23c..00000000 --- a/nix/.stack.nix/cardano-sl-x509.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = {}; - package = { - specVersion = "1.10"; - identifier = { name = "cardano-sl-x509"; version = "3.0.0"; }; - license = "MIT"; - copyright = "2018 IOHK"; - maintainer = "operations@iohk.io"; - author = "IOHK Engineering Team"; - homepage = "https://github.com/input-output-hk/cardano-sl/x509/README.md"; - url = ""; - synopsis = "Tool-suite for generating x509 certificates specialized for RSA with SHA-256"; - description = "See README"; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.base) - (hsPkgs.aeson) - (hsPkgs.asn1-encoding) - (hsPkgs.asn1-types) - (hsPkgs.base64-bytestring) - (hsPkgs.bytestring) - (hsPkgs.cardano-prelude) - (hsPkgs.cryptonite) - (hsPkgs.data-default-class) - (hsPkgs.directory) - (hsPkgs.exceptions) - (hsPkgs.filepath) - (hsPkgs.hourglass) - (hsPkgs.ip) - (hsPkgs.text) - (hsPkgs.unordered-containers) - (hsPkgs.x509) - (hsPkgs.x509-store) - (hsPkgs.x509-validation) - (hsPkgs.yaml) - ]; - }; - tests = { - "cardano-sl-x509-test" = { - depends = [ - (hsPkgs.base) - (hsPkgs.QuickCheck) - (hsPkgs.cardano-prelude) - (hsPkgs.cardano-sl-x509) - (hsPkgs.exceptions) - (hsPkgs.hedgehog) - ]; - }; - }; - }; - } // { - src = (pkgs.lib).mkDefault (pkgs.fetchgit { - url = "https://github.com/input-output-hk/cardano-sl-x509"; - rev = "43a036c5bbe68ca2e9cbe611eab7982e2348fe49"; - sha256 = "1aw7ns8lv51fjf45k8yzils2j7a6bqzy8hn65kb3z0dn1qsm8x88"; - }); - } \ No newline at end of file diff --git a/nix/.stack.nix/contra-tracer.nix b/nix/.stack.nix/contra-tracer.nix deleted file mode 100644 index ad918749..00000000 --- a/nix/.stack.nix/contra-tracer.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = {}; - package = { - specVersion = "1.10"; - identifier = { name = "contra-tracer"; version = "0.1.0.0"; }; - license = "Apache-2.0"; - copyright = "2019 IOHK"; - maintainer = "operations@iohk.io"; - author = "Neil Davies, Alexander Diemand, Andreas Triantafyllos"; - homepage = ""; - url = ""; - synopsis = "A simple interface for logging, tracing or monitoring."; - description = ""; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.base) - ] ++ (pkgs.lib).optional (compiler.isGhc && (compiler.version).lt "8.5") (hsPkgs.contravariant); - }; - }; - } // { - src = (pkgs.lib).mkDefault (pkgs.fetchgit { - url = "https://github.com/input-output-hk/iohk-monitoring-framework"; - rev = "4956b32f039579a0e7e4fd10793f65b4c77d9044"; - sha256 = "03lyb2m4i6p7rpjqarnhsx21nx48fwk6rzsrx15k6274a4bv0pix"; - }); - postUnpack = "sourceRoot+=/contra-tracer; echo source root reset to \$sourceRoot"; - } \ No newline at end of file diff --git a/nix/.stack.nix/default.nix b/nix/.stack.nix/default.nix deleted file mode 100644 index abccdf33..00000000 --- a/nix/.stack.nix/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - extras = hackage: - { - packages = { - "katip" = (((hackage.katip)."0.8.3.0").revisions).default; - "quickcheck-state-machine" = (((hackage.quickcheck-state-machine)."0.6.0").revisions).default; - "pretty-show" = (((hackage.pretty-show)."1.9.5").revisions).default; - "time-units" = (((hackage.time-units)."1.0.0").revisions).default; - "silently" = (((hackage.silently)."1.2.5.1").revisions).default; - "base58-bytestring" = (((hackage.base58-bytestring)."0.1.0").revisions).default; - "hedgehog" = (((hackage.hedgehog)."1.0").revisions).default; - "micro-recursion-schemes" = (((hackage.micro-recursion-schemes)."5.0.2.2").revisions).default; - "streaming-binary" = (((hackage.streaming-binary)."0.3.0.1").revisions).default; - "cborg" = (((hackage.cborg)."0.2.2.0").revisions).default; - "canonical-json" = (((hackage.canonical-json)."0.6.0.0").revisions).default; - "Win32" = (((hackage.Win32)."2.5.4.1").revisions)."e623a1058bd8134ec14d62759f76cac52eee3576711cb2c4981f398f1ec44b85"; - } // { - cardano-shell = ./cardano-shell.nix; - cardano-launcher = ./cardano-launcher.nix; - cardano-prelude = ./cardano-prelude.nix; - cardano-prelude-test = ./cardano-prelude-test.nix; - contra-tracer = ./contra-tracer.nix; - iohk-monitoring = ./iohk-monitoring.nix; - cardano-sl-x509 = ./cardano-sl-x509.nix; - cardano-crypto = ./cardano-crypto.nix; - }; - compiler.version = "8.6.5"; - compiler.nix-name = "ghc865"; - }; - resolver = "lts-13.26"; - compiler = "ghc-8.6.5"; - } \ No newline at end of file diff --git a/nix/.stack.nix/hedgehog.nix b/nix/.stack.nix/hedgehog.nix deleted file mode 100644 index 737eb786..00000000 --- a/nix/.stack.nix/hedgehog.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = {}; - package = { - specVersion = "1.8"; - identifier = { name = "hedgehog"; version = "0.6.1"; }; - license = "BSD-3-Clause"; - copyright = ""; - maintainer = "Jacob Stanley "; - author = "Jacob Stanley"; - homepage = "https://hedgehog.qa"; - url = ""; - synopsis = "Hedgehog will eat all your bugs."; - description = "Hedgehog is a modern property-based testing system, in the spirit of\nQuickCheck. Hedgehog uses integrated shrinking, so shrinks obey the\ninvariants of generated values by construction.\n\nTo get started quickly, see the examples:\n"; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.base) - (hsPkgs.ansi-terminal) - (hsPkgs.async) - (hsPkgs.bytestring) - (hsPkgs.concurrent-output) - (hsPkgs.containers) - (hsPkgs.directory) - (hsPkgs.exceptions) - (hsPkgs.lifted-async) - (hsPkgs.mmorph) - (hsPkgs.monad-control) - (hsPkgs.mtl) - (hsPkgs.pretty-show) - (hsPkgs.primitive) - (hsPkgs.random) - (hsPkgs.resourcet) - (hsPkgs.semigroups) - (hsPkgs.stm) - (hsPkgs.template-haskell) - (hsPkgs.text) - (hsPkgs.th-lift) - (hsPkgs.time) - (hsPkgs.transformers) - (hsPkgs.transformers-base) - (hsPkgs.wl-pprint-annotated) - ]; - }; - tests = { - "test" = { - depends = [ - (hsPkgs.hedgehog) - (hsPkgs.base) - (hsPkgs.containers) - (hsPkgs.pretty-show) - (hsPkgs.semigroups) - (hsPkgs.text) - (hsPkgs.transformers) - ]; - }; - }; - }; - } // { - src = (pkgs.lib).mkDefault (pkgs.fetchgit { - url = "https://github.com/input-output-hk/haskell-hedgehog.git"; - rev = "2e741bb53afb085741807018948ae17d956c53af"; - sha256 = "0l0d1n2b68m0628j4yi214q5fy6pz777qfj1bc1lrra8scs5gcxh"; - }); - postUnpack = "sourceRoot+=/hedgehog; echo source root reset to \$sourceRoot"; - } \ No newline at end of file diff --git a/nix/.stack.nix/iohk-monitoring.nix b/nix/.stack.nix/iohk-monitoring.nix deleted file mode 100644 index 8350ae6b..00000000 --- a/nix/.stack.nix/iohk-monitoring.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = { disable-observables = false; performance-test-queue = false; }; - package = { - specVersion = "1.10"; - identifier = { name = "iohk-monitoring"; version = "0.1.10.1"; }; - license = "Apache-2.0"; - copyright = "2018 IOHK"; - maintainer = ""; - author = "Alexander Diemand, Andreas Triantafyllos"; - homepage = ""; - url = ""; - synopsis = "logging, benchmarking and monitoring framework"; - description = ""; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.base) - (hsPkgs.contra-tracer) - (hsPkgs.aeson) - (hsPkgs.array) - (hsPkgs.async) - (hsPkgs.async-timer) - (hsPkgs.attoparsec) - (hsPkgs.auto-update) - (hsPkgs.base64-bytestring) - (hsPkgs.bytestring) - (hsPkgs.clock) - (hsPkgs.containers) - (hsPkgs.contravariant) - (hsPkgs.directory) - (hsPkgs.filepath) - (hsPkgs.katip) - (hsPkgs.lens) - (hsPkgs.mtl) - (hsPkgs.safe) - (hsPkgs.safe-exceptions) - (hsPkgs.scientific) - (hsPkgs.stm) - (hsPkgs.template-haskell) - (hsPkgs.text) - (hsPkgs.time) - (hsPkgs.time-units) - (hsPkgs.transformers) - (hsPkgs.unordered-containers) - (hsPkgs.vector) - (hsPkgs.yaml) - (hsPkgs.libyaml) - ] ++ (if system.isWindows - then [ (hsPkgs.Win32) ] - else [ (hsPkgs.unix) ]); - }; - tests = { - "tests" = { - depends = [ - (hsPkgs.base) - (hsPkgs.contra-tracer) - (hsPkgs.iohk-monitoring) - (hsPkgs.aeson) - (hsPkgs.array) - (hsPkgs.async) - (hsPkgs.bytestring) - (hsPkgs.clock) - (hsPkgs.containers) - (hsPkgs.directory) - (hsPkgs.filepath) - (hsPkgs.mtl) - (hsPkgs.process) - (hsPkgs.QuickCheck) - (hsPkgs.random) - (hsPkgs.semigroups) - (hsPkgs.split) - (hsPkgs.stm) - (hsPkgs.tasty) - (hsPkgs.tasty-hunit) - (hsPkgs.tasty-quickcheck) - (hsPkgs.temporary) - (hsPkgs.text) - (hsPkgs.time) - (hsPkgs.time-units) - (hsPkgs.transformers) - (hsPkgs.unordered-containers) - (hsPkgs.vector) - (hsPkgs.void) - (hsPkgs.yaml) - (hsPkgs.libyaml) - ]; - }; - }; - }; - } // { - src = (pkgs.lib).mkDefault (pkgs.fetchgit { - url = "https://github.com/input-output-hk/iohk-monitoring-framework"; - rev = "4956b32f039579a0e7e4fd10793f65b4c77d9044"; - sha256 = "03lyb2m4i6p7rpjqarnhsx21nx48fwk6rzsrx15k6274a4bv0pix"; - }); - postUnpack = "sourceRoot+=/iohk-monitoring; echo source root reset to \$sourceRoot"; - } \ No newline at end of file diff --git a/nix/.stack.nix/plutus-prototype.nix b/nix/.stack.nix/plutus-prototype.nix deleted file mode 100644 index c0aa3ce5..00000000 --- a/nix/.stack.nix/plutus-prototype.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: - { - flags = {}; - package = { - specVersion = "1.10"; - identifier = { name = "plutus-prototype"; version = "0.1.0.0"; }; - license = "MIT"; - copyright = ""; - maintainer = "darryl.mcadams@iohk.io"; - author = "Darryl McAdams"; - homepage = "iohk.io"; - url = ""; - synopsis = "Prototype of the Plutus language"; - description = "Prototype of the Plutus language"; - buildType = "Simple"; - }; - components = { - "library" = { - depends = [ - (hsPkgs.base) - (hsPkgs.bifunctors) - (hsPkgs.binary) - (hsPkgs.bytestring) - (hsPkgs.cardano-crypto) - (hsPkgs.cryptonite) - (hsPkgs.ed25519) - (hsPkgs.either) - (hsPkgs.filepath) - (hsPkgs.lens) - (hsPkgs.memory) - (hsPkgs.mtl) - (hsPkgs.operational) - (hsPkgs.parsec) - (hsPkgs.transformers) - ]; - }; - }; - } // { - src = (pkgs.lib).mkDefault (pkgs.fetchgit { - url = "https://github.com/avieth/plutus-prototype"; - rev = "d094be301195fcd8ab864d793f114970426a4478"; - sha256 = "1s932rghn4zn441waansp408b5bwk20rc1wsa5693a2nwnp4dijw"; - }); - } \ No newline at end of file diff --git a/nix/default.nix b/nix/default.nix deleted file mode 100644 index 9c6c90fe..00000000 --- a/nix/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ system ? builtins.currentSystem -, crossSystem ? null -, config ? {} -, sourcesOverride ? {} -}: -let - sources = import ./sources.nix { inherit pkgs; } - // sourcesOverride; - iohkNix = import sources.iohk-nix { inherit system crossSystem; }; - haskellNix = import sources."haskell.nix" { - # Without that, haskell.nilx tries to call builtins.currentSystem, which fails inside flake builds: - pkgs = import nixpkgs { inherit system crossSystem; }; - inherit system crossSystem; - }; - # use our own nixpkgs if it exists in our sources, - # otherwise use iohkNix default nixpkgs. - nixpkgs = if (sources ? nixpkgs) - then (builtins.trace "Not using IOHK default nixpkgs (use 'niv drop nixpkgs' to use default for better sharing)" - sources.nixpkgs) - else (builtins.trace "Using IOHK default nixpkgs" - iohkNix.nixpkgs); - - # for inclusion in pkgs: - overlays = - # Haskell.nix (https://github.com/input-output-hk/haskell.nix) - haskellNix.overlays - # haskell-nix.haskellLib.extra: some useful extra utility functions for haskell.nix - ++ iohkNix.overlays.haskell-nix-extra - # iohkNix: nix utilities and niv: - ++ iohkNix.overlays.iohkNix - # our own overlays: - ++ [ - (pkgs: _: with pkgs; { - - # commonLib: mix pkgs.lib with iohk-nix utils and our own: - commonLib = lib // iohkNix // iohkNix.cardanoLib - // import ./util.nix { inherit haskell-nix; } - # also expose our sources and overlays - // { inherit overlays sources; }; - - svcLib = import ./svclib.nix { inherit pkgs; }; - }) - # And, of course, our haskell-nix-ified cabal project: - (import ./pkgs.nix) - # stack needs to be version 1.9.3, because versions greater than - # this can't be re-execed in a nix shell: - # - # https://github.com/commercialhaskell/stack/issues/5000 - # - # i.e. "runCoveralls" fails with stack > 1.9.3 - (self: super: { - stack_1_9_3 = (import sources."nixpkgs-19.03" {}).stack; - }) - ]; - - pkgs = import nixpkgs { - inherit system crossSystem overlays; - config = haskellNix.config // config; - }; - -in pkgs diff --git a/nix/haskell.nix b/nix/haskell.nix deleted file mode 100644 index cf7b1a1c..00000000 --- a/nix/haskell.nix +++ /dev/null @@ -1,95 +0,0 @@ -############################################################################ -# Builds Haskell packages with Haskell.nix -############################################################################ -{ lib -, stdenv -, haskell-nix -, buildPackages -, config ? {} -# GHC attribute name -, compiler ? config.haskellNix.compiler or "ghc8107" -# Enable profiling -, profiling ? config.haskellNix.profiling or false -# Enable coverage -, coverage ? config.haskellNix.coverage or false -}: -let - src = haskell-nix.haskellLib.cleanGit { - name = "cardano-shell"; - src = ../.; - }; - - # This creates the Haskell package set. - # https://input-output-hk.github.io/haskell.nix/user-guide/projects/ - pkgSet = haskell-nix.cabalProject (lib.optionalAttrs stdenv.hostPlatform.isWindows { - # FIXME: without this deprecated attribute, db-converter fails to compile directory with: - # Encountered missing dependencies: unix >=2.5.1 && <2.9 - ghc = buildPackages.haskell-nix.compiler.${compiler}; - } // { - inherit src; - compiler-nix-name = compiler; - modules = [ - { compiler.nix-name = compiler; } - - # Allow reinstallation of Win32 - { nonReinstallablePkgs = - [ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base" - "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell" - # ghcjs custom packages - "ghcjs-prim" "ghcjs-th" - "ghc-boot" - "ghc" "array" "binary" "bytestring" "containers" - "filepath" "ghc-boot" "ghc-compact" "ghc-prim" - # "ghci" "haskeline" - "hpc" - "mtl" "parsec" "text" "transformers" - "xhtml" - # "stm" "terminfo" - ]; - - } - { - # These tests need files from the source tree. - packages.cardano-launcher.components.tests.cardano-launcher-test.keepSource = true; - - # Packages we wish to ignore version bounds of. - # This is similar to jailbreakCabal, however it - # does not require any messing with cabal files. - packages.katip.doExactConfig = true; - - # split data output for ekg to reduce closure size - packages.ekg.components.library.enableSeparateDataOutput = true; - } - (lib.optionalAttrs profiling { - enableLibraryProfiling = true; - packages.cardano-launcher.components.exes.cardano-launcher.enableExecutableProfiling = true; - profilingDetail = "default"; - }) - (lib.optionalAttrs stdenv.hostPlatform.isWindows { - # Make sure we use a buildPackages version of happy - packages.pretty-show.components.library.build-tools = [ buildPackages.haskell-nix.haskellPackages.happy ]; - - # Remove hsc2hs build-tool dependencies (suitable version will be available as part of the ghc derivation) - packages.Win32.components.library.build-tools = lib.mkForce []; - packages.terminal-size.components.library.build-tools = lib.mkForce []; - packages.network.components.library.build-tools = lib.mkForce []; - - - # Disable cabal-doctest tests by turning off custom setups - packages.comonad.package.buildType = lib.mkForce "Simple"; - packages.distributive.package.buildType = lib.mkForce "Simple"; - packages.lens.package.buildType = lib.mkForce "Simple"; - packages.nonempty-vector.package.buildType = lib.mkForce "Simple"; - packages.semigroupoids.package.buildType = lib.mkForce "Simple"; - }) - (lib.optionalAttrs coverage { - packages.cardano-launcher.components.library.doCoverage = true; - packages.cardano-shell.components.library.doCoverage = true; - }) - ]; - # TODO add flags to packages (like cs-ledger) so we can turn off tests that will - # not build for windows on a per package bases (rather than using --disable-tests). - configureArgs = lib.optionalString stdenv.hostPlatform.isWindows "--disable-tests"; - }); -in - pkgSet diff --git a/nix/iohk-common.nix b/nix/iohk-common.nix deleted file mode 100644 index 75cba1cd..00000000 --- a/nix/iohk-common.nix +++ /dev/null @@ -1,14 +0,0 @@ -# Imports the iohk-nix library. -# The version can be overridden for debugging purposes by setting -# NIX_PATH=iohk_nix=/path/to/iohk-nix -import ( - let try = builtins.tryEval ; - in if try.success - then builtins.trace "using host " try.value - else - let - spec = builtins.fromJSON (builtins.readFile ./iohk-nix-src.json); - in builtins.fetchTarball { - url = "${spec.url}/archive/${spec.rev}.tar.gz"; - inherit (spec) sha256; - }) {} diff --git a/nix/iohk-nix-src.json b/nix/iohk-nix-src.json deleted file mode 100644 index 149a0197..00000000 --- a/nix/iohk-nix-src.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "url": "https://github.com/input-output-hk/iohk-nix", - "rev": "094425c27307dcaa33595bda5fc69ee00a671612", - "date": "2019-09-19T15:45:13+00:00", - "sha256": "1615yaj2lzdn6lmxyfr2q9r3sn36gnwfpr9hg6n5iqcnkh4gwq5v", - "fetchSubmodules": false -} diff --git a/nix/pkgs.nix b/nix/pkgs.nix deleted file mode 100644 index 58d9ede5..00000000 --- a/nix/pkgs.nix +++ /dev/null @@ -1,11 +0,0 @@ -# our packages overlay -pkgs: _: with pkgs; { - cardanoShellHaskellPackages = import ./haskell.nix { - inherit config - lib - stdenv - haskell-nix - buildPackages - ; - }; -} diff --git a/nix/regenerate.sh b/nix/regenerate.sh deleted file mode 100755 index 4e2be286..00000000 --- a/nix/regenerate.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd $(git rev-parse --show-toplevel) - -exec $(nix-build `dirname $0`/. -A iohkNix.cabalProjectRegenerate --no-out-link --option substituters "https://hydra.iohk.io https://cache.nixos.org" --option trusted-substituters "" --option trusted-public-keys "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=")/bin/cabal-project-regenerate diff --git a/nix/sources.json b/nix/sources.json deleted file mode 100644 index 6925db8b..00000000 --- a/nix/sources.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "haskell.nix": { - "branch": "master", - "description": "Alternative Haskell Infrastructure for Nixpkgs", - "homepage": "https://input-output-hk.github.io/haskell.nix", - "owner": "input-output-hk", - "repo": "haskell.nix", - "rev": "4b6ee9767daaf5fc1d5419e07733ab006b95ec93", - "sha256": "03hkqrdjbab0m16y3bpmcg4nvrnpajkbaa595v67r77hhqja3nqj", - "type": "tarball", - "url": "https://github.com/input-output-hk/haskell.nix/archive/4b6ee9767daaf5fc1d5419e07733ab006b95ec93.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "iohk-nix": { - "branch": "master", - "description": "nix scripts shared across projects", - "homepage": null, - "owner": "input-output-hk", - "repo": "iohk-nix", - "rev": "0a0126d8fb1bdc61ce1fd2ef61cf396de800fdad", - "sha256": "0gwppj37fphjssw9s99xs7yyxylxzi6fdc9g1sq6w7yyx46lrf0i", - "type": "tarball", - "url": "https://github.com/input-output-hk/iohk-nix/archive/0a0126d8fb1bdc61ce1fd2ef61cf396de800fdad.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs-19.03": { - "branch": "nixos-19.03", - "description": "Nix Packages collection", - "homepage": null, - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "34c7eb7545d155cc5b6f499b23a7cb1c96ab4d59", - "sha256": "11z6ajj108fy2q5g8y4higlcaqncrbjm3dnv17pvif6avagw4mcb", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/34c7eb7545d155cc5b6f499b23a7cb1c96ab4d59.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - } -} diff --git a/nix/sources.nix b/nix/sources.nix deleted file mode 100644 index 1938409d..00000000 --- a/nix/sources.nix +++ /dev/null @@ -1,174 +0,0 @@ -# This file has been generated by Niv. - -let - - # - # The fetchers. fetch_ fetches specs of type . - # - - fetch_file = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; name = name'; } - else - pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; - - fetch_tarball = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchTarball { name = name'; inherit (spec) url sha256; } - else - pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; - - fetch_git = name: spec: - let - ref = - if spec ? ref then spec.ref else - if spec ? branch then "refs/heads/${spec.branch}" else - if spec ? tag then "refs/tags/${spec.tag}" else - abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; - in - builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; - - fetch_local = spec: spec.path; - - fetch_builtin-tarball = name: throw - ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=tarball -a builtin=true''; - - fetch_builtin-url = name: throw - ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=file -a builtin=true''; - - # - # Various helpers - # - - # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 - sanitizeName = name: - ( - concatMapStrings (s: if builtins.isList s then "-" else s) - ( - builtins.split "[^[:alnum:]+._?=-]+" - ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) - ) - ); - - # The set of packages used when specs are fetched using non-builtins. - mkPkgs = sources: system: - let - sourcesNixpkgs = - import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; - hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; - hasThisAsNixpkgsPath = == ./.; - in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; - - # The actual fetching function. - fetch = pkgs: name: spec: - - if ! builtins.hasAttr "type" spec then - abort "ERROR: niv spec ${name} does not have a 'type' attribute" - else if spec.type == "file" then fetch_file pkgs name spec - else if spec.type == "tarball" then fetch_tarball pkgs name spec - else if spec.type == "git" then fetch_git name spec - else if spec.type == "local" then fetch_local spec - else if spec.type == "builtin-tarball" then fetch_builtin-tarball name - else if spec.type == "builtin-url" then fetch_builtin-url name - else - abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; - - # If the environment variable NIV_OVERRIDE_${name} is set, then use - # the path directly as opposed to the fetched source. - replace = name: drv: - let - saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; - ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; - in - if ersatz == "" then drv else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; - - # Ports of functions for older nix versions - - # a Nix version of mapAttrs if the built-in doesn't exist - mapAttrs = builtins.mapAttrs or ( - f: set: with builtins; - listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) - ); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 - stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 - stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); - concatMapStrings = f: list: concatStrings (map f list); - concatStrings = builtins.concatStringsSep ""; - - # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else {}; - - # fetchTarball version that is compatible between all the versions of Nix - builtins_fetchTarball = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchTarball; - in - if lessThan nixVersion "1.12" then - fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchTarball attrs; - - # fetchurl version that is compatible between all the versions of Nix - builtins_fetchurl = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchurl; - in - if lessThan nixVersion "1.12" then - fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchurl attrs; - - # Create the final "sources" from the config - mkSources = config: - mapAttrs ( - name: spec: - if builtins.hasAttr "outPath" spec - then abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); } - ) config.sources; - - # The "config" used by the fetchers - mkConfig = - { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) - , system ? builtins.currentSystem - , pkgs ? mkPkgs sources system - }: rec { - # The sources, i.e. the attribute set of spec name to spec - inherit sources; - - # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers - inherit pkgs; - }; - -in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/nix/update-iohk-nix.sh b/nix/update-iohk-nix.sh deleted file mode 100755 index 0c9d1e08..00000000 --- a/nix/update-iohk-nix.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p nix-prefetch-git - -set -euo pipefail - -NIX_DIR=`dirname $0` - -nix-prefetch-git https://github.com/input-output-hk/iohk-nix \ - > $NIX_DIR/iohk-nix-src.json diff --git a/nix/util.nix b/nix/util.nix deleted file mode 100644 index feffc7cc..00000000 --- a/nix/util.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ haskell-nix }: - -with haskell-nix.haskellLib; -{ - - inherit - selectProjectPackages - collectComponents'; - - inherit (extra) - recRecurseIntoAttrs - collectChecks; - -} diff --git a/nixpkgs.nix b/nixpkgs.nix deleted file mode 100644 index 1f05f6b7..00000000 --- a/nixpkgs.nix +++ /dev/null @@ -1,4 +0,0 @@ -builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/069bf7aee30faf7b3ed773cfae2154d761b2d6c2.tar.gz"; - sha256 = "1c44vjb60fw2r8ck8yqwkj1w4288wixi59c6w1vazjixa79mvjvg"; -} diff --git a/release.nix b/release.nix deleted file mode 100644 index b35b4f18..00000000 --- a/release.nix +++ /dev/null @@ -1,95 +0,0 @@ -############################################################################ -# -# Hydra release jobset. -# -# The purpose of this file is to select jobs defined in default.nix and map -# them to all supported build platforms. -# -############################################################################ - -# The project sources -{ cardano-shell? { outPath = ./.; rev = "abcdef"; } - -# Function arguments to pass to the project -, projectArgs ? { - config = { allowUnfree = false; inHydra = true; }; - gitrev = cardano-shell.rev; - } - -# The systems that the jobset will be built for. -, supportedSystems ? [ "x86_64-linux" ] - -# The systems used for cross-compiling -, supportedCrossSystems ? [ "x86_64-linux" ] - -# A Hydra option -, scrubJobs ? true - -# Dependencies overrides -, sourcesOverride ? {} - -# Import pkgs, including IOHK common nix lib -, pkgs ? import ./nix { inherit sourcesOverride; } - -}: - -with (import pkgs.iohkNix.release-lib) { - inherit pkgs; - inherit supportedSystems supportedCrossSystems scrubJobs projectArgs; - packageSet = import cardano-shell; - gitrev = cardano-shell.rev; -}; - -with pkgs.lib; - -let - getArchDefault = system: let - table = { - x86_64-linux = import ./. { system = "x86_64-linux"; }; - }; - in table.${system}; - default = getArchDefault builtins.currentSystem; - makeScripts = cluster: let - getScript = name: { - x86_64-linux = (getArchDefault "x86_64-linux").scripts.${cluster}.${name}; - }; - in { - node = getScript "node"; - }; - mkPins = inputs: pkgs.runCommand "ifd-pins" {} '' - mkdir $out - cd $out - ${lib.concatMapStringsSep "\n" (input: "ln -sv ${input.value} ${input.key}") (lib.attrValues (lib.mapAttrs (key: value: { inherit key value; }) inputs))} - ''; - - testsSupportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; - # Recurse through an attrset, returning all test derivations in a list. - collectTests' = ds: filter (d: elem d.system testsSupportedSystems) (collect isDerivation ds); - # Adds the package name to the test derivations for windows-testing-bundle.nix - # (passthru.identifier.name does not survive mapTestOn) - collectTests = ds: concatLists ( - mapAttrsToList (packageName: package: - map (drv: drv // { inherit packageName; }) (collectTests' package) - ) ds); - - # Remove build jobs for which cross compiling does not make sense. - filterJobsCross = filterAttrs (n: _: n != "dockerImage" && n != "shell"); - - sources = import ./nix/sources.nix; - - jobs = { - native = mapTestOn (__trace (__toJSON (packagePlatforms project)) (packagePlatforms project)); - # TODO: fix broken evals - ifd-pins = mkPins { - inherit (sources) iohk-nix "haskell.nix"; - inherit (import "${sources.iohk-nix}/nix/sources.nix" {}) nixpkgs; - #hackageSrc = (import pkgs.path (import sources."haskell.nix")).haskell-nix.hackageSrc; - #stackageSrc = (import pkgs.path (import sources."haskell.nix")).haskell-nix.stackageSrc; - }; - } // (mkRequiredJob ( - collectTests jobs.native.checks ++ - collectTests jobs.native.benchmarks ++ [ - jobs.native.node-ipc.x86_64-linux - ])); - -in jobs diff --git a/scripts/buildkite/cache-s3.nix b/scripts/buildkite/cache-s3.nix deleted file mode 100644 index c1523c91..00000000 --- a/scripts/buildkite/cache-s3.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ stdenv, fetchurl, zlib, gmp }: - -stdenv.mkDerivation rec { - name = "cache-s3-${version}"; - version = "v0.1.6"; - src = fetchurl { - url = "https://github.com/fpco/cache-s3/releases/download/${version}/cache-s3-${version}-linux-x86_64.tar.gz"; - sha256 = "01qm6mg11g6kq3sfnnj1civmda35mbfmp1fym5yvqwbdsmqd0b19"; - }; - libPath = stdenv.lib.makeLibraryPath [ - stdenv.cc.cc.lib - zlib - gmp - ]; - sourceRoot = "."; - buildPhase = "true"; - installPhase = '' - mkdir -p $out/bin - install -m 0755 cache-s3 $out/bin - ''; - postFixup = '' - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/cache-s3 - patchelf --set-rpath ${libPath} $out/bin/cache-s3 - ''; -} diff --git a/scripts/buildkite/default.nix b/scripts/buildkite/default.nix deleted file mode 100644 index 74351508..00000000 --- a/scripts/buildkite/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs ? import (import ../../nix/fetch-nixpkgs.nix) { } -, buildTools ? with pkgs; [ git nix gnumake ] -}: - -with pkgs.lib; -with pkgs; - -let - cache-s3 = callPackage ./cache-s3.nix {}; - - stackRebuild = runCommand "stack-rebuild" {} '' - ${haskellPackages.ghcWithPackages (ps: [ps.turtle ps.safe ps.transformers])}/bin/ghc -o $out ${./rebuild.hs} - ''; - -in - writeScript "stack-rebuild-wrapped" '' - #!${stdenv.shell} - export PATH=${lib.makeBinPath ([ cache-s3 stack gnused coreutils ] ++ buildTools)} - exec ${stackRebuild} "$@" - '' diff --git a/scripts/buildkite/rebuild.hs b/scripts/buildkite/rebuild.hs deleted file mode 100644 index 852a4b48..00000000 --- a/scripts/buildkite/rebuild.hs +++ /dev/null @@ -1,166 +0,0 @@ -{-# LANGUAGE OverloadedStrings, RecordWildCards, LambdaCase, ScopedTypeVariables #-} - -import Turtle hiding (option) -import Prelude hiding (FilePath) -import qualified Filesystem.Path.CurrentOS as FP -import Control.Monad.Trans.Maybe -import Control.Exception -import qualified Data.Text as T -import Safe -import System.Exit (exitWith) -import Options.Applicative - -data BuildkiteEnv = BuildkiteEnv - { bkBuildNum :: Int - , bkPipeline :: Text - , bkBranch :: Text - } deriving (Show) - -data CICacheConfig = CICacheConfig - { ccMaxSize :: Maybe Text - , ccBucket :: Text - , ccRegion :: Maybe Text - , ccPrefix :: Text - , ccBranch :: Text - , ccBaseBranch :: Text - } deriving (Show) - -data RebuildOpts = RebuildOpts - { optBuildDirectory :: Maybe FilePath - , optBaseBranch :: Text - } deriving (Show) - -rebuildOpts :: Parser RebuildOpts -rebuildOpts = RebuildOpts <$> optional buildDir <*> baseBranch - where - buildDir = option (FP.decodeString <$> str) (long "build-dir" <> metavar "DIR" <> help "Copy sources to directory before building") - baseBranch = option str ( long "base-branch" <> value "master" <> showDefault <> help "Fallback base branch for cache-s3" ) - -parseOpts :: IO RebuildOpts -parseOpts = execParser opts - where opts = info (rebuildOpts <**> helper) - ( fullDesc <> progDesc "Build cardano-sl project with stack in Buildkite" ) - -main :: IO () -main = do - RebuildOpts{..} <- parseOpts - awsCreds - bk <- getBuildkiteEnv - maybe (pure ()) setupBuildDirectory optBuildDirectory - cacheConfig <- getCacheConfig bk optBaseBranch - cacheDownloadStep cacheConfig - buildResult <- buildStep - cacheUploadStep cacheConfig - exitWith buildResult - -buildStep :: IO ExitCode -buildStep = do - echo "+++ Build and test" - build .&&. test - where - cfg = ["--dump-logs", "--color", "always"] - stackBuild args = run "stack" $ cfg ++ ["build", "--fast"] ++ args - buildArgs = ["--bench", "--no-run-benchmarks", "--no-haddock-deps"] - buildAndTest = stackBuild $ ["--tests"] ++ buildArgs - build = stackBuild $ ["--no-run-tests"] ++ buildArgs - test = stackBuild ["--test", "--jobs", "1"] - --- buildkite agents have S3 creds installed, but under different names -awsCreds :: IO () -awsCreds = mapM_ (uncurry copy) things - where - copy src dst = need src >>= maybe (pure ()) (export dst) - things = [ ( "BUILDKITE_S3_ACCESS_KEY_ID" - , "AWS_ACCESS_KEY_ID") - , ( "BUILDKITE_S3_SECRET_ACCESS_KEY" - , "AWS_SECRET_ACCESS_KEY") - , ( "BUILDKITE_S3_DEFAULT_REGION" - , "AWS_DEFAULT_REGION") - ] - -getBuildkiteEnv :: IO (Maybe BuildkiteEnv) -getBuildkiteEnv = runMaybeT $ do - bkBuildNum <- MaybeT $ needRead "BUILDKITE_BUILD_NUMBER" - bkPipeline <- MaybeT $ need "BUILDKITE_PIPELINE_SLUG" - bkBranch <- MaybeT $ need "BUILDKITE_BRANCH" - pure BuildkiteEnv{..} - -needRead :: Read a => Text -> IO (Maybe a) -needRead v = (>>= readMay) . fmap T.unpack <$> need v - -getCacheConfig :: Maybe BuildkiteEnv -> Text -> IO (Either Text CICacheConfig) -getCacheConfig Nothing _ = pure (Left "BUILDKITE_* environment variables are not set") -getCacheConfig (Just BuildkiteEnv{..}) ccBaseBranch = do - ccMaxSize <- need "CACHE_S3_MAX_SIZE" - ccRegion <- need "AWS_REGION" - need "S3_BUCKET" >>= \case - Just ccBucket -> pure (Right CICacheConfig{ccBranch=bkBranch, ccPrefix=bkPipeline, ..}) - Nothing -> pure (Left "S3_BUCKET environment variable is not set") - -cacheDownloadStep :: Either Text CICacheConfig -> IO () -cacheDownloadStep cacheConfig = do - echo "--- CI Cache Download" - case cacheConfig of - Right cfg -> restoreCICache cfg `catch` - \ (ex :: IOException) -> do - eprintf ("Failed to download CI cache: "%w%"\nContinuing anyway...\n") ex - Left ex -> eprintf ("Not using CI cache because "%s%"\n") ex - -cacheUploadStep :: Either Text CICacheConfig -> IO () -cacheUploadStep cacheConfig = do - echo "--- CI Cache Upload" - case cacheConfig of - Right cfg -> saveCICache cfg `catch` - \ (ex :: IOException) -> do - eprintf ("Failed to upload CI cache: "%w%"\n") ex - Left _ -> printf "CI cache not configured.\n" - -restoreCICache :: CICacheConfig -> IO () -restoreCICache cfg = do - -- cacheS3 cfg (Just $ ccBaseBranch cfg) "restore stack" - cacheS3 cfg (Just $ ccBaseBranch cfg) "restore stack work" - -saveCICache :: CICacheConfig -> IO () -saveCICache cfg = do - -- cacheS3 cfg Nothing "save stack" - cacheS3 cfg Nothing "save stack work" - -cacheS3 :: CICacheConfig -> Maybe Text -> Text -> IO () -cacheS3 CICacheConfig{..} baseBranch cmd = void $ run "cache-s3" args - where - args = ml maxSize ++ ml regionArg ++ - [ format ("--bucket="%s) ccBucket - , format ("--prefix="%s) ccPrefix - , format ("--git-branch="%s) ccBranch - , "--suffix=linux" - , "-v" - , "info" - ] ++ cmds ++ ml baseBranchArg - baseBranchArg = format ("--base-branch="%s) <$> baseBranch - maxSize = format ("--max-size="%s) <$> ccMaxSize - regionArg = format ("--region="%s) <$> ccRegion - cmds = ("-c":T.words cmd) - ml = maybe [] pure - --- cache-s3 needs a build directory that is the same across all --- buildkite agents. The build directory option can be used to ensure --- this is the case. -setupBuildDirectory :: FilePath -> IO () -setupBuildDirectory buildDir = do - exists <- testpath buildDir - when exists $ do - printf ("Removing old build directory "%fp%"\n") buildDir - rmtree buildDir - src <- pwd - printf ("Copying source tree "%fp%" -> "%fp%"\n") src buildDir - cptree src buildDir - cd buildDir - -run :: Text -> [Text] -> IO ExitCode -run cmd args = do - printf (s%" "%s%"\n") cmd (T.unwords args) - res <- proc cmd args empty - case res of - ExitSuccess -> pure () - ExitFailure code -> eprintf ("error: Command exited with code "%d%"!\nContinuing...\n") code - pure res diff --git a/scripts/buildkite/stack-cabal-sync.sh b/scripts/buildkite/stack-cabal-sync.sh deleted file mode 100755 index 3d776ad3..00000000 --- a/scripts/buildkite/stack-cabal-sync.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -set -eu - -# This script checks that the `stack.yaml` and `cabal.project` files have -# consistent git hashes for the packages they depend on. We use -# `cardano-repo-tool`'s `update-cabal-project` command which modifies -# `cabal.project` to be consistent with `stack.yaml`s versions. If the -# diff is non-empty, we know they're out of sync. - -# Check that functions are defined. -HELP_TEXT="cardano-repo-tool not found." -type cardano-repo-tool > /dev/null 2>&1 || { echo "${HELP_TEXT}"; exit 1; } -HELP_TEXT="git not found." -type git > /dev/null 2>&1 || { echo "${HELP_TEXT}"; exit 1; } - -# Update `cabal.project` from the `stack.yaml` file. -cardano-repo-tool update-cabal-project - -git diff cabal.project | tee stack-cabal.patch - -if test "$(wc -l < stack-cabal.patch)" -gt 0 ; then - buildkite-agent artifact upload stack-cabal.patch --job "$BUILDKITE_JOB_ID" - exit 1 - fi - -exit 0 diff --git a/shell.nix b/shell.nix deleted file mode 100644 index df7c0285..00000000 --- a/shell.nix +++ /dev/null @@ -1,72 +0,0 @@ -# This file is used by nix-shell. -# It just takes the shell attribute from default.nix. -{ config ? {} -, sourcesOverride ? {} -, withHoogle ? true -, pkgs ? import ./nix { - inherit config sourcesOverride; - } -}: - -with pkgs; -let - # This provides a development environment that can be used with nix-shell or - # lorri. See https://input-output-hk.github.io/haskell.nix/user-guide/development/ - shell = cardanoShellHaskellPackages.shellFor { - name = "cabal-dev-shell"; - - # If shellFor local packages selection is wrong, - # then list all local packages then include source-repository-package that cabal complains about: - packages = ps: with ps; [ - ps.cardano-shell - ps.cardano-launcher - ]; - - # These programs will be available inside the nix-shell. - buildInputs = (with haskellPackages; [ - profiteur - weeder - ]) ++ (with pkgs; [ - cabal-install - ghcid - git - hlint - niv - nix - pkgconfig - sqlite-interactive - tmux - ]); - - # Prevents cabal from choosing alternate plans, so that - # *all* dependencies are provided by Nix. - exactDeps = true; - - inherit withHoogle; - - GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; - }; - - devops = pkgs.stdenv.mkDerivation { - name = "devops-shell"; - buildInputs = [ - niv - ]; - shellHook = '' - echo "DevOps Tools" \ - | ${figlet}/bin/figlet -f banner -c \ - | ${lolcat}/bin/lolcat - - echo "NOTE: you may need to export GITHUB_TOKEN if you hit rate limits with niv" - echo "Commands: - * niv update - update package - - " - ''; - }; - - localPkgs = import ./. { }; - -in - - shell // { inherit devops; } // { inherit (localPkgs) runCoveralls; } diff --git a/stack-shell.nix b/stack-shell.nix deleted file mode 100644 index a6bdf202..00000000 --- a/stack-shell.nix +++ /dev/null @@ -1 +0,0 @@ -(import ./. { }).shell diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 583d83be..00000000 --- a/stack.yaml +++ /dev/null @@ -1,42 +0,0 @@ -resolver: https://raw.githubusercontent.com/input-output-hk/cardano-prelude/316c854d1d3089f480708ad5cd5ecf8a74423ddd/snapshot.yaml - -packages: -- ./cardano-shell -- ./cardano-launcher - -extra-deps: - - katip-0.8.3.0 - - quickcheck-state-machine-0.6.0 # Used a specific dependency, new release. - - pretty-show-1.9.5 # Used for quickcheck-state-machine. - - time-units-1.0.0 - - silently-1.2.5.1 - - network-3.1.1.1 - - - Win32-2.5.4.1@sha256:e623a1058bd8134ec14d62759f76cac52eee3576711cb2c4981f398f1ec44b85 - - - git: https://github.com/input-output-hk/cardano-prelude - commit: 316c854d1d3089f480708ad5cd5ecf8a74423ddd - subdirs: - - . - - test - - - git: https://github.com/input-output-hk/iohk-monitoring-framework - commit: efa4b5ecd7f0a13124616b12679cd42517cd905a - subdirs: - - contra-tracer - - iohk-monitoring - - tracer-transformers - - - git: https://github.com/input-output-hk/ouroboros-network - commit: 1361bb92814c65e5964732777fc7f8ec9ebdccfe - subdirs: - - Win32-network - - # Extracted from cardano-sl since it's quite useful - - git: https://github.com/input-output-hk/cardano-sl-x509 - commit: 43a036c5bbe68ca2e9cbe611eab7982e2348fe49 - subdirs: - - . - -nix: - shell-file: stack-shell.nix diff --git a/test.nix b/test.nix deleted file mode 100644 index ba17c64f..00000000 --- a/test.nix +++ /dev/null @@ -1,28 +0,0 @@ -let - shell = import ./. {}; - pkgs = shell._lib.pkgs; - # partial code for testing on a cross arch - cross-ipc = (import ./release.nix {}).nix-tools.cexes.x86_64-pc-mingw32-cardano-shell.node-ipc.x86_64-linux; - crossShell = pkgs.mkShell { - name = "test"; - buildInputs = [ cross-ipc pkgs.wineWowPackages.minimal ]; - }; - # test the ipc on a given native arch - mkTest = arch: { - name = arch; - value = let - pkgs = shell._lib.getPkgs { system = arch; }; - shell = import ./. { system = arch; }; - in pkgs.runCommand "test-ipc-${arch}" { - buildInputs = [ shell.nix-tools.cexes.cardano-shell.node-ipc pkgs.nodejs ]; - } '' - cp ${./cardano-shell/app/NodeIPCClient/server.js} server.js - node server.js - touch $out - ''; - }; -in builtins.listToAttrs (map mkTest [ - "x86_64-linux" - # "x86_64-darwin" -- This has been (approximately since forever) causing intermittent failures, such as: - # https://iohk-nix-cache.s3-eu-central-1.amazonaws.com/log/8hl7r13yw4sbmyylcdpq2q3qj8d12jmk-test-ipc-x86_64-darwin.drv - ]) diff --git a/updater-test-win.nix b/updater-test-win.nix deleted file mode 100644 index 5f4226d2..00000000 --- a/updater-test-win.nix +++ /dev/null @@ -1,26 +0,0 @@ -# This will create everything we need to manually test the update system and compress them into -# updater_test.zip. -# Zip file will be located inside result directory. -# How to run: nix-build updater-test-win.nix -let - commonLib = import ./nix/iohk-common.nix; - self = import ./. {}; - pkgs = commonLib.getPkgs {}; - crossSelf = import ./. { crossSystem = pkgs.lib.systems.examples.mingwW64; }; - pkgsCross = commonLib.getPkgs { crossSystem = pkgs.lib.systems.examples.mingwW64; }; -in pkgs.runCommand "updater_test.zip" { buildInputs = [ pkgs.zip ]; } '' - mkdir -pv $out/updater-test - cd $out/updater-test - mkdir -pv configuration/client configuration/server configuration/launcher - cp ${crossSelf.nix-tools.cexes.cardano-launcher.cardano-launcher}/bin/cardano-launcher.exe ./cardano-launcher.exe - cp ${crossSelf.nix-tools.cexes.cardano-launcher.mock-daedalus-frontend}/bin/mock-daedalus-frontend.exe ./daedalus.exe - cp ${crossSelf.nix-tools.cexes.cardano-launcher.mock-installer}/bin/mock-installer.exe ./updater.exe - cp ${pkgsCross.libffi}/bin/libffi-6.dll ./ - cp ${./cardano-launcher/configuration/launcher/launcher-config-demo.windows.yaml} ./launcher-config.yaml - cp ${./cardano-launcher/configuration/cert-configuration.yaml} ./configuration/cert-configuration.yaml - cp ${./configuration/log-configuration.yaml} ./configuration/log-configuration.yaml - chmod +w -R . - cd .. - zip updater_test.zip -r updater-test/ -'' -