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`
This commit is contained in:
Nick Cao
2023-02-10 18:38:56 +08:00
committed by Florian Brandes
parent 6245a0a9ac
commit 79e75c20ad

View File

@@ -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"