makiri 0.9.0 → 0.10.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +129 -6
  3. data/.github/workflows/conformance.yml +12 -0
  4. data/.github/workflows/libfuzzer.yml +62 -31
  5. data/.github/workflows/release.yml +17 -2
  6. data/.github/workflows/security.yml +111 -41
  7. data/.github/workflows/valgrind.yml +26 -6
  8. data/.github/workflows/verify.yml +23 -15
  9. data/CHANGELOG.md +138 -24
  10. data/NOKOGIRI_DIFFERENCES.md +170 -0
  11. data/NOTICE +3 -2
  12. data/README.md +13 -153
  13. data/Rakefile +475 -129
  14. data/ext/makiri/rust/Cargo.lock +301 -0
  15. data/ext/makiri/rust/Cargo.toml +116 -0
  16. data/ext/makiri/rust/build.rs +426 -0
  17. data/ext/makiri/rust/clippy.toml +40 -0
  18. data/ext/makiri/rust/extconf.rb +422 -0
  19. data/ext/makiri/rust/fuzz/Cargo.lock +303 -0
  20. data/ext/makiri/rust/fuzz/Cargo.toml +63 -0
  21. data/ext/makiri/rust/fuzz/build.rs +7 -0
  22. data/ext/makiri/rust/fuzz/fuzz_targets/common.rs +87 -0
  23. data/ext/makiri/rust/fuzz/fuzz_targets/css.rs +79 -0
  24. data/ext/makiri/rust/fuzz/fuzz_targets/html.rs +24 -0
  25. data/ext/makiri/rust/fuzz/fuzz_targets/html_xpath.rs +77 -0
  26. data/ext/makiri/rust/fuzz/fuzz_targets/xml.rs +17 -0
  27. data/ext/makiri/rust/fuzz/fuzz_targets/xml_xpath.rs +66 -0
  28. data/ext/makiri/rust/fuzz/fuzz_targets/xpath.rs +60 -0
  29. data/ext/makiri/rust/src/bridge/alloc.rs +38 -0
  30. data/ext/makiri/rust/src/bridge/doc.rs +163 -0
  31. data/ext/makiri/rust/src/bridge/fragment.rs +200 -0
  32. data/ext/makiri/rust/src/bridge/gvl.rs +82 -0
  33. data/ext/makiri/rust/src/bridge/html.rs +513 -0
  34. data/ext/makiri/rust/src/bridge/mod.rs +66 -0
  35. data/ext/makiri/rust/src/bridge/node_set.rs +650 -0
  36. data/ext/makiri/rust/src/bridge/ruby.rs +356 -0
  37. data/ext/makiri/rust/src/bridge/string.rs +570 -0
  38. data/ext/makiri/rust/src/bridge/typed.rs +316 -0
  39. data/ext/makiri/rust/src/bridge/wrapper.rs +484 -0
  40. data/ext/makiri/rust/src/bridge/xml.rs +561 -0
  41. data/ext/makiri/rust/src/bridge/xml_decode.rs +198 -0
  42. data/ext/makiri/rust/src/bridge/xpath/context_object.rs +299 -0
  43. data/ext/makiri/rust/src/bridge/xpath/handler.rs +307 -0
  44. data/ext/makiri/rust/src/bridge/xpath/mod.rs +307 -0
  45. data/ext/makiri/rust/src/caught.rs +86 -0
  46. data/ext/makiri/rust/src/cbuf/verify.rs +242 -0
  47. data/ext/makiri/rust/src/cbuf.rs +447 -0
  48. data/ext/makiri/rust/src/css/build.rs +212 -0
  49. data/ext/makiri/rust/src/css/lower.rs +669 -0
  50. data/ext/makiri/rust/src/css/mod.rs +156 -0
  51. data/ext/makiri/rust/src/cutf8/verify.rs +143 -0
  52. data/ext/makiri/rust/src/cutf8.rs +163 -0
  53. data/ext/makiri/rust/src/falloc/calloc_verify.rs +139 -0
  54. data/ext/makiri/rust/src/falloc/cstr.rs +53 -0
  55. data/ext/makiri/rust/src/falloc/inject.rs +44 -0
  56. data/ext/makiri/rust/src/falloc/mod.rs +337 -0
  57. data/ext/makiri/rust/src/falloc/raw.rs +62 -0
  58. data/ext/makiri/rust/src/falloc/verify.rs +64 -0
  59. data/ext/makiri/rust/src/glue/css.rs +21 -0
  60. data/ext/makiri/rust/src/glue/html_doc.rs +179 -0
  61. data/ext/makiri/rust/src/glue/html_node/css.rs +115 -0
  62. data/ext/makiri/rust/src/glue/html_node/mod.rs +253 -0
  63. data/ext/makiri/rust/src/glue/html_node/mutate.rs +301 -0
  64. data/ext/makiri/rust/src/glue/html_node/read.rs +532 -0
  65. data/ext/makiri/rust/src/glue/html_node/serialize.rs +80 -0
  66. data/ext/makiri/rust/src/glue/mod.rs +59 -0
  67. data/ext/makiri/rust/src/glue/node.rs +39 -0
  68. data/ext/makiri/rust/src/glue/node_set.rs +170 -0
  69. data/ext/makiri/rust/src/glue/query.rs +274 -0
  70. data/ext/makiri/rust/src/glue/stylesheet.rs +170 -0
  71. data/ext/makiri/rust/src/glue/xml_doc.rs +154 -0
  72. data/ext/makiri/rust/src/glue/xml_node/css.rs +109 -0
  73. data/ext/makiri/rust/src/glue/xml_node/mod.rs +225 -0
  74. data/ext/makiri/rust/src/glue/xml_node/mutate.rs +334 -0
  75. data/ext/makiri/rust/src/glue/xml_node/ns.rs +106 -0
  76. data/ext/makiri/rust/src/glue/xml_node/read.rs +295 -0
  77. data/ext/makiri/rust/src/glue/xml_node/serialize.rs +130 -0
  78. data/ext/makiri/rust/src/glue/xml_node/strings.rs +25 -0
  79. data/ext/makiri/rust/src/glue/xpath_context.rs +98 -0
  80. data/ext/makiri/rust/src/gvl.rs +162 -0
  81. data/ext/makiri/rust/src/init.rs +455 -0
  82. data/ext/makiri/rust/src/lexbor/abi.rs +202 -0
  83. data/ext/makiri/rust/src/lexbor/adapter/arena_bytes.rs +79 -0
  84. data/ext/makiri/rust/src/lexbor/adapter/cross_import.rs +425 -0
  85. data/ext/makiri/rust/src/lexbor/adapter/dom_index.rs +185 -0
  86. data/ext/makiri/rust/src/lexbor/adapter/html/build.rs +385 -0
  87. data/ext/makiri/rust/src/lexbor/adapter/html/mod.rs +961 -0
  88. data/ext/makiri/rust/src/lexbor/adapter/html/mutate.rs +321 -0
  89. data/ext/makiri/rust/src/lexbor/adapter/mod.rs +18 -0
  90. data/ext/makiri/rust/src/lexbor/adapter/post_parse.rs +312 -0
  91. data/ext/makiri/rust/src/lexbor/adapter/source_loc.rs +303 -0
  92. data/ext/makiri/rust/src/lexbor/adapter/text_index.rs +235 -0
  93. data/ext/makiri/rust/src/lexbor/adapter/utf8_input.rs +114 -0
  94. data/ext/makiri/rust/src/lexbor/css_engine.rs +183 -0
  95. data/ext/makiri/rust/src/lexbor/css_parser.rs +514 -0
  96. data/ext/makiri/rust/src/lexbor/fragment.rs +302 -0
  97. data/ext/makiri/rust/src/lexbor/mod.rs +39 -0
  98. data/ext/makiri/rust/src/lexbor/selectors.rs +565 -0
  99. data/ext/makiri/rust/src/lexbor/serialize.rs +128 -0
  100. data/ext/makiri/rust/src/lexbor/stylesheet.rs +480 -0
  101. data/ext/makiri/rust/src/lexbor/xpath.rs +318 -0
  102. data/ext/makiri/rust/src/lib.rs +129 -0
  103. data/ext/makiri/rust/src/limits.rs +10 -0
  104. data/ext/makiri/rust/src/ptr_table.rs +228 -0
  105. data/ext/makiri/rust/src/rust_tests.rs +527 -0
  106. data/ext/makiri/rust/src/text.rs +185 -0
  107. data/ext/makiri/rust/src/token.rs +114 -0
  108. data/ext/makiri/rust/src/xml/api.rs +18 -0
  109. data/ext/makiri/rust/src/xml/arena.rs +667 -0
  110. data/ext/makiri/rust/src/xml/chars.rs +287 -0
  111. data/ext/makiri/rust/src/xml/encoding_sniff.rs +168 -0
  112. data/ext/makiri/rust/src/xml/index.rs +142 -0
  113. data/ext/makiri/rust/src/xml/mod.rs +29 -0
  114. data/ext/makiri/rust/src/xml/model.rs +382 -0
  115. data/ext/makiri/rust/src/xml/mutate.rs +1159 -0
  116. data/ext/makiri/rust/src/xml/parse.rs +46 -0
  117. data/ext/makiri/rust/src/xml/qname.rs +194 -0
  118. data/ext/makiri/rust/src/xml/selftest.rs +1051 -0
  119. data/ext/makiri/rust/src/xml/serialize.rs +729 -0
  120. data/ext/makiri/rust/src/xml/tree.rs +1467 -0
  121. data/ext/makiri/rust/src/xml/verify.rs +105 -0
  122. data/ext/makiri/rust/src/xml/xpath.rs +219 -0
  123. data/ext/makiri/rust/src/xpath/abi.rs +25 -0
  124. data/ext/makiri/rust/src/xpath/ast.rs +213 -0
  125. data/ext/makiri/rust/src/xpath/ast_ops.rs +159 -0
  126. data/ext/makiri/rust/src/xpath/attr_pred.rs +100 -0
  127. data/ext/makiri/rust/src/xpath/axis.rs +249 -0
  128. data/ext/makiri/rust/src/xpath/ctx.rs +422 -0
  129. data/ext/makiri/rust/src/xpath/dom.rs +201 -0
  130. data/ext/makiri/rust/src/xpath/eval.rs +916 -0
  131. data/ext/makiri/rust/src/xpath/funcs/ext.rs +115 -0
  132. data/ext/makiri/rust/src/xpath/funcs/mod.rs +1117 -0
  133. data/ext/makiri/rust/src/xpath/lex.rs +372 -0
  134. data/ext/makiri/rust/src/xpath/limits.rs +316 -0
  135. data/ext/makiri/rust/src/xpath/mod.rs +67 -0
  136. data/ext/makiri/rust/src/xpath/msg.rs +257 -0
  137. data/ext/makiri/rust/src/xpath/nodetest.rs +191 -0
  138. data/ext/makiri/rust/src/xpath/number.rs +158 -0
  139. data/ext/makiri/rust/src/xpath/order.rs +397 -0
  140. data/ext/makiri/rust/src/xpath/parse.rs +666 -0
  141. data/ext/makiri/rust/src/xpath/step_index.rs +157 -0
  142. data/ext/makiri/rust/src/xpath/str_cache.rs +97 -0
  143. data/ext/makiri/rust/src/xpath/tests.rs +319 -0
  144. data/ext/makiri/rust/src/xpath/value.rs +529 -0
  145. data/ext/makiri/rust/src/xpath/verify.rs +125 -0
  146. data/lib/makiri/attr.rb +1 -1
  147. data/lib/makiri/css.rb +1 -1
  148. data/lib/makiri/document_fragment.rb +2 -2
  149. data/lib/makiri/document_type.rb +1 -1
  150. data/lib/makiri/element.rb +1 -1
  151. data/lib/makiri/html/node_methods.rb +1 -1
  152. data/lib/makiri/html.rb +2 -1
  153. data/lib/makiri/node.rb +3 -11
  154. data/lib/makiri/version.rb +1 -1
  155. data/lib/makiri/xml/builder.rb +1 -1
  156. data/lib/makiri/xml/document.rb +2 -1
  157. data/lib/makiri/xml/namespace.rb +17 -0
  158. data/lib/makiri/xml/node_methods.rb +9 -2
  159. data/lib/makiri/xml.rb +2 -2
  160. data/lib/makiri/xpath_context.rb +3 -3
  161. data/lib/makiri.rb +2 -1
  162. data/script/api_manifest.rb +151 -0
  163. data/script/build_native_gem.rb +3 -0
  164. data/script/check_alloc_failures.rb +215 -1
  165. data/script/check_leaks.rb +1 -1
  166. data/script/check_unsafe_boundaries.rb +408 -0
  167. data/script/leaks_harness.rb +6 -0
  168. data/suppressions/ruby.supp +16 -0
  169. data/tools/pe_exports.rb +124 -0
  170. data/vendor/lexbor/CMakeLists.txt +23 -16
  171. data/vendor/lexbor/config.cmake +3 -3
  172. data/vendor/lexbor/lexbor.pc.in +2 -2
  173. data/vendor/lexbor/source/lexbor/core/conv.c +13 -8
  174. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.c +3 -0
  175. data/vendor/lexbor/source/lexbor/css/selectors/selector.c +30 -3
  176. data/vendor/lexbor/source/lexbor/css/selectors/state.c +34 -5
  177. data/vendor/lexbor/source/lexbor/css/syntax/parser.c +38 -12
  178. data/vendor/lexbor/source/lexbor/css/syntax/state.c +100 -115
  179. data/vendor/lexbor/source/lexbor/dom/interfaces/attr_const.h +74 -39
  180. data/vendor/lexbor/source/lexbor/dom/interfaces/attr_res.h +150 -34
  181. data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.c +1 -1
  182. data/vendor/lexbor/source/lexbor/encoding/encode.c +16 -3
  183. data/vendor/lexbor/source/lexbor/html/attribute_steps_res.h +4 -2
  184. data/vendor/lexbor/source/lexbor/html/element_steps_res.h +4 -2
  185. data/vendor/lexbor/source/lexbor/html/encoding.c +12 -3
  186. data/vendor/lexbor/source/lexbor/html/interface_res.h +36 -2
  187. data/vendor/lexbor/source/lexbor/html/serialize.c +1 -1
  188. data/vendor/lexbor/source/lexbor/html/serialize_ext.c +1 -1
  189. data/vendor/lexbor/source/lexbor/html/tag_res.h +11 -2
  190. data/vendor/lexbor/source/lexbor/html/token.c +1 -0
  191. data/vendor/lexbor/source/lexbor/html/token.h +17 -0
  192. data/vendor/lexbor/source/lexbor/html/tokenizer/error.c +5 -1
  193. data/vendor/lexbor/source/lexbor/html/tokenizer/error.h +8 -0
  194. data/vendor/lexbor/source/lexbor/html/tokenizer/state.c +361 -5
  195. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_body.c +12 -1
  196. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_frameset.c +12 -1
  197. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_body.c +11 -0
  198. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_frameset.c +10 -0
  199. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_head.c +10 -0
  200. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_head.c +10 -0
  201. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_html.c +11 -0
  202. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/foreign_content.c +17 -0
  203. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_body.c +32 -20
  204. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_column_group.c +17 -0
  205. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_frameset.c +10 -0
  206. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head.c +10 -0
  207. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head_noscript.c +1 -0
  208. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table.c +18 -0
  209. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_template.c +1 -0
  210. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/initial.c +11 -0
  211. data/vendor/lexbor/source/lexbor/html/tree/open_elements_res.h +4 -2
  212. data/vendor/lexbor/source/lexbor/html/tree.c +42 -0
  213. data/vendor/lexbor/source/lexbor/html/tree.h +5 -0
  214. data/vendor/lexbor/source/lexbor/ns/res.h +38 -38
  215. data/vendor/lexbor/source/lexbor/selectors/selectors.c +83 -2
  216. data/vendor/lexbor/source/lexbor/style/attribute_steps_res.h +4 -2
  217. data/vendor/lexbor/source/lexbor/style/dom/interfaces/document.c +4 -0
  218. data/vendor/lexbor/source/lexbor/style/element_steps_res.h +4 -2
  219. data/vendor/lexbor/source/lexbor/style/tree/open_elements_res.h +4 -2
  220. data/vendor/lexbor/source/lexbor/tag/const.h +203 -202
  221. data/vendor/lexbor/source/lexbor/tag/res.h +136 -134
  222. data/vendor/lexbor/source/lexbor/unicode/idna.c +19 -9
  223. data/vendor/lexbor/source/lexbor/url/base.h +1 -1
  224. data/vendor/lexbor/source/lexbor/url/url.c +147 -52
  225. data/vendor/lexbor/source/lexbor/url/url.h +122 -0
  226. data/vendor/lexbor/source/lexbor/utils/http.c +22 -1
  227. metadata +153 -98
  228. data/ext/makiri/bridge/bridge.h +0 -134
  229. data/ext/makiri/bridge/bridge_internal.h +0 -28
  230. data/ext/makiri/bridge/ruby_string.c +0 -263
  231. data/ext/makiri/bridge/text_token.c +0 -9
  232. data/ext/makiri/bridge/xml_decode.c +0 -237
  233. data/ext/makiri/core/mkr_alloc.c +0 -131
  234. data/ext/makiri/core/mkr_alloc.h +0 -141
  235. data/ext/makiri/core/mkr_buf.c +0 -103
  236. data/ext/makiri/core/mkr_buf.h +0 -165
  237. data/ext/makiri/core/mkr_core.h +0 -30
  238. data/ext/makiri/core/mkr_core_selftest.c +0 -244
  239. data/ext/makiri/core/mkr_hash.h +0 -58
  240. data/ext/makiri/core/mkr_span.h +0 -186
  241. data/ext/makiri/core/mkr_text.h +0 -177
  242. data/ext/makiri/core/mkr_utf8.c +0 -101
  243. data/ext/makiri/core/mkr_utf8.h +0 -95
  244. data/ext/makiri/dom_adapter/compat.h +0 -197
  245. data/ext/makiri/dom_adapter/compat_internal.h +0 -41
  246. data/ext/makiri/dom_adapter/cross_import.c +0 -469
  247. data/ext/makiri/dom_adapter/cross_import.h +0 -35
  248. data/ext/makiri/dom_adapter/dom_index.c +0 -334
  249. data/ext/makiri/dom_adapter/post_parse.c +0 -242
  250. data/ext/makiri/dom_adapter/source_loc.c +0 -258
  251. data/ext/makiri/dom_adapter/text_index.c +0 -291
  252. data/ext/makiri/dom_adapter/utf8_input.c +0 -114
  253. data/ext/makiri/extconf.rb +0 -273
  254. data/ext/makiri/fuzz/Makefile +0 -103
  255. data/ext/makiri/fuzz/check_fuzzer.cc +0 -4
  256. data/ext/makiri/fuzz/xml_fuzz.c +0 -24
  257. data/ext/makiri/fuzz/xml_xpath_fuzz.c +0 -87
  258. data/ext/makiri/fuzz/xpath_fuzz.c +0 -114
  259. data/ext/makiri/glue/cross_import.h +0 -30
  260. data/ext/makiri/glue/glue.h +0 -139
  261. data/ext/makiri/glue/ruby_doc.c +0 -665
  262. data/ext/makiri/glue/ruby_html_css.c +0 -381
  263. data/ext/makiri/glue/ruby_html_mutate.c +0 -842
  264. data/ext/makiri/glue/ruby_html_node.c +0 -964
  265. data/ext/makiri/glue/ruby_html_serialize.c +0 -154
  266. data/ext/makiri/glue/ruby_lexbor_css.c +0 -462
  267. data/ext/makiri/glue/ruby_node.c +0 -159
  268. data/ext/makiri/glue/ruby_node_set.c +0 -460
  269. data/ext/makiri/glue/ruby_xml.c +0 -600
  270. data/ext/makiri/glue/ruby_xml_node.c +0 -2002
  271. data/ext/makiri/glue/ruby_xpath.c +0 -761
  272. data/ext/makiri/glue/ruby_xpath.h +0 -19
  273. data/ext/makiri/makiri.c +0 -276
  274. data/ext/makiri/makiri.h +0 -97
  275. data/ext/makiri/xml/mkr_xml.h +0 -135
  276. data/ext/makiri/xml/mkr_xml_chars.c +0 -227
  277. data/ext/makiri/xml/mkr_xml_index.c +0 -169
  278. data/ext/makiri/xml/mkr_xml_index.h +0 -48
  279. data/ext/makiri/xml/mkr_xml_mutate.c +0 -1154
  280. data/ext/makiri/xml/mkr_xml_mutate.h +0 -201
  281. data/ext/makiri/xml/mkr_xml_node.c +0 -408
  282. data/ext/makiri/xml/mkr_xml_node.h +0 -225
  283. data/ext/makiri/xml/mkr_xml_tree.c +0 -1550
  284. data/ext/makiri/xpath/mkr_css.c +0 -1008
  285. data/ext/makiri/xpath/mkr_css.h +0 -65
  286. data/ext/makiri/xpath/mkr_xpath.c +0 -726
  287. data/ext/makiri/xpath/mkr_xpath.h +0 -249
  288. data/ext/makiri/xpath/mkr_xpath_engine_html.c +0 -17
  289. data/ext/makiri/xpath/mkr_xpath_engine_xml.c +0 -12
  290. data/ext/makiri/xpath/mkr_xpath_eval_body.h +0 -1828
  291. data/ext/makiri/xpath/mkr_xpath_funcs_body.h +0 -1118
  292. data/ext/makiri/xpath/mkr_xpath_internal.h +0 -599
  293. data/ext/makiri/xpath/mkr_xpath_lex.c +0 -233
  294. data/ext/makiri/xpath/mkr_xpath_node_access_html.h +0 -138
  295. data/ext/makiri/xpath/mkr_xpath_node_access_xml.h +0 -145
  296. data/ext/makiri/xpath/mkr_xpath_number.c +0 -109
  297. data/ext/makiri/xpath/mkr_xpath_parse.c +0 -768
  298. data/ext/makiri/xpath/mkr_xpath_prelude_html.h +0 -30
  299. data/ext/makiri/xpath/mkr_xpath_prelude_xml.h +0 -28
  300. data/ext/makiri/xpath/mkr_xpath_shared.c +0 -609
  301. data/ext/makiri/xpath/mkr_xpath_value_body.h +0 -790
  302. data/ext/makiri/xpath/mkr_xpath_xml_selftest.c +0 -73
  303. data/script/check_c_safety.rb +0 -324
  304. data/script/check_c_safety_allowlist.yml +0 -108
  305. data/verify/Makefile +0 -237
  306. data/verify/cbmc_models.c +0 -38
  307. data/verify/harness_alloc.c +0 -257
  308. data/verify/harness_buf.c +0 -167
  309. data/verify/harness_hash.c +0 -28
  310. data/verify/harness_span.c +0 -213
  311. data/verify/harness_spanbuf.c +0 -98
  312. data/verify/harness_utf8.c +0 -70
  313. data/verify/harness_utf8_chain.c +0 -64
  314. data/verify/harness_utf8_words.c +0 -54
  315. data/verify/harness_xml_chars.c +0 -59
  316. data/verify/harness_xml_expand.c +0 -72
  317. data/verify/harness_xml_parse.c +0 -42
  318. data/verify/harness_xpath_lex.c +0 -51
  319. data/verify/harness_xpath_number.c +0 -68
  320. data/verify/harness_xpath_parse.c +0 -57
  321. data/verify/selftest_main.c +0 -16
  322. data/verify/stub.c +0 -10
  323. data/verify/verify.h +0 -54
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ece0ed1298dbb761fbaeecc7e497b20ee69766c988ef5e0c671e282a3a455de9
4
- data.tar.gz: a909b7cbd715ad23e58f5c4f649298c6ca4472c9004423eb73930baadea205ec
3
+ metadata.gz: c7dc5843dd369edd0bcae884c8b4f23dbdb854de335b51c99e1474858c9c49f6
4
+ data.tar.gz: ba1aeb6c3363450fc0212f5ce814c971b0e2eaf8dfd3f927703cfa2a667fdc35
5
5
  SHA512:
