File: 0003-switch-to-the-single-header-Rapid-YAML-upgrade-to-v0.patch

package info (click to toggle)
jsonnet 0.20.0%2Bds-3.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,376 kB
  • sloc: cpp: 66,583; ansic: 8,227; python: 2,833; sh: 1,948; javascript: 1,417; makefile: 197; java: 140
file content (71 lines) | stat: -rw-r--r-- 2,857 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From: Bastian Germann
Subject: Build with system Rapid YAML
---
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +123,6 @@ endif()
 add_subdirectory(include)
 add_subdirectory(stdlib)
 add_subdirectory(third_party/md5)
-add_subdirectory(third_party/rapidyaml/rapidyaml ryml)
 add_subdirectory(core)
 add_subdirectory(cpp)
 add_subdirectory(cmd)
--- a/Makefile
+++ b/Makefile
@@ -28,10 +28,10 @@ OPT ?= -O3
 PREFIX ?= /usr/local
 
 CXXFLAGS ?= -g $(OPT) -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++17 -fPIC
-CXXFLAGS += -Iinclude -Ithird_party/md5 -Ithird_party/json -Ithird_party/rapidyaml/rapidyaml/src/ -Ithird_party/rapidyaml/rapidyaml/ext/c4core/src/
+CXXFLAGS += -Iinclude -Ithird_party/md5
 CFLAGS ?= -g $(OPT) -Wall -Wextra -pedantic -std=c99 -fPIC
 CFLAGS += -Iinclude
-MAKEDEPENDFLAGS += -Iinclude -Ithird_party/md5 -Ithird_party/json -Ithird_party/rapidyaml/rapidyaml/src/ -Ithird_party/rapidyaml/rapidyaml/ext/c4core/src/
+MAKEDEPENDFLAGS += -Iinclude -Ithird_party/md5
 LDFLAGS ?=
 
 
--- a/core/vm.cpp
+++ b/core/vm.cpp
@@ -1637,7 +1636,7 @@ class Interpreter {
     }
 
     const ryml::Tree treeFromString(const std::string& s) {
-        return ryml::parse(c4::to_csubstr(s));
+        return ryml::parse_in_arena(ryml::to_csubstr(s));
     }
 
     const std::vector<std::string> split(const std::string& s, const std::string& delimiter) {
--- a/setup.py
+++ b/setup.py
@@ -32,18 +32,6 @@ LIB_OBJECTS = [
     'core/string_utils.o',
     'core/vm.o',
     'third_party/md5/md5.o',
-    'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/char_traits.o',
-    'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/base64.o',
-    'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/language.o',
-    'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/memory_util.o',
-    'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/format.o',
-    'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/time.o',
-    'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/memory_resource.o',
-    'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/error.o',
-    'third_party/rapidyaml/rapidyaml/src/c4/yml/parse.o',
-    'third_party/rapidyaml/rapidyaml/src/c4/yml/preprocess.o',
-    'third_party/rapidyaml/rapidyaml/src/c4/yml/common.o',
-    'third_party/rapidyaml/rapidyaml/src/c4/yml/tree.o',
 ]
 
 MODULE_SOURCES = ['python/_jsonnet.c']
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -30,7 +30,7 @@ set(LIBJSONNET_SOURCE
 
 add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE})
 add_dependencies(libjsonnet md5 stdlib)
-target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml)
+target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml c4core)
 
 file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/../include/libjsonnet.h JSONNET_VERSION_DEF
      REGEX "[#]define[ \t]+LIB_JSONNET_VERSION[ \t]+")