diff --git a/Cargo.lock b/Cargo.lock index 1d60b4c4..4fac5221 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,24 +4,24 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.28.1", + "gimli 0.31.1", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", @@ -31,78 +31,80 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "once_cell_polyfill", + "windows-sys 0.60.2", ] [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" [[package]] name = "as_hostcall" version = "0.1.0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.4", "derive_more", "thiserror-no-std", ] @@ -118,7 +120,7 @@ dependencies = [ "linked_list_allocator", "serde", "serde_json", - "spin 0.9.8", + "spin", "thiserror-no-std", "unwinding", ] @@ -129,7 +131,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.106", ] [[package]] @@ -148,20 +150,20 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "axum" @@ -219,25 +221,25 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdca6a10ecad987bda04e95606ef85a5417dcaac1a78455242d72e031e2b6b62" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.1", + "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -248,15 +250,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "byteorder" @@ -266,24 +268,25 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.0.83" +version = "1.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "65193589c6404eb80b450d618eaf9a2cafaaafd57ecce47370519ef674a7bd44" dependencies = [ - "libc", + "find-msvc-tools", + "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "cfg_aliases" @@ -293,9 +296,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "clap" -version = "4.4.10" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" +checksum = "7eac00902d9d136acd712710d71823fb8ac8004ca445a89e73a41d45aa712931" dependencies = [ "clap_builder", "clap_derive", @@ -303,9 +306,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.9" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" +checksum = "2ad9bbf750e73b5884fb8a211a9424a1906c1e156724260fdae972f31d70e1d6" dependencies = [ "anstream", "anstyle", @@ -315,33 +318,36 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "cobs" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror 2.0.16", +] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "convert_case" @@ -351,18 +357,18 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cranelift-bforest" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6b33d7e757a887989eb18b35712b2a67d96171ec3149d1bfb657b29b7b367c" +checksum = "fad7096c10a285583f2ed620c0c85d7baf745922e33415290f2900b73319f1e0" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9acf15cb22be42d07c3b57d7856329cb228b7315d385346149df2566ad5e4aa" +checksum = "bd0d5b0dcd4a4e18c6352304d76f1c63258b5b2c248fc261b89c3a02952d51ff" dependencies = [ "bumpalo", "cranelift-bforest", @@ -382,33 +388,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e934d301392b73b3f8b0540391fb82465a0f179a3cee7c726482ac4727efcc97" +checksum = "3d14aa8551924931235a4eec42d561a8415d5a758267a549575a3fe0e13ba84f" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb2a2566b3d54b854dfb288b3b187f6d3d17d6f762c92898207eba302931da" +checksum = "315a326e9f63b996f55e93b73a9a239b55f2de1211fcfbcc99d9423f44dc6ded" [[package]] name = "cranelift-control" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0100f33b704cdacd01ad66ff41f8c5030d57cbff078e2a4e49ab1822591299fa" +checksum = "806ca69ca5aa8422035543444e1dc936f8f3e7f6854d562ef31db9fe30355c5c" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8cfdc315e5d18997093e040a8d234bea1ac1e118a716d3e30f40d449e78207b" +checksum = "c9778487136bf37f9007920d9cb332a020e5d7259c1fbf35e625368eb88c7bfe" dependencies = [ "serde", "serde_derive", @@ -416,9 +422,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f74b84f16af2e982b0c0c72233503d9d55cbfe3865dbe807ca28dc6642a28b5" +checksum = "55326cb3b61ca368210899a35892bca66aea4d75e8ceb5464e0539906c2ffb61" dependencies = [ "cranelift-codegen", "log", @@ -428,15 +434,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf306d3dde705fb94bd48082f01d38c4ededc74293a4c007805f610bf08bc6e" +checksum = "4807df8ebad0106f207bcdc1f38199200ed175066b4122689e7f18e33ec8548c" [[package]] name = "cranelift-native" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea0ebdef7aff4a79bcbc8b6495f31315f16b3bf311152f472eaa8d679352581" +checksum = "91c24c076002cb6a926a3f7220040278c7178878cd9142a418ddef9ee5b84963" dependencies = [ "cranelift-codegen", "libc", @@ -445,9 +451,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d549108a1942065cdbac3bb96c2952afa0e1b9a3beff4b08c4308ac72257576d" +checksum = "66ba3e8a666222d2df5a79a1279282c04545c4ca9712b7d85f4f54937617a533" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -461,31 +467,31 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.106", ] [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "embedded-io" @@ -501,18 +507,18 @@ checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -523,18 +529,18 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.0", ] [[package]] @@ -543,6 +549,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" +[[package]] +name = "find-msvc-tools" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d" + [[package]] name = "fnv" version = "1.0.7" @@ -551,45 +563,45 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-task", @@ -621,6 +633,12 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "hash32" version = "0.3.1" @@ -651,9 +669,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "foldhash", ] @@ -674,17 +692,23 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -693,9 +717,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -704,9 +728,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -716,15 +740,15 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -736,7 +760,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.10", "tokio", "tower-service", "tracing", @@ -751,26 +775,43 @@ checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" [[package]] name = "indexmap" -version = "2.5.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "206a8042aec68fa4a62e8d3f7aa4ceb508177d9324faf261e1959e495b7a1921" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.5", "serde", ] +[[package]] +name = "io-uring" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" +dependencies = [ + "bitflags 2.9.4", + "cfg-if", + "libc", +] + [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ "hermit-abi", - "rustix", - "windows-sys 0.48.0", + "libc", + "windows-sys 0.59.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.12.1" @@ -782,17 +823,17 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin", ] [[package]] @@ -815,31 +856,31 @@ dependencies = [ "nix", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "xmas-elf", ] [[package]] name = "libc" -version = "0.2.158" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.53.3", ] [[package]] name = "libm" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "linked_list_allocator" @@ -858,15 +899,21 @@ checksum = "b1ad52afd8f9448cbbe722ae722849cc41f1d365e285cca386896352bc08e1a9" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -874,15 +921,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "mach2" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" dependencies = [ "libc", ] @@ -895,17 +942,17 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memfd" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" dependencies = [ - "rustix", + "rustix 1.1.2", ] [[package]] @@ -925,22 +972,22 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.9" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -973,7 +1020,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -982,48 +1029,35 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.4", "cfg-if", "cfg_aliases", "libc", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" -version = "0.32.1" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" -dependencies = [ - "memchr", -] - -[[package]] -name = "object" -version = "0.36.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "crc32fast", - "hashbrown 0.15.0", + "hashbrown 0.15.5", "indexmap", "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "paste" @@ -1033,35 +1067,35 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1071,9 +1105,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "postcard" -version = "1.0.10" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7f0a8d620d71c457dd1d47df76bb18960378da56af4527aaa10f515eee732e" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" dependencies = [ "cobs", "embedded-io 0.4.0", @@ -1083,27 +1117,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -1123,9 +1157,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ "aho-corasick", "memchr", @@ -1135,9 +1169,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" dependencies = [ "aho-corasick", "memchr", @@ -1146,15 +1180,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -1164,37 +1198,50 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.4", "errno", "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +dependencies = [ + "bitflags 2.9.4", + "errno", + "libc", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "sc" @@ -1210,50 +1257,62 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.20" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.223" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "a505d71960adde88e293da5cb5eda57093379f64e61cf77bf0e6a63af07a7bac" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.223" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20f57cbd357666aa7b3ac84a90b4ea328f1d4ddb6772b430caa5d9e1309bb9e9" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.223" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "3d428d07faf17e306e699ec1e91996e5a165ba5d6bce5b5155173e91a8a01a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "a30a8abed938137c7183c173848e3c9b3517f5e038226849a4ecc9b21a4b4e2a" dependencies = [ "itoa", "serde", + "serde_core", ] [[package]] @@ -1268,6 +1327,12 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "sjlj" version = "0.1.3" @@ -1279,6 +1344,12 @@ dependencies = [ "sc", ] +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + [[package]] name = "slice-group-by" version = "0.3.1" @@ -1287,39 +1358,33 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" dependencies = [ "serde", ] [[package]] name = "socket2" -version = "0.4.10" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "socket2" -version = "0.5.5" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -1352,9 +1417,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" @@ -1369,9 +1434,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -1392,31 +1457,51 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +dependencies = [ + "thiserror-impl 2.0.16", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", ] [[package]] @@ -1441,29 +1526,30 @@ dependencies = [ [[package]] name = "tokio" -version = "1.34.0" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", + "io-uring", "libc", "mio", - "num_cpus", "pin-project-lite", - "socket2 0.5.5", + "slab", + "socket2 0.6.0", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -1484,21 +1570,21 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -1507,24 +1593,24 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", ] [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-xid" @@ -1544,9 +1630,9 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "version_check" @@ -1565,9 +1651,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasm-encoder" @@ -1585,7 +1671,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07035cc9a9b41e62d3bb3a3815a66ab87c993c06fe1cf6b2a3f2a18499d937db" dependencies = [ "ahash", - "bitflags 2.6.0", + "bitflags 2.9.4", "hashbrown 0.14.5", "indexmap", "semver", @@ -1605,7 +1691,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +source = "git+https://github.com/NIBRSYK16/wasmtime-as-lib.git?branch=main#c1674a280f99ebbb888872fe0e27721a43cd45da" dependencies = [ "anyhow", "bumpalo", @@ -1620,12 +1706,12 @@ dependencies = [ "mach2", "memfd", "memoffset", - "object 0.36.5", + "object", "once_cell", "paste", "postcard", "psm", - "rustix", + "rustix 0.38.44", "semver", "serde", "serde_derive", @@ -1663,7 +1749,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1691,9 +1777,9 @@ dependencies = [ "cranelift-wasm", "gimli 0.28.1", "log", - "object 0.36.5", + "object", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "wasmparser", "wasmtime-environ", "wasmtime-versioned-export-macros", @@ -1710,7 +1796,7 @@ dependencies = [ "gimli 0.28.1", "indexmap", "log", - "object 0.36.5", + "object", "postcard", "serde", "serde_derive", @@ -1742,9 +1828,9 @@ checksum = "0a7de1f2bec5bbb35d532e61c85c049dc84ae671df60492f90b954ecf21169e7" [[package]] name = "wasmtime-types" -version = "22.0.0" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "412463e9000e14cf6856be48628d2213c20c153e29ffc22b036980c892ea6964" +checksum = "b2017ea47e7a91440f94cc29f5f41d303e80f979a5384bf560d4b0afdabe32d0" dependencies = [ "cranelift-entity", "serde", @@ -1761,7 +1847,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -1773,7 +1859,7 @@ dependencies = [ "anyhow", "cranelift-codegen", "gimli 0.28.1", - "object 0.36.5", + "object", "target-lexicon", "wasmparser", "wasmtime-cranelift", @@ -1788,7 +1874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc077306b38288262e5ba01d4b21532a6987416cdc0aedf04bb06c22a68fdc" dependencies = [ "anyhow", - "heck", + "heck 0.4.1", "indexmap", "wit-parser", ] @@ -1803,41 +1889,19 @@ dependencies = [ "hashbrown 0.14.5", "lazy_static", "sjlj", - "spin 0.9.8", + "spin", "wasmtime", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "winapi", + "windows-sys 0.61.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "winch-codegen" version = "0.20.0" @@ -1855,137 +1919,182 @@ dependencies = [ "wasmtime-environ", ] +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" + [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.53.3", +] + +[[package]] +name = "windows-sys" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" +dependencies = [ + "windows-link 0.2.0", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 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_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows-link 0.1.3", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[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" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[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" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[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 = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[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 = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[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" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "wit-parser" @@ -2022,20 +2131,20 @@ checksum = "2fe21bcc34ca7fe6dd56cc2cb1261ea59d6b93620215aefb5ea6032265527784" [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] diff --git a/Cargo.toml b/Cargo.toml index 667083fb..4de6d1d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,10 @@ members = [ # In current implementation, as_std has conflict features (e.g. `panic_def` and # `unwinding`). Of course, if add "user/" to members, will also have problem of # feature gate. +# +# When building projects and user applications, if there are invalid soft links, +# you need to manually clean up the user crate cache. + exclude = ["user/", "common_service/", "baseline/"] default-members = ["bins/asvisor"] resolver = "2" diff --git a/as_std/src/agent.rs b/as_std/src/agent.rs index c86edca1..0b925e3b 100644 --- a/as_std/src/agent.rs +++ b/as_std/src/agent.rs @@ -69,9 +69,16 @@ mod refer_based_impl { } } else { let fingerprint = T::__fingerprint(); - - libos!(buffer_alloc(&slot, l, fingerprint)).expect("alloc failed.") as *mut T - + let ptr = libos!(buffer_alloc(&slot, l, fingerprint)); + let ptr = ptr.expect("alloc failed.") as *mut T; + if ptr.is_null() { + panic!("buffer_alloc returned null pointer!"); + } + // key:Initialize memory immediately after allocation + unsafe { + core::ptr::write(ptr, T::default()); + } + ptr // let val = T::default(); // println!("will write addr=0x{:x}", addr as usize); // unsafe { core::ptr::write(addr, val) }; diff --git a/doc/testing_a_workflow.md b/doc/testing_a_workflow.md index 7b7ff064..13141113 100644 --- a/doc/testing_a_workflow.md +++ b/doc/testing_a_workflow.md @@ -72,10 +72,32 @@ reducer3 has counted 362 words ``` ### Testing Other Workflows +``` The same 3-step process applies to any workflow: 1.Build services: `just all_libos` 2.Build functions: `just rust_func ` -3.Execute workflow: `target/release/asvisor --files isol_config/.json` \ No newline at end of file +3.Execute workflow: `target/release/asvisor --files isol_config/.json` +``` + +### Custom parameters recompile for Wasmtime module +``` +Pre-install wasmtime-cli 22.0.0 、WASI-sdk + +Modify the build.sh script in the user corresponding function directory. + +User manually sets environment variables +export CC="/opt/wasi-sdk/bin/clang" +export CPP="/opt/wasi-sdk/bin/clang++" + +wasmtime_wordcount: +just cwasm_compile_wordcount *args: + +wasmtime_parallel_sort: +just cwasm_compile_parallel_sort *args: + +Run before testing or compile other modules: +unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC" +``` \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..8cf62a76 --- /dev/null +++ b/install.sh @@ -0,0 +1,578 @@ +#!/bin/sh +# +# This script should be run via curl: +# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +# or via wget: +# sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +# or via fetch: +# sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +# +# As an alternative, you can first download the install script and run it afterwards: +# wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh +# sh install.sh +# +# You can tweak the install behavior by setting variables when running the script. For +# example, to change the path to the Oh My Zsh repository: +# ZSH=~/.zsh sh install.sh +# +# Respects the following environment variables: +# ZDOTDIR - path to Zsh dotfiles directory (default: unset). See [1][2] +# [1] https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-ZDOTDIR +# [2] https://zsh.sourceforge.io/Doc/Release/Files.html#index-ZDOTDIR_002c-use-of +# ZSH - path to the Oh My Zsh repository folder (default: $HOME/.oh-my-zsh) +# REPO - name of the GitHub repo to install from (default: ohmyzsh/ohmyzsh) +# REMOTE - full remote URL of the git repo to install (default: GitHub via HTTPS) +# BRANCH - branch to check out immediately after install (default: master) +# +# Other options: +# CHSH - 'no' means the installer will not change the default shell (default: yes) +# RUNZSH - 'no' means the installer will not run zsh after the install (default: yes) +# KEEP_ZSHRC - 'yes' means the installer will not replace an existing .zshrc (default: no) +# OVERWRITE_CONFIRMATION - 'no' means the installer will not ask for confirmation to overwrite the existing .zshrc (default: yes) +# +# You can also pass some arguments to the install script to set some these options: +# --skip-chsh: has the same behavior as setting CHSH to 'no' +# --unattended: sets both CHSH and RUNZSH to 'no' +# --keep-zshrc: sets KEEP_ZSHRC to 'yes' +# For example: +# sh install.sh --unattended +# or: +# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended +# +set -e + +# Make sure important variables exist if not already defined +# +# $USER is defined by login(1) which is not always executed (e.g. containers) +# POSIX: https://pubs.opengroup.org/onlinepubs/009695299/utilities/id.html +USER=${USER:-$(id -u -n)} +# $HOME is defined at the time of login, but it could be unset. If it is unset, +# a tilde by itself (~) will not be expanded to the current user's home directory. +# POSIX: https://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd_chap08.html#tag_08_03 +HOME="${HOME:-$(getent passwd $USER 2>/dev/null | cut -d: -f6)}" +# macOS does not have getent, but this works even if $HOME is unset +HOME="${HOME:-$(eval echo ~$USER)}" + + +# Track if $ZSH was provided +custom_zsh=${ZSH:+yes} + +# Use $zdot to keep track of where the directory is for zsh dotfiles +# To check if $ZDOTDIR was provided, explicitly check for $ZDOTDIR +zdot="${ZDOTDIR:-$HOME}" + +# Default value for $ZSH +# a) if $ZDOTDIR is supplied and not $HOME: $ZDOTDIR/ohmyzsh +# b) otherwise, $HOME/.oh-my-zsh +if [ -n "$ZDOTDIR" ] && [ "$ZDOTDIR" != "$HOME" ]; then + ZSH="${ZSH:-$ZDOTDIR/ohmyzsh}" +fi +ZSH="${ZSH:-$HOME/.oh-my-zsh}" + +# Default settings +REPO=${REPO:-ohmyzsh/ohmyzsh} +REMOTE=${REMOTE:-https://github.com/${REPO}.git} +BRANCH=${BRANCH:-master} + +# Other options +CHSH=${CHSH:-yes} +RUNZSH=${RUNZSH:-yes} +KEEP_ZSHRC=${KEEP_ZSHRC:-no} +OVERWRITE_CONFIRMATION=${OVERWRITE_CONFIRMATION:-yes} + + +command_exists() { + command -v "$@" >/dev/null 2>&1 +} + +user_can_sudo() { + # Check if sudo is installed + command_exists sudo || return 1 + # Termux can't run sudo, so we can detect it and exit the function early. + case "$PREFIX" in + *com.termux*) return 1 ;; + esac + # The following command has 3 parts: + # + # 1. Run `sudo` with `-v`. Does the following: + # • with privilege: asks for a password immediately. + # • without privilege: exits with error code 1 and prints the message: + # Sorry, user may not run sudo on + # + # 2. Pass `-n` to `sudo` to tell it to not ask for a password. If the + # password is not required, the command will finish with exit code 0. + # If one is required, sudo will exit with error code 1 and print the + # message: + # sudo: a password is required + # + # 3. Check for the words "may not run sudo" in the output to really tell + # whether the user has privileges or not. For that we have to make sure + # to run `sudo` in the default locale (with `LANG=`) so that the message + # stays consistent regardless of the user's locale. + # + ! LANG= sudo -n -v 2>&1 | grep -q "may not run sudo" +} + +# The [ -t 1 ] check only works when the function is not called from +# a subshell (like in `$(...)` or `(...)`, so this hack redefines the +# function at the top level to always return false when stdout is not +# a tty. +if [ -t 1 ]; then + is_tty() { + true + } +else + is_tty() { + false + } +fi + +# This function uses the logic from supports-hyperlinks[1][2], which is +# made by Kat Marchán (@zkat) and licensed under the Apache License 2.0. +# [1] https://github.com/zkat/supports-hyperlinks +# [2] https://crates.io/crates/supports-hyperlinks +# +# Copyright (c) 2021 Kat Marchán +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +supports_hyperlinks() { + # $FORCE_HYPERLINK must be set and be non-zero (this acts as a logic bypass) + if [ -n "$FORCE_HYPERLINK" ]; then + [ "$FORCE_HYPERLINK" != 0 ] + return $? + fi + + # If stdout is not a tty, it doesn't support hyperlinks + is_tty || return 1 + + # DomTerm terminal emulator (domterm.org) + if [ -n "$DOMTERM" ]; then + return 0 + fi + + # VTE-based terminals above v0.50 (Gnome Terminal, Guake, ROXTerm, etc) + if [ -n "$VTE_VERSION" ]; then + [ $VTE_VERSION -ge 5000 ] + return $? + fi + + # If $TERM_PROGRAM is set, these terminals support hyperlinks + case "$TERM_PROGRAM" in + Hyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;; + esac + + # These termcap entries support hyperlinks + case "$TERM" in + xterm-kitty|alacritty|alacritty-direct) return 0 ;; + esac + + # xfce4-terminal supports hyperlinks + if [ "$COLORTERM" = "xfce4-terminal" ]; then + return 0 + fi + + # Windows Terminal also supports hyperlinks + if [ -n "$WT_SESSION" ]; then + return 0 + fi + + # Konsole supports hyperlinks, but it's an opt-in setting that can't be detected + # https://github.com/ohmyzsh/ohmyzsh/issues/10964 + # if [ -n "$KONSOLE_VERSION" ]; then + # return 0 + # fi + + return 1 +} + +# Adapted from code and information by Anton Kochkov (@XVilka) +# Source: https://gist.github.com/XVilka/8346728 +supports_truecolor() { + case "$COLORTERM" in + truecolor|24bit) return 0 ;; + esac + + case "$TERM" in + iterm |\ + tmux-truecolor |\ + linux-truecolor |\ + xterm-truecolor |\ + screen-truecolor) return 0 ;; + esac + + return 1 +} + +fmt_link() { + # $1: text, $2: url, $3: fallback mode + if supports_hyperlinks; then + printf '\033]8;;%s\033\\%s\033]8;;\033\\\n' "$2" "$1" + return + fi + + case "$3" in + --text) printf '%s\n' "$1" ;; + --url|*) fmt_underline "$2" ;; + esac +} + +fmt_underline() { + is_tty && printf '\033[4m%s\033[24m\n' "$*" || printf '%s\n' "$*" +} + +# shellcheck disable=SC2016 # backtick in single-quote +fmt_code() { + is_tty && printf '`\033[2m%s\033[22m`\n' "$*" || printf '`%s`\n' "$*" +} + +fmt_error() { + printf '%sError: %s%s\n' "${FMT_BOLD}${FMT_RED}" "$*" "$FMT_RESET" >&2 +} + +setup_color() { + # Only use colors if connected to a terminal + if ! is_tty; then + FMT_RAINBOW="" + FMT_RED="" + FMT_GREEN="" + FMT_YELLOW="" + FMT_BLUE="" + FMT_BOLD="" + FMT_RESET="" + return + fi + + if supports_truecolor; then + FMT_RAINBOW=" + $(printf '\033[38;2;255;0;0m') + $(printf '\033[38;2;255;97;0m') + $(printf '\033[38;2;247;255;0m') + $(printf '\033[38;2;0;255;30m') + $(printf '\033[38;2;77;0;255m') + $(printf '\033[38;2;168;0;255m') + $(printf '\033[38;2;245;0;172m') + " + else + FMT_RAINBOW=" + $(printf '\033[38;5;196m') + $(printf '\033[38;5;202m') + $(printf '\033[38;5;226m') + $(printf '\033[38;5;082m') + $(printf '\033[38;5;021m') + $(printf '\033[38;5;093m') + $(printf '\033[38;5;163m') + " + fi + + FMT_RED=$(printf '\033[31m') + FMT_GREEN=$(printf '\033[32m') + FMT_YELLOW=$(printf '\033[33m') + FMT_BLUE=$(printf '\033[34m') + FMT_BOLD=$(printf '\033[1m') + FMT_RESET=$(printf '\033[0m') +} + +setup_ohmyzsh() { + # Prevent the cloned repository from having insecure permissions. Failing to do + # so causes compinit() calls to fail with "command not found: compdef" errors + # for users with insecure umasks (e.g., "002", allowing group writability). Note + # that this will be ignored under Cygwin by default, as Windows ACLs take + # precedence over umasks except for filesystems mounted with option "noacl". + umask g-w,o-w + + echo "${FMT_BLUE}Cloning Oh My Zsh...${FMT_RESET}" + + command_exists git || { + fmt_error "git is not installed" + exit 1 + } + + ostype=$(uname) + if [ -z "${ostype%CYGWIN*}" ] && git --version | grep -Eq 'msysgit|windows'; then + fmt_error "Windows/MSYS Git is not supported on Cygwin" + fmt_error "Make sure the Cygwin git package is installed and is first on the \$PATH" + exit 1 + fi + + # Manual clone with git config options to support git < v1.7.2 + git init --quiet "$ZSH" && cd "$ZSH" \ + && git config core.eol lf \ + && git config core.autocrlf false \ + && git config fsck.zeroPaddedFilemode ignore \ + && git config fetch.fsck.zeroPaddedFilemode ignore \ + && git config receive.fsck.zeroPaddedFilemode ignore \ + && git config oh-my-zsh.remote origin \ + && git config oh-my-zsh.branch "$BRANCH" \ + && git remote add origin "$REMOTE" \ + && git fetch --depth=1 origin \ + && git checkout -b "$BRANCH" "origin/$BRANCH" || { + [ ! -d "$ZSH" ] || { + cd - + rm -rf "$ZSH" 2>/dev/null + } + fmt_error "git clone of oh-my-zsh repo failed" + exit 1 + } + # Exit installation directory + cd - + + echo +} + +setup_zshrc() { + # Keep most recent old .zshrc at .zshrc.pre-oh-my-zsh, and older ones + # with datestamp of installation that moved them aside, so we never actually + # destroy a user's original zshrc + echo "${FMT_BLUE}Looking for an existing zsh config...${FMT_RESET}" + + # Must use this exact name so uninstall.sh can find it + OLD_ZSHRC="$zdot/.zshrc.pre-oh-my-zsh" + if [ -f "$zdot/.zshrc" ] || [ -h "$zdot/.zshrc" ]; then + # Skip this if the user doesn't want to replace an existing .zshrc + if [ "$KEEP_ZSHRC" = yes ]; then + echo "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Keeping...${FMT_RESET}" + return + fi + + if [ $OVERWRITE_CONFIRMATION != "no" ]; then + # Ask user for confirmation before backing up and overwriting + echo "${FMT_YELLOW}Found ${zdot}/.zshrc." + echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten." + echo "Make sure your .zshrc contains the following minimal configuration if you choose not to overwrite it:${FMT_RESET}" + echo "----------------------------------------" + cat "$ZSH/templates/minimal.zshrc" + echo "----------------------------------------" + printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \ + "$FMT_YELLOW" "$FMT_RESET" + read -r opt + case $opt in + [Yy]*|"") ;; + [Nn]*) echo "Overwrite skipped. Existing .zshrc will be kept."; return ;; + *) echo "Invalid choice. Overwrite skipped. Existing .zshrc will be kept."; return ;; + esac + fi + + if [ -e "$OLD_ZSHRC" ]; then + OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)" + if [ -e "$OLD_OLD_ZSHRC" ]; then + fmt_error "$OLD_OLD_ZSHRC exists. Can't back up ${OLD_ZSHRC}" + fmt_error "re-run the installer again in a couple of seconds" + exit 1 + fi + mv "$OLD_ZSHRC" "${OLD_OLD_ZSHRC}" + + echo "${FMT_YELLOW}Found old .zshrc.pre-oh-my-zsh." \ + "${FMT_GREEN}Backing up to ${OLD_OLD_ZSHRC}${FMT_RESET}" + fi + echo "${FMT_GREEN}Backing up to ${OLD_ZSHRC}${FMT_RESET}" + mv "$zdot/.zshrc" "$OLD_ZSHRC" + fi + + echo "${FMT_GREEN}Using the Oh My Zsh template file and adding it to $zdot/.zshrc.${FMT_RESET}" + + # Modify $ZSH variable in .zshrc directory to use the literal $ZDOTDIR or $HOME + omz="$ZSH" + if [ -n "$ZDOTDIR" ] && [ "$ZDOTDIR" != "$HOME" ]; then + omz=$(echo "$omz" | sed "s|^$ZDOTDIR/|\$ZDOTDIR/|") + fi + omz=$(echo "$omz" | sed "s|^$HOME/|\$HOME/|") + + sed "s|^export ZSH=.*$|export ZSH=\"${omz}\"|" "$ZSH/templates/zshrc.zsh-template" > "$zdot/.zshrc-omztemp" + mv -f "$zdot/.zshrc-omztemp" "$zdot/.zshrc" + + echo +} + +setup_shell() { + # Skip setup if the user wants or stdin is closed (not running interactively). + if [ "$CHSH" = no ]; then + return + fi + + # If this user's login shell is already "zsh", do not attempt to switch. + if [ "$(basename -- "$SHELL")" = "zsh" ]; then + return + fi + + # If this platform doesn't provide a "chsh" command, bail out. + if ! command_exists chsh; then + cat < "$zdot/.shell.pre-oh-my-zsh" + else + grep "^$USER:" /etc/passwd | awk -F: '{print $7}' > "$zdot/.shell.pre-oh-my-zsh" + fi + + echo "Changing your shell to $zsh..." + + # Check if user has sudo privileges to run `chsh` with or without `sudo` + # + # This allows the call to succeed without password on systems where the + # user does not have a password but does have sudo privileges, like in + # Google Cloud Shell. + # + # On systems that don't have a user with passwordless sudo, the user will + # be prompted for the password either way, so this shouldn't cause any issues. + # + if user_can_sudo; then + sudo -k chsh -s "$zsh" "$USER" # -k forces the password prompt + else + chsh -s "$zsh" "$USER" # run chsh normally + fi + + # Check if the shell change was successful + if [ $? -ne 0 ]; then + fmt_error "chsh command unsuccessful. Change your default shell manually." + else + export SHELL="$zsh" + echo "${FMT_GREEN}Shell successfully changed to '$zsh'.${FMT_RESET}" + fi + + echo +} + +# shellcheck disable=SC2183 # printf string has more %s than arguments ($FMT_RAINBOW expands to multiple arguments) +print_success() { + printf '%s %s__ %s %s %s %s %s__ %s\n' $FMT_RAINBOW $FMT_RESET + printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $FMT_RAINBOW $FMT_RESET + printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $FMT_RAINBOW $FMT_RESET + printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $FMT_RAINBOW $FMT_RESET + printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $FMT_RAINBOW $FMT_RESET + printf '%s %s %s %s /____/ %s %s %s %s....is now installed!%s\n' $FMT_RAINBOW $FMT_GREEN $FMT_RESET + printf '\n' + printf '\n' + printf "%s %s %s\n" "Before you scream ${FMT_BOLD}${FMT_YELLOW}Oh My Zsh!${FMT_RESET} look over the" \ + "$(fmt_code "$(fmt_link ".zshrc" "file://$zdot/.zshrc" --text)")" \ + "file to select plugins, themes, and options." + printf '\n' + printf '%s\n' "• Follow us on X: $(fmt_link @ohmyzsh https://x.com/ohmyzsh)" + printf '%s\n' "• Join our Discord community: $(fmt_link "Discord server" https://discord.gg/ohmyzsh)" + printf '%s\n' "• Get stickers, t-shirts, coffee mugs and more: $(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)" + printf '%s\n' $FMT_RESET +} + +main() { + # Run as unattended if stdin is not a tty + if [ ! -t 0 ]; then + RUNZSH=no + CHSH=no + OVERWRITE_CONFIRMATION=no + fi + + # Parse arguments + while [ $# -gt 0 ]; do + case $1 in + --unattended) RUNZSH=no; CHSH=no; OVERWRITE_CONFIRMATION=no ;; + --skip-chsh) CHSH=no ;; + --keep-zshrc) KEEP_ZSHRC=yes ;; + esac + shift + done + + setup_color + + if ! command_exists zsh; then + echo "${FMT_YELLOW}Zsh is not installed.${FMT_RESET} Please install zsh first." + exit 1 + fi + + if [ -d "$ZSH" ]; then + echo "${FMT_YELLOW}The \$ZSH folder already exists ($ZSH).${FMT_RESET}" + if [ "$custom_zsh" = yes ]; then + cat <&1 | grep 'total_dur' target/{{profile}}/asvisor --files isol_config/long_chain_n15.json --metrics total-dur 2>&1 | grep 'total_dur' -p99: asvisor all_libos parallel_sort +p99_latency: asvisor all_libos parallel_sort -sudo mount fs_images/fatfs.img image_content 2>/dev/null sudo -E ./scripts/gen_data.py 0 0 3 '25 * 1024 * 1024' @@ -285,4 +287,57 @@ resource_consume: asvisor all_libos parallel_sort ./resourcetester 80 | grep 'total consume mem:' mv monitor.log as_parallel_sort_resouce_c5_25_80.txt - ./scripts/comp_resource.py \ No newline at end of file + ./scripts/comp_resource.py + +# WebAssembly compilation tasks using compile_wasm.sh script +# Unified CWASM compilation entry point with customizable parameters +cwasm_compile: + @echo "CWASM Compilation Tasks Available:" + @echo " just cwasm_compile_help - Show help information" + @echo " just cwasm_compile_all [OPTIONS] - Compile all components with default settings, supports optional parameters" + @echo " just cwasm_compile_wordcount [OPTIONS] - Compile only wordcount workflow components, supports optional parameters" + @echo " just cwasm_compile_parallel_sort [OPTIONS] - Compile only parallel_sort workflow components, supports optional parameters" + @echo "" + @echo "Optional parameters for all tasks:" + @echo " --mode MODE - Specify build mode (debug, release)" + @echo " --concurrency N - Specify concurrency level (1, 3, 5)" + @echo " --cflags FLAGS - Custom CFLAGS compilation parameters" + +cwasm_compile_help: + ./scripts/compile_wasm.sh --help + +cwasm_compile_all *args: + ./scripts/compile_wasm.sh {{args}} + +cwasm_compile_wordcount *args: + ./scripts/compile_wasm.sh --workflow wordcount {{args}} + +cwasm_compile_parallel_sort *args: + ./scripts/compile_wasm.sh --workflow parallel_sort {{args}} + + +# C++ WebAssembly compilation tasks using compile_wasm_cpp.sh script +# Unified C++ CWASM compilation entry point with customizable parameters +ccwasm_compile: + @echo "C++ CWASM Compilation Tasks Available:" + @echo " just ccwasm_compile_help - Show help information" + @echo " just ccwasm_compile_all [OPTIONS] - Compile all C++ components with default settings, supports optional parameters" + @echo " just ccwasm_compile_wordcount [OPTIONS] - Compile only C++ wordcount workflow components, supports optional parameters" + @echo " just ccwasm_compile_parallel_sort [OPTIONS] - Compile only C++ parallel_sort workflow components, supports optional parameters" + @echo "" + @echo "Optional parameters for all tasks:" + @echo " --mode MODE - Specify build mode (debug, release)" + @echo " --concurrency N - Specify concurrency level (1, 3, 5)" + @echo " --cflags FLAGS - Custom CFLAGS compilation parameters" + +ccwasm_compile_help: + ./scripts/compile_wasm_cpp.sh --help + +ccwasm_compile_all *args: + ./scripts/compile_wasm_cpp.sh {{args}} + +ccwasm_compile_wordcount *args: + ./scripts/compile_wasm_cpp.sh --workflow wordcount {{args}} + +ccwasm_compile_parallel_sort *args: + ./scripts/compile_wasm_cpp.sh --workflow parallel_sort {{args}} diff --git a/scripts/analyze_fake_data.py b/scripts/analyze_fake_data.py new file mode 100644 index 00000000..2daa5073 --- /dev/null +++ b/scripts/analyze_fake_data.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +import re +from collections import Counter + +# 读取fake_data_0.txt文件 +file_path = './image_content/fake_data_0.txt' + +with open(file_path, 'r') as f: + content = f.read() + +# 提取所有单词(去除标点符号) +words = re.findall(r'\b\w+\b', content.lower()) + +# 统计唯一单词数量 +unique_words = set(words) +unique_word_count = len(unique_words) + +# 找到最长单词及其长度 +longest_word = max(unique_words, key=len) if unique_words else '' +longest_word_length = len(longest_word) + +# 统计单词总数量 +total_word_count = len(words) + +# 分析单词频率分布 +word_freq = Counter(words) + +# 计算平均单词长度 +avg_word_length = sum(len(word) for word in words) / total_word_count if total_word_count > 0 else 0 + +# 打印分析结果 +print("===== fake_data_0.txt 分析结果 =====") +print(f"总单词数: {total_word_count}") +print(f"唯一单词数: {unique_word_count}") +print(f"最长单词: '{longest_word}' (长度: {longest_word_length})") +print(f"平均单词长度: {avg_word_length:.2f}") +print("\n===== 推荐参数值 =====") +print("# 基于fake_data_0.txt的分析,考虑到可能有多个文件和更大的数据量,建议以下参数值:") +print(f"MAX_WORD_LENGTH = {max(longest_word_length, 20)} # 最长单词长度,保留一定余量") +print(f"MAX_WORDS = {max(unique_word_count * 2, 10000)} # 唯一单词数量的2倍,确保足够空间") +print(f"MAX_SLOT_NUM = 100 # 通常设置为mapper或reducer的最大数量") +print(f"MAX_BUFFER_SIZE = {max(unique_word_count * 50, 100000)} # 每个单词约占用50字节空间") \ No newline at end of file diff --git a/scripts/compile_wasm.sh b/scripts/compile_wasm.sh new file mode 100755 index 00000000..ce4659e3 --- /dev/null +++ b/scripts/compile_wasm.sh @@ -0,0 +1,244 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment:export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC" + +# Help information +show_help() { + echo "Usage: $0 [OPTIONS] [COMPONENT...]" + echo "" + echo "Compile WebAssembly modules, supporting two workflows: wordcount and parallel_sort." + echo "If no components are specified, all components will be compiled." + echo "" + echo "Options:" + echo " -h, --help Show help information" + echo " -c, --concurrency N Specify concurrency level, available values: 1, 3, 5 (default: 1)" + echo " -m, --mode MODE Specify build mode, available values: debug, release (default: release)" + echo " -w, --workflow NAME Specify workflow, available values: wordcount, parallel_sort, all (default: all)" + echo " --cflags FLAGS Custom CFLAGS compilation parameters, overriding default parameters" + echo "" + echo "Components:" + echo " wordcount workflow components: mapper, reducer" + echo " parallel_sort workflow components: spliter, sorter, merger, checker" + echo "" + echo "Examples:" + echo " # Compile all components with default concurrency 1 and release mode" + echo " $0" + echo "" + echo " # Compile only wordcount workflow components" + echo " $0 --workflow wordcount" + echo "" + echo " # Compile only parallel_sort workflow components with concurrency 3" + echo " $0 --workflow parallel_sort --concurrency 3" + echo "" + echo " # Compile specific components" + echo " $0 mapper reducer" + echo "" + echo " # Compile all components in debug mode" + echo " $0 --mode debug" +} + +# Default parameters +CONCURRENCY=1 +BUILD_MODE="release" +WORKFLOW="all" +TARGET_DIR="x86_64-unknown-none" +CUSTOM_CFLAGS="" +# Initialize components array +COMPONENTS=() + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + show_help + exit 0 + ;; + -c|--concurrency) + CONCURRENCY=$2 + shift 2 + ;; + -m|--mode) + BUILD_MODE=$2 + shift 2 + ;; + -w|--workflow) + WORKFLOW=$2 + shift 2 + ;; + --cflags) + CUSTOM_CFLAGS=$2 + shift 2 + ;; + *) + # Collect component arguments + COMPONENTS+=($1) + shift + ;; + esac + +done + +# Validate parameters +if [[ ! $CONCURRENCY =~ ^[135]$ ]]; then + echo "Error: Concurrency must be 1, 3 or 5" >&2 + exit 1 +fi + +if [[ ! $BUILD_MODE =~ ^(debug|release)$ ]]; then + echo "Error: Build mode must be debug or release" >&2 + exit 1 +fi + +if [[ ! $WORKFLOW =~ ^(wordcount|parallel_sort|all)$ ]]; then + echo "Error: Workflow must be wordcount, parallel_sort or all" >&2 + exit 1 +fi + +# Set workflow components +if [[ ${#COMPONENTS[@]} -eq 0 ]]; then + case $WORKFLOW in + wordcount) + COMPONENTS=(mapper reducer) + ;; + parallel_sort) + COMPONENTS=(spliter sorter merger checker) + ;; + all) + COMPONENTS=(mapper reducer spliter sorter merger checker) + ;; + esac +fi + +# Check component validity +VALID_COMPONENTS=(mapper reducer spliter sorter merger checker) +for comp in "${COMPONENTS[@]}"; do + if [[ ! " ${VALID_COMPONENTS[*]} " =~ " $comp " ]]; then + echo "Error: Invalid component name: $comp" >&2 + echo "Valid component names: ${VALID_COMPONENTS[*]}" >&2 + exit 1 + fi + + # Check workflow compatibility + if [[ $WORKFLOW == "wordcount" && ! " mapper reducer " =~ " $comp " ]]; then + echo "Error: Component $comp does not belong to the wordcount workflow" >&2 + exit 1 + elif [[ $WORKFLOW == "parallel_sort" && ! " spliter sorter merger checker " =~ " $comp " ]]; then + echo "Error: Component $comp does not belong to the parallel_sort workflow" >&2 + exit 1 + fi +done + +# Set compilation environment variables +export CPP="/opt/wasi-sdk/bin/clang++" +export CC="/opt/wasi-sdk/bin/clang" + +echo "Using compilation environment: CC=$CC, CPP=$CPP" +echo "Build mode: $BUILD_MODE" +echo "Concurrency: C$CONCURRENCY" +echo "Components to compile: ${COMPONENTS[*]}" + +# Set cargo parameters +CARGO_FLAGS="--target $TARGET_DIR" +if [[ $BUILD_MODE == "release" ]]; then + CARGO_FLAGS+=" --release" +fi + +# Compilation function +compile_component() { + local component=$1 + local source_file="$component.c" + local wasm_file="$component.wasm" + local cwasm_file="$component.cwasm" + local cargo_dir="wasmtime_$component" + local output_dir="target/$TARGET_DIR/$BUILD_MODE" + local lib_name="libwasmtime_$component.so" + local symlink_path="./target/$BUILD_MODE/$lib_name" + + echo "\n===== Compiling $component =====" + + # Enter component directory + cd "$WORKSPACE/user/$cargo_dir" + echo "Current directory: $(pwd)" + + # Set compilation parameters + if [[ -n "$CUSTOM_CFLAGS" ]]; then + # If custom CFLAGS is provided, use custom parameters + CFLAGS="$CUSTOM_CFLAGS" + echo "Using custom compilation parameters: $CFLAGS" + else + # Otherwise use default parameters + case $component in + mapper|reducer) + # Wordcount workflow component parameters + if [[ $CONCURRENCY -eq 1 ]]; then + CFLAGS="-DMAX_WORD_LENGTH=20 -DMAX_WORDS=18000000 -DMAX_SLOT_NUM=100 -DMAX_BUFFER_SIZE=500000" + elif [[ $CONCURRENCY -eq 3 ]]; then + CFLAGS="-DMAX_WORD_LENGTH=20 -DMAX_WORDS=18000000 -DMAX_SLOT_NUM=100 -DMAX_BUFFER_SIZE=500000" + elif [[ $CONCURRENCY -eq 5 ]]; then + CFLAGS="-DMAX_WORD_LENGTH=20 -DMAX_WORDS=18000000 -DMAX_SLOT_NUM=100 -DMAX_BUFFER_SIZE=500000" + fi + ;; + spliter|sorter|merger|checker) + # Parallel sort workflow component parameters + if [[ $CONCURRENCY -eq 1 ]]; then + CFLAGS="-DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000" + elif [[ $CONCURRENCY -eq 3 ]]; then + CFLAGS="-DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000" + elif [[ $CONCURRENCY -eq 5 ]]; then + CFLAGS="-DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000" + fi + ;; + esac + echo "Compilation parameters: $CFLAGS" + fi + + # Compile C to WASM + echo "Compiling C to WASM..." + $CC $source_file -o $wasm_file -O3 $CFLAGS + + # Compile WASM to CWASM + echo "Compiling WASM to CWASM..." + wasmtime compile --target $TARGET_DIR -W threads=n,tail-call=n $wasm_file + + # Compile Rust code and create shared library + echo "Compiling Rust code and creating shared library..." + cargo build $CARGO_FLAGS + + cc -Wl,--gc-sections -nostdlib \ + -Wl,--whole-archive \ + $output_dir/lib$cargo_dir.a \ + -Wl,--no-whole-archive \ + -shared \ + -o $output_dir/$lib_name + + # Create or update symbolic link + echo "Updating symbolic link..." + if [ -L "$symlink_path" ]; then + rm "$symlink_path" + fi + ln -s "$(pwd)/$output_dir/$lib_name" "$symlink_path" + + echo "$component compilation completed!" + + # Return to script directory + cd "$WORKSPACE" +} + +# Set workspace directory +WORKSPACE="$(cd "$(dirname "$0")" && cd .. && pwd)" +cd "$WORKSPACE" + +# Compile all specified components +for component in "${COMPONENTS[@]}"; do + compile_component $component + if [ $? -ne 0 ]; then + echo "$component compilation failed!" >&2 + exit 1 + fi +done + +unset CPP && export CPP=/usr/bin/clang++ && unset CC && export CC=/usr/bin/clang + +echo "All components compiled successfully!" \ No newline at end of file diff --git a/scripts/compile_wasm_cpp.sh b/scripts/compile_wasm_cpp.sh new file mode 100755 index 00000000..2c25e5c5 --- /dev/null +++ b/scripts/compile_wasm_cpp.sh @@ -0,0 +1,267 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment:export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CPP && export CPP=/usr/bin/clang++ && echo "CPP is now: $CPP" + +# Help information +show_help() { + echo "Usage: $0 [OPTIONS] [COMPONENT...]" + echo "" + echo "Compile C++ WebAssembly modules, supporting two workflows: wordcount and parallel_sort." + echo "If no components are specified, all components will be compiled." + echo "" + echo "Options:" + echo " -h, --help Show help information" + echo " -c, --concurrency N Specify concurrency level, available values: 1, 3, 5 (default: 1)" + echo " -m, --mode MODE Specify build mode, available values: debug, release (default: release)" + echo " -w, --workflow NAME Specify workflow, available values: wordcount, parallel_sort, all (default: all)" + echo " --cflags FLAGS Custom CFLAGS compilation parameters, overriding default parameters" + echo "" + echo "Components:" + echo " wordcount workflow components: mapper, reducer" + echo " parallel_sort workflow components: spliter, sorter, merger, checker" + echo "" + echo "Examples:" + echo " # Compile all components with default concurrency 1 and release mode" + echo " $0" + echo "" + echo " # Compile only wordcount workflow components" + echo " $0 --workflow wordcount" + echo "" + echo " # Compile only parallel_sort workflow components with concurrency 3" + echo " $0 --workflow parallel_sort --concurrency 3" + echo "" + echo " # Compile specific components" + echo " $0 mapper reducer" + echo "" + echo " # Compile all components in debug mode" + echo " $0 --mode debug" +} + +# Default parameters +CONCURRENCY=1 +BUILD_MODE="release" +WORKFLOW="all" +TARGET_DIR="x86_64-unknown-none" +CUSTOM_CFLAGS="" +# Initialize components array +COMPONENTS=() + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + show_help + exit 0 + ;; + -c|--concurrency) + CONCURRENCY=$2 + shift 2 + ;; + -m|--mode) + BUILD_MODE=$2 + shift 2 + ;; + -w|--workflow) + WORKFLOW=$2 + shift 2 + ;; + --cflags) + CUSTOM_CFLAGS=$2 + shift 2 + ;; + *) + # Collect component arguments + COMPONENTS+=($1) + shift + ;; + esac + +done + +# Validate parameters +if [[ ! $CONCURRENCY =~ ^[135]$ ]]; then + echo "Error: Concurrency must be 1, 3 or 5" >&2 + exit 1 +fi + +if [[ ! $BUILD_MODE =~ ^(debug|release)$ ]]; then + echo "Error: Build mode must be debug or release" >&2 + exit 1 +fi + +if [[ ! $WORKFLOW =~ ^(wordcount|parallel_sort|all)$ ]]; then + echo "Error: Workflow must be wordcount, parallel_sort or all" >&2 + exit 1 +fi + +# Set workflow components +if [[ ${#COMPONENTS[@]} -eq 0 ]]; then + case $WORKFLOW in + wordcount) + COMPONENTS=(mapper reducer) + ;; + parallel_sort) + COMPONENTS=(spliter sorter merger checker) + ;; + all) + COMPONENTS=(mapper reducer spliter sorter merger checker) + ;; + esac +fi + +# Check component validity +VALID_COMPONENTS=(mapper reducer spliter sorter merger checker) +for comp in "${COMPONENTS[@]}"; do + if [[ ! " ${VALID_COMPONENTS[*]} " =~ " $comp " ]]; then + echo "Error: Invalid component name: $comp" >&2 + echo "Valid component names: ${VALID_COMPONENTS[*]}" >&2 + exit 1 + fi + + # Check workflow compatibility + if [[ $WORKFLOW == "wordcount" && ! " mapper reducer " =~ " $comp " ]]; then + echo "Error: Component $comp does not belong to the wordcount workflow" >&2 + exit 1 + elif [[ $WORKFLOW == "parallel_sort" && ! " spliter sorter merger checker " =~ " $comp " ]]; then + echo "Error: Component $comp does not belong to the parallel_sort workflow" >&2 + exit 1 + fi +done + +# Set compilation environment variables +export CPP="/opt/wasi-sdk/bin/clang++" +export CC="/opt/wasi-sdk/bin/clang" + +echo "Using compilation environment: CC=$CC, CPP=$CPP" +echo "Build mode: $BUILD_MODE" +echo "Concurrency: C$CONCURRENCY" +echo "Components to compile: ${COMPONENTS[*]}" + +# Set cargo parameters +CARGO_FLAGS="--target $TARGET_DIR" +if [[ $BUILD_MODE == "release" ]]; then + CARGO_FLAGS+=" --release" +fi + +# Compilation function +compile_component() { + local component=$1 + local source_file="" + local wasm_file="$component.wasm" + local cargo_dir="wasmtime_$component" + local output_dir="target/$TARGET_DIR/$BUILD_MODE" + local lib_name="libwasmtime_$component.so" + local symlink_path="./target/$BUILD_MODE/$lib_name" + + echo "\n===== Compiling $component =====" + + # Enter component directory + cd "$WORKSPACE/user/$cargo_dir" + echo "Current directory: $(pwd)" + + # Determine source file based on component + case $component in + mapper) + source_file="mapper_new.cpp" + ;; + reducer) + source_file="reducer_new.cpp" + ;; + checker) + source_file="checker.cpp" + ;; + merger) + source_file="merger.cpp" + ;; + sorter) + source_file="sorter.cpp" + ;; + spliter) + source_file="spliter.cpp" + ;; + esac + + # Set compilation parameters + if [[ -n "$CUSTOM_CFLAGS" ]]; then + # If custom CFLAGS is provided, use custom parameters + CFLAGS="$CUSTOM_CFLAGS" + echo "Using custom compilation parameters: $CFLAGS" + else + # Otherwise use default parameters + case $component in + mapper|reducer) + # Wordcount workflow component parameters + if [[ $CONCURRENCY -eq 1 ]]; then + CFLAGS="-fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_SLOT_NUM=10 -DMAX_WORDS=18000000 -DMAX_BUFFER_SIZE=500000" + elif [[ $CONCURRENCY -eq 3 ]]; then + CFLAGS="-fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_SLOT_NUM=10 -DMAX_WORDS=18000000 -DMAX_BUFFER_SIZE=500000" + elif [[ $CONCURRENCY -eq 5 ]]; then + CFLAGS="-fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_SLOT_NUM=10 -DMAX_WORDS=18000000 -DMAX_BUFFER_SIZE=500000" + fi + ;; + spliter|sorter|merger|checker) + # Parallel sort workflow component parameters + if [[ $CONCURRENCY -eq 1 ]]; then + CFLAGS="-fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000" + elif [[ $CONCURRENCY -eq 3 ]]; then + CFLAGS="-fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000" + elif [[ $CONCURRENCY -eq 5 ]]; then + CFLAGS="-fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000" + fi + ;; + esac + echo "Compilation parameters: $CFLAGS" + fi + + # Compile C++ to WASM + echo "Compiling C++ to WASM..." + $CPP $source_file -o $wasm_file $CFLAGS + + # Compile WASM to CWASM if component is mapper or reducer + if [[ $component == "mapper" || $component == "reducer" ]]; then + echo "Compiling WASM to CWASM..." + wasmtime compile --target $TARGET_DIR -W threads=n,tail-call=n $wasm_file + fi + + # Compile Rust code and create shared library + echo "Compiling Rust code and creating shared library..." + cargo build $CARGO_FLAGS + + cc -Wl,--gc-sections -nostdlib \ + -Wl,--whole-archive \ + $output_dir/lib$cargo_dir.a \ + -Wl,--no-whole-archive \ + -shared \ + -o $output_dir/$lib_name + + # Create or update symbolic link + echo "Updating symbolic link..." + if [ -L "$symlink_path" ]; then + rm "$symlink_path" + fi + ln -s "$(pwd)/$output_dir/$lib_name" "$symlink_path" + + echo "$component compilation completed!" + + # Return to script directory + cd "$WORKSPACE" +} + +# Set workspace directory +WORKSPACE="$(cd "$(dirname "$0")" && cd .. && pwd)" +cd "$WORKSPACE" + +# Compile all specified components +for component in "${COMPONENTS[@]}"; do + compile_component $component + if [ $? -ne 0 ]; then + echo "$component compilation failed!" >&2 + exit 1 + fi +done + +unset CPP && export CPP=/usr/bin/clang++ && unset CC && export CC=/usr/bin/clang + +echo "All components compiled successfully!" \ No newline at end of file diff --git a/scripts/gen_data.py b/scripts/gen_data.py index d33743c4..88dcac33 100755 --- a/scripts/gen_data.py +++ b/scripts/gen_data.py @@ -24,6 +24,8 @@ def gen_word_count(file_num: int, total_size: int): def gen_parallel_sort(file_num: int, total_size: int): import random + # 固定随机数种子,确保每次生成相同的数据 + random.seed(42) one_size = int(total_size / file_num) for i in range(file_num): diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 82586a26..db916091 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -11,15 +11,20 @@ declare -A results # 获取脚本参数(feature) feature_arg="" -if [ $# -gt 0 ]; then - feature_arg="--features $1" -fi +release_arg="" +for arg in "$@"; do + if [[ $arg == --features* ]]; then + feature_arg="$arg" + elif [[ $arg == --release ]]; then + release_arg="--release" + fi +done for group in "${!test_groups[@]}"; do names=${test_groups[$group]} for name in $names; do - output=$(RUST_LOG=info cargo run $feature_arg -- --files "isol_config/$name.json") + output=$(RUST_LOG=info cargo run $release_arg $feature_arg -- --files "isol_config/$name.json") if [ $? -eq 0 ]; then results[$name]="passed" ((passed_count++)) # 增加通过计数 diff --git a/user/wasmtime_checker/Cargo.lock b/user/wasmtime_checker/Cargo.lock index 71a650b7..c737ca87 100644 --- a/user/wasmtime_checker/Cargo.lock +++ b/user/wasmtime_checker/Cargo.lock @@ -855,7 +855,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +source = "git+https://github.com/NIBRSYK16/wasmtime-as-lib.git?branch=main#c1674a280f99ebbb888872fe0e27721a43cd45da" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_checker/build.sh b/user/wasmtime_checker/build.sh index 03f89ec6..1c660bee 100755 --- a/user/wasmtime_checker/build.sh +++ b/user/wasmtime_checker/build.sh @@ -1,7 +1,25 @@ +# Activate environment:export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC" + +# Ensure we run from the script directory so relative paths work +cd "$(dirname "$0")" + +# C1 +$CC checker.c -o checker.wasm -O3 -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 + +# C3 +# $CC checker.c -o checker.wasm -O3 -DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000 + +# C5 +# $CC checker.c -o checker.wasm -O3 -DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000 + +# $CPP checker.cpp -o checker.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 + +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n checker.wasm # $CPP checker.cpp -o checker.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -$CPP checker_ori.cpp -o checker.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast +# $CPP checker_ori.cpp -o checker.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast # $CC checker.c -o checker.wasm -wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n checker.wasm + cargo build --target x86_64-unknown-none --release && cc \ -Wl,--gc-sections -nostdlib \ @@ -11,5 +29,12 @@ cargo build --target x86_64-unknown-none --release && cc \ -shared \ -o target/x86_64-unknown-none/release/libwasmtime_checker.so -ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_checker/target/x86_64-unknown-none/release/libwasmtime_checker.so /home/wyj/dyx_workplace/mslibos/target/release/libwasmtime_checker.so +SYMLINK_PATH="./target/release/libwasmtime_checker.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + + +ln -s ./user/wasmtime_checker/target/x86_64-unknown-none/release/libwasmtime_checker.so ./target/release/libwasmtime_checker.so diff --git a/user/wasmtime_checker/build_cpp.sh b/user/wasmtime_checker/build_cpp.sh new file mode 100755 index 00000000..acffa498 --- /dev/null +++ b/user/wasmtime_checker/build_cpp.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment: export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CPP && export CPP=/usr/bin/clang++ && echo "CPP is now: $CPP" + +cd "$(dirname "$0")" +$CPP checker.cpp -o checker.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=30000000 +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n checker.wasm + +cargo build --target x86_64-unknown-none --release && cc \ + -Wl,--gc-sections -nostdlib \ + -Wl,--whole-archive \ + target/x86_64-unknown-none/release/libwasmtime_checker.a \ + -Wl,--no-whole-archive \ + -shared \ + -o target/x86_64-unknown-none/release/libwasmtime_checker.so + + SYMLINK_PATH="./target/release/libwasmtime_checker.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + +ln -s ./user/wasmtime_checker/target/x86_64-unknown-none/release/libwasmtime_checker.so ./target/release/libwasmtime_checker.so \ No newline at end of file diff --git a/user/wasmtime_checker/checker.c b/user/wasmtime_checker/checker.c index 626137d3..7b94fadd 100644 --- a/user/wasmtime_checker/checker.c +++ b/user/wasmtime_checker/checker.c @@ -4,8 +4,13 @@ __attribute__((import_module("env"), import_name("access_buffer"))) void access_buffer(void *slot_name, int name_size, void *buffer, int buffer_size); +#ifndef MAX_ARRAY_LENGTH #define MAX_ARRAY_LENGTH 20000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 200000000 +#endif int result[MAX_ARRAY_LENGTH]; diff --git a/user/wasmtime_checker/checker.cpp b/user/wasmtime_checker/checker.cpp index 30aa13c7..18665998 100644 --- a/user/wasmtime_checker/checker.cpp +++ b/user/wasmtime_checker/checker.cpp @@ -14,8 +14,13 @@ using namespace std; __attribute__((import_module("env"), import_name("access_buffer"))) void access_buffer(void *slot_name, int name_size, void *buffer, int buffer_size); +#ifndef MAX_ARRAY_LENGTH #define MAX_ARRAY_LENGTH 8000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 80000000 +#endif int result[MAX_ARRAY_LENGTH]; diff --git a/user/wasmtime_checker/checker.cwasm b/user/wasmtime_checker/checker.cwasm index 8b9daccf..19da294b 100644 Binary files a/user/wasmtime_checker/checker.cwasm and b/user/wasmtime_checker/checker.cwasm differ diff --git a/user/wasmtime_checker/checker.wasm b/user/wasmtime_checker/checker.wasm index cd9ea684..4e385185 100755 Binary files a/user/wasmtime_checker/checker.wasm and b/user/wasmtime_checker/checker.wasm differ diff --git a/user/wasmtime_cpython_func/Cargo.lock b/user/wasmtime_cpython_func/Cargo.lock index 2d6b3970..72667eb2 100644 --- a/user/wasmtime_cpython_func/Cargo.lock +++ b/user/wasmtime_cpython_func/Cargo.lock @@ -855,7 +855,6 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_cpython_parallel_sort/Cargo.lock b/user/wasmtime_cpython_parallel_sort/Cargo.lock index 0fd0d8de..39c32512 100644 --- a/user/wasmtime_cpython_parallel_sort/Cargo.lock +++ b/user/wasmtime_cpython_parallel_sort/Cargo.lock @@ -855,7 +855,6 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_cpython_wordcount/Cargo.lock b/user/wasmtime_cpython_wordcount/Cargo.lock index d386453a..45bd50cc 100644 --- a/user/wasmtime_cpython_wordcount/Cargo.lock +++ b/user/wasmtime_cpython_wordcount/Cargo.lock @@ -855,7 +855,6 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_longchain/Cargo.lock b/user/wasmtime_longchain/Cargo.lock index adbeb799..0e6a62a1 100644 --- a/user/wasmtime_longchain/Cargo.lock +++ b/user/wasmtime_longchain/Cargo.lock @@ -855,7 +855,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +source = "git+https://github.com/NIBRSYK16/wasmtime-as-lib.git?branch=main#c1674a280f99ebbb888872fe0e27721a43cd45da" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_mapper/Cargo.lock b/user/wasmtime_mapper/Cargo.lock index 432e311e..b5c289fa 100644 --- a/user/wasmtime_mapper/Cargo.lock +++ b/user/wasmtime_mapper/Cargo.lock @@ -855,7 +855,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +source = "git+https://github.com/NIBRSYK16/wasmtime-as-lib.git?branch=main#c1674a280f99ebbb888872fe0e27721a43cd45da" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_mapper/build.sh b/user/wasmtime_mapper/build.sh index 3e4d4025..a1c4029b 100755 --- a/user/wasmtime_mapper/build.sh +++ b/user/wasmtime_mapper/build.sh @@ -1,5 +1,21 @@ -$CPP mapper_new.cpp -o mapper.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -# $CC mapper.c -o mapper.wasm -O3 +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment: export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC" + + +# Ensure we run from the script directory so relative paths work +cd "$(dirname "$0")" + +# Compile C to WASM with optimizations and specified macros +# Data volume: sudo -E ./scripts/gen_data.py 3 '1' 3 '25' +$CC mapper.c -o mapper.wasm -O3 \ + -DMAX_WORD_LENGTH=20 \ + -DMAX_WORDS=1000 \ + -DMAX_SLOT_NUM=100 \ + -DMAX_BUFFER_SIZE=50000 +# $CPP mapper_new.cpp -o mapper.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n mapper.wasm @@ -11,7 +27,13 @@ cargo build --target x86_64-unknown-none --release && cc \ -shared \ -o target/x86_64-unknown-none/release/libwasmtime_mapper.so -ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_mapper/target/x86_64-unknown-none/release/libwasmtime_mapper.so /home/wyj/dyx_workplace/mslibos/target/release/libwasmtime_mapper.so +SYMLINK_PATH="./target/release/libwasmtime_mapper.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + +ln -s ./user/wasmtime_mapper/target/x86_64-unknown-none/release/libwasmtime_mapper.so ./target/release/libwasmtime_mapper.so # cargo build --target x86_64-unknown-none && cc \ # -Wl,--gc-sections -nostdlib \ @@ -22,3 +44,36 @@ ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_mapper/target/x86_64-unknown # -o target/x86_64-unknown-none/debug/libwasmtime_mapper.so # ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_mapper/target/x86_64-unknown-none/debug/libwasmtime_mapper.so /home/wyj/dyx_workplace/mslibos/target/debug/libwasmtime_mapper.so + +# #!/bin/bash + +# # 设置编译参数 +# CFLAGS="-DMAX_WORD_LENGTH=14 -DMAX_WORDS=743 -DMAX_SLOT_NUM=100 -DMAX_BUFFER_SIZE=50000" + +# # 确保当前目录是脚本所在目录 +# cd "$(dirname "$0")" + +# # 编译C到WASM +# echo "编译C到WASM..." + +# # 使用Emscripten +# emcc mapper.c -o mapper.wasm $CFLAGS \ +# -s STANDALONE_WASM=1 \ +# -s IMPORTED_MEMORY=1 \ +# -s ALLOW_MEMORY_GROWTH=1 \ +# -s ERROR_ON_UNDEFINED_SYMBOLS=0 \ +# -s "EXPORTED_FUNCTIONS=['_main']" + +# # 使用WASI SDK的替代命令 (如果需要的话取消注释) +# # /opt/wasi-sdk/bin/clang mapper.c -o mapper.wasm $CFLAGS -O2 + +# # 编译WASM到CWASM +# echo "编译WASM到CWASM..." +# ~/.wasmtime/bin/wasmtime compile \ +# --target x86_64-unknown-none \ +# -W threads=n,tail-call=n \ +# mapper.wasm \ +# -o mapper.cwasm + +# echo "编译完成!" +# echo "输出文件: $(pwd)/mapper.wasm, $(pwd)/mapper.cwasm" \ No newline at end of file diff --git a/user/wasmtime_mapper/build_cpp.sh b/user/wasmtime_mapper/build_cpp.sh new file mode 100755 index 00000000..5e6b4539 --- /dev/null +++ b/user/wasmtime_mapper/build_cpp.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment: export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CPP && export CPP=/usr/bin/clang++ && echo "CPP is now: $CPP" + +cd "$(dirname "$0")" +$CPP mapper_new.cpp -o mapper.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_WORD_LENGTH=20 -DMAX_WORDS=18000000 -DMAX_SLOT_NUM=10 -DMAX_BUFFER_SIZE=500000 +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n mapper.wasm + +cargo build --target x86_64-unknown-none --release && cc \ + -Wl,--gc-sections -nostdlib \ + -Wl,--whole-archive \ + target/x86_64-unknown-none/release/libwasmtime_mapper.a \ + -Wl,--no-whole-archive \ + -shared \ + -o target/x86_64-unknown-none/release/libwasmtime_mapper.so + + SYMLINK_PATH="./target/release/libwasmtime_mapper.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + +ln -s ./user/wasmtime_mapper/target/x86_64-unknown-none/release/libwasmtime_mapper.so ./target/release/libwasmtime_mapper.so \ No newline at end of file diff --git a/user/wasmtime_mapper/mapper.c b/user/wasmtime_mapper/mapper.c index f0731498..b7c3fe35 100644 --- a/user/wasmtime_mapper/mapper.c +++ b/user/wasmtime_mapper/mapper.c @@ -1,117 +1,130 @@ -#include -#include -#include -#include -#include - -__attribute__((import_module("env"), import_name("buffer_register"))) void buffer_register(void *slot_name, int name_size, void *buffer, int buffer_size); - -#define MAX_WORD_LENGTH 100 -#define MAX_WORDS 8000 -#define MAX_SLOT_NUM 100 -#define MAX_BUFFER_SIZE 8000 - - -void to_lowercase(char *str) { - for (int i = 0; str[i]; i++) { - str[i] = tolower(str[i]); - } -} -int main(int argc, char* argv[]) { - int id = atoi(argv[1]); - int reducer_num = atoi(argv[2]); - printf("mapper.c recieve: id: %d, reducer_num: %d\n", id, reducer_num); - - char input_file[30]; - sprintf(input_file, "fake_data_%d.txt", id); - FILE *file = fopen(input_file, "r"); - if (!file) { - perror("Failed to open input file\n"); - exit(EXIT_FAILURE); - } - - printf("mapper_%d input file: %s\n", id, input_file); - - int count[MAX_WORDS] = {0}; - char *words[MAX_WORDS]; - char word[MAX_WORD_LENGTH]; - int word_index = 0; - - char line[1024]; - while (fgets(line, sizeof(line), file)) { - char *token = strtok(line, " \n"); // 以空格和换行作为分隔符 - while (token != NULL) { - char word[MAX_WORD_LENGTH]; - strncpy(word, token, MAX_WORD_LENGTH); - word[MAX_WORD_LENGTH - 1] = '\0'; // 确保字符串以 null 结尾 - - to_lowercase(word); - int found = 0; - - for (int i = 0; i < word_index; i++) { - if (strcmp(words[i], word) == 0) { - count[i]++; - found = 1; - break; - } - } - - if (!found) { - words[word_index] = strdup(word); - count[word_index]++; - word_index++; - } - - token = strtok(NULL, " \n"); //读取下一个单词 - } - } - - fclose(file); - printf("mapper_%d_index: %d\n", id, word_index); - - char *slot_name[MAX_SLOT_NUM]; - char *buffer[MAX_SLOT_NUM]; - char slot[20]; - int bufferSize = MAX_BUFFER_SIZE; - int slot_index = 0; - - for (int i = 0; i < word_index; i++) { - int partition_index = i % reducer_num; - sprintf(slot, "buffer_%d_%d", partition_index, id); - int found = 0; - for (int j = 0; j < slot_index; j++) { - if (strcmp(slot_name[j], slot) == 0) { - found = 1; - sprintf(buffer[j] + strlen(buffer[j]), "%s: %d\n", words[i], count[i]); - break; - } - } - - if (!found) { - slot_name[slot_index] = strdup(slot); - buffer[slot_index] = (char *)malloc(bufferSize * sizeof(char)); - if (buffer[slot_index] == NULL) { - printf("alloc mem failed\n"); - return 1; - } - memset(buffer[slot_index], 0, bufferSize * sizeof(char)); - sprintf(buffer[slot_index], "%s: %d\n", words[i], count[i]); - // printf("slot: %s; buffer: %s\n", slot_name[slot_index], buffer[slot_index]); - slot_index++; - } - // printf("found: %d; word: %s; count: %d; slot_name: %s; buffer: %s\n", found, words[i], count[i], slot, buffer[slot_index]); - free(words[i]); - } - - for (int i = 0; i < slot_index; i++) { - buffer_register(slot_name[i], strlen(slot_name[i]), buffer[i], bufferSize); - } - - for (int i = 0; i < slot_index; i++) { - free(slot_name[i]); // 释放 strdup 分配的内存 - free(buffer[i]); // 释放 buffer - } - write(1, "mapper end!\n", sizeof("mapper end!\n")); - // printf("mapper_%d finished!\n", id); - return 0; +#include +#include +#include +#include +#include + +__attribute__((import_module("env"), import_name("buffer_register"))) void buffer_register(void *slot_name, int name_size, void *buffer, int buffer_size); + + +// 允许通过编译参数覆盖默认值 +#ifndef MAX_WORD_LENGTH +#define MAX_WORD_LENGTH 100 +#endif + +#ifndef MAX_WORDS +#define MAX_WORDS 8000 +#endif + +#ifndef MAX_SLOT_NUM +#define MAX_SLOT_NUM 100 +#endif + +#ifndef MAX_BUFFER_SIZE +#define MAX_BUFFER_SIZE 8000 +#endif + + +void to_lowercase(char *str) { + for (int i = 0; str[i]; i++) { + str[i] = tolower(str[i]); + } +} +int main(int argc, char* argv[]) { + int id = atoi(argv[1]); + int reducer_num = atoi(argv[2]); + printf("mapper.c recieve: id: %d, reducer_num: %d\n", id, reducer_num); + + char input_file[30]; + sprintf(input_file, "fake_data_%d.txt", id); + FILE *file = fopen(input_file, "r"); + if (!file) { + perror("Failed to open input file\n"); + exit(EXIT_FAILURE); + } + + printf("mapper_%d input file: %s\n", id, input_file); + + int count[MAX_WORDS] = {0}; + char *words[MAX_WORDS]; + char word[MAX_WORD_LENGTH]; + int word_index = 0; + + char line[1024]; + while (fgets(line, sizeof(line), file)) { + char *token = strtok(line, " \n"); // 以空格和换行作为分隔符 + while (token != NULL) { + char word[MAX_WORD_LENGTH]; + strncpy(word, token, MAX_WORD_LENGTH); + word[MAX_WORD_LENGTH - 1] = '\0'; // 确保字符串以 null 结尾 + + to_lowercase(word); + int found = 0; + + for (int i = 0; i < word_index; i++) { + if (strcmp(words[i], word) == 0) { + count[i]++; + found = 1; + break; + } + } + + if (!found) { + words[word_index] = strdup(word); + count[word_index]++; + word_index++; + } + + token = strtok(NULL, " \n"); //读取下一个单词 + } + } + + fclose(file); + printf("mapper_%d_index: %d\n", id, word_index); + + char *slot_name[MAX_SLOT_NUM]; + char *buffer[MAX_SLOT_NUM]; + char slot[20]; + int bufferSize = MAX_BUFFER_SIZE; + int slot_index = 0; + + for (int i = 0; i < word_index; i++) { + int partition_index = i % reducer_num; + sprintf(slot, "buffer_%d_%d", partition_index, id); + int found = 0; + for (int j = 0; j < slot_index; j++) { + if (strcmp(slot_name[j], slot) == 0) { + found = 1; + sprintf(buffer[j] + strlen(buffer[j]), "%s: %d\n", words[i], count[i]); + break; + } + } + + if (!found) { + slot_name[slot_index] = strdup(slot); + buffer[slot_index] = (char *)malloc(bufferSize * sizeof(char)); + if (buffer[slot_index] == NULL) { + printf("alloc mem failed\n"); + return 1; + } + memset(buffer[slot_index], 0, bufferSize * sizeof(char)); + sprintf(buffer[slot_index], "%s: %d\n", words[i], count[i]); + // printf("slot: %s; buffer: %s\n", slot_name[slot_index], buffer[slot_index]); + slot_index++; + } + // printf("found: %d; word: %s; count: %d; slot_name: %s; buffer: %s\n", found, words[i], count[i], slot, buffer[slot_index]); + free(words[i]); + } + + for (int i = 0; i < slot_index; i++) { + buffer_register(slot_name[i], strlen(slot_name[i]), buffer[i], bufferSize); + } + + for (int i = 0; i < slot_index; i++) { + free(slot_name[i]); // 释放 strdup 分配的内存 + free(buffer[i]); // 释放 buffer + } + // write(1, "mapper end!\n", strlen("mapper end!\n")); + printf("mapper_%d finished!\n", id); + return 0; } \ No newline at end of file diff --git a/user/wasmtime_mapper/mapper.cwasm b/user/wasmtime_mapper/mapper.cwasm index aac27a41..03f39f3e 100644 Binary files a/user/wasmtime_mapper/mapper.cwasm and b/user/wasmtime_mapper/mapper.cwasm differ diff --git a/user/wasmtime_mapper/mapper.wasm b/user/wasmtime_mapper/mapper.wasm index 502d4cb7..23ef1d85 100755 Binary files a/user/wasmtime_mapper/mapper.wasm and b/user/wasmtime_mapper/mapper.wasm differ diff --git a/user/wasmtime_mapper/mapper_new.cpp b/user/wasmtime_mapper/mapper_new.cpp index bdd827df..8cbf8ceb 100644 --- a/user/wasmtime_mapper/mapper_new.cpp +++ b/user/wasmtime_mapper/mapper_new.cpp @@ -11,9 +11,17 @@ using namespace std; +#ifndef MAX_SLOT_NUM #define MAX_SLOT_NUM 10 +#endif + +#ifndef MAX_WORDS #define MAX_WORDS 18000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 500000 +#endif string words[MAX_WORDS]; int counts[MAX_WORDS]; diff --git a/user/wasmtime_merger/Cargo.lock b/user/wasmtime_merger/Cargo.lock index fbeff1f3..a8579fdd 100644 --- a/user/wasmtime_merger/Cargo.lock +++ b/user/wasmtime_merger/Cargo.lock @@ -855,7 +855,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +source = "git+https://github.com/NIBRSYK16/wasmtime-as-lib.git?branch=main#c1674a280f99ebbb888872fe0e27721a43cd45da" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_merger/build.sh b/user/wasmtime_merger/build.sh index 496e87ec..b6c2b972 100755 --- a/user/wasmtime_merger/build.sh +++ b/user/wasmtime_merger/build.sh @@ -1,7 +1,25 @@ +# Activate environment:export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC" + +# Ensure we run from the script directory so relative paths work +cd "$(dirname "$0")" + +# C1 +$CC merger.c -o merger.wasm -O3 -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 + +# C3 +# $CC merger.c -o merger.wasm -O3 -DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000 + +# C5 +# $CC merger.c -o merger.wasm -O3 -DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000 + +# $CPP merger.cpp -o merger.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 + +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n merger.wasm # $CPP merger.cpp -o merger.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -$CPP merger_ori.cpp -o merger.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast +# $CPP merger_ori.cpp -o merger.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast # $CC merger.c -o merger.wasm -wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n merger.wasm + cargo build --target x86_64-unknown-none --release && cc \ -Wl,--gc-sections -nostdlib \ @@ -11,5 +29,12 @@ cargo build --target x86_64-unknown-none --release && cc \ -shared \ -o target/x86_64-unknown-none/release/libwasmtime_merger.so -ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_merger/target/x86_64-unknown-none/release/libwasmtime_merger.so /home/wyj/dyx_workplace/mslibos/target/release/libwasmtime_merger.so +SYMLINK_PATH="./target/release/libwasmtime_merger.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + + +ln -s ./user/wasmtime_merger/target/x86_64-unknown-none/release/libwasmtime_merger.so ./target/release/libwasmtime_merger.so diff --git a/user/wasmtime_merger/build_cpp.sh b/user/wasmtime_merger/build_cpp.sh new file mode 100755 index 00000000..96239948 --- /dev/null +++ b/user/wasmtime_merger/build_cpp.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment: export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CPP && export CPP=/usr/bin/clang++ && echo "CPP is now: $CPP" + +cd "$(dirname "$0")" +$CPP merger.cpp -o merger.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=30000000 +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n merger.wasm + +cargo build --target x86_64-unknown-none --release && cc \ + -Wl,--gc-sections -nostdlib \ + -Wl,--whole-archive \ + target/x86_64-unknown-none/release/libwasmtime_merger.a \ + -Wl,--no-whole-archive \ + -shared \ + -o target/x86_64-unknown-none/release/libwasmtime_merger.so + + SYMLINK_PATH="./target/release/libwasmtime_merger.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + +ln -s ./user/wasmtime_merger/target/x86_64-unknown-none/release/libwasmtime_merger.so ./target/release/libwasmtime_merger.so \ No newline at end of file diff --git a/user/wasmtime_merger/merger.c b/user/wasmtime_merger/merger.c index 2717fe68..35ee1d3e 100644 --- a/user/wasmtime_merger/merger.c +++ b/user/wasmtime_merger/merger.c @@ -5,8 +5,13 @@ __attribute__((import_module("env"), import_name("buffer_register"))) void buffer_register(void *slot_name, int name_size, void *buffer, int buffer_size); __attribute__((import_module("env"), import_name("access_buffer"))) void access_buffer(void *slot_name, int name_size, void *buffer, int buffer_size); +#ifndef MAX_ARRAY_LENGTH #define MAX_ARRAY_LENGTH 20000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 200000000 +#endif int result[MAX_ARRAY_LENGTH]; diff --git a/user/wasmtime_merger/merger.cpp b/user/wasmtime_merger/merger.cpp index 955ef576..8e976f73 100644 --- a/user/wasmtime_merger/merger.cpp +++ b/user/wasmtime_merger/merger.cpp @@ -15,8 +15,13 @@ using namespace std; __attribute__((import_module("env"), import_name("buffer_register"))) void buffer_register(void *slot_name, int name_size, void *buffer, int buffer_size); __attribute__((import_module("env"), import_name("access_buffer"))) void access_buffer(void *slot_name, int name_size, void *buffer, int buffer_size); +#ifndef MAX_ARRAY_LENGTH #define MAX_ARRAY_LENGTH 8000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 80000000 +#endif int result[MAX_ARRAY_LENGTH]; diff --git a/user/wasmtime_merger/merger.cwasm b/user/wasmtime_merger/merger.cwasm index 34a956b9..ff2d0d5b 100644 Binary files a/user/wasmtime_merger/merger.cwasm and b/user/wasmtime_merger/merger.cwasm differ diff --git a/user/wasmtime_merger/merger.wasm b/user/wasmtime_merger/merger.wasm index aadad419..6fd2c441 100755 Binary files a/user/wasmtime_merger/merger.wasm and b/user/wasmtime_merger/merger.wasm differ diff --git a/user/wasmtime_reducer/Cargo.lock b/user/wasmtime_reducer/Cargo.lock index 7eebb7db..17f67fe6 100644 --- a/user/wasmtime_reducer/Cargo.lock +++ b/user/wasmtime_reducer/Cargo.lock @@ -855,7 +855,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +source = "git+https://github.com/NIBRSYK16/wasmtime-as-lib.git?branch=main#c1674a280f99ebbb888872fe0e27721a43cd45da" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_reducer/build.sh b/user/wasmtime_reducer/build.sh index aed52545..21ea67b2 100755 --- a/user/wasmtime_reducer/build.sh +++ b/user/wasmtime_reducer/build.sh @@ -1,5 +1,21 @@ -# $CC reducer.c -o reducer.wasm -$CPP reducer_new.cpp -o reducer.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment: export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC" + + + +# Ensure we run from the script directory so relative paths work +cd "$(dirname "$0")" + +# Compile C to WASM with optimizations and specified macros +$CC reducer.c -o reducer.wasm -O3 \ + -DMAX_WORD_LENGTH=20 \ + -DMAX_WORDS=1000 \ + -DMAX_SLOT_NUM=100 \ + -DMAX_BUFFER_SIZE=50000 +# $CPP reducer_new.cpp -o reducer.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n reducer.wasm @@ -11,7 +27,14 @@ cargo build --target x86_64-unknown-none --release && cc \ -shared \ -o target/x86_64-unknown-none/release/libwasmtime_reducer.so -ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_reducer/target/x86_64-unknown-none/release/libwasmtime_reducer.so /home/wyj/dyx_workplace/mslibos/target/release/libwasmtime_reducer.so +# Create symlink, handling the case where it already exists +SYMLINK_PATH="./target/release/libwasmtime_reducer.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + +ln -s ./user/wasmtime_reducer/target/x86_64-unknown-none/release/libwasmtime_reducer.so ./target/release/libwasmtime_reducer.so # cargo build --target x86_64-unknown-none && cc \ @@ -23,3 +46,33 @@ ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_reducer/target/x86_64-unknow # -o target/x86_64-unknown-none/debug/libwasmtime_reducer.so # ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_reducer/target/x86_64-unknown-none/debug/libwasmtime_reducer.so /home/wyj/dyx_workplace/mslibos/target/debug/libwasmtime_reducer.so +# # 设置编译参数 +# CFLAGS="-DMAX_WORD_LENGTH=14 -DMAX_WORDS=743 -DMAX_SLOT_NUM=100 -DMAX_BUFFER_SIZE=50000" + +# # 确保当前目录是脚本所在目录 +# cd "$(dirname "$0")" + +# # 编译C到WASM +# echo "编译C到WASM..." + +# # 使用Emscripten +# emcc reducer.c -o reducer.wasm $CFLAGS \ +# -s STANDALONE_WASM=1 \ +# -s IMPORTED_MEMORY=1 \ +# -s ALLOW_MEMORY_GROWTH=1 \ +# -s ERROR_ON_UNDEFINED_SYMBOLS=0 \ +# -s "EXPORTED_FUNCTIONS=['_main']" + +# # 使用WASI SDK的替代命令 (如果需要的话取消注释) +# # /opt/wasi-sdk/bin/clang reducer.c -o reducer.wasm $CFLAGS -O2 + +# # 编译WASM到CWASM +# echo "编译WASM到CWASM..." +# ~/.wasmtime/bin/wasmtime compile \ +# --target x86_64-unknown-none \ +# -W threads=n,tail-call=n \ +# reducer.wasm \ +# -o reducer.cwasm + +# echo "编译完成!" +# echo "输出文件: $(pwd)/reducer.wasm, $(pwd)/reducer.cwasm" \ No newline at end of file diff --git a/user/wasmtime_reducer/build_cpp.sh b/user/wasmtime_reducer/build_cpp.sh new file mode 100644 index 00000000..4b15492c --- /dev/null +++ b/user/wasmtime_reducer/build_cpp.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment: export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CPP && export CPP=/usr/bin/clang++ && echo "CPP is now: $CPP" + +cd "$(dirname "$0")" +$CPP reducer_new.cpp -o reducer.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_WORD_LENGTH=20 -DMAX_WORDS=18000000 -DMAX_SLOT_NUM=10 -DMAX_BUFFER_SIZE=500000 +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n reducer.wasm + +cargo build --target x86_64-unknown-none --release && cc \ + -Wl,--gc-sections -nostdlib \ + -Wl,--whole-archive \ + target/x86_64-unknown-none/release/libwasmtime_reducer.a \ + -Wl,--no-whole-archive \ + -shared \ + -o target/x86_64-unknown-none/release/libwasmtime_reducer.so + + SYMLINK_PATH="./target/release/libwasmtime_reducer.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + +ln -s ./user/wasmtime_reducer/target/x86_64-unknown-none/release/libwasmtime_reducer.so ./target/release/libwasmtime_reducer.so \ No newline at end of file diff --git a/user/wasmtime_reducer/reducer.c b/user/wasmtime_reducer/reducer.c index 3e77e1f0..57bf7c33 100644 --- a/user/wasmtime_reducer/reducer.c +++ b/user/wasmtime_reducer/reducer.c @@ -5,10 +5,23 @@ __attribute__((import_module("env"), import_name("access_buffer"))) void access_buffer(void *slot_name, int name_size, void *buffer, int buffer_size); + +// 允许通过编译参数覆盖默认值 +#ifndef MAX_WORD_LENGTH #define MAX_WORD_LENGTH 20 +#endif + +#ifndef MAX_WORDS #define MAX_WORDS 5000 +#endif + +#ifndef MAX_SLOT_NUM #define MAX_SLOT_NUM 100 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 6000 +#endif void to_lowercase(char *str) { for (int i = 0; str[i]; i++) { diff --git a/user/wasmtime_reducer/reducer.cwasm b/user/wasmtime_reducer/reducer.cwasm index da2d9a9d..3f154d32 100644 Binary files a/user/wasmtime_reducer/reducer.cwasm and b/user/wasmtime_reducer/reducer.cwasm differ diff --git a/user/wasmtime_reducer/reducer.wasm b/user/wasmtime_reducer/reducer.wasm index c36bcb3b..9d3d056f 100755 Binary files a/user/wasmtime_reducer/reducer.wasm and b/user/wasmtime_reducer/reducer.wasm differ diff --git a/user/wasmtime_reducer/reducer_new.cpp b/user/wasmtime_reducer/reducer_new.cpp index 11e0e851..1797d734 100644 --- a/user/wasmtime_reducer/reducer_new.cpp +++ b/user/wasmtime_reducer/reducer_new.cpp @@ -8,9 +8,17 @@ #include using namespace std; +#ifndef MAX_SLOT_NUM #define MAX_SLOT_NUM 10 +#endif + +#ifndef MAX_WORDS #define MAX_WORDS 18000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 500000 +#endif __attribute__((import_module("env"), import_name("access_buffer"))) void access_buffer(void *slot_name, int name_size, void *buffer, int buffer_size); diff --git a/user/wasmtime_sorter/Cargo.lock b/user/wasmtime_sorter/Cargo.lock index 264cbf8c..3398b045 100644 --- a/user/wasmtime_sorter/Cargo.lock +++ b/user/wasmtime_sorter/Cargo.lock @@ -855,7 +855,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +source = "git+https://github.com/NIBRSYK16/wasmtime-as-lib.git?branch=main#c1674a280f99ebbb888872fe0e27721a43cd45da" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_sorter/build.sh b/user/wasmtime_sorter/build.sh index 5dc84ed5..d33b90f8 100755 --- a/user/wasmtime_sorter/build.sh +++ b/user/wasmtime_sorter/build.sh @@ -1,7 +1,26 @@ +# Activate environment:export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC" + +# Ensure we run from the script directory so relative paths work +cd "$(dirname "$0")" + +# C1 +$CC sorter.c -o sorter.wasm -O3 -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 + +# C3 +# $CC sorter.c -o sorter.wasm -O3 -DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000 + +# C5 +# $CC sorter.c -o sorter.wasm -O3 -DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000 + +# $CPP sorter.cpp -o sorter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 + + +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n sorter.wasm # $CPP sorter.cpp -o sorter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -$CPP sorter_ori.cpp -o sorter.wasm -fno-exceptions -fno-rtti -ffast-math -fomit-frame-pointer -Ofast #-funroll-loops +# $CPP sorter_ori.cpp -o sorter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast # $CC sorter.c -o sorter.wasm -wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n sorter.wasm + cargo build --target x86_64-unknown-none --release && cc \ -Wl,--gc-sections -nostdlib \ @@ -11,8 +30,14 @@ cargo build --target x86_64-unknown-none --release && cc \ -shared \ -o target/x86_64-unknown-none/release/libwasmtime_sorter.so +SYMLINK_PATH="./target/release/libwasmtime_sorter.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + -ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_sorter/target/x86_64-unknown-none/release/libwasmtime_sorter.so /home/wyj/dyx_workplace/mslibos/target/release/libwasmtime_sorter.so +ln -s ./user/wasmtime_sorter/target/x86_64-unknown-none/release/libwasmtime_sorter.so ./target/release/libwasmtime_sorter.so diff --git a/user/wasmtime_sorter/build_cpp.sh b/user/wasmtime_sorter/build_cpp.sh new file mode 100755 index 00000000..8407a7fe --- /dev/null +++ b/user/wasmtime_sorter/build_cpp.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment: export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CPP && export CPP=/usr/bin/clang++ && echo "CPP is now: $CPP" + +cd "$(dirname "$0")" +$CPP sorter.cpp -o sorter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=30000000 +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n sorter.wasm + +cargo build --target x86_64-unknown-none --release && cc \ + -Wl,--gc-sections -nostdlib \ + -Wl,--whole-archive \ + target/x86_64-unknown-none/release/libwasmtime_sorter.a \ + -Wl,--no-whole-archive \ + -shared \ + -o target/x86_64-unknown-none/release/libwasmtime_sorter.so + + SYMLINK_PATH="./target/release/libwasmtime_sorter.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + +ln -s ./user/wasmtime_sorter/target/x86_64-unknown-none/release/libwasmtime_sorter.so ./target/release/libwasmtime_sorter.so \ No newline at end of file diff --git a/user/wasmtime_sorter/sorter.c b/user/wasmtime_sorter/sorter.c index 932d8589..badeb112 100644 --- a/user/wasmtime_sorter/sorter.c +++ b/user/wasmtime_sorter/sorter.c @@ -6,8 +6,13 @@ __attribute__((import_module("env"), import_name("buffer_register"))) void buffer_register(void *slot_name, int name_size, void *buffer, int buffer_size); +#ifndef MAX_ARRAY_LENGTH #define MAX_ARRAY_LENGTH 20000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 200000000 +#endif // 比较函数,用于 qsort int compare(const void *a, const void *b) { @@ -23,9 +28,20 @@ char nc(FILE *stream) { int readfile(FILE *stream) { int x = 0, ch = nc(stream); - for (; ch < '0' || ch > '9'; ch = nc(stream)); + + // 如果第一个字符就是EOF,直接返回0 + if (ch == EOF) return 0; + + // 跳过非数字字符 + for (; ch != EOF && (ch < '0' || ch > '9'); ch = nc(stream)); + + // 如果跳过非数字字符后遇到EOF,返回0 + if (ch == EOF) return 0; + + // 读取数字 for (; ch >= '0' && ch <= '9'; ch = nc(stream)) x = (x << 1) + (x << 3) + (ch ^ 48); + return x; } @@ -44,32 +60,28 @@ int main(int argc, char* argv[]) { } int index = 0; - // char line[1024]; - // while (fgets(line, sizeof(line), file)) { - // char *token = strtok(line, " \n"); // 以空格和换行作为分隔符 - // while (token != NULL) { - // array[index++] = atoi(token); - // token = strtok(NULL, " \n"); //读取下一个单词 - // } - // } - // time_t now; - // time(&now); - // printf("%ld read start\n", now); - // write(1, "read start\n", sizeof("read start\n")); + printf("DEBUG: Starting to read file...\n"); + fflush(stdout); + char number[10]; - while (array[index++] = readfile(file)); - // time(&now); - // printf("%ld read finished\n", now); - // write(1, "read finished\n", sizeof("read finished\n")); - // while (fscanf(file, "%s", number) != EOF) { - // array[index] = atoi(number); - // // printf("array[%d]: %d\n", index, array[index]); - // index++; - // } - // printf("sorter_%d read finished!\n", id); - // printf("index: %d\n", index); + while (array[index++] = readfile(file)) { + if (index % 10000 == 0) { + // printf("DEBUG: Read %d numbers so far\n", index); + fflush(stdout); + } + } + + printf("DEBUG: Finished reading, total count: %d\n", index); + fflush(stdout); + fclose(file); - // qsort(array, index, sizeof(int), compare); + printf("DEBUG: Starting qsort...\n"); + fflush(stdout); + + qsort(array, index, sizeof(int), compare); + + printf("DEBUG: Finished qsort\n"); + fflush(stdout); // printf("sorter_%d sort finished!\n", id); diff --git a/user/wasmtime_sorter/sorter.cpp b/user/wasmtime_sorter/sorter.cpp index 90488f45..8195183d 100644 --- a/user/wasmtime_sorter/sorter.cpp +++ b/user/wasmtime_sorter/sorter.cpp @@ -17,8 +17,13 @@ using namespace std; __attribute__((import_module("env"), import_name("buffer_register"))) void buffer_register(void *slot_name, int name_size, void *buffer, int buffer_size); +#ifndef MAX_ARRAY_LENGTH #define MAX_ARRAY_LENGTH 8000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 80000000 +#endif // 比较函数,用于 qsort int compare(const void *a, const void *b) { diff --git a/user/wasmtime_sorter/sorter.cwasm b/user/wasmtime_sorter/sorter.cwasm index 2c4b1374..cc63e6bd 100644 Binary files a/user/wasmtime_sorter/sorter.cwasm and b/user/wasmtime_sorter/sorter.cwasm differ diff --git a/user/wasmtime_sorter/sorter.wasm b/user/wasmtime_sorter/sorter.wasm index 23deaa7e..07ec8eac 100755 Binary files a/user/wasmtime_sorter/sorter.wasm and b/user/wasmtime_sorter/sorter.wasm differ diff --git a/user/wasmtime_spliter/Cargo.lock b/user/wasmtime_spliter/Cargo.lock index bbd0289a..f4331e46 100644 --- a/user/wasmtime_spliter/Cargo.lock +++ b/user/wasmtime_spliter/Cargo.lock @@ -855,7 +855,7 @@ dependencies = [ [[package]] name = "wasmtime" version = "22.0.0" -source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +source = "git+https://github.com/NIBRSYK16/wasmtime-as-lib.git?branch=main#c1674a280f99ebbb888872fe0e27721a43cd45da" dependencies = [ "anyhow", "bumpalo", diff --git a/user/wasmtime_spliter/build.sh b/user/wasmtime_spliter/build.sh index 2dca26a3..8a27e744 100755 --- a/user/wasmtime_spliter/build.sh +++ b/user/wasmtime_spliter/build.sh @@ -1,7 +1,25 @@ +# Activate environment:export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC" + +# Ensure we run from the script directory so relative paths work +cd "$(dirname "$0")" + +# C1 +$CC spliter.c -o spliter.wasm -O3 -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 + +# C3 +# $CC spliter.c -o spliter.wasm -O3 -DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000 + +# C5 +# $CC spliter.c -o spliter.wasm -O3 -DMAX_ARRAY_LENGTH=8000000 -DMAX_BUFFER_SIZE=80000000 + +# $CPP spliter.cpp -o spliter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 + +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n spliter.wasm # $CPP spliter.cpp -o spliter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -$CPP spliter_ori.cpp -o spliter.wasm # -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast +# $CPP spliter_ori.cpp -o spliter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast # $CC spliter.c -o spliter.wasm -wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n spliter.wasm + cargo build --target x86_64-unknown-none --release && cc \ -Wl,--gc-sections -nostdlib \ @@ -11,6 +29,12 @@ cargo build --target x86_64-unknown-none --release && cc \ -shared \ -o target/x86_64-unknown-none/release/libwasmtime_spliter.so +SYMLINK_PATH="./target/release/libwasmtime_spliter.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + -ln -s /home/wyj/dyx_workplace/mslibos/user/wasmtime_spliter/target/x86_64-unknown-none/release/libwasmtime_spliter.so /home/wyj/dyx_workplace/mslibos/target/release/libwasmtime_spliter.so +ln -s ./user/wasmtime_spliter/target/x86_64-unknown-none/release/libwasmtime_spliter.so ./target/release/libwasmtime_spliter.so diff --git a/user/wasmtime_spliter/build_cpp.sh b/user/wasmtime_spliter/build_cpp.sh new file mode 100755 index 00000000..be0dd8af --- /dev/null +++ b/user/wasmtime_spliter/build_cpp.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Activate environment: export CPP="/opt/wasi-sdk/bin/clang++" && export CC="/opt/wasi-sdk/bin/clang" +# Before compiling other modules: unset CPP && export CPP=/usr/bin/clang++ && echo "CPP is now: $CPP" + +cd "$(dirname "$0")" +# $CPP spliter.cpp -o spliter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=15000000 +$CPP spliter.cpp -o spliter.wasm -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fomit-frame-pointer -Ofast -DMAX_ARRAY_LENGTH=1600000 -DMAX_BUFFER_SIZE=30000000 + +wasmtime compile --target x86_64-unknown-none -W threads=n,tail-call=n spliter.wasm + +cargo build --target x86_64-unknown-none --release && cc \ + -Wl,--gc-sections -nostdlib \ + -Wl,--whole-archive \ + target/x86_64-unknown-none/release/libwasmtime_spliter.a \ + -Wl,--no-whole-archive \ + -shared \ + -o target/x86_64-unknown-none/release/libwasmtime_spliter.so + + SYMLINK_PATH="./target/release/libwasmtime_spliter.so" +if [ -L "$SYMLINK_PATH" ]; then + echo "Symlink already exists, updating..." + rm "$SYMLINK_PATH" +fi + +ln -s ./user/wasmtime_spliter/target/x86_64-unknown-none/release/libwasmtime_spliter.so ./target/release/libwasmtime_spliter.so \ No newline at end of file diff --git a/user/wasmtime_spliter/spliter.c b/user/wasmtime_spliter/spliter.c index 1967fed1..d92d7ba5 100644 --- a/user/wasmtime_spliter/spliter.c +++ b/user/wasmtime_spliter/spliter.c @@ -5,8 +5,13 @@ __attribute__((import_module("env"), import_name("buffer_register"))) void buffer_register(void *slot_name, int name_size, void *buffer, int buffer_size); __attribute__((import_module("env"), import_name("access_buffer"))) void access_buffer(void *slot_name, int name_size, void *buffer, int buffer_size); +#ifndef MAX_ARRAY_LENGTH #define MAX_ARRAY_LENGTH 20000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 200000000 +#endif int sorter_array[MAX_ARRAY_LENGTH]; @@ -14,7 +19,9 @@ int main(int argc, char* argv[]) { int id = atoi(argv[1]); int sorter_num = atoi(argv[2]); int merger_num = atoi(argv[3]); + printf("spliter_%d start!\n", id); + // printf("???\n"); char slot_name[20]; int bufferSize = MAX_BUFFER_SIZE; char *ptr; @@ -23,6 +30,7 @@ int main(int argc, char* argv[]) { // access pivot buffer int pivot_array[10]; int pivot_index = 0; + if (merger_num > 1) { sprintf(slot_name, "pivot_%d", id); char *pivot_buffer; @@ -35,7 +43,7 @@ int main(int argc, char* argv[]) { pivot_buffer[0] = '\0'; // 初始化为空字符串 access_buffer(slot_name, strlen(slot_name), pivot_buffer, bufferSize); ptr = pivot_buffer; - printf("pivot_buffer: %s", pivot_buffer); + // printf("pivot_buffer: %s", pivot_buffer); while (sscanf(ptr, "%d", &num) == 1) { pivot_array[pivot_index] = num; pivot_index++; @@ -125,7 +133,7 @@ int main(int argc, char* argv[]) { free(buffer); free(array[i]); } - free(array_index); + // free(array_index); printf("spliter_%d all finished!\n", id); return 0; } \ No newline at end of file diff --git a/user/wasmtime_spliter/spliter.cpp b/user/wasmtime_spliter/spliter.cpp index e4ec5426..2f638ac9 100644 --- a/user/wasmtime_spliter/spliter.cpp +++ b/user/wasmtime_spliter/spliter.cpp @@ -15,8 +15,13 @@ using namespace std; __attribute__((import_module("env"), import_name("buffer_register"))) void buffer_register(void *slot_name, int name_size, void *buffer, int buffer_size); __attribute__((import_module("env"), import_name("access_buffer"))) void access_buffer(void *slot_name, int name_size, void *buffer, int buffer_size); +#ifndef MAX_ARRAY_LENGTH #define MAX_ARRAY_LENGTH 8000000 +#endif + +#ifndef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE 80000000 +#endif int sorter_array[MAX_ARRAY_LENGTH]; diff --git a/user/wasmtime_spliter/spliter.cwasm b/user/wasmtime_spliter/spliter.cwasm index 882b840f..c5ef7f2f 100644 Binary files a/user/wasmtime_spliter/spliter.cwasm and b/user/wasmtime_spliter/spliter.cwasm differ diff --git a/user/wasmtime_spliter/spliter.wasm b/user/wasmtime_spliter/spliter.wasm index 35fa9e4c..6bda2fde 100755 Binary files a/user/wasmtime_spliter/spliter.wasm and b/user/wasmtime_spliter/spliter.wasm differ diff --git a/wasmtime_wasi_api/Cargo.toml b/wasmtime_wasi_api/Cargo.toml index 5fa2189e..9d8381ee 100644 --- a/wasmtime_wasi_api/Cargo.toml +++ b/wasmtime_wasi_api/Cargo.toml @@ -16,8 +16,8 @@ hashbrown = { version = "0.14", default-features = false, features = ["ahash"] } lazy_static = { version = "1.4.0", features = ["spin_no_std"] } sjlj = { version = "0.1.3" } -# wasmtime = { path = "../wasmtime-as-lib", default-features = false, features = [ -wasmtime = { git = "https://gitee.com/tju-cloud-computing/wasmtime-as-lib", branch = "master", default-features = false, features = [ +# wasmtime = { path = "/home/as-group/syk_alloystack/workspace/wasmtime-as-lib", default-features = false, features = [ +wasmtime = { git = "https://github.com/NIBRSYK16/wasmtime-as-lib.git", branch = "main", default-features = false, features = [ "runtime", "gc", "component-model",