6
- metadata.gz: 265f7671dd689039fb98a41513b45fa2b3dae542f9a99942832fe25e36c1b4e7430caf8c14f39c3832947819258a850cacca556ef278785356d616d5b132cd16
7
- data.tar.gz: 7bed0126338689b1e5c2bbf47b60d9550352b471162f80b030cad11141158efbd7a293f48551be73bbdfe1ac9d24cab6c0074ff46ef5d01e2aa404888e147c0e
6
+ metadata.gz: f1699b0cdd955116e52a2b575abfa5dbfbbdaecd43d3217844020828d18af341505e2df25539a8c5086ad619c85fe099f679054a1cf562067d6ec159977aee73
7
+ data.tar.gz: 666692b6b9597640c6092a8407594a380fa6dfd6682844c1fecc4ce85ea5381e5dc49877210e3684ac3a10ab09f9b30a49cef4939b7f113fdc8d6e359b608156
@@ -30,12 +30,111 @@ jobs:
30
30
  ruby-version: ${{ matrix.ruby }}
31
31
  bundler-cache: true
32
32
 
33
- - name: Compile the extension (builds vendored Lexbor, then the ext)
33
+ # The extension is a Rust crate, so a toolchain is part of the build the
34
+ # way a C compiler used to be. (`rake ports` stood here and checked that
35
+ # the port table, Cargo.toml, this file and lib.rs agreed about which C
36
+ # each flag replaced. There is no table, no flags and no C left for it to
37
+ # check.)
38
+ - uses: dtolnay/rust-toolchain@stable
39
+ with:
40
+ # RubyInstaller's Ruby is a MinGW build, but a default rustup on
41
+ # Windows installs the MSVC host - and rb-sys will not generate
42
+ # bindings from Ruby's headers across that ABI boundary. extconf.rb
43
+ # names the GNU triple; this installs the std that goes with it.
44
+ # Empty elsewhere, so the other runners are unaffected.
45
+ targets: ${{ runner.os == 'Windows' && 'x86_64-pc-windows-gnu' || '' }}
46
+
47
+ # rb-sys runs bindgen at build time to generate bindings against the local
48
+ # Ruby, and bindgen needs libclang. The runner image ships one; installing
49
+ # it explicitly is what keeps a base-image change from turning into
50
+ # "Unable to find libclang" in the cargo step.
51
+ # clang/lld/llvm are for the vendored Lexbor's LTO, not for bindgen: on
52
+ # Linux the whole chain has to be LLVM or extconf turns LTO off (gcc emits
53
+ # GIMPLE, which rust-lld cannot read - see the note in extconf.rb). It
54
+ # DETECTS them, so a runner without them still builds, just without LTO;
55
+ # installing them here is what makes CI exercise the fast path.
56
+ - name: Install libclang (bindgen) and the LLVM chain (Lexbor LTO)
57
+ if: runner.os == 'Linux'
58
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev clang lld llvm
59
+
60
+ - name: Compile the extension (builds vendored Lexbor, then the crate)
34
61
  run: bundle exec rake compile
