Compare commits

...

2 Commits

Author SHA1 Message Date
Astro 4666f1aa6a artiq-full: concatenate paths as paths not strings
fixes running with restrict-eval=true on Hydra
2021-02-02 13:24:02 +01:00
Astro d149c66d05 artiq-full: move reading standalone flag from sinara-systems to before generatedNix 2021-02-02 13:23:31 +01:00
2 changed files with 22 additions and 2 deletions

View File

@ -2,6 +2,23 @@
let
sinaraSystemsSrc = <sinaraSystemsSrc>;
standaloneVariants =
let
jsonFiles =
builtins.attrNames (
pkgs.lib.filterAttrs (name: type:
type != "directory" &&
builtins.match ".+\\.json" name != null
) (builtins.readDir sinaraSystemsSrc)
);
isStandalone = jsonFile:
(builtins.fromJSON (
builtins.readFile (<sinaraSystemsSrc> + "/${jsonFile}")
)).base == "standalone";
in
map (builtins.replaceStrings [".json"] [""]) (
builtins.filter isStandalone jsonFiles
);
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
''
@ -111,6 +128,9 @@ let
"wipm7master"
"wipm7satellite"
]);
standaloneVariants = [${builtins.concatStringsSep " " (
builtins.map (variant: "\"${variant}\"") standaloneVariants
)}];
# Splitting the build process into software+gateware does
# not work when artiq embeds compiled firmware into generated
# Vivado input.
@ -148,7 +168,7 @@ let
boardBinaries = boardBinaries;
inherit target variant;
};
} // (pkgs.lib.optionalAttrs ((builtins.fromJSON (builtins.readFile json)).base == "standalone") {
} // (pkgs.lib.optionalAttrs (builtins.elem variant standaloneVariants) {
"device-db-\''${target}-\''${variant}" = pkgs.stdenv.mkDerivation {
name = "device-db-\''${target}-\''${variant}";
buildInputs = ddbDeps;

View File

@ -16,7 +16,7 @@ let
cargoDeps = fetchcargo rec {
name = "artiq-firmware-cargo-deps";
src = "${artiqSrc}/artiq/firmware";
sha256 = (import "${artiqSrc}/artiq/firmware/cargosha256.nix");
sha256 = import (artiqSrc + "/artiq/firmware/cargosha256.nix");
};
cargoVendored = pkgs.stdenv.mkDerivation {