···38 "-DCIRCT_LLHD_SIM_ENABLED=OFF"
39 ];
4041+ # There are some tests depending on `clang-tools` to work. They are activated only when detected
42+ # `clang-tidy` in PATH, However, we cannot simply put `clang-tools` in checkInputs to make these
43+ # tests work. Because
44+ #
45+ # 1. The absolute paths of binaries used in tests are resolved in configure phase.
46+ # 2. When stdenv = clangStdenv, the `clang-tidy` binary appears in PATH via `clang-unwrapped`,
47+ # which is always placed before `${clang-tools}/bin` in PATH. `clang-tidy` provided in
48+ # `clang-unwrapped` cause tests failing because it is not wrapped to resolve header search paths.
49+ # https://github.com/NixOS/nixpkgs/issues/214945 discusses this issue.
50+ #
51+ # As a temporary fix, we disabled these tests when using clang stdenv
52+ LIT_FILTER_OUT = lib.optionalString stdenv.cc.isClang "CIRCT :: Target/ExportSystemC/.*\.mlir";
53+54 preConfigure = ''
55 substituteInPlace test/circt-reduce/test/annotation-remover.mlir --replace "/usr/bin/env" "${coreutils}/bin/env"
56 '';