From 9b7a7e9c9ca48d39bda7cfdd8221219caa1cffec Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Thu, 9 May 2024 18:22:30 +0300 Subject: [PATCH 1/5] workflows: check MSRV in CI. --- .github/workflows/rust.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 12365252..0126a929 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,6 +2,9 @@ name: Rust on: [push, pull_request] +env: + MSRV: 1.62.1 + jobs: build_test: runs-on: ubuntu-latest @@ -11,6 +14,7 @@ jobs: - nightly - beta - stable + - $MSRV steps: - uses: actions/checkout@v4 with: @@ -28,6 +32,7 @@ jobs: - nightly - beta - stable + - $MSRV steps: - uses: actions/checkout@v4 with: @@ -43,7 +48,7 @@ jobs: with: submodules: true - name: Obtain Rust - run: rustup override set stable + run: rustup override set $MSRV - name: Setup for wasm run: rustup target add wasm32-unknown-unknown - name: Build @@ -58,6 +63,7 @@ jobs: - nightly - beta - stable + - $MSRV steps: - uses: actions/checkout@v4 with: @@ -73,7 +79,7 @@ jobs: with: submodules: true - name: Obtain Rust - run: rustup override set stable + run: rustup override set $MSRV - name: Build and test with no features run: cargo +stable build --locked --release --all-features clippy_format: @@ -81,7 +87,7 @@ jobs: strategy: matrix: rust: - - stable + - $MSRV steps: - uses: actions/checkout@v4 with: From 24dc120073c6bbbba94425d20e3cc22526d92e36 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Thu, 9 May 2024 21:54:59 +0300 Subject: [PATCH 2/5] get bin/lib/test going on 1.62.1 again. --- .github/workflows/rust.yml | 36 ++- Cargo.lock | 584 ++++++++++++------------------------- Cargo.toml | 12 +- examples/update-readme.rs | 9 +- script/cibuild | 86 +++--- src/main.rs | 8 +- src/tests.rs | 1 - src/tests/propfuzz.rs | 47 --- 8 files changed, 261 insertions(+), 522 deletions(-) delete mode 100644 src/tests/propfuzz.rs diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0126a929..eaa64c6d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -6,7 +6,7 @@ env: MSRV: 1.62.1 jobs: - build_test: + build_lib_test: runs-on: ubuntu-latest strategy: matrix: @@ -21,11 +21,16 @@ jobs: submodules: true - name: Obtain Rust run: rustup override set ${{ matrix.rust }} - - name: Build and test - run: env SPEC=false script/cibuild - build_spec: + - name: Build library + run: cargo build --verbose --lib + - name: Build examples + run: cargo build --verbose --lib --examples + - name: Run unit tests + run: cargo test --verbose + - name: "Run README sample (TODO: update me)" + run: cargo run --example sample + build_bin_spec: runs-on: ubuntu-latest - needs: build_test strategy: matrix: rust: @@ -39,16 +44,25 @@ jobs: submodules: true - name: Obtain Rust run: rustup override set ${{ matrix.rust }} - - name: Build and run spec tests - run: env SPEC=true script/cibuild + - name: Build binary + run: cargo build --verbose --bin --release + - name: Run spec tests + run: script/cibuild build_wasm: runs-on: ubuntu-latest + strategy: + matrix: + rust: + - nightly + - beta + - stable + - $MSRV steps: - uses: actions/checkout@v4 with: submodules: true - name: Obtain Rust - run: rustup override set $MSRV + run: rustup override set ${{ matrix.rust }} - name: Setup for wasm run: rustup target add wasm32-unknown-unknown - name: Build @@ -84,16 +98,12 @@ jobs: run: cargo +stable build --locked --release --all-features clippy_format: runs-on: ubuntu-latest - strategy: - matrix: - rust: - - $MSRV steps: - uses: actions/checkout@v4 with: submodules: true - name: Obtain Rust - run: rustup override set ${{ matrix.rust }} + run: rustup override set $MSRV - name: Check clippy run: rustup component add clippy && cargo clippy - name: Check formatting diff --git a/Cargo.lock b/Cargo.lock index a4c6cf91..ff26f2db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,62 +10,13 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.3" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] -[[package]] -name = "anstream" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" - -[[package]] -name = "anstyle-parse" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "arbitrary" version = "1.3.2" @@ -117,24 +68,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - [[package]] name = "cc" version = "1.0.78" @@ -149,50 +82,41 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.4" +version = "4.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" dependencies = [ - "clap_builder", + "bitflags", "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" -dependencies = [ - "anstream", - "anstyle", "clap_lex", - "strsim 0.11.1", + "is-terminal", + "once_cell", + "strsim", + "termcolor", "terminal_size", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" dependencies = [ "heck", + "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 1.0.107", ] [[package]] name = "clap_lex" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" - -[[package]] -name = "colorchoice" -version = "1.0.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +dependencies = [ + "os_str_bytes", +] [[package]] name = "comrak" @@ -203,16 +127,14 @@ dependencies = [ "derive_builder", "emojis", "entities", - "in-place", "memchr", "ntest", "once_cell", - "propfuzz", "regex", "shell-words", "slug", "syntect", - "toml 0.8.12", + "toml 0.7.3", "typed-arena", "unicode_categories", "xdg", @@ -247,7 +169,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", + "strsim", "syn 2.0.60", ] @@ -304,6 +226,15 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "deunicode" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71dbf1bf89c23e9cd1baf5e654f622872655f195b36588dc9dc38f7eda30758c" +dependencies = [ + "deunicode 1.4.4", +] + [[package]] name = "deunicode" version = "1.4.4" @@ -325,12 +256,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - [[package]] name = "errno" version = "0.3.8" @@ -351,12 +276,6 @@ dependencies = [ "regex", ] -[[package]] -name = "fastrand" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" - [[package]] name = "flate2" version = "1.0.25" @@ -373,17 +292,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -391,16 +299,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] -name = "hashbrown" -version = "0.14.3" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "heck" -version = "0.5.0" +name = "hermit-abi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "ident_case" @@ -408,15 +316,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "in-place" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdb69f3adfd5f493210cece799f4620417bf9965bc1536c22ae0e29ba27a8c0" -dependencies = [ - "tempfile", -] - [[package]] name = "indexmap" version = "1.9.2" @@ -424,24 +323,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", - "hashbrown 0.12.3", + "hashbrown", ] [[package]] -name = "indexmap" -version = "2.2.6" +name = "io-lifetimes" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "equivalent", - "hashbrown 0.14.3", + "hermit-abi", + "libc", + "windows-sys 0.48.0", ] [[package]] -name = "is_terminal_polyfill" -version = "1.70.0" +name = "is-terminal" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" +dependencies = [ + "hermit-abi", + "io-lifetimes", + "rustix 0.36.17", + "windows-sys 0.45.0", +] [[package]] name = "itoa" @@ -478,15 +384,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] -name = "log" -version = "0.4.21" +name = "linux-raw-sys" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "memchr" @@ -536,15 +442,6 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - [[package]] name = "once_cell" version = "1.19.0" @@ -557,7 +454,7 @@ version = "6.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" dependencies = [ - "bitflags 1.3.2", + "bitflags", "libc", "once_cell", "onig_sys", @@ -573,6 +470,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + [[package]] name = "phf" version = "0.11.1" @@ -604,19 +507,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" dependencies = [ "base64", - "indexmap 1.9.2", + "indexmap", "line-wrap", "serde", "time", "xml-rs", ] -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - [[package]] name = "proc-macro-crate" version = "1.2.1" @@ -629,61 +526,38 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "1.0.81" +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ - "unicode-ident", -] - -[[package]] -name = "propfuzz" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf775bd278492e4908c866f47385a46c4a07f66bb373aff4745f59abb19c4df5" -dependencies = [ - "propfuzz-macro", - "proptest", + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.107", + "version_check", ] [[package]] -name = "propfuzz-macro" -version = "0.0.1" +name = "proc-macro-error-attr" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5b9b3697fc8ff26a9da20efc7029679d664794f7dd906cfa6cf72ea1523ff6" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "version_check", ] [[package]] -name = "proptest" -version = "0.10.1" +name = "proc-macro2" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e6c80c1139113c28ee4670dc50cc42915228b51f56a9e407f0ec60f966646f" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ - "bit-set", - "bitflags 1.3.2", - "byteorder", - "lazy_static", - "num-traits", - "quick-error", - "rand", - "rand_chacha", - "rand_xorshift", - "regex-syntax 0.6.28", - "rusty-fork", - "tempfile", + "unicode-ident", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" version = "1.0.36" @@ -693,77 +567,15 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom", - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_xorshift" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" -dependencies = [ - "rand_core", -] - [[package]] name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax 0.8.3", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax", ] [[package]] @@ -772,35 +584,32 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - [[package]] name = "rustix" -version = "0.38.32" +version = "0.36.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" dependencies = [ - "bitflags 2.5.0", + "bitflags", "errno", + "io-lifetimes", "libc", - "linux-raw-sys", - "windows-sys 0.52.0", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", ] [[package]] -name = "rusty-fork" -version = "0.3.0" +name = "rustix" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", ] [[package]] @@ -854,9 +663,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" dependencies = [ "serde", ] @@ -875,12 +684,11 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slug" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" +checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" dependencies = [ - "deunicode", - "wasm-bindgen", + "deunicode 0.4.5", ] [[package]] @@ -889,12 +697,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - [[package]] name = "syn" version = "1.0.107" @@ -924,7 +726,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8" dependencies = [ "bincode", - "bitflags 1.3.2", + "bitflags", "fancy-regex", "flate2", "fnv", @@ -932,7 +734,7 @@ dependencies = [ "once_cell", "onig", "plist", - "regex-syntax 0.6.28", + "regex-syntax", "serde", "serde_derive", "serde_json", @@ -942,24 +744,21 @@ dependencies = [ ] [[package]] -name = "tempfile" -version = "3.10.1" +name = "termcolor" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", + "winapi-util", ] [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ - "rustix", + "rustix 0.37.27", "windows-sys 0.48.0", ] @@ -1021,9 +820,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" dependencies = [ "serde", "serde_spanned", @@ -1033,20 +832,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.19.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "08de71aa0d6e348f070457f85af8bd566e2bc452156a423ddf22861b3a953fae" dependencies = [ - "indexmap 2.2.6", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -1072,19 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] -name = "utf8parse" -version = "0.2.1" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" @@ -1097,66 +887,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasm-bindgen" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 1.0.107", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" - [[package]] name = "winapi" version = "0.3.9" @@ -1188,6 +918,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -1206,6 +945,21 @@ dependencies = [ "windows-targets 0.52.4", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -1236,6 +990,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.4", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -1248,6 +1008,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -1260,6 +1026,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -1272,6 +1044,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -1284,6 +1062,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -1296,6 +1080,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -1308,6 +1098,12 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -1322,9 +1118,9 @@ checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" -version = "0.6.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "da01e24d23aeb852fb05609f2701ce4da9f73d58857239ed3853667cf178f204" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index e0ac96b1..1fc429a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ doc = false [dependencies] typed-arena = "2.0.2" -regex = "1.10.4" +regex = "1" once_cell = "1.19.0" entities = "1.0.1" unicode_categories = "0.1.1" @@ -46,18 +46,14 @@ slug = "0.1.4" emojis = { version = "0.6.2", optional = true } arbitrary = { version = "1", optional = true, features = ["derive"] } derive_builder = "0.20.0" -in-place = { version = "0.2.0", optional = true } [dev-dependencies] ntest = "0.9" -toml = "0.8" - -[target.'cfg(not(target_arch="wasm32"))'.dev-dependencies] -propfuzz = "0.0.1" +toml = "0.7.3" [features] default = ["cli", "syntect"] -cli = ["clap", "shell-words", "xdg", "in-place"] +cli = ["clap", "shell-words", "xdg"] shortcodes = ["emojis"] [target.'cfg(all(not(windows), not(target_arch="wasm32")))'.dependencies] @@ -67,7 +63,7 @@ xdg = { version = "^2.5", optional = true } syntect = { version = "5.0", optional = true, default-features = false, features = [ "default-fancy", ] } -clap = { version = "4.5", optional = true, features = ["derive", "string"] } +clap = { version = "4.0.32", optional = true, features = ["derive", "string"] } [target.'cfg(not(target_arch="wasm32"))'.dependencies] syntect = { version = "5.0", optional = true, default-features = false, features = [ diff --git a/examples/update-readme.rs b/examples/update-readme.rs index 2b310ae1..fab08d70 100644 --- a/examples/update-readme.rs +++ b/examples/update-readme.rs @@ -1,6 +1,5 @@ // Update the "comrak --help" text in Comrak's own README. -use in_place::InPlace; use std::error::Error; use std::fmt::Write; use std::str; @@ -15,8 +14,7 @@ const HELP: &str = "$ comrak --help\n"; fn main() -> Result<(), Box> { let arena = Arena::new(); - let inp = InPlace::new("README.md").open()?; - let readme = std::io::read_to_string(inp.reader())?; + let readme = std::fs::read_to_string("README.md")?; let doc = parse_document(&arena, &readme, &Options::default()); let cargo_toml = std::fs::read_to_string("Cargo.toml")?.parse::()?; @@ -70,8 +68,9 @@ fn main() -> Result<(), Box> { } } - format_commonmark(doc, &Options::default(), &mut inp.writer())?; - inp.save()?; + let mut out = vec![]; + format_commonmark(doc, &Options::default(), &mut out)?; + std::fs::write("README.md", &out)?; Ok(()) } diff --git a/script/cibuild b/script/cibuild index e5191f3d..503c7124 100755 --- a/script/cibuild +++ b/script/cibuild @@ -8,54 +8,42 @@ fi failed=0 -if [ x"$SPEC" = "xtrue" ]; then - cargo build --verbose --release - - cd vendor/cmark-gfm/test - - PROGRAM_ARG="--program=../../../target/release/comrak --syntax-highlighting none" - - set +e - python3 spec_tests.py --no-normalize --spec spec.txt "$PROGRAM_ARG" \ - || failed=1 - python3 pathological_tests.py "$PROGRAM_ARG" \ - || failed=1 - python3 roundtrip_tests.py --spec spec.txt "$PROGRAM_ARG" \ - || failed=1 - python3 entity_tests.py "$PROGRAM_ARG" \ - || failed=1 - python3 spec_tests.py --no-normalize --spec smart_punct.txt "$PROGRAM_ARG --smart" \ - || failed=1 - - python3 spec_tests.py --no-normalize --spec extensions.txt "$PROGRAM_ARG" --extensions "table strikethrough autolink tagfilter footnotes tasklist" \ - || failed=1 - python3 roundtrip_tests.py --spec extensions.txt "$PROGRAM_ARG" --extensions "table strikethrough autolink tagfilter footnotes tasklist" \ - || failed=1 - # python3 roundtrip_tests.py --spec extensions-table-prefer-style-attributes.txt "$PROGRAM_ARG --table-prefer-style-attributes" --extensions "table strikethrough autolink tagfilter footnotes tasklist" || failed=1 - python3 roundtrip_tests.py --spec extensions-full-info-string.txt "$PROGRAM_ARG --full-info-string" \ - || failed=1 - python3 spec_tests.py --no-normalize --spec ../../../src/tests/fixtures/multiline_blockquote.md "$PROGRAM_ARG -e multiline-block-quotes" \ - || failed=1 - python3 spec_tests.py --no-normalize --spec ../../../src/tests/fixtures/math_dollars.md "$PROGRAM_ARG -e math-dollars" \ - || failed=1 - python3 spec_tests.py --no-normalize --spec ../../../src/tests/fixtures/math_code.md "$PROGRAM_ARG -e math-code" \ - || failed=1 - - python3 spec_tests.py --no-normalize --spec regression.txt "$PROGRAM_ARG" \ - || failed=1 - set -e -else - set +e - cargo build --verbose \ - || failed=1 - cargo build --verbose --examples \ - || failed=1 - - cargo test --verbose \ - || failed=1 - cargo run --example sample \ - || failed=1 - set -e -fi +cargo build --verbose --release + +cd vendor/cmark-gfm/test + +PROGRAM_ARG="--program=../../../target/release/comrak --syntax-highlighting none" + +set +e + +python3 spec_tests.py --no-normalize --spec spec.txt "$PROGRAM_ARG" \ + || failed=1 +python3 pathological_tests.py "$PROGRAM_ARG" \ + || failed=1 +python3 roundtrip_tests.py --spec spec.txt "$PROGRAM_ARG" \ + || failed=1 +python3 entity_tests.py "$PROGRAM_ARG" \ + || failed=1 +python3 spec_tests.py --no-normalize --spec smart_punct.txt "$PROGRAM_ARG --smart" \ + || failed=1 + +python3 spec_tests.py --no-normalize --spec extensions.txt "$PROGRAM_ARG" --extensions "table strikethrough autolink tagfilter footnotes tasklist" \ + || failed=1 +python3 roundtrip_tests.py --spec extensions.txt "$PROGRAM_ARG" --extensions "table strikethrough autolink tagfilter footnotes tasklist" \ + || failed=1 +# python3 roundtrip_tests.py --spec extensions-table-prefer-style-attributes.txt "$PROGRAM_ARG --table-prefer-style-attributes" --extensions "table strikethrough autolink tagfilter footnotes tasklist" || failed=1 +python3 roundtrip_tests.py --spec extensions-full-info-string.txt "$PROGRAM_ARG --full-info-string" \ + || failed=1 +python3 spec_tests.py --no-normalize --spec ../../../src/tests/fixtures/multiline_blockquote.md "$PROGRAM_ARG -e multiline-block-quotes" \ + || failed=1 +python3 spec_tests.py --no-normalize --spec ../../../src/tests/fixtures/math_dollars.md "$PROGRAM_ARG -e math-dollars" \ + || failed=1 +python3 spec_tests.py --no-normalize --spec ../../../src/tests/fixtures/math_code.md "$PROGRAM_ARG -e math-code" \ + || failed=1 + +python3 spec_tests.py --no-normalize --spec regression.txt "$PROGRAM_ARG" \ + || failed=1 + +set -e exit $failed diff --git a/src/main.rs b/src/main.rs index d2cbd3e7..a259232b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,6 @@ use std::path::PathBuf; use std::process; use clap::{Parser, ValueEnum}; -use in_place::InPlace; const EXIT_SUCCESS: i32 = 0; const EXIT_PARSE_CONFIG: i32 = 2; @@ -327,11 +326,10 @@ fn main() -> Result<(), Box> { formatter(root, &options, &mut bw, &plugins)?; bw.flush()?; } else if cli.inplace { - let inp: in_place::InPlaceFile = - InPlace::new(unsafe { cli.files.unwrap_unchecked().get_unchecked(0) }).open()?; - let mut bw = inp.writer(); + let output_filename = cli.files.unwrap().get(0).unwrap().clone(); + let mut bw = BufWriter::new(fs::File::create(output_filename)?); formatter(root, &options, &mut bw, &plugins)?; - inp.save()?; + bw.flush()?; } else { let stdout = std::io::stdout(); let mut bw = BufWriter::new(stdout.lock()); diff --git a/src/tests.rs b/src/tests.rs index 42d46762..a3467bf9 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -18,7 +18,6 @@ mod multiline_block_quotes; mod options; mod pathological; mod plugins; -mod propfuzz; mod regressions; mod shortcodes; mod strikethrough; diff --git a/src/tests/propfuzz.rs b/src/tests/propfuzz.rs deleted file mode 100644 index 13ff71a5..00000000 --- a/src/tests/propfuzz.rs +++ /dev/null @@ -1,47 +0,0 @@ -use crate::*; - -#[cfg(not(target_arch = "wasm32"))] -use propfuzz::prelude::*; - -#[cfg(not(target_arch = "wasm32"))] -#[propfuzz] -fn propfuzz_doesnt_crash(md: String) { - let options = Options { - extension: ExtensionOptions { - strikethrough: true, - tagfilter: true, - table: true, - autolink: true, - tasklist: true, - superscript: true, - header_ids: Some("user-content-".to_string()), - footnotes: true, - description_lists: true, - multiline_block_quotes: true, - math_dollars: true, - math_code: true, - front_matter_delimiter: None, - #[cfg(feature = "shortcodes")] - shortcodes: true, - }, - parse: ParseOptions { - smart: true, - default_info_string: Some("Rust".to_string()), - relaxed_tasklist_matching: true, - relaxed_autolinks: true, - }, - render: RenderOptions { - hardbreaks: true, - github_pre_lang: true, - full_info_string: true, - width: 80, - unsafe_: true, - escape: false, - list_style: ListStyleType::Dash, - sourcepos: true, - escaped_char_spans: true, - }, - }; - - parse_document(&Arena::new(), &md, &options); -} From f996ba7587ad3b3083b1d8ddcd89dc5d55acbb64 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Thu, 9 May 2024 21:57:35 +0300 Subject: [PATCH 3/5] workflows: cargo build --bin takes an argument. --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index eaa64c6d..452c46c7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,7 +45,7 @@ jobs: - name: Obtain Rust run: rustup override set ${{ matrix.rust }} - name: Build binary - run: cargo build --verbose --bin --release + run: cargo build --verbose --bin comrak --release - name: Run spec tests run: script/cibuild build_wasm: From dca26d4dec66a73d37676806f10b6c21356a2aa5 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Thu, 9 May 2024 22:00:30 +0300 Subject: [PATCH 4/5] wip. --- Cargo.lock | 30 ++++++++++++++++++++++++------ Cargo.toml | 6 ++++-- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff26f2db..62f1402b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -569,13 +569,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata", + "regex-syntax 0.7.5", +] + +[[package]] +name = "regex-automata" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.5", ] [[package]] @@ -584,6 +596,12 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "rustix" version = "0.36.17" @@ -734,7 +752,7 @@ dependencies = [ "once_cell", "onig", "plist", - "regex-syntax", + "regex-syntax 0.6.28", "serde", "serde_derive", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 1fc429a3..8a08f4de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ doc = false [dependencies] typed-arena = "2.0.2" -regex = "1" +regex = "= 1.9.6" # Latest to support 1.62.1. once_cell = "1.19.0" entities = "1.0.1" unicode_categories = "0.1.1" @@ -72,7 +72,9 @@ syntect = { version = "5.0", optional = true, default-features = false, features "html", "regex-onig", ] } -clap = { version = "4.0", optional = true, features = [ + +# Latest to support 1.62.1. +clap = { version = "= 4.0.32", optional = true, features = [ "derive", "string", "wrap_help", From f8d2f363143ac41c5dafac26a2f978969bfa724e Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Thu, 9 May 2024 23:06:26 +0300 Subject: [PATCH 5/5] workflows: add check that declared MSRV is the same one as tested. --- .github/workflows/msrv.yml | 10 ++++++++++ script/check-msrv-matches-workflow | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/msrv.yml create mode 100755 script/check-msrv-matches-workflow diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml new file mode 100644 index 00000000..cfb636ca --- /dev/null +++ b/.github/workflows/msrv.yml @@ -0,0 +1,10 @@ +name: Ensure declared MSRV is tested + +on: [push, pull_request] + +jobs: + ensure_msrv: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: script/check-msrv-matches-workflow diff --git a/script/check-msrv-matches-workflow b/script/check-msrv-matches-workflow new file mode 100755 index 00000000..f3ebe6a3 --- /dev/null +++ b/script/check-msrv-matches-workflow @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +CI_FILE=".github/workflows/rust.yml" + +MSRV=$( + grep -E '^rust-version = "[^"]+"$' Cargo.toml | + head -n 1 | + cut -d\" -f2 +) + +TESTED=$( + grep -E '^\s*MSRV: \S+$' $CI_FILE | + awk '{ print $2 }' +) + +if test "$MSRV" != "$TESTED"; then + echo "MSRV used in $CI_FILE ($TESTED) doesn't match Cargo.toml's rust-version declaration ($MSRV)." + exit 1 +fi + +echo "MSRV: $MSRV"