From 00e518e77da14517f681ccee8e627cc2792702d0 Mon Sep 17 00:00:00 2001 From: Stephan Maka Date: Mon, 27 May 2019 22:08:36 +0200 Subject: [PATCH] artiq-board: check for constraint errors in vivado.log Should fix Gitea issue #15 --- artiq/artiq-board.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/artiq/artiq-board.nix b/artiq/artiq-board.nix index d2ff017..10c40aa 100644 --- a/artiq/artiq-board.nix +++ b/artiq/artiq-board.nix @@ -47,11 +47,22 @@ let in pkgs.python3Packages.buildPythonPackage rec { name = "artiq-board-${target}-${variant}-${version}"; version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; }); - phases = [ "buildPhase" "installPhase" ]; + phases = [ "buildPhase" "installCheckPhase" "installPhase" ]; buildPhase = '' ${buildenv}/bin/artiq-dev -c "export CARGO_HOME=${cargoVendored}; ${buildCommand}" ''; + preCheck = '' + # Search for PCREs in the Vivado output to check for errors + function check_log() { + grep -Pe "$1" artiq_${target}/${variant}/gateware/vivado.log + if [ $? -ne 1 ]; then + exit 1 + fi + } + check_log "\d+ constraint not met\." + check_log "Timing constraints are not met\." + ''; installPhase = '' TARGET_DIR=$out/${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}