From 5d32d5629dc579013f9b3b4e7ad818e5df5b911f Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 15 Jun 2024 22:37:02 +0300 Subject: [PATCH 01/35] chore(deps): Bump pinned versions of patch level crate updates --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 010c317c5..4c6dd34fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1216,9 +1216,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -1328,7 +1328,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.2", "smallvec", "windows-targets 0.52.5", ] @@ -1410,9 +1410,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ "bitflags 2.5.0", ] From cd135d2fc5e3917985285eb10ed740112aff4bc1 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 15 Jun 2024 17:04:04 +0300 Subject: [PATCH 02/35] refactor(cli): Separate Rust concerns in a workspace --- Cargo.toml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 089786c2d..55dbb2fac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,19 +1,32 @@ -[package] -name = "sile" -version = "0.15.3" +[workspace] +resolver = "2" +members = [ + ".", +] + +[workspace.package] edition = "2021" -rust-version = "1.71.0" -description = "Simon’s Improved Layout Engine" authors = [ "Simon Cozens", "Caleb Maclennan ", "Olivier Nicole", "Didier Willis" ] -readme = "README.md" homepage = "https://sile-typesetter.org" repository = "https://github.com/sile-typesetter/sile" license = "MIT" + +[package] +name = "sile" +version = "0.15.3" +edition.workspace = true +rust-version = "1.71.0" +description = "Simon’s Improved Layout Engine" +authors.workspace = true +homepage.workspace = true +readme = "README.md" +repository.workspace = true +license.workspace = true build = "build-aux/build.rs" [[bin]] From 33703dba233d007dfa17e01e846726655548cf18 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 1 Oct 2024 00:34:12 +0300 Subject: [PATCH 03/35] chore(deps): Bump pinned versions of patch level crate updates --- Cargo.lock | 151 ++++++++++++++++++++++++++++------------------------- 1 file changed, 80 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e9cc343c7..3c9c09367 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,9 +86,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arc-swap" @@ -98,9 +98,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" @@ -168,9 +168,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "3bbb537bb4a30b90362caddba8f360c0a56bc13d3a5570028e7197204cb54a17" dependencies = [ "shlex", ] @@ -183,9 +183,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.16" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -206,23 +206,23 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.24" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7db6eca8c205649e8d3ccd05aa5042b1800a784e56bc7c43524fde8abbfa9b" +checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -307,9 +307,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -400,9 +400,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", @@ -741,7 +741,7 @@ checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -803,9 +803,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.10" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d5b8722112fa2fa87135298780bc833b0e9f6c56cc82795d209804b3a03484" +checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" dependencies = [ "bstr", "gix-trace", @@ -921,9 +921,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" +checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" [[package]] name = "gix-traverse" @@ -978,9 +978,9 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", @@ -1061,9 +1061,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libredox" @@ -1125,9 +1125,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] @@ -1157,9 +1157,9 @@ dependencies = [ [[package]] name = "mlua-sys" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab7a5b4756b8177a2dfa8e0bbcde63bd4000afbc4ab20cbb68d114a25470f29" +checksum = "ebe026d6bd1583a9cf9080e189030ddaea7e6f5f0deb366a8e26f8a26c4135b8" dependencies = [ "cc", "cfg-if", @@ -1180,7 +1180,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -1209,9 +1209,12 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "parking_lot" @@ -1244,9 +1247,15 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "portable-atomic" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "powerfmt" @@ -1304,18 +1313,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -1325,9 +1334,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -1336,9 +1345,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "roff" @@ -1366,7 +1375,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.76", + "syn 2.0.79", "walkdir", ] @@ -1389,9 +1398,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -1438,29 +1447,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -1548,9 +1557,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -1559,9 +1568,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -1582,22 +1591,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -1668,15 +1677,15 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] @@ -1900,9 +1909,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -1930,5 +1939,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.79", ] From 055a68e740415d9ecd5439c3b328274bd4ed892e Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 1 Oct 2024 00:53:42 +0300 Subject: [PATCH 04/35] chore(deps): Upgrade mlua to beta release of v0.10 --- Cargo.lock | 14 +++++++------- Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3c9c09367..20e397a5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1046,9 +1046,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1143,15 +1143,15 @@ dependencies = [ [[package]] name = "mlua" -version = "0.9.9" +version = "0.10.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d111deb18a9c9bd33e1541309f4742523bfab01d276bfa9a27519f6de9c11dc7" +checksum = "200dd4c8e5f81416d43a023b9921c3cbf01d828094b23a90b26826c3840ba4f3" dependencies = [ "bstr", "mlua-sys", "mlua_derive", "num-traits", - "once_cell", + "parking_lot", "rustc-hash", ] @@ -1170,9 +1170,9 @@ dependencies = [ [[package]] name = "mlua_derive" -version = "0.9.3" +version = "0.10.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09697a6cec88e7f58a02c7ab5c18c611c6907c8654613df9cc0192658a4fb859" +checksum = "13e6f40fa1fd8426285688f4a37b56beac69284743d057ee6db352b543f4b621" dependencies = [ "itertools", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index c26c94cf0..fc3cdb2ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -100,7 +100,7 @@ optional = true features = [ "derive", "string", "wrap_help" ] [dependencies.mlua] -version = "0.9" +version = "0.10.0-beta.2" features = [ "macros" ] [dependencies.rust-embed] From b9716f00744a3ffa847285a2625feabcbbe67753 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 1 Oct 2024 00:59:35 +0300 Subject: [PATCH 05/35] refactor(cli): Update Lua VM usage with improved generic handling --- src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index dc7e48fb4..0c8254be8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,7 +60,7 @@ pub fn inject_version(lua: &Lua) { pub fn load_sile(lua: &Lua) { let entry: LuaString = lua.create_string("core.sile").unwrap(); let require: LuaFunction = lua.globals().get("require").unwrap(); - require.call::(entry).unwrap(); + require.call::(entry).unwrap(); } pub fn version() -> crate::Result { @@ -153,7 +153,7 @@ pub fn run( eprintln!("{full_version}"); } let init: LuaFunction = sile.get("init")?; - init.call::<_, ()>(())?; + init.call::(())?; if let Some(inputs) = inputs { let input_filenames: LuaTable = lua.create_table()?; for input in inputs.iter() { @@ -175,20 +175,20 @@ pub fn run( let spec = spec?; let module: LuaString = spec.get("module")?; let options: LuaTable = spec.get("options")?; - r#use.call::<(LuaString, LuaTable), ()>((module, options))?; + r#use.call::<(LuaString, LuaTable)>((module, options))?; } let input_filenames: LuaTable = sile_input.get("filenames")?; let process_file: LuaFunction = sile.get("processFile")?; for file in input_filenames.sequence_values::() { - process_file.call::(file?)?; + process_file.call::(file?)?; } let finish: LuaFunction = sile.get("finish")?; - finish.call::<_, ()>(())?; + finish.call::(())?; } else { let repl_module: LuaString = lua.create_string("core.repl")?; let require: LuaFunction = lua.globals().get("require")?; - let repl: LuaTable = require.call::(repl_module)?; - repl.call_method::<_, ()>("enter", ())?; + let repl: LuaTable = require.call::(repl_module)?; + repl.call_method::("enter", ())?; } Ok(()) } From 3a95a487e486fffeeed01f60a4e76c675476270a Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 15 Jun 2024 22:24:38 +0300 Subject: [PATCH 06/35] feat(core): Add separate crate to enable exporting interfaces to Lua --- Cargo.lock | 8 ++++++++ Cargo.toml | 13 ++++++++----- Makefile.am | 20 ++++++++++++++++++-- build-aux/build.rs | 2 ++ build-aux/pkg.nix | 3 +++ core/sile.lua | 6 ++++++ rusile/Cargo.toml | 28 ++++++++++++++++++++++++++++ rusile/src/lib.rs | 11 +++++++++++ src/embed.rs.in | 4 ++++ 9 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 rusile/Cargo.toml create mode 100644 rusile/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 4c6dd34fd..728c3b7b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1452,6 +1452,14 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b833d8d034ea094b1ea68aa6d5c740e0d04bad9d16568d08ba6f76823a114316" +[[package]] +name = "rusile" +version = "0.15.3" +dependencies = [ + "mlua", + "sile", +] + [[package]] name = "rust-embed" version = "8.4.0" diff --git a/Cargo.toml b/Cargo.toml index 55dbb2fac..140b7d196 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,13 @@ resolver = "2" members = [ ".", + "rusile", ] [workspace.package] +version = "0.15.3" edition = "2021" +rust-version = "1.71.0" authors = [ "Simon Cozens", "Caleb Maclennan ", @@ -18,16 +21,16 @@ license = "MIT" [package] name = "sile" -version = "0.15.3" -edition.workspace = true -rust-version = "1.71.0" description = "Simon’s Improved Layout Engine" +readme = "README.md" +build = "build-aux/build.rs" +version.workspace = true +edition.workspace = true +rust-version.workspace = true authors.workspace = true homepage.workspace = true -readme = "README.md" repository.workspace = true license.workspace = true -build = "build-aux/build.rs" [[bin]] name = "sile" diff --git a/Makefile.am b/Makefile.am index 7ea15a56b..22953a8bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,16 +56,22 @@ endif $(MANUAL): $(FIGURES) BUILT_LUA_SOURCES = core/features.lua core/pathsetup.lua core/version.lua +RUSILE_SOURCES = rusile/Cargo.toml rusile/src/lib.rs bin_PROGRAMS = sile bin_SCRIPTS = sile-lua dist_man_MANS = sile-lua.1 sile_SOURCES = src/bin/sile.rs src/lib.rs src/cli.rs EXTRA_sile_SOURCES = -if !EMBEDDED_RESOURCES +if EMBEDDED_RESOURCES +noinst_LIBRARIES = librusile.a +librusile_a_SOURCES = $(RUSILE_SOURCES) +else !EMBEDDED_RESOURCES nobase_dist_pkgdata_DATA = $(SILEDATA) $(LUALIBRARIES) nobase_nodist_pkgdata_DATA = $(BUILT_LUA_SOURCES) $(LUAMODULES) -endif +pkglib_LIBRARIES = rusile.so +rusile_so_SOURCES = $(RUSILE_SOURCES) +endif !EMBEDDED_RESOURCES dist_doc_DATA = README.md CHANGELOG.md dist_pdf_DATA = $(_MANUAL) dist_license_DATA = LICENSE.md @@ -122,6 +128,7 @@ $(CARGO_BIN): justenough/.libs/justenoughicu.a $(CARGO_BIN): justenough/.libs/justenoughlibtexpdf.a $(CARGO_BIN): justenough/.libs/svg.a $(CARGO_BIN): libtexpdf/.libs/libtexpdf.a +$(CARGO_BIN): librusile.a rusile.so src/embed-includes.rs: Makefile-distfiles { @@ -146,6 +153,7 @@ else MLUAVER = lua$(LUA_SHORT_VERSION) endif CARGO_FEATURE_ARGS = --features $(MLUAVER) +RUSILE_FEATURE_ARG = --features $(MLUAVER) if !SYSTEM_LUA_SOURCES CARGO_FEATURE_ARGS += --features vendored @@ -159,6 +167,14 @@ if FONT_VARIATIONS CARGO_FEATURE_ARGS += --features variations endif +rusile.so: + $(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) $(RUSILE_FEATURE_ARG) $(CARGO_RELEASE_ARGS) -p rusile + $(INSTALL) @builddir@/target/@RUST_TARGET_SUBDIR@/lib$@ $@ + +librusile.a: + $(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) $(RUSILE_FEATURE_ARG) $(CARGO_RELEASE_ARGS) -p rusile + $(INSTALL) @builddir@/target/@RUST_TARGET_SUBDIR@/$@ $@ + DEPDIR := .deps LOCALFONTS := FONTCONFIG_FILE=$(PWD)/fontconfig.conf LOCALPATHS := SILE_PATH="$(PWD);libtexpdf/.libs;justenough/.libs" diff --git a/build-aux/build.rs b/build-aux/build.rs index 2f90b107f..b92f40575 100644 --- a/build-aux/build.rs +++ b/build-aux/build.rs @@ -36,6 +36,8 @@ fn main() { generate_shell_completions(); #[cfg(feature = "static")] { + println!("cargo:rustc-link-arg=-lrusile"); + let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); println!( "cargo:rustc-link-search=native={}", diff --git a/build-aux/pkg.nix b/build-aux/pkg.nix index 1514da569..d1e2939ec 100644 --- a/build-aux/pkg.nix +++ b/build-aux/pkg.nix @@ -115,6 +115,9 @@ in stdenv.mkDerivation (finalAttrs: { # `pdfinfo`, by using `false` we make sure that if it is expected during # build time we would fail to build since we only provide it at test time. "PDFINFO=false" + # We're using Cargo to build a shared library skipping some libtool bits + # and Nix mistakenly assumes are relevant and thinks it needs to cleanup. + "RANLIB=:" #"--with-manual" In Nixpkgs we add this flag, here its not important enough ] ++ lib.optionals (!lua.pkgs.isLuaJIT) [ "--without-luajit" diff --git a/core/sile.lua b/core/sile.lua index 037e96c46..70f8c12ff 100644 --- a/core/sile.lua +++ b/core/sile.lua @@ -16,6 +16,12 @@ SILE = {} --- Fields -- @section fields +--- Load the C module that provides any and all SILE features implemented in Rust. The exports in this module are meant +--- to be moved to approprate places in the Lua API as we load other things and assemble the public facing interface. +--- This location is considered internal and accessing them directly from here is not supported. +-- @table SILE.rusile +SILE._rusile = require("rusile") + --- Machine friendly short-form version. -- Semver, prefixed with "v", possible postfixed with ".r" followed by VCS version information. -- @string version diff --git a/rusile/Cargo.toml b/rusile/Cargo.toml new file mode 100644 index 000000000..ea6afb749 --- /dev/null +++ b/rusile/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "rusile" +description = "Rusty components for the SILE typesetter" +readme = "README.md" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true + +[lib] +crate_type = ["rlib", "cdylib", "staticlib"] + +[dependencies.sile] +path = ".." + +[features] +lua54 = [ "mlua/lua54" ] +lua53 = [ "mlua/lua53" ] +lua52 = [ "mlua/lua52" ] +lua51 = [ "mlua/lua51" ] +luajit = [ "mlua/luajit" ] + +[dependencies.mlua] +version = "0.9" +features = [ "module" ] diff --git a/rusile/src/lib.rs b/rusile/src/lib.rs new file mode 100644 index 000000000..c5bb5e723 --- /dev/null +++ b/rusile/src/lib.rs @@ -0,0 +1,11 @@ +#![crate_type = "cdylib"] +#![crate_type = "rlib"] +#![crate_type = "staticlib"] + +use mlua::prelude::*; + +#[mlua::lua_module] +fn rusile(lua: &Lua) -> LuaResult { + let exports = lua.create_table().unwrap(); + Ok(exports) +} diff --git a/src/embed.rs.in b/src/embed.rs.in index 9d35d32da..1db7e9687 100644 --- a/src/embed.rs.in +++ b/src/embed.rs.in @@ -31,6 +31,7 @@ pub struct SileModules; // Link Lua loader functions from C modules that Lua would otherwise be loading externally that // we've linked into the CLI binary. Linking happens in build-aux/build.rs. extern "C-unwind" { + fn luaopen_rusile(lua: *mut mlua::lua_State) -> i32; fn luaopen_fontmetrics(lua: *mut mlua::lua_State) -> i32; fn luaopen_justenoughfontconfig(lua: *mut mlua::lua_State) -> i32; fn luaopen_justenoughharfbuzz(lua: *mut mlua::lua_State) -> i32; @@ -52,6 +53,9 @@ pub fn inject_embedded_loader(lua: &Lua) { loaders .push(LuaFunction::wrap(|lua, module: String| unsafe { match module.as_str() { + "rusile" => lua + .create_c_function(luaopen_rusile) + .map(LuaValue::Function), "fontmetrics" => lua .create_c_function(luaopen_fontmetrics) .map(LuaValue::Function), From 93c6de70e8c54f7fd4bccf9de0ea857123268a14 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sun, 16 Jun 2024 00:50:54 +0300 Subject: [PATCH 07/35] test(api): Mockup how to test a Rust function from Lua --- rusile/src/lib.rs | 7 +++++++ spec/rusile_spec.lua | 16 ++++++++++++++++ src/lib.rs | 4 ++++ 3 files changed, 27 insertions(+) create mode 100644 spec/rusile_spec.lua diff --git a/rusile/src/lib.rs b/rusile/src/lib.rs index c5bb5e723..d295175b2 100644 --- a/rusile/src/lib.rs +++ b/rusile/src/lib.rs @@ -7,5 +7,12 @@ use mlua::prelude::*; #[mlua::lua_module] fn rusile(lua: &Lua) -> LuaResult { let exports = lua.create_table().unwrap(); + let demo: LuaFunction = lua.create_function(demo).unwrap(); + exports.set("demo", demo)?; Ok(exports) } + +fn demo(lua: &Lua, (): ()) -> LuaResult { + let res = rusile_demo().unwrap(); + lua.create_string(res) +} diff --git a/spec/rusile_spec.lua b/spec/rusile_spec.lua new file mode 100644 index 000000000..30cbb1117 --- /dev/null +++ b/spec/rusile_spec.lua @@ -0,0 +1,16 @@ +SILE = require("core.sile") + +describe("rusile", function () + + it("should exist", function () + assert.is.truthy(SILE._rusile) + end) + + describe("demo ", function () + it("should return a test string", function () + local str = "Hello from rusile" + assert.is.equal(str, SILE._rusile.demo()) + end) + end) + +end) diff --git a/src/lib.rs b/src/lib.rs index ae6a911ed..db4f2ec89 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -200,3 +200,7 @@ fn path_to_string(path: &PathBuf) -> String { fn paths_to_strings(paths: Vec) -> Vec { paths.iter().map(path_to_string).collect() } + +pub fn rusile_demo() -> Result { + Ok("Hello from rusile".to_string()) +} From 46bcc15a637c3fb0bc006600b004802ddba31f8a Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 28 Jun 2024 13:42:22 +0300 Subject: [PATCH 08/35] chore(deps): Bump pinned versions of patch level crate updates --- Cargo.lock | 357 ++++++++--------------------------------------------- 1 file changed, 54 insertions(+), 303 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 728c3b7b8..017050471 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -92,9 +92,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -159,9 +159,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" [[package]] name = "cfg-if" @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.5" +version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2020fa13af48afc65a9a87335bda648309ab3d154cd03c7ff95b378c7ed39c4" +checksum = "fbca90c87c2a04da41e95d1856e8bcd22f159bdbfa147314d2ce5218057b0e58" dependencies = [ "clap", ] @@ -210,7 +210,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -340,17 +340,6 @@ dependencies = [ "crypto-common", ] -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "dunce" version = "1.0.4" @@ -359,9 +348,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "errno" @@ -578,7 +567,7 @@ version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr", "gix-path", "libc", @@ -587,9 +576,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367ee9093b0c2b04fd04c5c7c8b6a1082713534eab537597ae343663a518fa99" +checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" dependencies = [ "bstr", "itoa", @@ -657,7 +646,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae6232f18b262770e343dcdd461c0011c9b9ae27f0c805e115012aa2b902c1b8" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr", "gix-features", "gix-path", @@ -690,7 +679,7 @@ version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e50e63df6c8d4137f7fb882f27643b3a9756c468a1a2cdbe1ce443010ca8778" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr", "btoi", "filetime", @@ -728,7 +717,7 @@ checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -791,9 +780,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23623cf0f475691a6d943f898c4d0b89f5c1a2a64d0f92bce0e0322ee6528783" +checksum = "ca987128ffb056d732bd545db5db3d8b103d252fbf083c2567bb0796876619a4" dependencies = [ "bstr", "gix-trace", @@ -885,7 +874,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -1010,134 +999,14 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -1173,12 +1042,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -1191,9 +1054,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lua-src" @@ -1231,18 +1094,18 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mlua" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e340c022072f3208a4105458286f4985ba5355bfe243c3073afe45cbe9ecf491" +checksum = "d111deb18a9c9bd33e1541309f4742523bfab01d276bfa9a27519f6de9c11dc7" dependencies = [ "bstr", "mlua-sys", @@ -1254,9 +1117,9 @@ dependencies = [ [[package]] name = "mlua-sys" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5552e7e4e22ada0463dfdeee6caf6dc057a189fdc83136408a8f950a5e5c5540" +checksum = "a088ed0723df7567f569ba018c5d48c23c501f3878b190b04144dfa5ebfa8abc" dependencies = [ "cc", "cfg-if", @@ -1277,7 +1140,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1377,9 +1240,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -1414,7 +1277,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -1480,7 +1343,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.66", + "syn 2.0.68", "walkdir", ] @@ -1497,9 +1360,9 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" @@ -1507,7 +1370,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -1567,14 +1430,14 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", @@ -1637,12 +1500,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "strsim" version = "0.11.1" @@ -1661,26 +1518,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "tempfile" version = "3.10.1" @@ -1720,7 +1566,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1756,21 +1602,11 @@ dependencies = [ "time-core", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] @@ -1787,6 +1623,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-bom" version = "2.0.3" @@ -1810,27 +1652,15 @@ dependencies = [ [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -2042,82 +1872,3 @@ name = "winsafe" version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", -] - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] From af9bbf54c4f5566ab567c0d6f25416699d103adf Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 2 Jul 2024 14:24:50 +0300 Subject: [PATCH 09/35] chore(tooling): Call out Rusile module as possile commit scope --- .commitlintrc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.commitlintrc.yml b/.commitlintrc.yml index bcedfff22..4eae08e9c 100644 --- a/.commitlintrc.yml +++ b/.commitlintrc.yml @@ -51,6 +51,7 @@ rules: - pdf - readme - release + - rusile - settings - shapers - tooling From b8534cf6429ef77c7d21363303431856a48d274e Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 2 Jul 2024 14:18:38 +0300 Subject: [PATCH 10/35] refactor(rusile): Move function into sile, keep rusile as just bindings --- rusile/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rusile/src/lib.rs b/rusile/src/lib.rs index d295175b2..9516dfea8 100644 --- a/rusile/src/lib.rs +++ b/rusile/src/lib.rs @@ -3,6 +3,7 @@ #![crate_type = "staticlib"] use mlua::prelude::*; +use sile::rusile_demo; #[mlua::lua_module] fn rusile(lua: &Lua) -> LuaResult { From f590e3773fc808ae589457b89fd5c7df66884506 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 3 Jul 2024 15:07:56 +0300 Subject: [PATCH 11/35] chore(rusile): Hold off embedding rusile pending duplicate linking issue resolution --- Cargo.toml | 3 +++ Makefile.am | 12 ++++++++---- build-aux/build.rs | 8 +++++++- rusile/Cargo.toml | 4 +++- src/embed.rs.in | 9 +++++---- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 658d004ac..f9990fcdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,6 +78,9 @@ features = [ "derive", "string", "wrap_help" ] version = "0.9" features = [ "macros" ] +# [dependencies.rusile] +# path = "rusile" + [dependencies.rust-embed] version = "8.0" optional = true diff --git a/Makefile.am b/Makefile.am index 030986c3b..fb9bc6493 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,7 +53,7 @@ endif $(MANUAL): $(FIGURES) -BUILT_LUA_SOURCES = core/features.lua core/pathsetup.lua core/version.lua +BUILT_SOURCES_LUA = core/features.lua core/pathsetup.lua core/version.lua RUSILE_SOURCES = rusile/Cargo.toml rusile/src/lib.rs bin_PROGRAMS = sile @@ -67,7 +67,7 @@ noinst_LIBRARIES = librusile.a librusile_a_SOURCES = $(RUSILE_SOURCES) else !EMBEDDED_RESOURCES nobase_dist_pkgdata_DATA = $(SILEDATA) $(LUALIBRARIES) -nobase_nodist_pkgdata_DATA = $(BUILT_LUA_SOURCES) $(LUAMODULES) +nobase_nodist_pkgdata_DATA = $(BUILT_SOURCES_LUA) $(LUAMODULES) pkglib_LIBRARIES = rusile.so rusile_so_SOURCES = $(RUSILE_SOURCES) endif !EMBEDDED_RESOURCES @@ -87,7 +87,7 @@ if EMBEDDED_RESOURCES EXTRA_DIST += $(SILEDATA) $(LUALIBRARIES) endif -BUILT_SOURCES = $(BUILT_LUA_SOURCES) Makefile-distfiles +BUILT_SOURCES = $(BUILT_SOURCES_LUA) Makefile-distfiles CLEANFILES = $(MANUAL) @@ -126,7 +126,11 @@ $(CARGO_BIN): justenough/.libs/justenoughicu.a $(CARGO_BIN): justenough/.libs/justenoughlibtexpdf.a $(CARGO_BIN): justenough/.libs/svg.a $(CARGO_BIN): libtexpdf/.libs/libtexpdf.a -$(CARGO_BIN): librusile.a rusile.so +if EMBEDDED_RESOURCES +$(CARGO_BIN): librusile.a +else !EMBEDDED_RESOURCES +$(CARGO_BIN): rusile.so +endif !EMBEDDED_RESOURCES src/embed-includes.rs: Makefile-distfiles { diff --git a/build-aux/build.rs b/build-aux/build.rs index b92f40575..007423434 100644 --- a/build-aux/build.rs +++ b/build-aux/build.rs @@ -36,7 +36,13 @@ fn main() { generate_shell_completions(); #[cfg(feature = "static")] { - println!("cargo:rustc-link-arg=-lrusile"); + ////let dir = env::var("CARGO_TARGET_DIR").unwrap(); + //let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + //println!( + // "cargo:rustc-link-search=native={}", + // Path::new(&dir).join("target").join("release").display() + //); + //println!("cargo:rustc-link-arg=-l:librusile.a"); let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); println!( diff --git a/rusile/Cargo.toml b/rusile/Cargo.toml index ea6afb749..1d34eb520 100644 --- a/rusile/Cargo.toml +++ b/rusile/Cargo.toml @@ -17,12 +17,14 @@ crate_type = ["rlib", "cdylib", "staticlib"] path = ".." [features] +default = [] lua54 = [ "mlua/lua54" ] lua53 = [ "mlua/lua53" ] lua52 = [ "mlua/lua52" ] lua51 = [ "mlua/lua51" ] luajit = [ "mlua/luajit" ] +vendored = [ "mlua/vendored" ] [dependencies.mlua] version = "0.9" -features = [ "module" ] +features = [ "macros", "module" ] diff --git a/src/embed.rs.in b/src/embed.rs.in index 1db7e9687..88681dac5 100644 --- a/src/embed.rs.in +++ b/src/embed.rs.in @@ -2,6 +2,7 @@ use mlua::chunk; use mlua::prelude::*; use rust_embed::{EmbeddedFile, RustEmbed}; use std::str; +//use rusile::rusile; /// Embed everything that would otherwise be installed to datadir #[derive(RustEmbed)] @@ -31,7 +32,7 @@ pub struct SileModules; // Link Lua loader functions from C modules that Lua would otherwise be loading externally that // we've linked into the CLI binary. Linking happens in build-aux/build.rs. extern "C-unwind" { - fn luaopen_rusile(lua: *mut mlua::lua_State) -> i32; + //fn luaopen_rusile(lua: *mut mlua::lua_State) -> i32; fn luaopen_fontmetrics(lua: *mut mlua::lua_State) -> i32; fn luaopen_justenoughfontconfig(lua: *mut mlua::lua_State) -> i32; fn luaopen_justenoughharfbuzz(lua: *mut mlua::lua_State) -> i32; @@ -53,9 +54,9 @@ pub fn inject_embedded_loader(lua: &Lua) { loaders .push(LuaFunction::wrap(|lua, module: String| unsafe { match module.as_str() { - "rusile" => lua - .create_c_function(luaopen_rusile) - .map(LuaValue::Function), + //"rusile" => lua + // .create_c_function(luaopen_rusile) + // .map(LuaValue::Function), "fontmetrics" => lua .create_c_function(luaopen_fontmetrics) .map(LuaValue::Function), From b70acd7d5a02a92a80d880fac7b6bd243c7d80d5 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 2 Oct 2024 16:11:21 +0300 Subject: [PATCH 12/35] chore(deps): Bump pinned versions of patch level crate updates --- Cargo.lock | 607 +++++++++++++++++++++++++++-------------------------- libtexpdf | 2 +- 2 files changed, 310 insertions(+), 299 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b8475f28..a536be2e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,10 +3,22 @@ version = 3 [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] [[package]] name = "aho-corasick" @@ -17,11 +29,17 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -34,33 +52,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -68,9 +86,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arc-swap" @@ -80,9 +98,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" @@ -107,29 +125,20 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", "regex-automata", "serde", ] -[[package]] -name = "btoi" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" -dependencies = [ - "num-traits", -] - [[package]] name = "camino" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -159,9 +168,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.101" +version = "1.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" +checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -171,9 +183,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.7" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" dependencies = [ "clap_builder", "clap_derive", @@ -181,9 +193,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" dependencies = [ "anstream", "anstyle", @@ -194,36 +206,36 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.6" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbca90c87c2a04da41e95d1856e8bcd22f159bdbfa147314d2ce5218057b0e58" +checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.79", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clap_mangen" -version = "0.2.21" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b70fc13e60c0e1d490dc50eb73a749be6d81f4ef03783df1d9b7b0c62bc937" +checksum = "f17415fd4dfbea46e3274fcd8d368284519b358654772afb700dc2e8d2b24eeb" dependencies = [ "clap", "roff", @@ -237,9 +249,9 @@ checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "core-foundation" @@ -253,9 +265,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core-graphics" @@ -295,9 +307,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -342,9 +354,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" @@ -370,32 +382,38 @@ checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foreign-types" version = "0.3.2" @@ -453,9 +471,9 @@ dependencies = [ [[package]] name = "gix" -version = "0.57.1" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd025382892c7b500a9ce1582cd803f9c2ebfe44aff52e9c7f86feee7ced75e" +checksum = "984c5018adfa7a4536ade67990b3ebc6e11ab57b3d6cd9968de0947ca99b4b06" dependencies = [ "gix-actor", "gix-commitgraph", @@ -491,18 +509,17 @@ dependencies = [ "signal-hook", "smallvec", "thiserror", - "unicode-normalization", ] [[package]] name = "gix-actor" -version = "0.29.1" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da27b5ab4ab5c75ff891dccd48409f8cc53c28a79480f1efdd33184b2dc1d958" +checksum = "a0e454357e34b833cc3a00b6efbbd3dd4d18b24b9fb0c023876ec2645e8aa3f2" dependencies = [ "bstr", - "btoi", "gix-date", + "gix-utils", "itoa", "thiserror", "winnow", @@ -528,9 +545,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.23.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8dcbf434951fa477063e05fea59722615af70dc2567377e58c2f7853b010fc" +checksum = "133b06f67f565836ec0c473e2116a60fb74f80b6435e21d88013ac0e3c60fc78" dependencies = [ "bstr", "gix-chunk", @@ -542,9 +559,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.33.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367304855b369cadcac4ee5fb5a3a20da9378dd7905106141070b79f85241079" +checksum = "53fafe42957e11d98e354a66b6bd70aeea00faf2f62dd11164188224a507c840" dependencies = [ "bstr", "gix-config-value", @@ -563,9 +580,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.6" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" +checksum = "03f76169faa0dec598eac60f83d7fcdd739ec16596eca8fb144c88973dbe6f8c" dependencies = [ "bitflags 2.6.0", "bstr", @@ -588,9 +605,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.39.1" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6a0454f8c42d686f17e7f084057c717c082b7dbb8209729e4e8f26749eb93a" +checksum = "1996d5c8a305b59709467d80617c9fde48d9d75fd1f4179ea970912630886c9d" dependencies = [ "bstr", "gix-hash", @@ -600,12 +617,13 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.28.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d7b2896edc3d899d28a646ccc6df729827a6600e546570b2783466404a42d6" +checksum = "fc27c699b63da66b50d50c00668bc0b7e90c3a382ef302865e891559935f3dbf" dependencies = [ "bstr", "dunce", + "gix-fs", "gix-hash", "gix-path", "gix-ref", @@ -615,14 +633,15 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.37.2" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50270e8dcc665f30ba0735b17984b9535bdf1e646c76e638e007846164d57af" +checksum = "ac7045ac9fe5f9c727f38799d002a7ed3583cd777e3322a7c4b43e3cf437dc69" dependencies = [ "crc32fast", "flate2", "gix-hash", "gix-trace", + "gix-utils", "libc", "once_cell", "prodash", @@ -633,18 +652,20 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.9.1" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7555c23a005537434bbfcb8939694e18cad42602961d0de617f8477cc2adecdd" +checksum = "f2bfe6249cfea6d0c0e0990d5226a4cb36f030444ba9e35e0639275db8f98575" dependencies = [ + "fastrand", "gix-features", + "gix-utils", ] [[package]] name = "gix-glob" -version = "0.15.1" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6232f18b262770e343dcdd461c0011c9b9ae27f0c805e115012aa2b902c1b8" +checksum = "74908b4bbc0a0a40852737e5d7889f676f081e340d5451a16e5b4c50d592f111" dependencies = [ "bitflags 2.6.0", "bstr", @@ -675,14 +696,14 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.28.2" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e50e63df6c8d4137f7fb882f27643b3a9756c468a1a2cdbe1ce443010ca8778" +checksum = "9a9a44eb55bd84bb48f8a44980e951968ced21e171b22d115d1cdcef82a7d73f" dependencies = [ "bitflags 2.6.0", "bstr", - "btoi", "filetime", + "fnv", "gix-bitmap", "gix-features", "gix-fs", @@ -690,6 +711,9 @@ dependencies = [ "gix-lock", "gix-object", "gix-traverse", + "gix-utils", + "gix-validate", + "hashbrown", "itoa", "libc", "memmap2", @@ -700,9 +724,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "12.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40a439397f1e230b54cf85d52af87e5ea44cc1e7748379785d3f6d03d802b00" +checksum = "e3bc7fe297f1f4614774989c00ec8b1add59571dc9b024b4c00acb7dedd4e19d" dependencies = [ "gix-tempfile", "gix-utils", @@ -717,21 +741,21 @@ checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.79", ] [[package]] name = "gix-object" -version = "0.40.1" +version = "0.42.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c89402e8faa41b49fde348665a8f38589e461036475af43b6b70615a6a313a2" +checksum = "25da2f46b4e7c2fa7b413ce4dffb87f69eaf89c2057e386491f4c55cadbfe386" dependencies = [ "bstr", - "btoi", "gix-actor", "gix-date", "gix-features", "gix-hash", + "gix-utils", "gix-validate", "itoa", "smallvec", @@ -741,13 +765,14 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.56.1" +version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46ae6da873de41c6c2b73570e82c571b69df5154dcd8f46dfafc6687767c33b1" +checksum = "20d384fe541d93d8a3bb7d5d5ef210780d6df4f50c4e684ccba32665a5e3bc9b" dependencies = [ "arc-swap", "gix-date", "gix-features", + "gix-fs", "gix-hash", "gix-object", "gix-pack", @@ -760,9 +785,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.46.1" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "782b4d42790a14072d5c400deda9851f5765f50fe72bca6dece0da1cd6f05a9a" +checksum = "3e0594491fffe55df94ba1c111a6566b7f56b3f8d2e1efc750e77d572f5f5229" dependencies = [ "clru", "gix-chunk", @@ -771,18 +796,16 @@ dependencies = [ "gix-hashtable", "gix-object", "gix-path", - "gix-tempfile", "memmap2", - "parking_lot", "smallvec", "thiserror", ] [[package]] name = "gix-path" -version = "0.10.8" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca987128ffb056d732bd545db5db3d8b103d252fbf083c2567bb0796876619a4" +checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" dependencies = [ "bstr", "gix-trace", @@ -804,9 +827,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.40.1" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d9bd1984638d8f3511a2fcbe84fcedb8a5b5d64df677353620572383f42649" +checksum = "3394a2997e5bc6b22ebc1e1a87b41eeefbcfcff3dbfa7c4bd73cb0ac8f1f3e2e" dependencies = [ "gix-actor", "gix-date", @@ -817,6 +840,7 @@ dependencies = [ "gix-object", "gix-path", "gix-tempfile", + "gix-utils", "gix-validate", "memmap2", "thiserror", @@ -825,9 +849,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.21.1" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be219df5092c1735abb2a53eccdf775e945eea6986ee1b6e7a5896dccc0be704" +checksum = "6868f8cd2e62555d1f7c78b784bece43ace40dd2a462daf3b588d5416e603f37" dependencies = [ "bstr", "gix-hash", @@ -839,9 +863,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.25.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa78e1df3633bc937d4db15f8dca2abdb1300ca971c0fabcf9fa97e38cf4cd9f" +checksum = "01b13e43c2118c4b0537ddac7d0821ae0dfa90b7b8dbf20c711e153fb749adce" dependencies = [ "bstr", "gix-date", @@ -855,9 +879,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.11.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702de5fe5c2bbdde80219f3a8b9723eb927466e7ecd187cfd1b45d986408e45f" +checksum = "1b030ccaab71af141f537e0225f19b9e74f25fefdba0372246b844491cab43e0" dependencies = [ "gix-commitgraph", "gix-date", @@ -870,9 +894,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" +checksum = "0fe4d52f30a737bbece5276fab5d3a8b276dc2650df963e293d0673be34e7a5f" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -882,9 +906,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "12.0.1" +version = "14.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8ef376d718b1f5f119b458e21b00fbf576bc9d4e26f8f383d29f5ffe3ba3eaa" +checksum = "046b4927969fa816a150a0cda2e62c80016fe11fb3c3184e4dddf4e542f108aa" dependencies = [ "gix-fs", "libc", @@ -897,16 +921,17 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" +checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" [[package]] name = "gix-traverse" -version = "0.36.2" +version = "0.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65109e445ba7a409b48f34f570a4d7db72eade1dc1bcff81990a490e86c07161" +checksum = "e499a18c511e71cf4a20413b743b9f5bcf64b3d9e81e9c3c6cd399eae55a8840" dependencies = [ + "bitflags 2.6.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -919,9 +944,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.26.1" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0f17cceb7552a231d1fec690bc2740c346554e3be6f5d2c41dfa809594dc44" +checksum = "fd280c5e84fb22e128ed2a053a0daeacb6379469be6a85e3d518a0636e160c89" dependencies = [ "bstr", "gix-features", @@ -953,9 +978,9 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", @@ -983,6 +1008,10 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "heck" @@ -1011,9 +1040,9 @@ dependencies = [ [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -1032,9 +1061,20 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.159" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" + +[[package]] +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall", +] [[package]] name = "linux-raw-sys" @@ -1060,18 +1100,18 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lua-src" -version = "546.0.2" +version = "547.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da0daa7eee611a4c30c8f5ee31af55266e26e573971ba9336d2993e2da129b2" +checksum = "1edaf29e3517b49b8b746701e5648ccb5785cde1c119062cbabbc5d5cd115e42" dependencies = [ "cc", ] [[package]] name = "luajit-src" -version = "210.5.8+5790d25" +version = "210.5.10+f725e44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "441f18d9ad792e871fc2f7f2cb8902c386f6f56fdbddef3b835b61475e375346" +checksum = "18a0fa0df28e21f785c48d9c0f0be355cf40658badb667284207dbb4d1e574a9" dependencies = [ "cc", "which", @@ -1085,20 +1125,20 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -1117,9 +1157,9 @@ dependencies = [ [[package]] name = "mlua-sys" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a088ed0723df7567f569ba018c5d48c23c501f3878b190b04144dfa5ebfa8abc" +checksum = "ebe026d6bd1583a9cf9080e189030ddaea7e6f5f0deb366a8e26f8a26c4135b8" dependencies = [ "cc", "cfg-if", @@ -1140,7 +1180,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.68", + "syn 2.0.79", ] [[package]] @@ -1169,9 +1209,12 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "parking_lot" @@ -1191,9 +1234,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.2", + "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets", ] [[package]] @@ -1204,9 +1247,15 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "portable-atomic" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "powerfmt" @@ -1255,36 +1304,27 @@ checksum = "744a264d26b88a6a7e37cbad97953fa233b94d585236310bcbc88474b4092d79" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.5" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -1294,9 +1334,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -1305,15 +1345,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "roff" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b833d8d034ea094b1ea68aa6d5c740e0d04bad9d16568d08ba6f76823a114316" +checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3" [[package]] name = "rusile" @@ -1325,9 +1365,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.4.0" +version = "8.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19549741604902eb99a7ed0ee177a0663ee1eda51a29f71401f166e47e77806a" +checksum = "fa66af4a4fdd5e7ebc276f115e895611a34739a9c1c01028383d612d550953c0" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1336,22 +1376,22 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.4.0" +version = "8.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9f96e283ec64401f30d3df8ee2aaeb2561f34c824381efa24a35f79bf40ee4" +checksum = "6125dbc8867951125eec87294137f4e9c2c96566e61bf72c45095a7c77761478" dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.68", + "syn 2.0.79", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "8.4.0" +version = "8.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c74a686185620830701348de757fd36bef4aa9680fd23c49fc539ddcc1af32" +checksum = "2e5347777e9aacb56039b0e1f28785929a8a3b709e87482e7442c72e7c12529d" dependencies = [ "globset", "sha2", @@ -1366,9 +1406,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -1415,40 +1455,41 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.118" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -1461,6 +1502,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -1518,9 +1565,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.68" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -1529,44 +1576,45 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" dependencies = [ "rustix", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.79", ] [[package]] @@ -1604,9 +1652,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -1637,15 +1685,15 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] @@ -1669,9 +1717,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "vergen" -version = "8.3.1" +version = "8.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566" dependencies = [ "anyhow", "cargo_metadata", @@ -1684,9 +1732,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -1700,9 +1748,9 @@ dependencies = [ [[package]] name = "which" -version = "6.0.1" +version = "6.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8211e4f58a2b2805adfbefbc07bab82958fc91e3836339b1ab7ae32465dce0d7" +checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", @@ -1712,20 +1760,11 @@ dependencies = [ [[package]] name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-targets 0.48.5", + "windows-sys 0.59.0", ] [[package]] @@ -1734,135 +1773,87 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -1872,3 +1863,23 @@ name = "winsafe" version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] diff --git a/libtexpdf b/libtexpdf index 736a5e753..1891bee5e 160000 --- a/libtexpdf +++ b/libtexpdf @@ -1 +1 @@ -Subproject commit 736a5e7530c13582ea704a061a358d0caa774916 +Subproject commit 1891bee5e0b73165e4a259f910d3ea3fe1df0b42 From 8dcccca8c937bd81cb01d0b612265fadc0dd5814 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 3 Oct 2024 11:21:26 +0300 Subject: [PATCH 13/35] chore(deps): Bump mlua to RC1 of upcomming 0.10 release --- Cargo.lock | 49 ++++++++++++++++++++----------------------------- Cargo.toml | 2 +- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee83e7803..cc8565c0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,9 +168,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.24" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "shlex", ] @@ -183,9 +183,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -206,9 +206,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.32" +version = "4.5.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a01f4f9ee6c066d42a1c8dedf0dcddad16c72a8981a309d6398de3a75b0c39" +checksum = "9646e2e245bf62f45d39a0f3f36f1171ad1ea0d6967fd114bca72cb02a8fcdfb" dependencies = [ "clap", ] @@ -233,9 +233,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clap_mangen" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17415fd4dfbea46e3274fcd8d368284519b358654772afb700dc2e8d2b24eeb" +checksum = "fbae9cbfdc5d4fa8711c09bd7b83f644cb48281ac35bf97af3e47b0675864bdf" dependencies = [ "clap", "roff", @@ -1109,9 +1109,9 @@ dependencies = [ [[package]] name = "luajit-src" -version = "210.5.10+f725e44" +version = "210.5.11+97813fb" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a0fa0df28e21f785c48d9c0f0be355cf40658badb667284207dbb4d1e574a9" +checksum = "3015551c284515db7c30c559fc1080f9cb9ee990d1f6fca315451a107c7540bb" dependencies = [ "cc", "which", @@ -1143,9 +1143,9 @@ dependencies = [ [[package]] name = "mlua" -version = "0.10.0-beta.2" +version = "0.10.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200dd4c8e5f81416d43a023b9921c3cbf01d828094b23a90b26826c3840ba4f3" +checksum = "7928e85ce39d4ea4d11dc850fde2acb503fc114a76f53e8606dd9ed237a491e9" dependencies = [ "bstr", "mlua-sys", @@ -1170,9 +1170,9 @@ dependencies = [ [[package]] name = "mlua_derive" -version = "0.10.0-beta.1" +version = "0.10.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e6f40fa1fd8426285688f4a37b56beac69284743d057ee6db352b543f4b621" +checksum = "e110f0addea6b8d2f2378717e94f63b36a74274760b4895943b3a5650fa7513e" dependencies = [ "itertools", "once_cell", @@ -1209,12 +1209,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "parking_lot" @@ -1251,12 +1248,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "powerfmt" version = "0.2.0" @@ -1289,9 +1280,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] diff --git a/Cargo.toml b/Cargo.toml index d7685e0f6..62e8c937d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,7 +108,7 @@ zsh = [ "completions" ] lto = true [workspace.dependencies.mlua] -version = "0.10.0-beta.2" +version = "0.10.0-rc.1" [dependencies.anyhow] version = "1.0" From 247856e93debb1b5b9d2c99023e3ed5bf0704206 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 3 Oct 2024 11:21:26 +0300 Subject: [PATCH 14/35] refactor(rusile): Use new anyhow feature to wrap original function --- Cargo.lock | 1 + Cargo.toml | 1 + Makefile.am | 2 +- rusile/src/lib.rs | 9 +-------- src/lib.rs | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cc8565c0f..a4fd60dde 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1147,6 +1147,7 @@ version = "0.10.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7928e85ce39d4ea4d11dc850fde2acb503fc114a76f53e8606dd9ed237a491e9" dependencies = [ + "anyhow", "bstr", "mlua-sys", "mlua_derive", diff --git a/Cargo.toml b/Cargo.toml index 62e8c937d..920c78db7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,6 +109,7 @@ lto = true [workspace.dependencies.mlua] version = "0.10.0-rc.1" +features = [ "anyhow" ] [dependencies.anyhow] version = "1.0" diff --git a/Makefile.am b/Makefile.am index a7224b0fe..149de6863 100644 --- a/Makefile.am +++ b/Makefile.am @@ -171,7 +171,7 @@ if FONT_VARIATIONS CARGO_FEATURE_ARGS += --features variations endif -rusile.so: +rusile.so: $(rusile_so_SOURCES) $(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) $(RUSILE_FEATURE_ARG) $(CARGO_RELEASE_ARGS) -p rusile $(INSTALL) @builddir@/target/@RUST_TARGET_SUBDIR@/lib$@ $@ diff --git a/rusile/src/lib.rs b/rusile/src/lib.rs index 9516dfea8..d7678acff 100644 --- a/rusile/src/lib.rs +++ b/rusile/src/lib.rs @@ -3,17 +3,10 @@ #![crate_type = "staticlib"] use mlua::prelude::*; -use sile::rusile_demo; #[mlua::lua_module] fn rusile(lua: &Lua) -> LuaResult { let exports = lua.create_table().unwrap(); - let demo: LuaFunction = lua.create_function(demo).unwrap(); - exports.set("demo", demo)?; + exports.set("demo", LuaFunction::wrap_raw(sile::rusile_demo))?; Ok(exports) } - -fn demo(lua: &Lua, (): ()) -> LuaResult { - let res = rusile_demo().unwrap(); - lua.create_string(res) -} diff --git a/src/lib.rs b/src/lib.rs index 89680cd04..782c7784c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -202,5 +202,5 @@ fn paths_to_strings(paths: Vec) -> Vec { } pub fn rusile_demo() -> Result { - Ok("Hello from rusile".to_string()) + Ok("Hello from rusile in the ten era".to_string()) } From 0b06d33706cae968d794c04fa791e18cceca0115 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 10 Oct 2024 15:59:37 +0300 Subject: [PATCH 15/35] chore(rusile): Update Cargo syntax for edition 2024 --- Cargo.toml | 3 --- rusile/Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 920c78db7..342b5e6d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -123,9 +123,6 @@ features = [ "derive", "string", "wrap_help" ] workspace = true features = [ "macros" ] -# [dependencies.rusile] -# path = "rusile" - [dependencies.rust-embed] version = "8.0" optional = true diff --git a/rusile/Cargo.toml b/rusile/Cargo.toml index c1a5a8c20..8606b30ee 100644 --- a/rusile/Cargo.toml +++ b/rusile/Cargo.toml @@ -11,7 +11,7 @@ repository.workspace = true license.workspace = true [lib] -crate_type = ["rlib", "cdylib", "staticlib"] +crate-type = ["rlib", "cdylib", "staticlib"] [dependencies.sile] path = ".." From b106bdae74c243a89dbd74823cc8cf12fc045818 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 12 Jun 2024 02:27:01 +0300 Subject: [PATCH 16/35] chore(deps): Add semver package, going to try to replace vendored Lua library --- Cargo.lock | 1 + Cargo.toml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index a4fd60dde..0fda3fa47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1530,6 +1530,7 @@ dependencies = [ "harfbuzz-sys", "mlua", "rust-embed", + "semver", "vergen", ] diff --git a/Cargo.toml b/Cargo.toml index 342b5e6d0..a7c834da4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,6 +132,9 @@ features = [ "include-exclude" ] version = "0.5" optional = true +[dependencies.semver] +version = "1.0" + [build-dependencies.clap_complete] version = "4.4" optional = true From 7fc0351831b51e04725db7b9e1eda0e019eb4d96 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 10 Oct 2024 18:01:09 +0300 Subject: [PATCH 17/35] chore(tooling): Setup bacon --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index a7c834da4..6886541e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,9 @@ homepage.workspace = true repository.workspace = true license.workspace = true +[package.metadata.bacon.jobs] +cmd = [ "cargo", "build", "--color", "always" ] + [package.metadata.typos.default] locale = "en-us" extend-ignore-re = [ From b850b24e49de4a30e1e29bf4b5642e7b1423f7c6 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 12 Oct 2024 16:46:57 +0300 Subject: [PATCH 18/35] chore(rusile): Remove demo, make room to land real stuff --- rusile/src/lib.rs | 1 - spec/rusile_spec.lua | 7 ------- src/lib.rs | 4 ---- 3 files changed, 12 deletions(-) diff --git a/rusile/src/lib.rs b/rusile/src/lib.rs index d7678acff..c5bb5e723 100644 --- a/rusile/src/lib.rs +++ b/rusile/src/lib.rs @@ -7,6 +7,5 @@ use mlua::prelude::*; #[mlua::lua_module] fn rusile(lua: &Lua) -> LuaResult { let exports = lua.create_table().unwrap(); - exports.set("demo", LuaFunction::wrap_raw(sile::rusile_demo))?; Ok(exports) } diff --git a/spec/rusile_spec.lua b/spec/rusile_spec.lua index 30cbb1117..e54bbfa6b 100644 --- a/spec/rusile_spec.lua +++ b/spec/rusile_spec.lua @@ -6,11 +6,4 @@ describe("rusile", function () assert.is.truthy(SILE._rusile) end) - describe("demo ", function () - it("should return a test string", function () - local str = "Hello from rusile" - assert.is.equal(str, SILE._rusile.demo()) - end) - end) - end) diff --git a/src/lib.rs b/src/lib.rs index 782c7784c..0c8254be8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -200,7 +200,3 @@ fn path_to_string(path: &PathBuf) -> String { fn paths_to_strings(paths: Vec) -> Vec { paths.iter().map(path_to_string).collect() } - -pub fn rusile_demo() -> Result { - Ok("Hello from rusile in the ten era".to_string()) -} From 358954a110acfba125e00c9048146b7615124a4d Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 10 Oct 2024 16:37:23 +0300 Subject: [PATCH 19/35] refactor(utilities): Rewrite semver in Rust and wrap as Lua type --- Makefile.am | 4 +-- rusile/src/lib.rs | 3 ++- src/lib.rs | 2 ++ src/types.rs | 1 + src/types/semver.rs | 65 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 src/types.rs create mode 100644 src/types/semver.rs diff --git a/Makefile.am b/Makefile.am index 149de6863..39932f411 100644 --- a/Makefile.am +++ b/Makefile.am @@ -62,7 +62,7 @@ bin_PROGRAMS = sile bin_SCRIPTS = sile-lua nodist_man_MANS = dist_man_MANS = sile-lua.1 -sile_SOURCES = src/bin/sile.rs src/lib.rs src/cli.rs +sile_SOURCES = src/bin/sile.rs src/lib.rs src/cli.rs src/types.rs src/types/semver.rs EXTRA_sile_SOURCES = if EMBEDDED_RESOURCES noinst_LIBRARIES = librusile.a @@ -171,7 +171,7 @@ if FONT_VARIATIONS CARGO_FEATURE_ARGS += --features variations endif -rusile.so: $(rusile_so_SOURCES) +rusile.so: $(rusile_so_SOURCES) $(bin_PROGRAMS) $(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) $(RUSILE_FEATURE_ARG) $(CARGO_RELEASE_ARGS) -p rusile $(INSTALL) @builddir@/target/@RUST_TARGET_SUBDIR@/lib$@ $@ diff --git a/rusile/src/lib.rs b/rusile/src/lib.rs index c5bb5e723..f4fb4bc11 100644 --- a/rusile/src/lib.rs +++ b/rusile/src/lib.rs @@ -6,6 +6,7 @@ use mlua::prelude::*; #[mlua::lua_module] fn rusile(lua: &Lua) -> LuaResult { - let exports = lua.create_table().unwrap(); + let exports = lua.create_table()?; + exports.set("semver", LuaFunction::wrap_raw(sile::types::semver::semver))?; Ok(exports) } diff --git a/src/lib.rs b/src/lib.rs index 0c8254be8..4f38bb63f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,6 +12,8 @@ pub mod cli; #[cfg(feature = "static")] pub mod embed; +pub mod types; + pub type Result = anyhow::Result; pub fn start_luavm() -> crate::Result { diff --git a/src/types.rs b/src/types.rs new file mode 100644 index 000000000..b658cff6c --- /dev/null +++ b/src/types.rs @@ -0,0 +1 @@ +pub mod semver; diff --git a/src/types/semver.rs b/src/types/semver.rs new file mode 100644 index 000000000..7d7e888a6 --- /dev/null +++ b/src/types/semver.rs @@ -0,0 +1,65 @@ +use mlua::prelude::*; +use semver::Version; +use std::ops::Deref; + +#[derive(Clone, Debug)] +pub struct Semver { + version: Version, +} + +impl Semver { + pub fn new(version: &str) -> crate::Result { + let version = version.strip_prefix("v").unwrap_or(version); + Ok(Self { + version: Version::parse(version)?, + }) + } +} + +// TODO: cfg gate this so it only ends up in Lua module? +pub fn semver(version: String) -> crate::Result { + Ok(Semver::new(&version)?) +} + +impl Deref for Semver { + type Target = Version; + fn deref(&self) -> &Version { + &self.version + } +} + +impl LuaUserData for Semver { + fn add_fields>(fields: &mut F) { + fields.add_field_method_get("major", |_, this| Ok(this.version.major)); + fields.add_field_method_get("minor", |_, this| Ok(this.version.minor)); + fields.add_field_method_get("patch", |_, this| Ok(this.version.patch)); + } + + fn add_methods>(methods: &mut M) { + methods.add_meta_method(LuaMetaMethod::ToString, |_, this, ()| { + Ok(this.version.to_string()) + }); + + methods.add_meta_method(LuaMetaMethod::Eq, |_, this, other: Self| { + Ok(this.version == other.version) + }); + + methods.add_meta_method(LuaMetaMethod::Le, |_, this, other: Self| { + Ok(this.version <= other.version) + }); + + methods.add_meta_method(LuaMetaMethod::Lt, |_, this, other: Self| { + Ok(this.version < other.version) + }); + } +} + +impl FromLua for Semver { + fn from_lua(value: LuaValue, _: &Lua) -> LuaResult { + match value { + LuaValue::UserData(ud) => Ok(ud.borrow::()?.clone()), + LuaValue::Table(_t) => todo!("implement for legacy Lua table based implementation"), + _ => unreachable!(), + } + } +} From 932252e67bfca8586d252f57875e592b59453148 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 12 Oct 2024 23:47:53 +0300 Subject: [PATCH 20/35] test(utilities): Add unit tests for semver type --- spec/rusile_spec.lua | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/spec/rusile_spec.lua b/spec/rusile_spec.lua index e54bbfa6b..3bacd2a91 100644 --- a/spec/rusile_spec.lua +++ b/spec/rusile_spec.lua @@ -1,9 +1,37 @@ SILE = require("core.sile") -describe("rusile", function () +local rusile = SILE._rusile + +local callable = require("luassert.util").callable +describe("rusile", function () it("should exist", function () - assert.is.truthy(SILE._rusile) + assert.is.truthy(rusile) end) + describe("semver", function () + -- semver = SILE._rusile.semver + semver = require("semver") + + it("constructor should exist", function () + assert.is.truthy(callable(semver)) + end) + + describe("instance", function () + local a = semver("1.3.5") + local b = semver("1.3.5") + local c = semver("2.4.6") + + it("should evaluate comparisons", function () + assert.is.equal(a, b) + assert.is.truthy(a == b) + assert.is_not.equal(a, c) + assert.is_not.truthy(a == c) + assert.is.truthy(a < c) + assert.is.truthy(c > b) + assert.is.truthy(a <= b) + assert.is.truthy(c >= b) + end) + end) + end) end) From 0ade15ef2e19b4da50a0f42ae9697abf8871ce34 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Mon, 14 Oct 2024 00:04:22 +0300 Subject: [PATCH 21/35] chore(cli): Add names to Lua code chunks to improve error messages --- src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 4f38bb63f..00055d64b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,7 +28,10 @@ pub fn start_luavm() -> crate::Result { pub fn inject_paths(lua: &Lua) { #[cfg(feature = "static")] - lua.load(r#"require("core.pathsetup")"#).exec().unwrap(); + lua.load(r#"require("core.pathsetup")"#) + .set_name("relative pathsetup loader") + .exec() + .unwrap(); #[cfg(not(feature = "static"))] { let datadir = env!("CONFIGURE_DATADIR").to_string(); @@ -47,6 +50,7 @@ pub fn inject_paths(lua: &Lua) { dofile("./core/pathsetup.lua") end }) + .set_name("hard coded pathsetup loader") .exec() .unwrap(); } @@ -147,6 +151,7 @@ pub fn run( local spec = SILE.parserBits.cliuse:match($module); table.insert(SILE.input.uses, spec) }) + .set_name("cli --uses flag parser") .eval::<()>()?; // let spec = cliuse.call_function::<_, _, _>("match", module); } From f1027282041a7059df9d7232a4cf0d6ee3276ba3 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 26 Oct 2024 18:07:25 +0300 Subject: [PATCH 22/35] chore(core): Update mlua from prerelease to stable tag --- Cargo.lock | 13 +++++++------ Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0fda3fa47..20bab6cd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1143,12 +1143,13 @@ dependencies = [ [[package]] name = "mlua" -version = "0.10.0-rc.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7928e85ce39d4ea4d11dc850fde2acb503fc114a76f53e8606dd9ed237a491e9" +checksum = "0f6ddbd668297c46be4bdea6c599dcc1f001a129586272d53170b7ac0a62961e" dependencies = [ "anyhow", "bstr", + "either", "mlua-sys", "mlua_derive", "num-traits", @@ -1158,9 +1159,9 @@ dependencies = [ [[package]] name = "mlua-sys" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe026d6bd1583a9cf9080e189030ddaea7e6f5f0deb366a8e26f8a26c4135b8" +checksum = "e9eebac25c35a13285456c88ee2fde93d9aee8bcfdaf03f9d6d12be3391351ec" dependencies = [ "cc", "cfg-if", @@ -1171,9 +1172,9 @@ dependencies = [ [[package]] name = "mlua_derive" -version = "0.10.0-rc.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e110f0addea6b8d2f2378717e94f63b36a74274760b4895943b3a5650fa7513e" +checksum = "2cfc5faa2e0d044b3f5f0879be2920e0a711c97744c42cf1c295cb183668933e" dependencies = [ "itertools", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 6886541e6..77c55511f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,7 +111,7 @@ zsh = [ "completions" ] lto = true [workspace.dependencies.mlua] -version = "0.10.0-rc.1" +version = "0.10.0" features = [ "anyhow" ] [dependencies.anyhow] From 208ce4f4df1161ec8fa2a439a5e25fb7b63e14e2 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 26 Oct 2024 18:12:21 +0300 Subject: [PATCH 23/35] refactor(core): Avoid chunk execution when enabled by mlua v0.10 --- src/lib.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 00055d64b..27c38d539 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -142,18 +142,15 @@ pub fn run( sile_input.set("options", options)?; } if let Some(modules) = uses { - // let parser_bits: LuaTable = sile.get("parserBits")?; - // let cliuse: LuaAnyUserData = parser_bits.get("cliuse")?; - // sile_input.get("uses")?; + let parser_bits: LuaTable = sile.get("parserBits")?; + let cliuse: LuaAnyUserData = parser_bits.get("cliuse")?; + let input_uses: LuaTable = sile_input.get("uses")?; for module in modules.iter() { let module = lua.create_string(module)?; - lua.load(chunk! { - local spec = SILE.parserBits.cliuse:match($module); - table.insert(SILE.input.uses, spec) - }) - .set_name("cli --uses flag parser") - .eval::<()>()?; - // let spec = cliuse.call_function::<_, _, _>("match", module); + let spec: LuaTable = cliuse + .call_method::<_>("match", module) + .context("failed to call `cliuse:match()`")?; + let _ = input_uses.push(spec); } } if !quiet { From fb6b866ddefbf871ce7e89e5e7c7f3c73c781ae4 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 1 Nov 2024 16:32:52 +0300 Subject: [PATCH 24/35] fix(cli): Correct return value handling when process() doesn't lift weight --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 27c38d539..845251b3c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -184,7 +184,7 @@ pub fn run( let input_filenames: LuaTable = sile_input.get("filenames")?; let process_file: LuaFunction = sile.get("processFile")?; for file in input_filenames.sequence_values::() { - process_file.call::(file?)?; + process_file.call::(file?)?; } let finish: LuaFunction = sile.get("finish")?; finish.call::(())?; From 1e162f69fdf4ed7129a2e04d9735d42cd36348ce Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 1 Nov 2024 16:35:03 +0300 Subject: [PATCH 25/35] chore(rusile): Allow conversion of nil to semver --- src/types/semver.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/types/semver.rs b/src/types/semver.rs index 7d7e888a6..5835e146d 100644 --- a/src/types/semver.rs +++ b/src/types/semver.rs @@ -18,7 +18,7 @@ impl Semver { // TODO: cfg gate this so it only ends up in Lua module? pub fn semver(version: String) -> crate::Result { - Ok(Semver::new(&version)?) + Semver::new(&version) } impl Deref for Semver { @@ -59,6 +59,7 @@ impl FromLua for Semver { match value { LuaValue::UserData(ud) => Ok(ud.borrow::()?.clone()), LuaValue::Table(_t) => todo!("implement for legacy Lua table based implementation"), + LuaValue::Nil => Ok(Semver::new("0.0.0")?), _ => unreachable!(), } } From dae2f7fe1398fd91eb64a59facbb03b9accd7f1a Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 2 Nov 2024 11:31:29 +0300 Subject: [PATCH 26/35] fix(build): Correct regression in v0.15.5 in generating embedded files list --- Makefile.am | 5 +++-- build-aux/que_rust_boilerplate.am | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 39932f411..e6c1d2b0a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -136,8 +136,9 @@ endif !EMBEDDED_RESOURCES src/embed-includes.rs: Makefile-distfiles { - echo $(BUILT_LUA_SOURCES) - $(GREP) -E '^(SILEDATA|LUALIBRARIES|LUAMODULES) = ' $< + echo $(BUILT_SOURCES_LUA) + $(SED) -ze 's/\\\n\t//g' $< | + $(GREP) -E '^(SILEDATA|LUALIBRARIES|LUAMODULES) = ' } | $(SED) -E -e 's/^.* = //;s/ /\n/g' | while read file; do diff --git a/build-aux/que_rust_boilerplate.am b/build-aux/que_rust_boilerplate.am index 93514b945..a1ba65af4 100644 --- a/build-aux/que_rust_boilerplate.am +++ b/build-aux/que_rust_boilerplate.am @@ -54,7 +54,7 @@ $(COMPLETIONS_OUT_DIR)/_$(TRANSFORMED_PACKAGE_NAME).ps1: $(CARGO_BIN) | $(COMPLE $(COMPLETIONS_OUT_DIR)/_$(TRANSFORMED_PACKAGE_NAME): $(CARGO_BIN) | $(COMPLETIONS_OUT_DIR) $(INSTALL) -m755 $$(cat $(_RUST_OUT))/$(COMPLETIONS_OUT_DIR)/_$(PACKAGE_NAME) $@ -$(_RUST_OUT) $(CARGO_BIN): $(@PACKAGE_VAR@_SOURCES) $(EXTRA_@PACKAGE_VAR@_SOURCES) +$(_RUST_OUT) $(CARGO_BIN): $(@PACKAGE_VAR@_SOURCES) $(nodist_@PACKAGE_VAR@_SOURCES) $(EXTRA_@PACKAGE_VAR@_SOURCES) set -e export AUTOTOOLS_DEPENDENCIES="$^" $(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) $(CARGO_FEATURE_ARGS) $(CARGO_RELEASE_ARGS) From 430a6d42c107bbfcb70e7a2b5d734097e27a26d1 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 2 Nov 2024 11:15:08 +0300 Subject: [PATCH 27/35] chore(cli): Don't embed unnecessary resources in static binary --- src/embed.rs.in | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/embed.rs.in b/src/embed.rs.in index 874f62136..55bb9970e 100644 --- a/src/embed.rs.in +++ b/src/embed.rs.in @@ -8,9 +8,24 @@ use std::str; #[derive(RustEmbed)] #[folder = "."] #[exclude = ".*"] -#[exclude = "*~"] +#[exclude = "*.a"] +#[exclude = "*.abnf"] +#[exclude = "*.ac"] +#[exclude = "*.am"] #[exclude = "*.in"] -#[exclude = "Make*"] +#[exclude = "*.json"] +#[exclude = "*.m4"] +#[exclude = "*.md"] +#[exclude = "*.nix"] +#[exclude = "*.so"] +#[exclude = "*.yml"] +#[exclude = "*~"] +#[exclude = "Makefile*"] +#[exclude = "bootstrap.sh"] +#[exclude = "config*"] +#[exclude = "libtool"] +#[exclude = "rust-toolchain"] +#[exclude = "sile*"] #[exclude = "autom4te.cache/*"] #[exclude = "build-aux/*"] #[exclude = "cmake/*"] @@ -18,11 +33,10 @@ use std::str; #[exclude = "documentation/*"] #[exclude = "justenough/*"] #[exclude = "libtexpdf/*"] -#[exclude = "libtexpdf/*"] -#[exclude = "libtool"] #[exclude = "node_modules/*"] -#[exclude = "rust-toolchain"] -#[exclude = "sile*"] +#[exclude = "rusile/*"] +#[exclude = "rust-api-docs/*"] +#[exclude = "spec/*"] #[exclude = "src/*"] #[exclude = "target/*"] #[exclude = "tests/*"] From 19d68bcfe5301b8dc051912b900cfe97d2851ccd Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 1 Nov 2024 23:30:15 +0300 Subject: [PATCH 28/35] chore(rusile): Refactor static embeded builds for mlua 0.10 --- src/embed.rs.in | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/embed.rs.in b/src/embed.rs.in index 55bb9970e..426c7ae90 100644 --- a/src/embed.rs.in +++ b/src/embed.rs.in @@ -65,8 +65,7 @@ pub fn inject_embedded_loader(lua: &Lua) { LuaValue::Nil => package.get("searchers").unwrap(), _ => panic!("Unable to find appropriate interface to inject embedded loader"), }; - loaders - .push(LuaFunction::wrap(|lua, module: String| unsafe { + let embedded_ffi_loader = lua.create_function(|lua, module: String| unsafe { match module.as_str() { //"rusile" => lua // .create_c_function(luaopen_rusile) @@ -89,10 +88,12 @@ pub fn inject_embedded_loader(lua: &Lua) { "svg" => lua.create_c_function(luaopen_svg).map(LuaValue::Function), _ => format!("C Module '{module}' is not linked in Rust binary").into_lua(lua), } - })) - .unwrap(); + }).unwrap(); loaders - .push(LuaFunction::wrap(|lua, module: String| { + .push(embedded_ffi_loader) + .unwrap(); + + let embedded_lua_loader = lua.create_function(|lua, module: String| { let module_path = module.replace('.', "/"); let luaversion: LuaString = lua .load(chunk! { @@ -100,7 +101,7 @@ pub fn inject_embedded_loader(lua: &Lua) { }) .eval() .unwrap(); - let luaversion: &str = luaversion.to_str().unwrap(); + let luaversion: &str = &luaversion.to_str().unwrap(); let mut package_epath: Vec<&str> = vec!["?/init.lua", "?.lua", "lua-libraries/?.lua"]; let path = format!("lua_modules/lib/lua/{}/?/init.lua", luaversion); package_epath.push(&path); @@ -121,35 +122,39 @@ pub fn inject_embedded_loader(lua: &Lua) { } match resource_option { Some(module) => { - return LuaFunction::wrap(move |lua, ()| { + lua.create_function(move |lua, _: ()| { let data = str::from_utf8(module.data.as_ref()) .expect("Embedded content is not valid UTF-8"); - lua.load(data).call::<_, LuaValue>(()) - }) - .into_lua(lua) - } + lua.load(data).call::(()) + }).map(LuaValue::Function) + }, + None => format!("Module '{module}' is not embedded in Rust binary").into_lua(lua), } - })) - .unwrap(); + }).unwrap(); loaders - .push(LuaFunction::wrap(|lua, module: String| { + .push(embedded_lua_loader) + .unwrap(); + + let embedded_ftl_loader = lua.create_function(|lua, module: String| { let module_path = module.replace('.', "/"); let pattern = "?.ftl"; let path = pattern.replace('?', &module_path); match SileModules::get(&path) { - Some(module) => LuaFunction::wrap(move |lua, ()| { + Some(module) => lua.create_function(move |lua, _: ()| { let data = str::from_utf8(module.data.as_ref()) .expect("Embedded content is not valid UTF-8"); lua.load(chunk! { return assert(fluent:add_messages($data)) }) - .call::<_, LuaValue>(()) - }) - .into_lua(lua), - None => format!("FTL resource '{module_path}' is not embedded in Rust binary") + .call::(()) + }).map(LuaValue::Function), + _ => format!("FTL resource '{module_path}' is not embedded in Rust binary") .into_lua(lua), } - })) + }).unwrap(); + loaders + .push(embedded_ftl_loader) .unwrap(); + } From 693d7d40433af5061fbc8c0cfdba3496c9f72411 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 1 Nov 2024 17:12:51 +0300 Subject: [PATCH 29/35] feat(rusile): Enable embedding of Rusile module --- Makefile.am | 13 ++------- build-aux/build.rs | 8 ------ core/sile.lua | 2 +- rusile/src/lib.rs | 7 ++--- src/embed.rs.in | 67 +++++++++++++++++++++++++--------------------- src/lib.rs | 9 ++++++- 6 files changed, 52 insertions(+), 54 deletions(-) diff --git a/Makefile.am b/Makefile.am index e6c1d2b0a..c27df04f7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,10 +64,7 @@ nodist_man_MANS = dist_man_MANS = sile-lua.1 sile_SOURCES = src/bin/sile.rs src/lib.rs src/cli.rs src/types.rs src/types/semver.rs EXTRA_sile_SOURCES = -if EMBEDDED_RESOURCES -noinst_LIBRARIES = librusile.a -librusile_a_SOURCES = $(RUSILE_SOURCES) -else !EMBEDDED_RESOURCES +if !EMBEDDED_RESOURCES nobase_dist_pkgdata_DATA = $(SILEDATA) $(LUALIBRARIES) nobase_nodist_pkgdata_DATA = $(BUILT_SOURCES_LUA) $(LUAMODULES) pkglib_LIBRARIES = rusile.so @@ -128,9 +125,7 @@ $(CARGO_BIN): justenough/.libs/justenoughicu.a $(CARGO_BIN): justenough/.libs/justenoughlibtexpdf.a $(CARGO_BIN): justenough/.libs/svg.a $(CARGO_BIN): libtexpdf/.libs/libtexpdf.a -if EMBEDDED_RESOURCES -$(CARGO_BIN): librusile.a -else !EMBEDDED_RESOURCES +if !EMBEDDED_RESOURCES $(CARGO_BIN): rusile.so endif !EMBEDDED_RESOURCES @@ -176,10 +171,6 @@ rusile.so: $(rusile_so_SOURCES) $(bin_PROGRAMS) $(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) $(RUSILE_FEATURE_ARG) $(CARGO_RELEASE_ARGS) -p rusile $(INSTALL) @builddir@/target/@RUST_TARGET_SUBDIR@/lib$@ $@ -librusile.a: - $(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) $(RUSILE_FEATURE_ARG) $(CARGO_RELEASE_ARGS) -p rusile - $(INSTALL) @builddir@/target/@RUST_TARGET_SUBDIR@/$@ $@ - DEPDIR := .deps LOCALFONTS := FONTCONFIG_FILE=$(PWD)/fontconfig.conf LOCALPATHS := SILE_PATH="$(PWD);libtexpdf/.libs;justenough/.libs" diff --git a/build-aux/build.rs b/build-aux/build.rs index 007423434..2f90b107f 100644 --- a/build-aux/build.rs +++ b/build-aux/build.rs @@ -36,14 +36,6 @@ fn main() { generate_shell_completions(); #[cfg(feature = "static")] { - ////let dir = env::var("CARGO_TARGET_DIR").unwrap(); - //let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); - //println!( - // "cargo:rustc-link-search=native={}", - // Path::new(&dir).join("target").join("release").display() - //); - //println!("cargo:rustc-link-arg=-l:librusile.a"); - let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); println!( "cargo:rustc-link-search=native={}", diff --git a/core/sile.lua b/core/sile.lua index e3f3b11cb..8d045914d 100644 --- a/core/sile.lua +++ b/core/sile.lua @@ -19,7 +19,7 @@ SILE = {} --- Load the C module that provides any and all SILE features implemented in Rust. The exports in this module are meant --- to be moved to approprate places in the Lua API as we load other things and assemble the public facing interface. --- This location is considered internal and accessing them directly from here is not supported. --- @table SILE.rusile +-- @table SILE._rusile SILE._rusile = require("rusile") --- Machine friendly short-form version. diff --git a/rusile/src/lib.rs b/rusile/src/lib.rs index f4fb4bc11..e685f3d3d 100644 --- a/rusile/src/lib.rs +++ b/rusile/src/lib.rs @@ -1,3 +1,6 @@ +// Thin wrapper around user facing functions implemented in Rust to expose them in a loadable Lua +// module separate from the Rust CLI. + #![crate_type = "cdylib"] #![crate_type = "rlib"] #![crate_type = "staticlib"] @@ -6,7 +9,5 @@ use mlua::prelude::*; #[mlua::lua_module] fn rusile(lua: &Lua) -> LuaResult { - let exports = lua.create_table()?; - exports.set("semver", LuaFunction::wrap_raw(sile::types::semver::semver))?; - Ok(exports) + sile::get_rusile_exports(lua) } diff --git a/src/embed.rs.in b/src/embed.rs.in index 426c7ae90..2b7e7e6c4 100644 --- a/src/embed.rs.in +++ b/src/embed.rs.in @@ -2,7 +2,6 @@ use mlua::chunk; use mlua::prelude::*; use rust_embed::{EmbeddedFile, RustEmbed}; use std::str; -//use rusile::rusile; /// Embed everything that would otherwise be installed to datadir #[derive(RustEmbed)] @@ -46,7 +45,6 @@ pub struct SileModules; // Link Lua loader functions from C modules that Lua would otherwise be loading externally that // we've linked into the CLI binary. Linking happens in build-aux/build.rs. extern "C-unwind" { - //fn luaopen_rusile(lua: *mut mlua::lua_State) -> i32; fn luaopen_fontmetrics(lua: *mut mlua::lua_State) -> i32; fn luaopen_justenoughfontconfig(lua: *mut mlua::lua_State) -> i32; fn luaopen_justenoughharfbuzz(lua: *mut mlua::lua_State) -> i32; @@ -58,18 +56,27 @@ extern "C-unwind" { /// Register a Lua function in the loaders/searchers table to return C modules linked into the CLI /// binary and another to return embedded Lua resources as Lua modules. See discussion in mlua: /// https://github.com/khvzak/mlua/discussions/322 -pub fn inject_embedded_loader(lua: &Lua) { +pub fn inject_embedded_loaders(lua: &Lua) { let package: LuaTable = lua.globals().get("package").unwrap(); let loaders: LuaTable = match package.get("loaders").unwrap() { LuaValue::Table(loaders) => loaders, LuaValue::Nil => package.get("searchers").unwrap(), _ => panic!("Unable to find appropriate interface to inject embedded loader"), }; - let embedded_ffi_loader = lua.create_function(|lua, module: String| unsafe { + + let embedded_rusile_loader = lua + .create_function(|lua, module: String| match module.as_str() { + "rusile" => lua + .create_function(move |lua, _: ()| crate::get_rusile_exports(lua)) + .map(LuaValue::Function), + _ => format!("Module '{module}' is embeded in Rust binary").into_lua(lua), + }) + .unwrap(); + loaders.push(embedded_rusile_loader).unwrap(); + + let embedded_ffi_loader = lua + .create_function(|lua, module: String| unsafe { match module.as_str() { - //"rusile" => lua - // .create_c_function(luaopen_rusile) - // .map(LuaValue::Function), "fontmetrics" => lua .create_c_function(luaopen_fontmetrics) .map(LuaValue::Function), @@ -88,12 +95,12 @@ pub fn inject_embedded_loader(lua: &Lua) { "svg" => lua.create_c_function(luaopen_svg).map(LuaValue::Function), _ => format!("C Module '{module}' is not linked in Rust binary").into_lua(lua), } - }).unwrap(); - loaders - .push(embedded_ffi_loader) + }) .unwrap(); + loaders.push(embedded_ffi_loader).unwrap(); - let embedded_lua_loader = lua.create_function(|lua, module: String| { + let embedded_lua_loader = lua + .create_function(|lua, module: String| { let module_path = module.replace('.', "/"); let luaversion: LuaString = lua .load(chunk! { @@ -121,40 +128,40 @@ pub fn inject_embedded_loader(lua: &Lua) { } } match resource_option { - Some(module) => { - lua.create_function(move |lua, _: ()| { + Some(module) => lua + .create_function(move |lua, _: ()| { let data = str::from_utf8(module.data.as_ref()) .expect("Embedded content is not valid UTF-8"); lua.load(data).call::(()) - }).map(LuaValue::Function) - }, + }) + .map(LuaValue::Function), None => format!("Module '{module}' is not embedded in Rust binary").into_lua(lua), } - }).unwrap(); - loaders - .push(embedded_lua_loader) + }) .unwrap(); + loaders.push(embedded_lua_loader).unwrap(); - let embedded_ftl_loader = lua.create_function(|lua, module: String| { + let embedded_ftl_loader = lua + .create_function(|lua, module: String| { let module_path = module.replace('.', "/"); let pattern = "?.ftl"; let path = pattern.replace('?', &module_path); match SileModules::get(&path) { - Some(module) => lua.create_function(move |lua, _: ()| { - let data = str::from_utf8(module.data.as_ref()) - .expect("Embedded content is not valid UTF-8"); - lua.load(chunk! { - return assert(fluent:add_messages($data)) + Some(module) => lua + .create_function(move |lua, _: ()| { + let data = str::from_utf8(module.data.as_ref()) + .expect("Embedded content is not valid UTF-8"); + lua.load(chunk! { + return assert(fluent:add_messages($data)) + }) + .call::(()) }) - .call::(()) - }).map(LuaValue::Function), + .map(LuaValue::Function), _ => format!("FTL resource '{module_path}' is not embedded in Rust binary") .into_lua(lua), } - }).unwrap(); - loaders - .push(embedded_ftl_loader) + }) .unwrap(); - + loaders.push(embedded_ftl_loader).unwrap(); } diff --git a/src/lib.rs b/src/lib.rs index 845251b3c..a1b75e011 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ // rust-embed include attributes have issues with lots of matches... #![recursion_limit = "2048"] +#[cfg(not(feature = "static"))] use mlua::chunk; use mlua::prelude::*; #[cfg(not(feature = "static"))] @@ -19,7 +20,7 @@ pub type Result = anyhow::Result; pub fn start_luavm() -> crate::Result { let lua = unsafe { Lua::unsafe_new() }; #[cfg(feature = "static")] - crate::embed::inject_embedded_loader(&lua); + crate::embed::inject_embedded_loaders(&lua); inject_paths(&lua); load_sile(&lua); inject_version(&lua); @@ -56,6 +57,12 @@ pub fn inject_paths(lua: &Lua) { } } +pub fn get_rusile_exports(lua: &Lua) -> LuaResult { + let exports = lua.create_table()?; + exports.set("semver", LuaFunction::wrap_raw(types::semver::semver))?; + Ok(exports) +} + pub fn inject_version(lua: &Lua) { let sile: LuaTable = lua.globals().get("SILE").unwrap(); let mut full_version: String = sile.get("full_version").unwrap(); From 83a957a8e6f9a335af751a49ef95a9f421c9a33e Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 2 Nov 2024 15:19:26 +0300 Subject: [PATCH 30/35] chore(tooling): Disable busted tests for static binary build where rusile unavailable --- Makefile.am | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index c27df04f7..0bacb6554 100644 --- a/Makefile.am +++ b/Makefile.am @@ -377,8 +377,15 @@ if !SYSTEM_LUAROCKS packagepath+=(./lua_modules/share/lua/$(LUA_VERSION)/?{,/init}.lua) packagecpath+=(./lua_modules/lib/lua/$(LUA_VERSION)/?.$(SHARED_LIB_EXT)) endif -# Note: use of --lua causes this to be passed back through a shell loosing one layer of quoting. Drop single quotes if removing. +# Note: Busted tests can't run with out static build since the Rusile module is +# only available embedded into it. We can test on the dynamic builds where it +# is available as a use space module. This could change if we enable a lua vm +# pass through mode and use that as busted's interpreter. +if SHARED +# Note: use of --lua causes this to be passed back through a shell loosing one +# layer of quoting. Drop single quotes if removing. $(LOCALFONTS) $(BUSTED) --lua=$(LUA) --lpath="'$${packagepath[*]};;'" --cpath="'$${packagecpath[*]};;'" $(BUSTEDFLAGS) . +endif coverage: export SILE_COVERAGE=1 coverage: BUSTEDFLAGS += -c From baf52692c94e4c8505bf42f13a7dcd78de536336 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 2 Nov 2024 15:35:26 +0300 Subject: [PATCH 31/35] refactor(utilities): Drop Lua semver implementation, use Rust one --- core/sile.lua | 6 ----- core/utilities/init.lua | 2 +- lua-libraries/semver.lua | 46 ------------------------------------ packages/retrograde/init.lua | 2 +- spec/rusile_spec.lua | 5 ++-- 5 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 lua-libraries/semver.lua diff --git a/core/sile.lua b/core/sile.lua index 8d045914d..d98b37fd6 100644 --- a/core/sile.lua +++ b/core/sile.lua @@ -16,12 +16,6 @@ SILE = {} --- Fields -- @section fields ---- Load the C module that provides any and all SILE features implemented in Rust. The exports in this module are meant ---- to be moved to approprate places in the Lua API as we load other things and assemble the public facing interface. ---- This location is considered internal and accessing them directly from here is not supported. --- @table SILE._rusile -SILE._rusile = require("rusile") - --- Machine friendly short-form version. -- Semver, prefixed with "v", possible postfixed with ".r" followed by VCS version information. -- @string version diff --git a/core/utilities/init.lua b/core/utilities/init.lua index c800415c6..632274a5f 100644 --- a/core/utilities/init.lua +++ b/core/utilities/init.lua @@ -4,7 +4,7 @@ local bitshim = require("bitshim") local luautf8 = require("lua-utf8") -local semver = require("semver") +local semver = require("rusile").semver local utilities = {} diff --git a/lua-libraries/semver.lua b/lua-libraries/semver.lua deleted file mode 100644 index 867eec95f..000000000 --- a/lua-libraries/semver.lua +++ /dev/null @@ -1,46 +0,0 @@ --- Loosely inspired from https://github.com/kikito/semver.lua --- (MIT License (c) 2011 Enrique García Cota) --- but simplified to our bare needs. - -local semver = {} -local mt = {} - -function mt:__eq(other) - return self.major == other.major and - self.minor == other.minor and - self.patch == other.patch -end - -function mt:__lt(other) - if self.major ~= other.major then return self.major < other.major end - if self.minor ~= other.minor then return self.minor < other.minor end - if self.patch ~= other.patch then return self.patch < other.patch end - return false -end - -function mt:__le(other) - if self.major ~= other.major then return self.major <= other.major end - if self.minor ~= other.minor then return self.minor <= other.minor end - if self.patch ~= other.patch then return self.patch <= other.patch end - return true -end - -function mt:__tostring() - return ("%d.%d.%d"):format(self.major, self.minor, self.patch) -end - -local function new (vstr) - local major, minor, patch = vstr:match("^v?(%d+)%.(%d+)%.(%d+)") - local result = { major = tonumber(major), minor = tonumber(minor), patch = tonumber(patch) } - if not result.major and not result.minor and not result.patch then - error("Invalid version string: "..vstr) - end - local o = setmetatable(result, mt) - return o -end - -setmetatable(semver, { - __call = function(_, ...) return new(...) end -}) - -return semver diff --git a/packages/retrograde/init.lua b/packages/retrograde/init.lua index be7658f27..07bd52215 100644 --- a/packages/retrograde/init.lua +++ b/packages/retrograde/init.lua @@ -3,7 +3,7 @@ local base = require("packages.base") local package = pl.class(base) package._name = "retrograde" -local semver = require("semver") +local semver = require("rusile").semver local semver_descending = function (a, b) a, b = semver(a), semver(b) diff --git a/spec/rusile_spec.lua b/spec/rusile_spec.lua index 3bacd2a91..114c90ff0 100644 --- a/spec/rusile_spec.lua +++ b/spec/rusile_spec.lua @@ -1,6 +1,6 @@ SILE = require("core.sile") -local rusile = SILE._rusile +local rusile = require("rusile") local callable = require("luassert.util").callable @@ -10,8 +10,7 @@ describe("rusile", function () end) describe("semver", function () - -- semver = SILE._rusile.semver - semver = require("semver") + local semver = rusile.semver it("constructor should exist", function () assert.is.truthy(callable(semver)) From 1ccb3c7dfc8ededb9e7329204a22b8a5d872c482 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 2 Nov 2024 15:57:06 +0300 Subject: [PATCH 32/35] chore(deps): Bump pinned versions of patch level crate updates --- Cargo.lock | 130 ++++++++++++++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 20bab6cd6..974f707ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,9 +37,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -52,43 +52,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" [[package]] name = "arc-swap" @@ -168,9 +168,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "e3788d6ac30243803df38a3e9991cf37e41210232916d41a8222ae378f912624" dependencies = [ "shlex", ] @@ -206,9 +206,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.33" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9646e2e245bf62f45d39a0f3f36f1171ad1ea0d6967fd114bca72cb02a8fcdfb" +checksum = "86bc73de94bc81e52f3bebec71bc4463e9748f7a59166663e32044669577b0e2" dependencies = [ "clap", ] @@ -222,7 +222,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.86", ] [[package]] @@ -249,9 +249,9 @@ checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "core-foundation" @@ -527,18 +527,18 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a371db66cbd4e13f0ed9dc4c0fea712d7276805fccc877f77e96374d317e87ae" +checksum = "10f78312288bd02052be5dbc2ecbc342c9f4eb791986d86c0a5c06b92dc72efa" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c8751169961ba7640b513c3b24af61aa962c967aaf04116734975cd5af0c52" +checksum = "6c28b58ba04f0c004722344390af9dbc85888fbb84be1981afb934da4114d4cf" dependencies = [ "thiserror", ] @@ -580,9 +580,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03f76169faa0dec598eac60f83d7fcdd739ec16596eca8fb144c88973dbe6f8c" +checksum = "f3de3fdca9c75fa4b83a76583d265fa49b1de6b088ebcd210749c24ceeb74660" dependencies = [ "bitflags 2.6.0", "bstr", @@ -741,7 +741,7 @@ checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.86", ] [[package]] @@ -803,9 +803,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.11" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" +checksum = "c04e5a94fdb56b1e91eb7df2658ad16832428b8eeda24ff1a0f0288de2bce554" dependencies = [ "bstr", "gix-trace", @@ -816,9 +816,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbff4f9b9ea3fa7a25a70ee62f545143abef624ac6aa5884344e70c8b0a1d9ff" +checksum = "f89f9a1525dcfd9639e282ea939f5ab0d09d93cf2b90c1fc6104f1b9582a8e49" dependencies = [ "bstr", "gix-utils", @@ -894,9 +894,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe4d52f30a737bbece5276fab5d3a8b276dc2650df963e293d0673be34e7a5f" +checksum = "a2007538eda296445c07949cf04f4a767307d887184d6b3e83e2d636533ddc6e" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -921,9 +921,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" +checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952" [[package]] name = "gix-traverse" @@ -958,9 +958,9 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" +checksum = "ba427e3e9599508ed98a6ddf8ed05493db114564e338e41f6a996d2e4790335f" dependencies = [ "fastrand", "unicode-normalization", @@ -1061,9 +1061,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libredox" @@ -1182,7 +1182,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.79", + "syn 2.0.86", ] [[package]] @@ -1282,9 +1282,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -1315,9 +1315,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1376,7 +1376,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.79", + "syn 2.0.86", "walkdir", ] @@ -1399,9 +1399,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.6.0", "errno", @@ -1412,9 +1412,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -1448,29 +1448,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.86", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -1559,9 +1559,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" dependencies = [ "proc-macro2", "quote", @@ -1593,22 +1593,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.86", ] [[package]] @@ -1875,5 +1875,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.86", ] From 02461db35d88ea089c8a2921f19d05b0f0c15df7 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 2 Nov 2024 21:42:35 +0300 Subject: [PATCH 33/35] chore(build): Disable RANLIB on already optimized module for all platforms --- build-aux/pkg.nix | 3 --- configure.ac | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build-aux/pkg.nix b/build-aux/pkg.nix index 85221386c..bc198dc6f 100644 --- a/build-aux/pkg.nix +++ b/build-aux/pkg.nix @@ -119,9 +119,6 @@ in stdenv.mkDerivation (finalAttrs: { # `pdfinfo`, by using `false` we make sure that if it is expected during # build time we would fail to build since we only provide it at test time. "PDFINFO=false" - # We're using Cargo to build a shared library skipping some libtool bits - # and Nix mistakenly assumes are relevant and thinks it needs to cleanup. - "RANLIB=:" #"--with-manual" In Nixpkgs we add this flag, here its not important enough ] ++ lib.optionals (!lua.pkgs.isLuaJIT) [ "--without-luajit" diff --git a/configure.ac b/configure.ac index 74e42b2da..34aac5680 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,10 @@ QUE_PROGVAR([pdfinfo]) QUE_PROGVAR([sort]) QUE_PROGVAR([xargs]) +# Disable ranlib to avoid it being run on our rusile.so module, already LTO +# optimized but libtool wants to relink it... +RANLIB=: + LT_PREREQ([2.2]) LT_INIT([dlopen]) From 252e674ad9c5e2b242d24b242f8265dafd04197b Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 2 Nov 2024 22:39:11 +0300 Subject: [PATCH 34/35] refactor(cli): Redo option parsing enabled by mlua v0.10 scopes --- src/lib.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ffa7ba226..689a0ef2a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -146,19 +146,20 @@ pub fn run( has_input_filename = true; } if let Some(options) = options { - // TODO: when mlua v0.10 merges, adapt this like the uses parsing to avoid chunking + let parameters: LuaAnyUserData = sile.get::("parserBits")?.get("parameters")?; + let input_options: LuaTable = sile_input.get("options")?; for option in options.iter() { - let option = lua.create_string(option)?; - lua.load(chunk! { - local parameter = SILE.parserBits.parameters:match($option); - SILE.input.options = pl.tablex.merge(SILE.input.options, parameter, true) - }) - .eval::<()>()?; + let parameters: LuaTable = parameters + .call_method("match", lua.create_string(option)?) + .context("failed to call `parameters:match()`")?; + for parameter in parameters.pairs::() { + let (key, value) = parameter?; + let _ = input_options.set(key, value); + } } } if let Some(modules) = uses { - let parser_bits: LuaTable = sile.get("parserBits")?; - let cliuse: LuaAnyUserData = parser_bits.get("cliuse")?; + let cliuse: LuaAnyUserData = sile.get::("parserBits")?.get("cliuse")?; let input_uses: LuaTable = sile_input.get("uses")?; for module in modules.iter() { let module = lua.create_string(module)?; From 155dc89cf1d38a10dd124f38ebce930e54cd56e7 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 2 Nov 2024 23:46:38 +0300 Subject: [PATCH 35/35] chore(build): Dodge race condition so manual doesn't build before modules --- Makefile.am | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0bacb6554..4bf08a194 100644 --- a/Makefile.am +++ b/Makefile.am @@ -88,6 +88,12 @@ endif BUILT_SOURCES = $(BUILT_SOURCES_LUA) Makefile-distfiles +if SHARED +EXTRA_RUNTIME_DEPS = $(pkglib_LIBRARIES) +else !SHARED +EXTRA_RUNTIME_DEPS = +endif + CLEANFILES = $(MANUAL) DISTCLEANFILES = @AMINCLUDE@ @@ -210,7 +216,7 @@ sile-%.md: CHANGELOG.md check: selfcheck .PHONY: selfcheck -selfcheck: | $(bin_PROGRAMS) $(_BUILT_SUBDIRS) +selfcheck: | $(bin_PROGRAMS) $(_BUILT_SUBDIRS) $(EXTRA_RUNTIME_DEPS) output=$$(mktemp -t selfcheck-XXXXXX.pdf) trap '$(RM) $$output' EXIT HUP TERM echo "foo" | $(LOCALPATHS) ./$(bin_PROGRAMS) -o $$output - @@ -261,9 +267,6 @@ _FORCED = $(and $(SILE_COVERAGE)$(CLEAN),force) _TEST_DEPS = $(and $$(filter tests/%,$@),$(addprefix .fonts/,$(TESTFONTFILES))) _DOCS_DEPS = $(and $$(filter documentation/%,$@),$(addprefix .fonts/,$(DOCSFONTFILES))) -# TODO: remove _BUILT_SUBDIRS hack and replace it with something sensible when -# these subdirs don't do crazy things like copying files outside of their own trees! -_BUILT_SUBDIRS = .built-subdirs _SUBDIR_TELLS = if SHARED @@ -294,7 +297,7 @@ CLEANFILES += $(_BUILT_SUBDIRS) $(_SUBDIR_TELLS): $(MAKE) $(AM_MAKEFLAGS) all-recursive -patterndeps = $(_FORCED) $(_TEST_DEPS) $(_DOCS_DEPS) | $(bin_PROGRAMS) $(DEPDIRS) $(LUAMODLOCK) $(_BUILT_SUBDIRS) +patterndeps = $(_FORCED) $(_TEST_DEPS) $(_DOCS_DEPS) | $(bin_PROGRAMS) $(EXTRA_RUNTIME_DEPS) $(DEPDIRS) $(LUAMODLOCK) $(_BUILT_SUBDIRS) %.pdf: %.sil $$(patterndeps) $(runsile)