35
62
 
63
+ # Warnings are errors: the lints that matter here are the project's own -
64
+ # `clippy.toml`'s disallowed-methods is what enforces that every heap
65
+ # allocation goes through `falloc`, which is the invariant `rake oom`
66
+ # exists to exercise. An unsafe block without a stated contract and a
67
+ # raw-pointer compare that should be `ptr::eq` are the others.
68
+ #
69
+ # After `rake compile`, because build.rs generates the Lexbor layout from
70
+ # the vendored headers and those only exist once cmake has installed them.
71
+ # One cell, not twelve: `--all-features` is every configuration the crate
72
+ # has, so the other matrix cells would re-run it. This step was
73
+ # lost when the per-flag port matrix was deleted - it used to run once per
74
+ # leg with that leg's features - and nothing noticed, because the comment
75
+ # claiming it ran was in a different file.
76
+ - name: Clippy
77
+ if: matrix.os == 'ubuntu-latest' && matrix.ruby == '3.4'
78
+ working-directory: ext/makiri/rust
79
+ run: cargo clippy --all-features -- -D warnings
80
+
81
+ - name: Rust formatting
82
+ if: matrix.os == 'ubuntu-latest' && matrix.ruby == '3.4'
83
+ working-directory: ext/makiri/rust
84
+ run: cargo fmt --all -- --check
85
+
86
+ # The cargo-fuzz crate is a separate crate that nothing else here builds,
87
+ # so an engine API change used to break it silently until the nightly
88
+ # run. Formatting and clippy on stable prove it still compiles and stays
89
+ # tidy against this commit; libFuzzer and the sanitizer stay nightly-only
90
+ # (libfuzzer.yml).
91
+ - name: Fuzz crate checks
92
+ if: matrix.os == 'ubuntu-latest' && matrix.ruby == '3.4'
93
+ working-directory: ext/makiri/rust/fuzz
94
+ run: |
95
+ cargo fmt -- --check
96
+ cargo clippy --all-targets -- -D warnings
97
+
98
+ # Fast, Ruby- and Lexbor-free checks for the Rust core. Kani proves the
99
+ # bounded symbolic contracts in verify.yml; this executes exhaustive
100
+ # small-domain and regression properties on every ordinary CI run.
101
+ - name: Rust core tests
102
+ if: matrix.os == 'ubuntu-latest' && matrix.ruby == '3.4'
103
+ run: bundle exec rake rust:test
104
+
105
+ # The Rust port has a small, explicitly audited unsafe perimeter. This
106
+ # catches a raw operation added to a parsing primitive, or a new mutable
107
+ # global added without a GVL/ownership proof.
108
+ - name: Unsafe-boundary gate
109
+ if: matrix.os == 'ubuntu-latest' && matrix.ruby == '3.4'
110
+ run: bundle exec rake unsafe:boundaries
111
+
112
+ # Only Init_makiri may be exported (or another Lexbor-based gem in the
113
+ # same process binds to our Lexbor and segfaults - CLAUDE.md), and no
114
+ # Lexbor/Makiri symbol may be left undefined (it would be a NULL call).
115
+ # The export half is enforced at the SOURCE - only Init_makiri is
116
+ # #[no_mangle] - because on ELF nothing else works: objcopy cannot remove
117
+ # an entry from a linked .so's .dynsym, and a second --version-script is
118
+ # merged rather than applied. This gate is what proves it held.
119
+ # One cell, like the Rust-only checks above: the symbol table does not
120
+ # vary by OS or Ruby.
121
+ - name: Symbol gate
122
+ if: matrix.os == 'ubuntu-latest' && matrix.ruby == '3.4'
123
+ run: bundle exec rake symbols
124
+
36
125
  # The :threading suite is heavy (GC.stress across threads) and checks a
