Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
fix gitrev and version in daedalus-bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverca22 committed Jul 12, 2019
1 parent fb6a974 commit 9004cce
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
14 changes: 10 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{ customConfig ? {}
, target ? builtins.currentSystem }:
let
lib = (import ./lib.nix).pkgs.lib;
commitIdFromGitRepo = import ./nix/commit-id.nix { inherit lib; };
in { customConfig ? {}
, target ? builtins.currentSystem
, gitrev ? commitIdFromGitRepo ./.git
}:
#
#
# Generated targets include anything from stack.yaml (via nix-tools:stack-to-nix and the nix/regenerate.sh script)
Expand All @@ -23,7 +28,7 @@

let
system = if target != "x86_64-windows" then target else builtins.currentSystem;
crossSystem = if target == "x86_64-windows" then commonLib.pkgs.lib.systems.examples.mingwW64 else null;
crossSystem = if target == "x86_64-windows" then lib.systems.examples.mingwW64 else null;
# commonLib provides iohk-nix tooling and extra libraries specific to cardano-sl.
commonLib = import ./lib.nix;
pkgs = import commonLib.nixpkgs { inherit system crossSystem; };
Expand All @@ -42,7 +47,8 @@ let
};
# daedalus bridge contains the binaries and config files daedalus requires
daedalus-bridge = pkgs.callPackage ./nix/daedalus-bridge.nix {
inherit nixTools cardanoConfig;
inherit nixTools cardanoConfig gitrev;
version = nixTools.nix-tools._raw.cardano-sl.identifier.version;
};
in {
inherit pkgs;
Expand Down
2 changes: 1 addition & 1 deletion nix/daedalus-bridge.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ runCommand, stdenv
, nixTools, cardanoConfig
, version ? "unstable", gitrev ? "abcdef", buildId ? null }:
, version ? "unstable", gitrev, buildId ? null }:

with stdenv.lib;

Expand Down
22 changes: 12 additions & 10 deletions release.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
let
commonLib = import ./lib.nix;
default = import ./. {};
disabled = [];
in { cardano ? { outPath = ./.; rev = "abcdef"; }, ... }@args:
let
getArchDefault = system: let
table = {
x86_64-linux = import ./. { target = "x86_64-linux"; gitrev = cardano.rev; };
x86_64-darwin = import ./. { target = "x86_64-darwin"; gitrev = cardano.rev; };
x86_64-windows = import ./. { target = "x86_64-windows"; gitrev = cardano.rev; };
};
in table.${system};
default = getArchDefault builtins.currentSystem;
makeConnectScripts = cluster: let
getScript = name: {
x86_64-linux = (getArchDefault "x86_64-linux").connectScripts.${cluster}.${name};
Expand All @@ -13,7 +22,7 @@ let
wallet = getScript "wallet";
};
wrapDockerImage = cluster: let
images = default.dockerImages;
images = (getArchDefault "x86_64-linux").dockerImages;
wrapImage = image: commonLib.pkgs.runCommand "${image.name}-hydra" {} ''
mkdir -pv $out/nix-support/
cat <<EOF > $out/nix-support/hydra-build-products
Expand All @@ -31,14 +40,7 @@ let
dockerImage = wrapDockerImage cluster;
};
};
getArchDefault = system: let
table = {
x86_64-linux = import ./. { target = "x86_64-linux"; };
x86_64-darwin = import ./. { target = "x86_64-darwin"; };
x86_64-windows = import ./. { target = "x86_64-windows"; };
};
in table.${system};
in { cardano ? { outPath = ./.; rev = "abcdef"; }, ... }@args:
in
commonLib.pkgs.lib.mapAttrsRecursiveCond
(as: !(as ? "type" && as.type == "derivation"))
(path: v: if (builtins.elem path disabled) then null else v)
Expand Down

0 comments on commit 9004cce

Please sign in to comment.