From 772dbad3d41932f08d44aaa63a571d4e26c5d143 Mon Sep 17 00:00:00 2001 From: Martin Schwaighofer Date: Sun, 7 Apr 2024 00:31:40 +0200 Subject: [PATCH] rocmPackages.llvm: replace --replace with --replace-fail (cleanup) --- pkgs/development/rocm-modules/6/llvm/base.nix | 2 +- .../rocm-modules/6/llvm/stage-1/clang-unwrapped.nix | 2 +- pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix | 10 +++++----- pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix | 2 +- .../development/rocm-modules/6/llvm/stage-3/libclc.nix | 10 +++++----- pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix | 2 +- pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pkgs/development/rocm-modules/6/llvm/base.nix b/pkgs/development/rocm-modules/6/llvm/base.nix index e49f28fe976b..88b384b43d8e 100644 --- a/pkgs/development/rocm-modules/6/llvm/base.nix +++ b/pkgs/development/rocm-modules/6/llvm/base.nix @@ -150,7 +150,7 @@ in stdenv.mkDerivation (finalAttrs: { rm unittests/Support/Path.cpp substituteInPlace unittests/Support/CMakeLists.txt \ - --replace "Path.cpp" "" + --replace-fail "Path.cpp" "" '' + extraPostPatch; doCheck = buildTests; diff --git a/pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix b/pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix index 8ae4e0e0abb8..0d982299ec6e 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix @@ -21,7 +21,7 @@ callPackage ../base.nix rec { ln -s ../cmake/Modules/FindLibEdit.cmake cmake/modules substituteInPlace CMakeLists.txt \ - --replace "include(CheckIncludeFile)" "include(CheckIncludeFile)''\nfind_package(LibEdit)" + --replace-fail "include(CheckIncludeFile)" "include(CheckIncludeFile)''\nfind_package(LibEdit)" # `No such file or directory: '/build/source/clang/tools/scan-build/bin/scan-build'` rm test/Analysis/scan-build/*.test diff --git a/pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix b/pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix index 7e7cf9c2a608..2446723ef5fe 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix @@ -14,11 +14,11 @@ callPackage ../base.nix rec { # `Failed to match ... against ...` `Match value not within tolerance value of MPFR result:` # We need a better way, but I don't know enough sed magic and patching `CMakeLists.txt` isn't working... substituteInPlace ../libc/test/src/math/log10_test.cpp \ - --replace "i < N" "i < 0" \ - --replace "test(mpfr::RoundingMode::Nearest);" "" \ - --replace "test(mpfr::RoundingMode::Downward);" "" \ - --replace "test(mpfr::RoundingMode::Upward);" "" \ - --replace "test(mpfr::RoundingMode::TowardZero);" "" + --replace-fail "i < N" "i < 0" \ + --replace-fail "test(mpfr::RoundingMode::Nearest);" "" \ + --replace-fail "test(mpfr::RoundingMode::Downward);" "" \ + --replace-fail "test(mpfr::RoundingMode::Upward);" "" \ + --replace-fail "test(mpfr::RoundingMode::TowardZero);" "" ''; checkTargets = [ "check-${targetName}" ]; diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix index 91f34265f85f..a0e1935d3c5f 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix @@ -68,6 +68,6 @@ wrapCCWith rec { # GPU compilation uses builtin `lld` substituteInPlace $out/bin/{clang,clang++} \ - --replace "-MM) dontLink=1 ;;" "-MM | --cuda-device-only) dontLink=1 ;;''\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;" + --replace-fail "-MM) dontLink=1 ;;" "-MM | --cuda-device-only) dontLink=1 ;;''\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;" ''; } diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix index 1fd72ee67188..c395dd792db0 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix @@ -21,13 +21,13 @@ in callPackage ../base.nix rec { # `clspv` tests fail, unresolved calls extraPostPatch = '' substituteInPlace CMakeLists.txt \ - --replace "find_program( LLVM_CLANG clang PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ + --replace-fail "find_program( LLVM_CLANG clang PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ "find_program( LLVM_CLANG clang PATHS \"${clang}/bin\" NO_DEFAULT_PATH )" \ - --replace "find_program( LLVM_SPIRV llvm-spirv PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ + --replace-fail "find_program( LLVM_SPIRV llvm-spirv PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ "find_program( LLVM_SPIRV llvm-spirv PATHS \"${spirv}/bin\" NO_DEFAULT_PATH )" \ - --replace " spirv-mesa3d-" "" \ - --replace " spirv64-mesa3d-" "" \ - --replace "NOT \''${t} MATCHES" \ + --replace-fail " spirv-mesa3d-" "" \ + --replace-fail " spirv64-mesa3d-" "" \ + --replace-fail "NOT \''${t} MATCHES" \ "NOT \''${ARCH} STREQUAL \"clspv\" AND NOT \''${ARCH} STREQUAL \"clspv64\" AND NOT \''${t} MATCHES" ''; diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix index 265d994a27f8..8b71b3fb2977 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix @@ -45,7 +45,7 @@ callPackage ../base.nix rec { extraPostPatch = '' # `add_library cannot create target "llvm_gtest" because an imported target with the same name already exists` substituteInPlace CMakeLists.txt \ - --replace "EXISTS \''${UNITTEST_DIR}/googletest/include/gtest/gtest.h" "FALSE" + --replace-fail "EXISTS \''${UNITTEST_DIR}/googletest/include/gtest/gtest.h" "FALSE" # Mainly `No such file or directory` cat ${./1001-mlir-failing-tests.list} | xargs -d \\n rm diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix index e001f33dfd43..da5c2e16f5d3 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix @@ -11,7 +11,7 @@ callPackage ../base.nix rec { extraPostPatch = '' # `add_library cannot create target "llvm_gtest" because an imported target with the same name already exists` substituteInPlace CMakeLists.txt \ - --replace "NOT TARGET gtest" "FALSE" + --replace-fail "NOT TARGET gtest" "FALSE" ''; checkTargets = [ "check-${targetName}" ];