From 3364d76c0b4df219ddbdc13bb6e84af78d67c496 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Fri, 10 Feb 2023 18:38:56 +0800 Subject: [PATCH] circt: fix build with non clang stdenv lib.optionalString creates an empty string when the condition is false And the circt test framework interprets this as disabling all tests failing the build with `error: filter did not match any tests` --- pkgs/development/compilers/circt/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/circt/default.nix b/pkgs/development/compilers/circt/default.nix index ce06782eb12..a8e36cbc785 100644 --- a/pkgs/development/compilers/circt/default.nix +++ b/pkgs/development/compilers/circt/default.nix @@ -49,7 +49,8 @@ stdenv.mkDerivation rec { # https://github.com/NixOS/nixpkgs/issues/214945 discusses this issue. # # As a temporary fix, we disabled these tests when using clang stdenv - LIT_FILTER_OUT = lib.optionalString stdenv.cc.isClang "CIRCT :: Target/ExportSystemC/.*\.mlir"; + # cannot use lib.optionalString as it creates an empty string, disabling all tests + LIT_FILTER_OUT = if stdenv.cc.isClang then "CIRCT :: Target/ExportSystemC/.*\.mlir" else null; preConfigure = '' substituteInPlace test/circt-reduce/test/annotation-remover.mlir --replace "/usr/bin/env" "${coreutils}/bin/env"