From e643caf024ab272982d4793bb69a1d25402b56c1 Mon Sep 17 00:00:00 2001 From: Mazunki Hoksaas Date: Tue, 14 Oct 2025 22:04:57 +0200 Subject: [PATCH] disable verbose warning --- chainloader.nix | 3 ++- default.nix | 2 +- overlay.nix | 16 +++++++++++++++- unikernel.nix | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/chainloader.nix b/chainloader.nix index 627d46e11..afbbcead7 100644 --- a/chainloader.nix +++ b/chainloader.nix @@ -6,6 +6,7 @@ (import ./overlay.nix { inherit withCcache; smp = false; # No SMP for chainloader + disableTargetWarning = true; }) ], pkgs ? import nixpkgs { @@ -47,5 +48,5 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgs.buildPackages.cmake pkgs.buildPackages.nasm - ]; + ] ++ [ pkgs.pkgsIncludeOS.suppressTargetWarningHook ]; } diff --git a/default.nix b/default.nix index 0e7b270fe..7a2717374 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,7 @@ smp ? false, # Enable multcore support (SMP) nixpkgs ? ./pinned.nix, overlays ? [ - (import ./overlay.nix { inherit withCcache; inherit smp; } ) + (import ./overlay.nix { inherit withCcache; inherit smp; disableTargetWarning = true; } ) ], pkgs ? import nixpkgs { config = {}; inherit overlays; } }: diff --git a/overlay.nix b/overlay.nix index 3dd750689..0ef600a40 100644 --- a/overlay.nix +++ b/overlay.nix @@ -1,5 +1,6 @@ { withCcache, # Enable ccache. Requires correct permissions, see below. + disableTargetWarning ? true, # TODO: see https://github.com/NixOS/nixpkgs/issues/395191 smp, # Enable multicore support (SMP) } : final: prev: { @@ -69,9 +70,21 @@ final: prev: { echo "=====" ''; }; + + suppressTargetWarningHook = prev.writeTextFile { + name = "suppress-target-warning-hook"; + destination = "/nix-support/setup-hook"; + text = '' + # see https://github.com/NixOS/nixpkgs/issues/395191 + # delete this hook and downstream references once resolved + + export NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1 + ''; + }; in { # self.callPackage will use this stdenv. stdenv = final.stdenvIncludeOS.includeos_stdenv; + inherit suppressTargetWarningHook; # Deps uzlib = self.callPackage ./deps/uzlib/default.nix { }; @@ -140,7 +153,8 @@ final: prev: { nativeBuildInputs = [ prev.buildPackages.cmake prev.buildPackages.nasm - ] ++ prev.lib.optionals withCcache [self.ccacheWrapper ccacheNoticeHook]; + ] ++ prev.lib.optionals disableTargetWarning [suppressTargetWarningHook] + ++ prev.lib.optionals withCcache [self.ccacheWrapper ccacheNoticeHook]; buildInputs = [ self.botan2 diff --git a/unikernel.nix b/unikernel.nix index 1aab8d755..bd0ef2b6c 100644 --- a/unikernel.nix +++ b/unikernel.nix @@ -49,7 +49,7 @@ includeos.stdenv.mkDerivation rec { nativeBuildInputs = [ includeos.pkgs.buildPackages.nasm includeos.pkgs.buildPackages.cmake - ]; + ] ++ [ includeos.pkgs.pkgsIncludeOS.suppressTargetWarningHook ]; buildInputs = [ includeos