Skip to content

Commit b715934

Browse files
committed
disable verbose warning
1 parent 937df39 commit b715934

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

chainloader.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
(import ./overlay.nix {
77
inherit withCcache;
88
smp = false; # No SMP for chainloader
9+
disableTargetWarning = true;
910
})
1011
],
1112
pkgs ? import nixpkgs {
@@ -47,5 +48,5 @@ stdenv.mkDerivation rec {
4748
nativeBuildInputs = [
4849
pkgs.buildPackages.cmake
4950
pkgs.buildPackages.nasm
50-
];
51+
] ++ [ pkgs.pkgsIncludeOS.suppressTargetWarningHook ];
5152
}

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
smp ? false, # Enable multcore support (SMP)
33
nixpkgs ? ./pinned.nix,
44
overlays ? [
5-
(import ./overlay.nix { inherit withCcache; inherit smp; } )
5+
(import ./overlay.nix { inherit withCcache; inherit smp; disableTargetWarning = true; } )
66
],
77
pkgs ? import nixpkgs { config = {}; inherit overlays; }
88
}:

example.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ includeos.stdenv.mkDerivation rec {
1313
nativeBuildInputs = [
1414
includeos.pkgs.buildPackages.nasm
1515
includeos.pkgs.buildPackages.cmake
16-
];
16+
] ++ [ includeos.pkgs.pkgsIncludeOS.suppressTargetWarningHook ];
1717

1818
buildInputs = [
1919
includeos

overlay.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
withCcache, # Enable ccache. Requires correct permissions, see below.
3+
disableTargetWarning ? true, # TODO: see https://github.com/NixOS/nixpkgs/issues/395191
34
smp, # Enable multicore support (SMP)
45
} :
56
final: prev: {
@@ -69,9 +70,21 @@ final: prev: {
6970
echo "====="
7071
'';
7172
};
73+
74+
suppressTargetWarningHook = prev.writeTextFile {
75+
name = "suppress-target-warning-hook";
76+
destination = "/nix-support/setup-hook";
77+
text = ''
78+
# see https://github.com/NixOS/nixpkgs/issues/395191
79+
# delete this hook and downstream references once resolved
80+
81+
export NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1
82+
'';
83+
};
7284
in {
7385
# self.callPackage will use this stdenv.
7486
stdenv = final.stdenvIncludeOS.includeos_stdenv;
87+
inherit suppressTargetWarningHook;
7588

7689
# Deps
7790
uzlib = self.callPackage ./deps/uzlib/default.nix { };
@@ -140,7 +153,8 @@ final: prev: {
140153
nativeBuildInputs = [
141154
prev.buildPackages.cmake
142155
prev.buildPackages.nasm
143-
] ++ prev.lib.optionals withCcache [self.ccacheWrapper ccacheNoticeHook];
156+
] ++ prev.lib.optionals disableTargetWarning [suppressTargetWarningHook]
157+
++ prev.lib.optionals withCcache [self.ccacheWrapper ccacheNoticeHook];
144158

145159
buildInputs = [
146160
self.botan2

shell.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ includeos.pkgs.mkShell.override { inherit (includeos) stdenv; } rec {
6363
mkdir -p "$BUILDPATH"
6464
pushd "$BUILDPATH"
6565
fi
66+
67+
# see https://github.com/NixOS/nixpkgs/issues/395191
68+
# delete this export once resolved
69+
export NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1
70+
6671
cmake "$unikernel" -DARCH=x86_64 -DINCLUDEOS_PACKAGE=${includeos} -DCMAKE_MODULE_PATH=${includeos}/cmake \
6772
-DFOR_PRODUCTION=OFF
6873
make -j $NIX_BUILD_CORES

0 commit comments

Comments
 (0)