37
126
  # structural property that does not vary by OS/Ruby, so run it on a single
38
127
  # representative job; the rest of the matrix skips it for a fast run.
128
+ #
129
+ # The recorded C-build differential. It was a tautology while the C was
130
+ # still what built here, and recording it then was the whole point: it is
131
+ # now the only surviving check that this build answers what the C
132
+ # answered, and it cannot be re-recorded. Again one cell: the answers do
133
+ # not vary by OS or Ruby.
134
+ - name: Differential
135
+ if: matrix.os == 'ubuntu-latest' && matrix.ruby == '3.4'
136
+ run: bundle exec rake diff
137
+
39
138
  - name: Run the test suite
40
139
  run: bundle exec rake spec
41
140
  env:
@@ -46,7 +145,11 @@ jobs:
46
145
  run: bundle exec ruby -Ilib -r makiri -e 'p Makiri::VERSION'
47
146
 
48
147
  sanitize:
49
- name: AddressSanitizer + UBSan (Ruby ${{ matrix.ruby }})
148
+ # AddressSanitizer only. UBSan used to run beside it over the C sources;
149
+ # rustc's -Zsanitizer has no `undefined`, so with the C retired there is
150
+ # nothing for it to instrument. Naming the job for what it runs keeps a
151
+ # green tick from claiming coverage that no longer exists.
152
+ name: AddressSanitizer (Ruby ${{ matrix.ruby }})
50
153
  runs-on: ubuntu-latest
