xcbuild: suppress warnings for unknown keys
Newer SDKs have keys that xcbuild doesn’t recognize. These warnings generate a lot of noise, especially when `xcrun` is used in an interactive session, so suppress them.
This commit is contained in:
parent
c8df66973b
commit
7ae8a1e519
@ -82,6 +82,8 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
./patches/includes.patch
|
./patches/includes.patch
|
||||||
# Prevent xcrun from recursively invoking itself but still find native toolchain binaries
|
# Prevent xcrun from recursively invoking itself but still find native toolchain binaries
|
||||||
./patches/Use-system-toolchain-for-usr-bin.patch
|
./patches/Use-system-toolchain-for-usr-bin.patch
|
||||||
|
# Suppress warnings due to newer SDKs with unknown keys
|
||||||
|
./patches/Suppress-unknown-key-warnings.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
diff --git a/Libraries/xcsdk/Tools/xcrun.cpp b/Libraries/xcsdk/Tools/xcrun.cpp
|
|
||||||
index 9d6d4576d7..7400267c2b 100644
|
|
||||||
--- a/Libraries/xcsdk/Tools/xcrun.cpp
|
|
||||||
+++ b/Libraries/xcsdk/Tools/xcrun.cpp
|
|
||||||
@@ -23,6 +23,8 @@
|
|
||||||
#include <process/DefaultUser.h>
|
|
||||||
#include <pbxsetting/Type.h>
|
|
||||||
|
|
||||||
+#include <algorithm>
|
|
||||||
+
|
|
||||||
using libutil::DefaultFilesystem;
|
|
||||||
using libutil::Filesystem;
|
|
||||||
using libutil::FSUtil;
|
|
||||||
@@ -398,6 +400,8 @@
|
|
||||||
fprintf(stderr, "\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
+ std::unordered_map<std::string, std::string> environment = processContext->environmentVariables();
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* Collect search paths for the tool.
|
|
||||||
* Can be in toolchains, target (if one is provided), developer root,
|
|
||||||
@@ -408,6 +412,15 @@
|
|
||||||
executablePaths.insert(executablePaths.end(), defaultExecutablePaths.begin(), defaultExecutablePaths.end());
|
|
||||||
|
|
||||||
/*
|
|
||||||
+ * Don’t look for tools in `/usr/bin` because it can cause an infinite recursion when `xcrun` finds a shim
|
|
||||||
+ * that tries to invoke `xcrun` to run the tool.
|
|
||||||
+ */
|
|
||||||
+ executablePaths.erase(
|
|
||||||
+ std::remove(executablePaths.begin(), executablePaths.end(), "/usr/bin"),
|
|
||||||
+ executablePaths.end()
|
|
||||||
+ );
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
* Find the tool to execute.
|
|
||||||
*/
|
|
||||||
ext::optional<std::string> executable = filesystem->findExecutable(*options.tool(), executablePaths);
|
|
||||||
@@ -428,8 +441,6 @@
|
|
||||||
} else {
|
|
||||||
/* Run is the default. */
|
|
||||||
|
|
||||||
- std::unordered_map<std::string, std::string> environment = processContext->environmentVariables();
|
|
||||||
-
|
|
||||||
if (target != nullptr) {
|
|
||||||
/*
|
|
||||||
* Update effective environment to include the target path.
|
|
@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/Libraries/xcsdk/Sources/SDK/Product.cpp b/Libraries/xcsdk/Sources/SDK/Product.cpp
|
||||||
|
index f291d475c7..bc339f567c 100644
|
||||||
|
--- a/Libraries/xcsdk/Sources/SDK/Product.cpp
|
||||||
|
+++ b/Libraries/xcsdk/Sources/SDK/Product.cpp
|
||||||
|
@@ -33,7 +33,7 @@
|
||||||
|
auto PBV = unpack.cast <plist::String> ("ProductBuildVersion");
|
||||||
|
auto PC = unpack.cast <plist::String> ("ProductCopyright");
|
||||||
|
|
||||||
|
- if (!unpack.complete(true)) {
|
||||||
|
+ if (!unpack.complete(false)) {
|
||||||
|
fprintf(stderr, "%s", unpack.errorText().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/Libraries/xcsdk/Sources/SDK/Target.cpp b/Libraries/xcsdk/Sources/SDK/Target.cpp
|
||||||
|
index 523c1e4cbd..2197b1d6d1 100644
|
||||||
|
--- a/Libraries/xcsdk/Sources/SDK/Target.cpp
|
||||||
|
+++ b/Libraries/xcsdk/Sources/SDK/Target.cpp
|
||||||
|
@@ -86,7 +86,7 @@
|
||||||
|
/* Ignored: seems to be a typo. */
|
||||||
|
(void)unpack.cast <plist::String> ("isBaseSDK");
|
||||||
|
|
||||||
|
- if (!unpack.complete(true)) {
|
||||||
|
+ if (!unpack.complete(false)) {
|
||||||
|
fprintf(stderr, "%s", unpack.errorText().c_str());
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user