mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-10-28 09:45:55 +08:00
vendor: apply deep nested json patch from upstream (#30253)
This commit is contained in:
1 parent
79e2e74eb1
commit
10a60cf303
4 files changed
+2115
-72
No files matched your search
@@ -45,6 +45,9 @@ insert_final_newline = unset
|
||||
trim_trailing_whitespace = unset
|
||||
insert_final_newline = unset
|
||||
|
||||
[vendor/**.patch]
|
||||
trim_trailing_whitespace = unset
|
||||
|
||||
[tools/ui/**]
|
||||
indent_style = unset
|
||||
indent_size = unset
|
||||
|
||||
@@ -101,6 +101,13 @@ patches = {
|
||||
)],
|
||||
}
|
||||
|
||||
# local changes too large for the replacements above, kept as diffs and applied with git apply
|
||||
patch_files = [
|
||||
# backport of the fix for the stack overflow on deeply nested values (nlohmann/json#5387)
|
||||
# TODO: remove once nlohmann/json releases a version newer than 3.12.0
|
||||
"vendor/nlohmann/json-deep-nesting.patch",
|
||||
]
|
||||
|
||||
for url, filename in vendor.items():
|
||||
print(f"downloading {url} to {filename}") # noqa: NP100
|
||||
urllib.request.urlretrieve(url, filename)
|
||||
@@ -117,6 +124,14 @@ for filename, replacements in patches.items():
|
||||
with open(filename, "w", encoding="utf-8", newline="") as f:
|
||||
f.write(content)
|
||||
|
||||
for patch_file in patch_files:
|
||||
print(f"applying {patch_file}") # noqa: NP100
|
||||
try:
|
||||
subprocess.check_call(["git", "apply", patch_file])
|
||||
except subprocess.CalledProcessError:
|
||||
print(f"Error: cannot apply {patch_file}, upstream code has changed") # noqa: NP100
|
||||
sys.exit(1)
|
||||
|
||||
print("Splitting httplib.h...") # noqa: NP100
|
||||
try:
|
||||
subprocess.check_call([
|
||||
|
||||
+1184
File diff suppressed because it is too large.
Load diff
Vendored
+913
-72
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user