51
154
  strategy:
52
155
  fail-fast: false
@@ -61,14 +164,34 @@ jobs:
61
164
  - name: Ensure cmake is available
62
165
  uses: lukka/get-cmake@latest
63
166
 
167
+ # Nightly, not stable: -Zsanitizer is unstable, and extconf refuses to
168
+ # build the crate uninstrumented when ASan is asked for rather than
169
+ # quietly producing a run that checks nothing.
170
+ - uses: dtolnay/rust-toolchain@nightly
171
+
172
+ - name: Install libclang (bindgen, via rb-sys)
173
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
174
+
64
175
  - name: Set up Ruby
65
176
  uses: ruby/setup-ruby@v1
66
177
  with:
67
178
  ruby-version: ${{ matrix.ruby }}
68
179
  bundler-cache: true
69
180
 
70
- # Builds the ext with -fsanitize=address,undefined and runs the whole
71
- # spec suite with the ASan runtime preloaded. Any heap/UB error aborts
72
- # the run with a non-zero exit, failing the job.
73
- - name: Build + test under sanitizers
181
+ # Builds the crate with -Zsanitizer=address and runs the whole spec suite
182
+ # with the ASan runtime preloaded. Any heap error aborts the run with a
183
+ # non-zero exit, failing the job.
184
+ - name: Build + test under AddressSanitizer
74
185
  run: bundle exec rake sanitize
