From c8f136c236830e3abd0b1ee1ba9e0330f802d9bd Mon Sep 17 00:00:00 2001 From: Madoura Date: Sun, 12 Nov 2023 04:09:46 -0600 Subject: [PATCH] python3Packages.torch: Suppress spammy warnings Suppresses the most spammy warnings. This is mainly to fix https://github.com/NixOS/nixpkgs/issues/266895. --- .../python-modules/torch/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index e31b6306bb19..c5d591c3f27a 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -290,6 +290,24 @@ in buildPythonPackage rec { # error: cast from ... to ... converts to incompatible function type [-Werror,-Wcast-function-type-strict] ++ lib.optionals (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "16") [ "-Wno-error=cast-function-type-strict" + # Suppresses the most spammy warnings. + # This is mainly to fix https://github.com/NixOS/nixpkgs/issues/266895. + ] ++ lib.optionals rocmSupport [ + "-Wno-#warnings" + "-Wno-cpp" + "-Wno-unknown-warning-option" + "-Wno-ignored-attributes" + "-Wno-deprecated-declarations" + "-Wno-defaulted-function-deleted" + "-Wno-pass-failed" + ] ++ [ + "-Wno-unused-command-line-argument" + "-Wno-maybe-uninitialized" + "-Wno-uninitialized" + "-Wno-array-bounds" + "-Wno-stringop-overflow" + "-Wno-free-nonheap-object" + "-Wno-unused-result" ])); nativeBuildInputs = [