From 8b7a7c83c785bf539873394d35bd4132afea8862 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Fri, 6 Jan 2023 17:17:52 -0500 Subject: [PATCH 1/8] Provide 3.2 build support --- .cross_rubies | 5 + .github/workflows/cruby-build-and-install.yml | 4 +- .../workflows/generic-build-and-install.yml | 5 +- Cargo.lock | 108 +++++++++--------- rakelib/extension.rake | 29 ----- 5 files changed, 65 insertions(+), 86 deletions(-) diff --git a/.cross_rubies b/.cross_rubies index 0d5dbb31..b6f56550 100644 --- a/.cross_rubies +++ b/.cross_rubies @@ -3,3 +3,8 @@ 3.1.0:x86_64-darwin 3.1.0:arm64-darwin 3.1.0:x64-mingw-ucrt +3.2.0:x86_64-linux +3.2.0:aarch64-linux +3.2.0:x86_64-darwin +3.2.0:arm64-darwin +3.2.0:x64-mingw-ucrt diff --git a/.github/workflows/cruby-build-and-install.yml b/.github/workflows/cruby-build-and-install.yml index 42a7982f..4129beec 100644 --- a/.github/workflows/cruby-build-and-install.yml +++ b/.github/workflows/cruby-build-and-install.yml @@ -32,7 +32,7 @@ jobs: - uses: oxidize-rb/actions/setup-ruby-and-rust@main with: - ruby-version: "3.1" + ruby-version: "3.2" rubygems: latest bundler-cache: false cargo-cache: true @@ -80,7 +80,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1"] + ruby: ["3.1", "3.2"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/generic-build-and-install.yml b/.github/workflows/generic-build-and-install.yml index 96f0462d..ddd531e8 100644 --- a/.github/workflows/generic-build-and-install.yml +++ b/.github/workflows/generic-build-and-install.yml @@ -42,12 +42,15 @@ jobs: generic-linux-install: needs: ["generic-package"] runs-on: ubuntu-latest + strategy: + matrix: + ruby: ["3.1", "3.2"] steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby-pkgs@v1 with: - ruby-version: "3.1" + ruby-version: "${{matrix.ruby}}" - uses: actions/download-artifact@v3 with: diff --git a/Cargo.lock b/Cargo.lock index f61ee5fe..bf7ff5c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,9 +89,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.77" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" [[package]] name = "cexpr" @@ -121,9 +121,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.29" +version = "4.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" +checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" dependencies = [ "bitflags", "clap_derive", @@ -319,9 +319,9 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "hashbrown" @@ -366,9 +366,9 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ "hermit-abi", "io-lifetimes", @@ -378,9 +378,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "lazy_static" @@ -396,9 +396,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libloading" @@ -427,9 +427,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "magnus" @@ -476,9 +476,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.1.1" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c" dependencies = [ "memchr", "minimal-lexical", @@ -486,9 +486,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "onig" @@ -526,9 +526,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pest" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f400b0f7905bf702f9f3dc3df5a121b16c54e9e8012c082905fdf09a931861a" +checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4" dependencies = [ "thiserror", "ucd-trie", @@ -536,9 +536,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "423c2ba011d6e27b02b482a3707c773d19aec65cc024637aec44e19652e66f63" +checksum = "96504449aa860c8dcde14f9fba5c58dc6658688ca1fe363589d6327b8662c603" dependencies = [ "pest", "pest_generator", @@ -546,9 +546,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e64e6c2c85031c02fdbd9e5c72845445ca0a724d419aa0bc068ac620c9935c1" +checksum = "798e0220d1111ae63d66cb66a5dcb3fc2d986d520b98e49e1852bfdb11d7c5e7" dependencies = [ "pest", "pest_meta", @@ -559,9 +559,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57959b91f0a133f89a68be874a5c88ed689c19cd729ecdb5d762ebf16c64d662" +checksum = "984298b75898e30a843e278a9f2452c31e349a073a0ce6fd950a12a74464e065" dependencies = [ "once_cell", "pest", @@ -614,36 +614,36 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] [[package]] name = "rb-sys" -version = "0.9.44" +version = "0.9.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f48777b8161ff5c077ad74ce486ebe963ca8a92257512bab473b405a80d69f" +checksum = "aa291f69bcc44f8e96597a3f39e9933fde6977b825415cfaa670ac49b8ab7c99" dependencies = [ "rb-sys-build", ] [[package]] name = "rb-sys-build" -version = "0.9.44" +version = "0.9.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a46785122aff7077527b78c2518d739c45dc0fbc410a2b8361076ff4bbf993f9" +checksum = "d998fd6ef588471d6d7cca24c4da88eda5e6757b6885c55760e856ecdb254c3d" dependencies = [ "bindgen", "regex", @@ -701,9 +701,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.36.4" +version = "0.36.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb93e85278e08bb5788653183213d3a60fc242b10cb9be96586f5a73dcb67c23" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" dependencies = [ "bitflags", "errno", @@ -715,9 +715,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "safemem" @@ -736,15 +736,15 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.148" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -753,9 +753,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", @@ -793,9 +793,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -847,18 +847,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -900,9 +900,9 @@ checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -912,9 +912,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode_categories" diff --git a/rakelib/extension.rake b/rakelib/extension.rake index 7530451e..4ce3d3f6 100644 --- a/rakelib/extension.rake +++ b/rakelib/extension.rake @@ -1,35 +1,6 @@ # frozen_string_literal: true require "rake/extensiontask" - -# FIXME: remove this hack if multiple versions of Ruby are supported... -module Rake - class ExtensionTask < BaseExtensionTask - def define_cross_platform_tasks(for_platform) - ruby_vers = ENV["RUBY_CC_VERSION"].split(":") - - old_multi = ruby_vers.size > 1 ? true : false - multi = true - puts "DEBUG: multi = #{multi} (was: #{old_multi})" - ruby_vers.each do |version| - # save original lib_dir - orig_lib_dir = @lib_dir - - # tweak lib directory only when targeting multiple versions - if multi - version =~ /(\d+\.\d+)/ - @lib_dir = "#{@lib_dir}/#{::Regexp.last_match(1)}" - end - - define_cross_platform_tasks_with_version(for_platform, version) - - # restore lib_dir - @lib_dir = orig_lib_dir - end - end - end -end - require_relative "extension/cross_rubies" Rake::ExtensionTask.new("commonmarker", COMMONMARKER_SPEC) do |ext| From 654e9228a83104517bdc7b66952e498e06be4734 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Fri, 6 Jan 2023 17:45:27 -0500 Subject: [PATCH 2/8] test 3.2 build --- lib/commonmarker/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commonmarker/version.rb b/lib/commonmarker/version.rb index 8f9172c3..9284bfe6 100644 --- a/lib/commonmarker/version.rb +++ b/lib/commonmarker/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Commonmarker - VERSION = "1.0.0.pre4" + VERSION = "1.0.0.pre5" end From f48eaef36cc58fd87efede415a70ec9abfa43578 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Sun, 8 Jan 2023 16:42:55 +1100 Subject: [PATCH 3/8] gemspec: allow 3.2+ --- commonmarker.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commonmarker.gemspec b/commonmarker.gemspec index b6d174c6..fcd8db5c 100644 --- a/commonmarker.gemspec +++ b/commonmarker.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.license = "MIT" spec.homepage = "https://github.com/gjtorikian/commonmarker" - spec.required_ruby_version = "~> 3.1" + spec.required_ruby_version = ">= 3.1" # https://github.com/rubygems/rubygems/pull/5852#issuecomment-1231118509 spec.required_rubygems_version = ">= 3.3.22" From 4fc98d70e431622aee28e48b0238304519bfaa8e Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Sun, 8 Jan 2023 18:00:31 +1100 Subject: [PATCH 4/8] generic-build-and-install: checking if it's this simple --- .github/workflows/generic-build-and-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generic-build-and-install.yml b/.github/workflows/generic-build-and-install.yml index ddd531e8..2c147615 100644 --- a/.github/workflows/generic-build-and-install.yml +++ b/.github/workflows/generic-build-and-install.yml @@ -29,7 +29,7 @@ jobs: with: platform: x86_64-linux env: | - RUBY_CC_VERSION=3.1.0 + RUBY_CC_VERSION=3.1.0:3.2.0 - run: ./script/test-gem-build gems ruby From 0c22b33123f2ac7640fa626cc6c488bfe0d7ed34 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Sun, 8 Jan 2023 18:11:48 +1100 Subject: [PATCH 5/8] gemspec: try adding Cargo.lock to spec.files See https://github.com/rubygems/rubygems/pull/6151. --- commonmarker.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commonmarker.gemspec b/commonmarker.gemspec index fcd8db5c..b3cb5080 100644 --- a/commonmarker.gemspec +++ b/commonmarker.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| # https://github.com/rubygems/rubygems/pull/5852#issuecomment-1231118509 spec.required_rubygems_version = ">= 3.3.22" - spec.files = ["LICENSE.txt", "README.md", "commonmarker.gemspec"] + spec.files = ["LICENSE.txt", "README.md", "commonmarker.gemspec", "Cargo.lock"] spec.files += Dir.glob("lib/**/*.rb") spec.files += Dir.glob("ext/**/*.{rs,toml,lock,rb}") spec.bindir = "exe" From 0384fda6e2482106a74b8cceafdebd333ea50970 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Sun, 8 Jan 2023 18:15:57 +1100 Subject: [PATCH 6/8] rubocop: appease --- script/test-gem-installation | 6 ++- test/test_extensions.rb | 6 ++- test/test_pathological_inputs.rb | 77 ++++++++++++++++++-------------- 3 files changed, 52 insertions(+), 37 deletions(-) diff --git a/script/test-gem-installation b/script/test-gem-installation index 81f54972..a227d0b8 100755 --- a/script/test-gem-installation +++ b/script/test-gem-installation @@ -59,8 +59,10 @@ describe gemspec.full_name do describe "cruby" do it "installs commonmarker files" do commonmarker_files.each do |file| - assert(File.file?(File.join(commonmarker_ext_dir, file)), - "expected #{file} to be installed in #{commonmarker_ext_dir}") + assert( + File.file?(File.join(commonmarker_ext_dir, file)), + "expected #{file} to be installed in #{commonmarker_ext_dir}", + ) end end end diff --git a/test/test_extensions.rb b/test/test_extensions.rb index 5ad2265e..c7fdfdfa 100644 --- a/test/test_extensions.rb +++ b/test/test_extensions.rb @@ -35,7 +35,9 @@ def test_bad_extension_specifications def test_comments_are_kept_as_expected options = { render: { unsafe_: true }, extension: { tagfilter: true } } - assert_equal(" <xmp>\n", - Commonmarker.to_html(" \n", options: options)) + assert_equal( + "<!--hello--> <blah> &lt;xmp>\n", + Commonmarker.to_html("<!--hello--> <blah> <xmp>\n", options: options), + ) end end diff --git a/test/test_pathological_inputs.rb b/test/test_pathological_inputs.rb index c533b60c..8ee45439 100644 --- a/test/test_pathological_inputs.rb +++ b/test/test_pathological_inputs.rb @@ -10,39 +10,50 @@ def markdown(str) class PathologicalInputsPerformanceTest < Minitest::Benchmark # list of pairs consisting of input and a regex that must match the output. pathological = { - "nested strong emph" => - ["#{"*a **a " * 65_000}b#{" a** a*" * 65_000}", - Regexp.compile("(<em>a <strong>a ){65_000}b( a</strong> a</em>){65_000}"),], - "many emph closers with no openers" => - [("a_ " * 65_000), - Regexp.compile("(a[_] ){64999}a_"),], - "many emph openers with no closers" => - [("_a " * 65_000), - Regexp.compile("(_a ){64999}_a"),], - "many link closers with no openers" => - [("a]" * 65_000), - Regexp.compile('(a\]){65_000}'),], - "many link openers with no closers" => - [("[a" * 65_000), - Regexp.compile('(\[a){65_000}'),], - "mismatched openers and closers" => - [("*a_ " * 50_000), - Regexp.compile("([*]a[_] ){49999}[*]a_"),], - "link openers and emph closers" => - [("[ a_" * 50_000), - Regexp.compile('(\[ a_){50000}'),], - "hard link/emph case" => - ["**x [a*b**c*](d)", - Regexp.compile('\\*\\*x <a href=\'d\'>a<em>b</em><em>c</em></a>'),], - "nested brackets" => - ["#{"[" * 50_000}a#{"]" * 50_000}", - Regexp.compile('\[{50000}a\]{50000}'),], - "nested block quotes" => - ["#{"> " * 50_000}a", - Regexp.compile('(<blockquote>\n){50000}'),], - "U+0000 in input" => - ['abc\u0000de\u0000', - Regexp.compile('abc\ufffd?de\ufffd?'),], + "nested strong emph" => [ + "#{"*a **a " * 65_000}b#{" a** a*" * 65_000}", + Regexp.compile("(<em>a <strong>a ){65_000}b( a</strong> a</em>){65_000}"), + ], + "many emph closers with no openers" => [ + ("a_ " * 65_000), + Regexp.compile("(a[_] ){64999}a_"), + ], + "many emph openers with no closers" => [ + ("_a " * 65_000), + Regexp.compile("(_a ){64999}_a"), + ], + "many link closers with no openers" => [ + ("a]" * 65_000), + Regexp.compile('(a\]){65_000}'), + ], + "many link openers with no closers" => [ + ("[a" * 65_000), + Regexp.compile('(\[a){65_000}'), + ], + "mismatched openers and closers" => [ + ("*a_ " * 50_000), + Regexp.compile("([*]a[_] ){49999}[*]a_"), + ], + "link openers and emph closers" => [ + ("[ a_" * 50_000), + Regexp.compile('(\[ a_){50000}'), + ], + "hard link/emph case" => [ + "**x [a*b**c*](d)", + Regexp.compile('\\*\\*x <a href=\'d\'>a<em>b</em><em>c</em></a>'), + ], + "nested brackets" => [ + "#{"[" * 50_000}a#{"]" * 50_000}", + Regexp.compile('\[{50000}a\]{50000}'), + ], + "nested block quotes" => [ + "#{"> " * 50_000}a", + Regexp.compile('(<blockquote>\n){50000}'), + ], + "U+0000 in input" => [ + 'abc\u0000de\u0000', + Regexp.compile('abc\ufffd?de\ufffd?'), + ], } pathological.each_pair do |name, description| From a18b3e1ed784c6c5ee34881dcc7d388201b58ebd Mon Sep 17 00:00:00 2001 From: Asherah Connor <asherah@hrzn.ee> Date: Sun, 8 Jan 2023 18:23:03 +1100 Subject: [PATCH 7/8] workflows: push more towards using 3.2 and building for both --- .github/workflows/cruby-build-and-install.yml | 7 +++---- .github/workflows/generic-build-and-install.yml | 5 ++--- .github/workflows/lint.yml | 2 +- .github/workflows/tag_and_release.yml | 9 ++++----- .github/workflows/test.yml | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cruby-build-and-install.yml b/.github/workflows/cruby-build-and-install.yml index 4129beec..20a548f1 100644 --- a/.github/workflows/cruby-build-and-install.yml +++ b/.github/workflows/cruby-build-and-install.yml @@ -41,8 +41,7 @@ jobs: - uses: oxidize-rb/cross-gem-action@main with: platform: ${{ matrix.platform }} - env: | - RUBY_CC_VERSION=3.1.0 + ruby-versions: '3.1, 3.2' - name: "Test gem build" run: | @@ -59,7 +58,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1"] + ruby: ["3.1", "3.2"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -107,7 +106,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1"] + ruby: ["3.1", "3.2"] runs-on: macos-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/generic-build-and-install.yml b/.github/workflows/generic-build-and-install.yml index 2c147615..0d826883 100644 --- a/.github/workflows/generic-build-and-install.yml +++ b/.github/workflows/generic-build-and-install.yml @@ -19,7 +19,7 @@ jobs: - uses: oxidize-rb/actions/setup-ruby-and-rust@main with: - ruby-version: "3.1" + ruby-version: "3.2" rubygems: latest bundler-cache: false cargo-cache: true @@ -28,8 +28,7 @@ jobs: - uses: oxidize-rb/cross-gem-action@main with: platform: x86_64-linux - env: | - RUBY_CC_VERSION=3.1.0:3.2.0 + ruby-versions: '3.1, 3.2' - run: ./script/test-gem-build gems ruby diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e15c6e9d..9b6426ce 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.1 + ruby-version: 3.2 rubygems: latest bundler-cache: true # 'bundle install' and cache - name: Rubocop diff --git a/.github/workflows/tag_and_release.yml b/.github/workflows/tag_and_release.yml index 142c5914..7e58a59e 100644 --- a/.github/workflows/tag_and_release.yml +++ b/.github/workflows/tag_and_release.yml @@ -27,7 +27,7 @@ jobs: - uses: oxidize-rb/actions/setup-ruby-and-rust@main with: - ruby-version: "3.1" + ruby-version: "3.2" rubygems: latest bundler-cache: false cargo-cache: true @@ -36,8 +36,7 @@ jobs: - uses: oxidize-rb/cross-gem-action@main with: platform: ${{ matrix.platform }} - env: | - RUBY_CC_VERSION=3.1.0 + ruby-versions: '3.1, 3.2' - uses: actions/download-artifact@v3 with: @@ -72,11 +71,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Ruby 3.1 + - name: Set up Ruby 3.2 uses: ruby/setup-ruby@v1 with: rubygems: latest - ruby-version: 3.1 + ruby-version: 3.2 bundler-cache: true - name: Configure Git diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 633b3e9b..3fb125da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: - macos-latest - windows-latest ruby: - - 3.1 + - 3.2 steps: - uses: actions/checkout@v3 From 8af6c97035de80b307227bdd5b5381bedeabd0f5 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" <gjtorikian@users.noreply.github.com> Date: Sun, 8 Jan 2023 18:09:37 -0500 Subject: [PATCH 8/8] Revert "gemspec: allow 3.2+" This reverts commit f48eaef36cc58fd87efede415a70ec9abfa43578. --- commonmarker.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commonmarker.gemspec b/commonmarker.gemspec index b3cb5080..57e1d5d6 100644 --- a/commonmarker.gemspec +++ b/commonmarker.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.license = "MIT" spec.homepage = "https://github.com/gjtorikian/commonmarker" - spec.required_ruby_version = ">= 3.1" + spec.required_ruby_version = "~> 3.1" # https://github.com/rubygems/rubygems/pull/5852#issuecomment-1231118509 spec.required_rubygems_version = ">= 3.3.22"