186
+
187
+ # The Ruby-free engine tests under ASan too - the XPath and CSS evaluation
188
+ # cases, and the arena, tree and mutation self-checks, which reach states
189
+ # no public API can build and
190
+ # ran under `rake sanitize` while they were a Ruby hook. `--target` keeps
191
+ # the build scripts uninstrumented. Linux only: on macOS an ASan test
192
+ # binary deadlocks in dyld before main (see the Rakefile's cargo-fuzz note).
193
+ - name: Rust core tests under AddressSanitizer
194
+ working-directory: ext/makiri/rust
195
+ env:
196
+ RUSTFLAGS: -Zsanitizer=address
197
+ run: cargo test --no-default-features --features lexbor --target x86_64-unknown-linux-gnu
@@ -31,6 +31,12 @@ jobs:
31
31
  - name: Ensure cmake is available
32
32
  uses: lukka/get-cmake@latest
33
33
 
34
+ # The extension is a Rust crate; cargo is part of the build now.
35
+ - uses: dtolnay/rust-toolchain@stable
36
+
37
+ - name: Install libclang (bindgen, via rb-sys)
38
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
39
+
34
40
  - name: Set up Ruby
35
41
  uses: ruby/setup-ruby@v1
36
42
  with:
@@ -82,6 +88,12 @@ jobs:
82
88
  - name: Ensure cmake is available
83
89
  uses: lukka/get-cmake@latest
84
90
 
91
+ # The extension is a Rust crate; cargo is part of the build now.
92
+ - uses: dtolnay/rust-toolchain@stable
93
+
94
+ - name: Install libclang (bindgen, via rb-sys)
95
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
96
+
85
97
  - name: Set up Ruby
86
98
  uses: ruby/setup-ruby@v1
87
99
  with:
@@ -11,17 +11,21 @@ on:
11
11
  workflow_dispatch:
12
12
 
13
13
  jobs:
14
- # Build the libFuzzer harnesses under clang with -fsanitize=fuzzer,address
15
- # and run each target for 300s. The corpus is stored as a build artifact so
16
- # it can be seeded in subsequent runs (regression asset per the roadmap).
17
- libfuzzer-nightly:
18
- name: libFuzzer ${{ matrix.target }} (clang)
14
+ # The surfaces, coverage-guided, under cargo-fuzz.
15
+ #
16
+ # A second job stood beside this one and fuzzed the same three XML/XPath
17
+ # surfaces as C binaries built by ext/makiri/fuzz/Makefile under clang.
18
+ # Both were shipped code while the port was in progress; only one is now,
19
+ # and the C harnesses went with the sources they drove. The corpus cache
20
+ # key is unchanged, so the accumulated seeds carry over.
21
+ cargo-fuzz-nightly:
22
+ name: cargo-fuzz ${{ matrix.target }} (rust)
19
23
  runs-on: ubuntu-latest
20
24
  timeout-minutes: 360
21
25
  strategy:
22
26
  fail-fast: false
23
27
  matrix:
24
- target: [xml, xpath, xml_xpath]
28
+ target: [xml, xpath, xml_xpath, css, html, html_xpath]
25
29
 
26
30
  steps:
27
31
  - name: Checkout (with vendored Lexbor submodule)
@@ -32,52 +36,79 @@ jobs:
32
36
  - name: Ensure cmake is available
33
37
  uses: lukka/get-cmake@latest
34
38
 
39
+ # -Zsanitizer is unstable, and cargo-fuzz needs it.
40
+ - uses: dtolnay/rust-toolchain@nightly
41
+ with:
42
+ components: clippy
43
+
44
+ - name: Install libclang (bindgen, via rb-sys)
45
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
46
+
35
47
  - name: Set up Ruby
36
48
  uses: ruby/setup-ruby@v1
37
49
  with:
38
50
  ruby-version: "3.4"
39
51
  bundler-cache: true
40
52
 
41
- # Build the vendored Lexbor first (plain mode is fine; the harness links
42
- # the static archive). The fuzzer binary itself is built with ASan.
53
+ # The targets need the vendored Lexbor library and headers - the crate's
54
+ # build.rs links the archive and generates bindings from the headers.
43
55
  - name: Compile the extension (builds Lexbor)
44
56
  run: bundle exec rake compile
45
57
 
46
- - name: Install clang
47
- run: |
48
- sudo apt-get update
49
- sudo apt-get install -y clang
58
+ - name: Install cargo-fuzz
59
+ run: cargo install cargo-fuzz --locked
60
+
61
+ # The fuzz crate inherits the allocation lint from ../clippy.toml, and it
62
+ # was firing there unseen: nothing built this crate with -D warnings.
63
+ - name: Clippy the fuzz crate
64
+ working-directory: ext/makiri/rust/fuzz
65
+ run: cargo clippy --all-targets -- -D warnings
50
66
 
51
- - name: Build libFuzzer harnesses
67
+ - name: Build the fuzz targets
68
+ working-directory: ext/makiri/rust/fuzz
69
+ run: cargo fuzz build ${{ matrix.target }}
70
+
71
+ # A green fuzz run proves nothing if the sanitizer is inert, and the
72
+ # obvious check for that (nm -u | grep __asan_report) reads 0 on Linux
73
+ # whether or not the binary is instrumented, because the runtime is
74
+ # linked statically. Assert on the full symbol table instead.
75
+ - name: Assert the target is instrumented
76
+ working-directory: ext/makiri/rust/fuzz
52
77
  run: |
53
- cd ext/makiri/fuzz
54
- make clean
55
- make all
78
+ bin=$(ls target/*/release/${{ matrix.target }})
79
+ reports=$(nm "$bin" | grep -c '__asan_report')
80
+ echo "$bin: __asan_report symbols = $reports"
81
+ test "$reports" -gt 0 || { echo "not ASan-instrumented"; exit 1; }
56
82
 
57
- # Restore the previous corpus so the fuzzer starts from the accumulated
58
- # regression seeds rather than from scratch.
59
83
  - name: Restore corpus cache
60
- uses: actions/cache@v4
84
+ uses: actions/cache@v6
61
85
  with:
62
- path: ext/makiri/fuzz/corpus/${{ matrix.target }}
63
- key: libfuzzer-corpus-${{ matrix.target }}-${{ github.run_id }}
86
+ path: ext/makiri/rust/fuzz/corpus/${{ matrix.target }}
87
+ key: cargo-fuzz-corpus-${{ matrix.target }}-${{ github.run_id }}
64
88
  restore-keys: |
65
- libfuzzer-corpus-${{ matrix.target }}-
89
+ cargo-fuzz-corpus-${{ matrix.target }}-
66
90
 
67
- - name: Run libFuzzer ${{ matrix.target }} (300s)
91
+ - name: Run cargo-fuzz ${{ matrix.target }} (300s)
92
+ working-directory: ext/makiri/rust/fuzz
68
93
  run: |
69
- mkdir -p ext/makiri/fuzz/corpus/${{ matrix.target }}
70
- cd ext/makiri/fuzz
71
- ./${{ matrix.target }}_fuzz \
94
+ mkdir -p corpus/${{ matrix.target }}
95
+ cargo fuzz run ${{ matrix.target }} -- \
72
96
  -max_total_time=300 \
73
97
  -max_len=4096 \
74
- -print_final_stats=1 \
75
- corpus/${{ matrix.target }}
98
+ -print_final_stats=1
76
99
 
77
- # Save the mutated corpus as an artifact for download / seeding.
78
100
  - name: Upload corpus artifact
79
101
  uses: actions/upload-artifact@v4
80
102
  with:
81
- name: libfuzzer-corpus-${{ matrix.target }}
82
- path: ext/makiri/fuzz/corpus/${{ matrix.target }}
103
+ name: cargo-fuzz-corpus-${{ matrix.target }}
104
+ path: ext/makiri/rust/fuzz/corpus/${{ matrix.target }}
83
105
  retention-days: 7
106
+
107
+ # Anything cargo-fuzz saved under artifacts/ is a reproducer.
108
+ - name: Upload reproducers
109
+ if: failure()
110
+ uses: actions/upload-artifact@v4
111
+ with:
112
+ name: cargo-fuzz-artifacts-${{ matrix.target }}
113
+ path: ext/makiri/rust/fuzz/artifacts/${{ matrix.target }}
114
+ retention-days: 30
@@ -6,7 +6,7 @@ name: Release
6
6
  #
7
7
  # Native gems are built on each target platform's own runner — NOT
8
8
  # cross-compiled — because the extension builds vendored Lexbor with CMake using
9
- # the host toolchain (see ext/makiri/extconf.rb). Each runner compiles for
9
+ # the host toolchain (see ext/makiri/rust/extconf.rb). Each runner compiles for
10
10
  # Ruby 3.2/3.3/3.4; script/build_native_gem.rb then assembles one gem per
11
11
  # platform containing all three ABIs (lib/makiri.rb selects the right one at
12
12
  # require time). `gem install` of a native gem does not recompile or need
@@ -74,11 +74,26 @@ jobs:
74
74
  submodules: recursive
75
75
  - name: Ensure cmake is available
76
76
  uses: lukka/get-cmake@latest
77
+ # The extension is a Rust crate, so every release runner needs cargo. This
78
+ # is the job that produces the precompiled gems, which is what most users
79
+ # install - if it cannot build, the gem falls back to a source install and
80
+ # every one of those users needs a toolchain of their own.
81
+ - uses: dtolnay/rust-toolchain@stable
82
+ with:
83
+ # RubyInstaller's Ruby is a MinGW build, but a default rustup on
84
+ # Windows installs the MSVC host - and rb-sys will not generate
85
+ # bindings from Ruby's headers across that ABI boundary. extconf.rb
86
+ # names the GNU triple; this installs the std that goes with it.
87
+ # Empty elsewhere, so the other runners are unaffected.
88
+ targets: ${{ runner.os == 'Windows' && 'x86_64-pc-windows-gnu' || '' }}
89
+ - name: Install libclang (bindgen, via rb-sys)
90
+ if: runner.os == 'Linux'
91
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
77
92
  - uses: ruby/setup-ruby@v1
78
93
  with:
79
94
  ruby-version: ${{ matrix.ruby }}
80
95
  bundler-cache: true
81
- - name: Compile (builds vendored Lexbor, then the ext)
96
+ - name: Compile (builds vendored Lexbor, then the crate)
82
97
  run: bundle exec rake compile
83
98
  - name: Smoke-load
84
99
  shell: bash
@@ -9,46 +9,17 @@ on:
9
9
  workflow_dispatch:
10
10
 
11
11
  jobs:
12
- security-lint:
13
- name: C safety lint
14
- runs-on: ubuntu-latest
15
- if: github.event_name != 'schedule'
16
- steps:
17
- - name: Checkout (with vendored Lexbor submodule)
18
- uses: actions/checkout@v6
19
- with:
20
- submodules: recursive
21
-
22
- - name: Set up Ruby
23
- uses: ruby/setup-ruby@v1
24
- with:
25
- ruby-version: "3.4"
26
- bundler-cache: true
27
-
28
- - name: Run C safety lint
29
- run: bundle exec rake security:clint
30
-
31
- security-sanitize:
32
- name: ASan + UBSan security suite
33
- runs-on: ubuntu-latest
34
- if: github.event_name != 'schedule'
35
- steps:
36
- - name: Checkout (with vendored Lexbor submodule)
37
- uses: actions/checkout@v6
38
- with:
39
- submodules: recursive
40
-
41
- - name: Ensure cmake is available
42
- uses: lukka/get-cmake@latest
43
-
44
- - name: Set up Ruby
45
- uses: ruby/setup-ruby@v1
46
- with:
47
- ruby-version: "3.4"
48
- bundler-cache: true
49
-
50
- - name: Build + test under sanitizers
51
- run: bundle exec rake sanitize
12
+ # A "C safety lint" job stood here (`rake security:clint`, over
13
+ # script/check_c_safety.rb). It enforced rules about C that no longer exists -
14
+ # bounded reads through mkr_span, no raw cursor members, no unchecked size
15
+ # arithmetic. The equivalents are now type-level rather than lint-level:
16
+ # slices carry their length, and the allocation chokepoint is enforced by
17
+ # `clippy.toml`'s disallowed-methods - run with `-D warnings` by ci.yml's
18
+ # Clippy step (the crate) and libfuzzer.yml's (the fuzz crate, nightly).
19
+
20
+ # A security-sanitize job stood here and ran `rake sanitize`. ci.yml's
21
+ # `sanitize` job already does (Ruby 3.4 and 4.0) and adds the Ruby-free engine
22
+ # tests under ASan, so this was a second copy of the same run.
52
23
 
53
24
  security-fuzz-short:
54
25
  name: Short sanitized fuzz
@@ -63,6 +34,20 @@ jobs:
63
34
  - name: Ensure cmake is available
64
35
  uses: lukka/get-cmake@latest
65
36
 
37
+ # The extension is a Rust crate; cargo is part of the build now. stable is
38
+ # the default because that is what ships - but nightly has to be PRESENT
39
+ # too: -Zsanitizer is unstable, so extconf sets RUSTUP_TOOLCHAIN=nightly
40
+ # for an ASan build (and aborts rather than quietly building it plain).
41
+ # Installed uniformly across this file's jobs; the few that never sanitize
42
+ # pay one toolchain download for one block instead of nine variants.
43
+ - uses: dtolnay/rust-toolchain@stable
44
+ - name: Install the nightly toolchain (for -Zsanitizer)
45
+ run: rustup toolchain install nightly
46
+
47
+ - name: Install libclang (bindgen, via rb-sys)
48
+ if: runner.os == 'Linux'
49
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
50
+
66
51
  - name: Set up Ruby
67
52
  uses: ruby/setup-ruby@v1
68
53
  with:
@@ -89,6 +74,20 @@ jobs:
89
74
  - name: Ensure cmake is available
90
75
  uses: lukka/get-cmake@latest
91
76
 
77
+ # The extension is a Rust crate; cargo is part of the build now. stable is
78
+ # the default because that is what ships - but nightly has to be PRESENT
79
+ # too: -Zsanitizer is unstable, so extconf sets RUSTUP_TOOLCHAIN=nightly
80
+ # for an ASan build (and aborts rather than quietly building it plain).
81
+ # Installed uniformly across this file's jobs; the few that never sanitize
82
+ # pay one toolchain download for one block instead of nine variants.
83
+ - uses: dtolnay/rust-toolchain@stable
84
+ - name: Install the nightly toolchain (for -Zsanitizer)
85
+ run: rustup toolchain install nightly
86
+
87
+ - name: Install libclang (bindgen, via rb-sys)
88
+ if: runner.os == 'Linux'
89
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
90
+
92
91
  - name: Set up Ruby
93
92
  uses: ruby/setup-ruby@v1
94
93
  with:
@@ -115,6 +114,20 @@ jobs:
115
114
  - name: Ensure cmake is available
116
115
  uses: lukka/get-cmake@latest
117
116
 
117
+ # The extension is a Rust crate; cargo is part of the build now. stable is
118
+ # the default because that is what ships - but nightly has to be PRESENT
119
+ # too: -Zsanitizer is unstable, so extconf sets RUSTUP_TOOLCHAIN=nightly
120
+ # for an ASan build (and aborts rather than quietly building it plain).
121
+ # Installed uniformly across this file's jobs; the few that never sanitize
122
+ # pay one toolchain download for one block instead of nine variants.
123
+ - uses: dtolnay/rust-toolchain@stable
124
+ - name: Install the nightly toolchain (for -Zsanitizer)
125
+ run: rustup toolchain install nightly
126
+
127
+ - name: Install libclang (bindgen, via rb-sys)
128
+ if: runner.os == 'Linux'
129
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
130
+
118
131
  - name: Set up Ruby
119
132
  uses: ruby/setup-ruby@v1
120
133
  with:
@@ -144,6 +157,20 @@ jobs:
144
157
  - name: Ensure cmake is available
145
158
  uses: lukka/get-cmake@latest
146
159
 
160
+ # The extension is a Rust crate; cargo is part of the build now. stable is
161
+ # the default because that is what ships - but nightly has to be PRESENT
162
+ # too: -Zsanitizer is unstable, so extconf sets RUSTUP_TOOLCHAIN=nightly
163
+ # for an ASan build (and aborts rather than quietly building it plain).
164
+ # Installed uniformly across this file's jobs; the few that never sanitize
165
+ # pay one toolchain download for one block instead of nine variants.
166
+ - uses: dtolnay/rust-toolchain@stable
167
+ - name: Install the nightly toolchain (for -Zsanitizer)
168
+ run: rustup toolchain install nightly
169
+
170
+ - name: Install libclang (bindgen, via rb-sys)
171
+ if: runner.os == 'Linux'
172
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
173
+
147
174
  - name: Set up Ruby
148
175
  uses: ruby/setup-ruby@v1
149
176
  with:
@@ -173,6 +200,20 @@ jobs:
173
200
  - name: Ensure cmake is available
174
201
  uses: lukka/get-cmake@latest
175
202
 
203
+ # The extension is a Rust crate; cargo is part of the build now. stable is
204
+ # the default because that is what ships - but nightly has to be PRESENT
205
+ # too: -Zsanitizer is unstable, so extconf sets RUSTUP_TOOLCHAIN=nightly
206
+ # for an ASan build (and aborts rather than quietly building it plain).
207
+ # Installed uniformly across this file's jobs; the few that never sanitize
208
+ # pay one toolchain download for one block instead of nine variants.
209
+ - uses: dtolnay/rust-toolchain@stable
210
+ - name: Install the nightly toolchain (for -Zsanitizer)
211
+ run: rustup toolchain install nightly
212
+
213
+ - name: Install libclang (bindgen, via rb-sys)
214
+ if: runner.os == 'Linux'
215
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
216
+
176
217
  - name: Set up Ruby
177
218
  uses: ruby/setup-ruby@v1
178
219
  with:
@@ -183,7 +224,7 @@ jobs:
183
224
  run: bundle exec rake invariants
184
225
 
185
226
  invariants-sanitize:
186
- name: Nightly invariant checks under ASan + UBSan
227
+ name: Nightly invariant checks under AddressSanitizer
187
228
  runs-on: ubuntu-latest
188
229
  if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
189
230
  steps:
@@ -195,6 +236,20 @@ jobs:
195
236
  - name: Ensure cmake is available
196
237
  uses: lukka/get-cmake@latest
197
238
 
239
+ # The extension is a Rust crate; cargo is part of the build now. stable is
240
+ # the default because that is what ships - but nightly has to be PRESENT
241
+ # too: -Zsanitizer is unstable, so extconf sets RUSTUP_TOOLCHAIN=nightly
242
+ # for an ASan build (and aborts rather than quietly building it plain).
243
+ # Installed uniformly across this file's jobs; the few that never sanitize
244
+ # pay one toolchain download for one block instead of nine variants.
245
+ - uses: dtolnay/rust-toolchain@stable
246
+ - name: Install the nightly toolchain (for -Zsanitizer)
247
+ run: rustup toolchain install nightly
248
+
249
+ - name: Install libclang (bindgen, via rb-sys)
250
+ if: runner.os == 'Linux'
251
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
252
+
198
253
  - name: Set up Ruby
199
254
  uses: ruby/setup-ruby@v1
200
255
  with:
@@ -219,6 +274,20 @@ jobs:
219
274
  - name: Ensure cmake is available
220
275
  uses: lukka/get-cmake@latest
221
276
 
277
+ # The extension is a Rust crate; cargo is part of the build now. stable is
278
+ # the default because that is what ships - but nightly has to be PRESENT
279
+ # too: -Zsanitizer is unstable, so extconf sets RUSTUP_TOOLCHAIN=nightly
280
+ # for an ASan build (and aborts rather than quietly building it plain).
281
+ # Installed uniformly across this file's jobs; the few that never sanitize
282
+ # pay one toolchain download for one block instead of nine variants.
283
+ - uses: dtolnay/rust-toolchain@stable
284
+ - name: Install the nightly toolchain (for -Zsanitizer)
285
+ run: rustup toolchain install nightly
286
+
287
+ - name: Install libclang (bindgen, via rb-sys)
288
+ if: runner.os == 'Linux'
289
+ run: sudo apt-get update && sudo apt-get install -y libclang-dev
290
+
222
291
  - name: Set up Ruby
223
292
  uses: ruby/setup-ruby@v1
224
293
  with:
@@ -227,3 +296,4 @@ jobs:
227
296
 
228
297
  - name: Build Lexbor under ASan and run the suite
229
298
  run: bundle exec rake "sanitize:lexbor"
299
+