From 1b54755f7fd12a44c7a2954c2175b7e668d01db8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 30 Aug 2026 11:17:18 +0000 Subject: [PATCH 1/2] Fix compilation and clippy errors across repository Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- Cargo.lock | 376 +++++++++++++++++--------- cli/Cargo.toml | 4 +- compiler/bytecode/Cargo.toml | 4 +- compiler/llvm_backend/Cargo.toml | 2 +- compiler/llvm_backend/src/codegen.rs | 38 ++- compiler/llvm_backend/src/context.rs | 3 + compiler/llvm_backend/src/jit.rs | 18 +- compiler/llvm_backend/src/lib.rs | 4 +- compiler/llvm_backend/src/type_map.rs | 5 +- runtime/native_runtime/src/lib.rs | 4 +- runtime/vm/Cargo.toml | 2 +- stdlib/Cargo.toml | 8 +- stdlib/src/compress.rs | 9 +- stdlib/src/crypto.rs | 2 +- stdlib/src/process.rs | 6 +- stdlib/src/sqlite.rs | 17 +- stdlib/src/web.rs | 4 +- stdlib/tests/stdlib_tests.rs | 9 +- tools/package-manager/Cargo.toml | 2 +- tools/packager/src/main.rs | 6 +- 20 files changed, 349 insertions(+), 174 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7aab48b..93e6fcd5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,7 +15,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1973cfbc1a2daf9cf550e74e1f088c28e7f7d8c1e1418fb6c9dc5184b7e84c99" dependencies = [ "crypto-common 0.2.2", - "inout", + "inout 0.2.2", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher 0.4.4", + "cpufeatures 0.2.17", ] [[package]] @@ -24,7 +35,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8eb277bec05f56a0e0591f155a484cbd0f4f07ff2905051a48c72f004f7ed58" dependencies = [ - "cipher", + "cipher 0.5.2", "cpubits", "cpufeatures 0.3.0", ] @@ -36,8 +47,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f2b8006a0c83f52b62ba44a97b58bf76fe2f70a329e588f67f89691d93d498f" dependencies = [ "aead", - "aes", - "cipher", + "aes 0.9.2", + "cipher 0.5.2", "ctr", "ctutils", "ghash", @@ -513,6 +524,12 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + [[package]] name = "bcrypt" version = "0.19.3" @@ -535,12 +552,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bincode" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6a120d2e16b3e1b4a24bd70f23b12d3e16b81f113364a26935f8db7245452d" - [[package]] name = "bit_field" version = "0.10.3" @@ -625,7 +636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62ce3946557b35e71d1bbe07ec385073ce9eda05043f95de134eb578fcf1a298" dependencies = [ "byteorder", - "cipher", + "cipher 0.5.2", ] [[package]] @@ -674,6 +685,16 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + [[package]] name = "bzip2" version = "0.6.1" @@ -683,6 +704,16 @@ dependencies = [ "libbz2-rs-sys", ] +[[package]] +name = "bzip2-sys" +version = "0.1.13+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" +dependencies = [ + "cc", + "pkg-config", +] + [[package]] name = "calamine" version = "0.36.1" @@ -697,7 +728,7 @@ dependencies = [ "log", "quick-xml", "serde", - "zip", + "zip 8.6.0", ] [[package]] @@ -706,7 +737,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce2dc9ee5f88d11e0beb842c88b33c8a5cf0d1329c4b19494af42b07dbfe8896" dependencies = [ - "cipher", + "cipher 0.5.2", ] [[package]] @@ -718,7 +749,7 @@ dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 2.0.1", ] [[package]] @@ -763,6 +794,16 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common 0.1.7", + "inout 0.1.4", +] + [[package]] name = "cipher" version = "0.5.2" @@ -771,7 +812,7 @@ checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c" dependencies = [ "block-buffer 0.12.1", "crypto-common 0.2.2", - "inout", + "inout 0.2.2", ] [[package]] @@ -894,38 +935,15 @@ checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" [[package]] name = "constant_time_eq" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" - -[[package]] -name = "cookie" -version = "0.18.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] -name = "cookie_store" -version = "0.22.1" +name = "constant_time_eq" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206" -dependencies = [ - "cookie", - "document-features", - "idna", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "time", - "url", -] +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" [[package]] name = "core-foundation-sys" @@ -1060,7 +1078,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baaca1c4b237092596f64d571e9db6ce4109c4ef9742e27590f1709594461f21" dependencies = [ - "cipher", + "cipher 0.5.2", ] [[package]] @@ -1111,6 +1129,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", "crypto-common 0.1.7", + "subtle", ] [[package]] @@ -1168,15 +1187,6 @@ dependencies = [ "syn 3.0.3", ] -[[package]] -name = "document-features" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" -dependencies = [ - "litrs", -] - [[package]] name = "dunce" version = "1.0.5" @@ -1189,7 +1199,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbfbf3db731928d6912bc3beda911d55b834cee3df6131ba79b337a1298a3fa9" dependencies = [ - "cipher", + "cipher 0.5.2", ] [[package]] @@ -1659,6 +1669,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "hmac" version = "0.13.0" @@ -1677,16 +1696,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "http" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" -dependencies = [ - "bytes", - "itoa", -] - [[package]] name = "httparse" version = "1.10.1" @@ -1714,7 +1723,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcf4dd4c44ae85155502a52c48739c8a48185d1449fff1963cffee63c28a50f0" dependencies = [ - "bincode 1.3.3", + "bincode", "fst", "hyphenation_commons", "pocket-resources", @@ -1911,6 +1920,15 @@ dependencies = [ "serde_core", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "inout" version = "0.2.2" @@ -2046,17 +2064,11 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" -[[package]] -name = "litrs" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" - [[package]] name = "llvm-sys" -version = "221.0.1" +version = "180.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2abcc34a3b190f03c2a61b555f218f529589ff13657bdd2ff8ac3e85f2abe6bb" +checksum = "778fa5fa02e32728e718f11eec147e6f134137399ab02fd2c13d32476337affa" dependencies = [ "anyhow", "cc", @@ -2128,7 +2140,7 @@ version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e2ec995d822e05cabc3f06d196ee43650af3fe4fe38012cacb35e0c3d113b68" dependencies = [ - "aes", + "aes 0.9.2", "bitflags 2.13.1", "cbc", "ecb", @@ -2142,7 +2154,7 @@ dependencies = [ "nom", "rand 0.10.2", "rangemap", - "sha2", + "sha2 0.11.0", "stringprep", "thiserror", "weezl 0.2.1", @@ -2173,7 +2185,7 @@ version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca93e534d1142d1d0dcca6d25fe302508a5dfb40b302802904577725ea0b695b" dependencies = [ - "sha2", + "sha2 0.11.0", ] [[package]] @@ -2533,6 +2545,17 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" @@ -2564,6 +2587,18 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", + "password-hash", + "sha2 0.10.9", +] + [[package]] name = "pbkdf2" version = "0.13.0" @@ -2571,7 +2606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112d82ceb8c5bf524d9af484d4e4970c9fd5a0cc15ba14ad93dccd28873b0629" dependencies = [ "digest 0.11.3", - "hmac", + "hmac 0.13.0", ] [[package]] @@ -2867,13 +2902,24 @@ dependencies = [ "nibble_vec", ] +[[package]] +name = "rand" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + [[package]] name = "rand" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ - "rand_chacha", + "rand_chacha 0.9.0", "rand_core 0.9.5", ] @@ -2888,6 +2934,16 @@ dependencies = [ "rand_core 0.10.1", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + [[package]] name = "rand_chacha" version = "0.9.0" @@ -2898,6 +2954,15 @@ dependencies = [ "rand_core 0.9.5", ] +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + [[package]] name = "rand_core" version = "0.9.5" @@ -2947,7 +3012,7 @@ dependencies = [ "paste", "profiling", "rand 0.9.5", - "rand_chacha", + "rand_chacha 0.9.0", "simd_helpers", "thiserror", "v_frame", @@ -3296,6 +3361,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + [[package]] name = "sha1" version = "0.11.0" @@ -3307,6 +3383,17 @@ dependencies = [ "digest 0.11.3", ] +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.11.0" @@ -3318,6 +3405,12 @@ dependencies = [ "digest 0.11.3", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "shlex" version = "2.0.1" @@ -3518,7 +3611,7 @@ dependencies = [ name = "techscript_bytecode" version = "2.0.0" dependencies = [ - "bincode 3.0.0", + "bincode", "serde", "techscript_ast", "techscript_common", @@ -3536,7 +3629,7 @@ name = "techscript_cli" version = "2.0.0" dependencies = [ "anyhow", - "bincode 3.0.0", + "bincode", "clap", "clap_complete", "colored", @@ -3741,9 +3834,9 @@ dependencies = [ "hex", "serde", "serde_json", - "sha2", + "sha2 0.11.0", "toml 1.1.4+spec-1.1.0", - "zip", + "zip 8.6.0", ] [[package]] @@ -3805,14 +3898,14 @@ dependencies = [ "printpdf", "qrcode", "quick-xml", - "rand 0.10.2", + "rand 0.8.8", "rusqlite", "rustls", "serde", "serde_json", "sha-1", - "sha2", - "shlex", + "sha2 0.11.0", + "shlex 1.3.0", "tar", "techscript_runtime", "tiny_http", @@ -3821,7 +3914,7 @@ dependencies = [ "ureq", "url", "uuid", - "zip", + "zip 0.6.6", ] [[package]] @@ -3837,7 +3930,7 @@ dependencies = [ name = "techscript_vm" version = "2.0.0" dependencies = [ - "bincode 3.0.0", + "bincode", "indexmap", "serde", "techscript_ast", @@ -3915,7 +4008,6 @@ dependencies = [ "powerfmt", "serde_core", "time-core", - "time-macros", ] [[package]] @@ -3924,16 +4016,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" -[[package]] -name = "time-macros" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tiny_http" version = "0.12.0" @@ -4268,34 +4350,20 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "3.4.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972d7902c8735f2695410b8aed7df6ed12a47394aa1c8d7af49f0497b731a94d" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "base64 0.23.1", - "cookie_store", + "base64 0.22.1", "flate2", "log", - "percent-encoding", + "once_cell", "rustls", "rustls-pki-types", "serde", "serde_json", - "ureq-proto", - "utf8-zero", - "webpki-roots", -] - -[[package]] -name = "ureq-proto" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da5f78b09e6941e1a0f2e30e695e4b120377b54d5e0aec11b594bb57b3971613" -dependencies = [ - "base64 0.23.1", - "http", - "httparse", - "log", + "url", + "webpki-roots 0.26.11", ] [[package]] @@ -4311,12 +4379,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "utf8-zero" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -4434,6 +4496,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "webpki-roots" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.9", +] + [[package]] name = "webpki-roots" version = "1.0.9" @@ -4953,31 +5024,51 @@ dependencies = [ "syn 3.0.3", ] +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes 0.8.4", + "byteorder", + "bzip2 0.4.4", + "constant_time_eq 0.1.5", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac 0.12.1", + "pbkdf2 0.11.0", + "sha1 0.10.7", + "time", + "zstd 0.11.2+zstd.1.5.2", +] + [[package]] name = "zip" version = "8.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d04a6b5381502aa6087c94c669499eb1602eb9c5e8198e534de571f7154809b" dependencies = [ - "aes", - "bzip2", - "constant_time_eq", + "aes 0.9.2", + "bzip2 0.6.1", + "constant_time_eq 0.4.2", "crc32fast", "deflate64", "flate2", "getrandom 0.4.3", - "hmac", + "hmac 0.13.0", "indexmap", "lzma-rust2", "memchr", - "pbkdf2", + "pbkdf2 0.13.0", "ppmd-rust", - "sha1", + "sha1 0.11.0", "time", "typed-path", "zeroize", "zopfli", - "zstd", + "zstd 0.13.3", ] [[package]] @@ -5004,13 +5095,32 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + [[package]] name = "zstd" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe", + "zstd-safe 7.2.4", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", ] [[package]] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 9b9d0b30..15b314a1 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -37,10 +37,10 @@ anyhow = { workspace = true } rustyline = { workspace = true } toml = { workspace = true } indexmap = { workspace = true } -bincode = "3.0" +bincode = "1.3.3" dirs = "6.0" num_cpus = "1.15" -ureq = { version = "3.4.0" } +ureq = { version = "2.9" } [build-dependencies] winres = "0.1.12" diff --git a/compiler/bytecode/Cargo.toml b/compiler/bytecode/Cargo.toml index c6ca4918..759d6121 100644 --- a/compiler/bytecode/Cargo.toml +++ b/compiler/bytecode/Cargo.toml @@ -10,7 +10,7 @@ techscript_syntax = { path = "../syntax" } techscript_ast = { path = "../ast" } techscript_ir = { path = "../ir" } serde = { workspace = true } -bincode = "3.0" +bincode = "1.3.3" [dev-dependencies] techscript_errors = { path = "../errors" } @@ -19,4 +19,4 @@ techscript_parser = { path = "../parser" } techscript_semantic = { path = "../semantic" } techscript_optimizer = { path = "../optimizer" } serde = { workspace = true } -bincode = "3.0" +bincode = "1.3.3" diff --git a/compiler/llvm_backend/Cargo.toml b/compiler/llvm_backend/Cargo.toml index 7ed4d837..333540ba 100644 --- a/compiler/llvm_backend/Cargo.toml +++ b/compiler/llvm_backend/Cargo.toml @@ -9,7 +9,7 @@ techscript_common = { path = "../common" } techscript_ir = { path = "../ir" } techscript_ast = { path = "../ast" } techscript_syntax = { path = "../syntax" } -llvm-sys = { version = "221", optional = true } +llvm-sys = { version = "180", optional = true } serde = { workspace = true } anyhow = { workspace = true } thiserror = { workspace = true } diff --git a/compiler/llvm_backend/src/codegen.rs b/compiler/llvm_backend/src/codegen.rs index 26655b60..4ef99af9 100644 --- a/compiler/llvm_backend/src/codegen.rs +++ b/compiler/llvm_backend/src/codegen.rs @@ -33,11 +33,14 @@ impl<'a> CodegenEngine<'a> { } } + /// # Safety + /// + /// Caller must ensure LLVM context is valid. pub unsafe fn compile_module(&mut self, ir_module: &Module) -> Result<(), String> { self.global_names.clear(); // 1. Declare globals - for &(ref global_id, ref name, ref ty) in &ir_module.globals { + for (global_id, name, ty) in &ir_module.globals { let llvm_ty = to_llvm_type(self.ctx.context, ty); let global_var = LLVMAddGlobal( self.ctx.module, @@ -124,8 +127,6 @@ impl<'a> CodegenEngine<'a> { let dest_block = self.ctx.get_block(*dest).unwrap(); LLVMBuildBr(self.ctx.builder, dest_block); } -< - } TerminatorKind::ConditionalJump { cond, then_block, @@ -199,6 +200,20 @@ impl<'a> CodegenEngine<'a> { TerminatorKind::Unreachable => { LLVMBuildUnreachable(self.ctx.builder); } + TerminatorKind::Throw(_) => { + let i8_ptr_ty = LLVMPointerType(LLVMInt8TypeInContext(self.ctx.context), 0); + let fn_throw = self.get_or_declare_runtime_fn("ts_throw", LLVMVoidTypeInContext(self.ctx.context), &[i8_ptr_ty]); + let null_ptr = LLVMConstNull(i8_ptr_ty); + LLVMBuildCall2( + self.ctx.builder, + LLVMTypeOf(fn_throw), + fn_throw, + [null_ptr].as_mut_ptr(), + 1, + c"".as_ptr(), + ); + LLVMBuildUnreachable(self.ctx.builder); + } } } } @@ -1056,7 +1071,10 @@ impl<'a> CodegenEngine<'a> { CString::new("cast").unwrap().as_ptr(), ) } - Op::Try { catch_block, catch_var } => { + Op::Try { + catch_block, + catch_var, + } => { let i8_ptr_ty = LLVMPointerType(LLVMInt8TypeInContext(context), 0); let fn_push = self.get_or_declare_runtime_fn("ts_try_push", i8_ptr_ty, &[]); let buf_ptr = LLVMBuildCall2( @@ -1120,7 +1138,11 @@ impl<'a> CodegenEngine<'a> { LLVMPositionBuilderAtEnd(self.ctx.builder, dispatch_block); // Clean up the jmp_buf since we arrived here via longjmp and ts_try_pop wasn't called - let fn_free_buf = self.get_or_declare_runtime_fn("ts_try_free", LLVMVoidTypeInContext(context), &[i8_ptr_ty]); + let fn_free_buf = self.get_or_declare_runtime_fn( + "ts_try_free", + LLVMVoidTypeInContext(context), + &[i8_ptr_ty], + ); LLVMBuildCall2( self.ctx.builder, LLVMTypeOf(fn_free_buf), @@ -1151,7 +1173,11 @@ impl<'a> CodegenEngine<'a> { return Ok(()); } Op::EndTry => { - let fn_pop = self.get_or_declare_runtime_fn("ts_try_pop", LLVMVoidTypeInContext(context), &[]); + let fn_pop = self.get_or_declare_runtime_fn( + "ts_try_pop", + LLVMVoidTypeInContext(context), + &[], + ); LLVMBuildCall2( self.ctx.builder, LLVMTypeOf(fn_pop), diff --git a/compiler/llvm_backend/src/context.rs b/compiler/llvm_backend/src/context.rs index 91d90c45..fb6aa894 100644 --- a/compiler/llvm_backend/src/context.rs +++ b/compiler/llvm_backend/src/context.rs @@ -21,6 +21,9 @@ pub struct CodegenContext { } impl CodegenContext { + /// # Safety + /// + /// Caller must ensure LLVM context is valid. pub unsafe fn new(name: &str) -> Self { let context = LLVMContextCreate(); let module = diff --git a/compiler/llvm_backend/src/jit.rs b/compiler/llvm_backend/src/jit.rs index e05cbfe8..e8165278 100644 --- a/compiler/llvm_backend/src/jit.rs +++ b/compiler/llvm_backend/src/jit.rs @@ -4,7 +4,6 @@ #![cfg(feature = "llvm")] -use llvm_sys::core::*; use llvm_sys::orc2::lljit::*; use llvm_sys::orc2::*; use std::collections::HashMap; @@ -23,6 +22,9 @@ pub struct LLVMJitEngine { impl LLVMJitEngine { /// Creates a new LLVMJitEngine instance. + /// # Safety + /// + /// Caller must ensure LLVM context is valid. pub unsafe fn new() -> Result { let mut jit = ptr::null_mut(); let builder = LLVMOrcCreateLLJITBuilder(); @@ -41,10 +43,13 @@ impl LLVMJitEngine { } /// Compiles a TechScript IR Module to JIT memory. + /// # Safety + /// + /// Caller must ensure LLVM context is valid. pub unsafe fn compile( &mut self, ir_module: &techscript_ir::Module, - options: &LLVMBackendOptions, + _options: &LLVMBackendOptions, ) -> Result<(), String> { // 1. Build LLVM IR Module let mut ctx = CodegenContext::new(&ir_module.name); @@ -79,6 +84,9 @@ impl LLVMJitEngine { } /// Looks up a function symbol by name. + /// # Safety + /// + /// Caller must ensure LLVM context is valid. pub unsafe fn lookup(&mut self, name: &str) -> Result { if let Some(&addr) = self.cache.get(name) { return Ok(addr); @@ -96,6 +104,9 @@ impl LLVMJitEngine { } /// Executes the JIT-compiled main function and returns its result (if integer). + /// # Safety + /// + /// Caller must ensure LLVM context is valid. pub unsafe fn execute(&mut self, func_name: &str) -> Result { let addr = self.lookup(func_name)?; let func: extern "C" fn() -> i64 = std::mem::transmute(addr); @@ -103,6 +114,9 @@ impl LLVMJitEngine { } /// Clears the function cache and reloads the engine (for hot reload support). + /// # Safety + /// + /// Caller must ensure LLVM context is valid. pub unsafe fn hot_reload(&mut self) { self.cache.clear(); } diff --git a/compiler/llvm_backend/src/lib.rs b/compiler/llvm_backend/src/lib.rs index b76a24a4..d322cc81 100644 --- a/compiler/llvm_backend/src/lib.rs +++ b/compiler/llvm_backend/src/lib.rs @@ -104,7 +104,7 @@ impl LLVMBackend { let mut engine = CodegenEngine::new(&mut ctx); engine .compile_module(ir_module) - .map_err(|e| LLVMCodegenError::CompilationError(e))?; + .map_err(LLVMCodegenError::CompilationError)?; let out_str = CString::new(out_path.to_string_lossy().to_string()).unwrap(); let mut err_msg = std::ptr::null_mut(); @@ -147,7 +147,7 @@ impl LLVMBackend { engine .compile_module(ir_module) - .map_err(|e| LLVMCodegenError::CompilationError(e))?; + .map_err(LLVMCodegenError::CompilationError)?; // 3. Resolve Target Triple & Host CPU Features let triple_cstr = CString::new(options.target_triple.as_str()).unwrap(); diff --git a/compiler/llvm_backend/src/type_map.rs b/compiler/llvm_backend/src/type_map.rs index 5b1038b5..fd7dc32e 100644 --- a/compiler/llvm_backend/src/type_map.rs +++ b/compiler/llvm_backend/src/type_map.rs @@ -9,7 +9,10 @@ use llvm_sys::prelude::*; use techscript_ir::types::IRType; /// Maps a TechScript IRType to its corresponding LLVMTypeRef. -pub unsafe fn to_llvm_type(context: LLVMContextRef, ty: &IRType) -> LLVMTypeRef { +/// # Safety + /// + /// Caller must ensure LLVM context is valid. + pub unsafe fn to_llvm_type(context: LLVMContextRef, ty: &IRType) -> LLVMTypeRef { match ty { IRType::Void => LLVMVoidTypeInContext(context), IRType::Int64 => LLVMInt64TypeInContext(context), diff --git a/runtime/native_runtime/src/lib.rs b/runtime/native_runtime/src/lib.rs index 735bdca7..eee9b534 100644 --- a/runtime/native_runtime/src/lib.rs +++ b/runtime/native_runtime/src/lib.rs @@ -1037,8 +1037,8 @@ extern "C" { } thread_local! { - static TRY_STACK: RefCell> = RefCell::new(Vec::new()); - static PENDING_EXCEPTION: RefCell<*mut TsValue> = RefCell::new(std::ptr::null_mut()); + static TRY_STACK: RefCell> = const { RefCell::new(Vec::new()) }; + static PENDING_EXCEPTION: RefCell<*mut TsValue> = const { RefCell::new(std::ptr::null_mut()) }; } #[no_mangle] diff --git a/runtime/vm/Cargo.toml b/runtime/vm/Cargo.toml index b83f0c59..39bf9dfa 100644 --- a/runtime/vm/Cargo.toml +++ b/runtime/vm/Cargo.toml @@ -14,7 +14,7 @@ techscript_runtime = { path = "../runtime" } techscript_builtins = { path = "../builtins" } techscript_stdlib = { path = "../../stdlib" } serde = { workspace = true } -bincode = "3.0" +bincode = "1.3.3" thiserror = { workspace = true } indexmap = "2.0" diff --git a/stdlib/Cargo.toml b/stdlib/Cargo.toml index f80ec7f0..48eb1a9b 100644 --- a/stdlib/Cargo.toml +++ b/stdlib/Cargo.toml @@ -9,7 +9,7 @@ techscript_runtime = { path = "../runtime/runtime" } serde_json = { workspace = true } serde = { workspace = true } indexmap = { version = "2", features = ["serde"] } -ureq = { version = "3.4", features = ["json"] } +ureq = { version = "2.9", features = ["json"] } toml = { workspace = true } rusqlite = { version = "0.40", features = ["bundled"] } md5 = "0.8" @@ -23,7 +23,10 @@ flate2 = "1.0" crc = "3.0" image = "0.25" tiny_http = "0.12" -rand = "0.10" +rand = "0.8" +zip = "0.6" +shlex = "1.3" +url = "2.5" base64 = "0.23" quick-xml = "0.41" qrcode = "0.14" @@ -36,4 +39,3 @@ uuid = { version = "1", features = ["v4"] } rustls = { version = "0.23", optional = true } tokio = { version = "1", features = ["rt", "macros", "sync", "time"], optional = true } hex = "0.4.3" -< \ No newline at end of file diff --git a/stdlib/src/compress.rs b/stdlib/src/compress.rs index 233b44c4..c27a71bb 100644 --- a/stdlib/src/compress.rs +++ b/stdlib/src/compress.rs @@ -208,8 +208,8 @@ impl StdlibRegistry { pub fn zip_dir(src_dir: &str, dst_file: &str) -> std::io::Result<()> { let file = File::create(dst_file)?; let mut zip = zip::ZipWriter::new(file); - let options = zip::write::SimpleFileOptions::default() - .compression_method(zip::CompressionMethod::Deflated); + let options = + zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Deflated); let walkdir = std::fs::read_dir(src_dir)?; for entry in walkdir { @@ -300,7 +300,10 @@ mod tests { let dest_dir = temp_dir.join("dest"); - let result = unzip_archive(corrupted_zip_path.to_str().unwrap(), dest_dir.to_str().unwrap()); + let result = unzip_archive( + corrupted_zip_path.to_str().unwrap(), + dest_dir.to_str().unwrap(), + ); assert!(result.is_err()); std::fs::remove_dir_all(&temp_dir).unwrap(); diff --git a/stdlib/src/crypto.rs b/stdlib/src/crypto.rs index 0bd4ebf1..a7b97e60 100644 --- a/stdlib/src/crypto.rs +++ b/stdlib/src/crypto.rs @@ -4,9 +4,9 @@ use aes_gcm::{ Aes256Gcm, Nonce, }; use bcrypt; +use rand::Rng; use sha2::Digest; use std::collections::HashMap; -use rand::Rng; use std::rc::Rc; use techscript_runtime::{error::RuntimeError, error::RuntimeErrorKind, value::RuntimeValue}; diff --git a/stdlib/src/process.rs b/stdlib/src/process.rs index 4626dac6..1b3a882b 100644 --- a/stdlib/src/process.rs +++ b/stdlib/src/process.rs @@ -117,14 +117,16 @@ impl StdlibRegistry { let parsed = shlex::split(&cmd).ok_or_else(|| { RuntimeError::new( - RuntimeErrorKind::InvalidOperation("Failed to parse command string".to_string()), + RuntimeErrorKind::InvalidOperation( + "Failed to parse command string".to_string(), + ), None, None, ) })?; if parsed.is_empty() { - return Err(RuntimeError::new( + return Err(RuntimeError::new( RuntimeErrorKind::InvalidOperation("Empty command string".to_string()), None, None, diff --git a/stdlib/src/sqlite.rs b/stdlib/src/sqlite.rs index e94dd4b4..c7d8f769 100644 --- a/stdlib/src/sqlite.rs +++ b/stdlib/src/sqlite.rs @@ -93,7 +93,14 @@ impl StdlibRegistry { CONNECTIONS.with(|m| { let mut map = m.borrow_mut(); if let Some(conn) = map.get_mut(&id) { - + conn.execute(&sql, rusqlite::params_from_iter(params)) + .map_err(|e| { + RuntimeError::new( + RuntimeErrorKind::InvalidOperation(e.to_string()), + None, + None, + ) + })?; Ok(()) } else { Err(RuntimeError::new( @@ -166,7 +173,13 @@ impl StdlibRegistry { .map(|i| stmt.column_name(i).unwrap_or("?").to_string()) .collect(); - + let mut rows = Vec::new(); + let row_iter = stmt + .query_map(rusqlite::params_from_iter(params), |row| { + let mut map = IndexMap::new(); + for name in &col_names { + map.insert(name.clone(), RuntimeValue::Null); + } for i in 0..col_count { let val: String = row.get::<_, String>(i).unwrap_or_default(); diff --git a/stdlib/src/web.rs b/stdlib/src/web.rs index 2260e2bd..3edf64c6 100644 --- a/stdlib/src/web.rs +++ b/stdlib/src/web.rs @@ -1,10 +1,10 @@ use crate::{StdFunction, StdlibModule, StdlibRegistry}; use std::collections::HashMap; +use std::net::{IpAddr, SocketAddr, ToSocketAddrs}; use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; -use std::net::{ToSocketAddrs, IpAddr, SocketAddr}; -use url::Url; use ureq::Resolver; +use url::Url; fn is_safe_ip(ip: &IpAddr) -> bool { match ip { diff --git a/stdlib/tests/stdlib_tests.rs b/stdlib/tests/stdlib_tests.rs index edf703dc..cf7e1aa6 100644 --- a/stdlib/tests/stdlib_tests.rs +++ b/stdlib/tests/stdlib_tests.rs @@ -1,7 +1,10 @@ use std::cell::RefCell; use std::collections::HashSet; use std::rc::Rc; -use techscript_runtime::{context::Capability, value::RuntimeValue, RuntimeConfig, RuntimeContext, error::RuntimeErrorKind}; +use techscript_runtime::{ + context::Capability, value::RuntimeValue, RuntimeConfig, + RuntimeContext, +}; use techscript_stdlib::StdlibRegistry; #[test] @@ -1151,7 +1154,3 @@ fn test_ai_generate_text() { let val = res.unwrap(); assert!(val.as_string().unwrap().contains("Prompt: What is 2+2?")); } - -#[test] - -} diff --git a/tools/package-manager/Cargo.toml b/tools/package-manager/Cargo.toml index 5b8db048..b891de41 100644 --- a/tools/package-manager/Cargo.toml +++ b/tools/package-manager/Cargo.toml @@ -9,4 +9,4 @@ serde = { workspace = true } serde_json = { workspace = true } toml = "1.1" anyhow = { workspace = true } -ureq = { version = "3.4" } +ureq = { version = "2.9" } diff --git a/tools/packager/src/main.rs b/tools/packager/src/main.rs index 55614957..db9bfa61 100644 --- a/tools/packager/src/main.rs +++ b/tools/packager/src/main.rs @@ -328,7 +328,7 @@ fn package_vsix(root_dir: &Path, dest_vsix: &Path, version: &str) -> anyhow::Res let file = File::create(dest_vsix)?; let mut zip = ZipWriter::new(file); - let options: FileOptions = + let options: FileOptions<()> = FileOptions::default().compression_method(zip::CompressionMethod::Deflated); zip.start_file("[Content_Types].xml", options)?; @@ -404,7 +404,7 @@ fn package_vsix(root_dir: &Path, dest_vsix: &Path, version: &str) -> anyhow::Res fn zip_release_folder(release_dir: &Path, dst_zip: &Path) -> anyhow::Result<()> { let file = File::create(dst_zip)?; let mut zip = ZipWriter::new(file); - let options: FileOptions = + let options: FileOptions<()> = FileOptions::default().compression_method(zip::CompressionMethod::Deflated); let folders = ["docs", "examples", "tools", "runtime"]; @@ -442,7 +442,7 @@ fn zip_release_folder(release_dir: &Path, dst_zip: &Path) -> anyhow::Result<()> fn zip_sub_directory(src_dir: &Path, dst_zip: &Path) -> anyhow::Result<()> { let file = File::create(dst_zip)?; let mut zip = ZipWriter::new(file); - let options: FileOptions = + let options: FileOptions<()> = FileOptions::default().compression_method(zip::CompressionMethod::Deflated); let files = walk_dir(src_dir)?; From d1716c4191f7d4642771221acd900aa5096df87f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 30 Aug 2026 11:32:27 +0000 Subject: [PATCH 2/2] Fix compilation errors, LLVM code generation bugs, and clean up repository Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- compiler/llvm_backend/src/codegen.rs | 13 +++++++++---- compiler/llvm_backend/src/type_map.rs | 6 +++--- stdlib/tests/stdlib_tests.rs | 5 +---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/compiler/llvm_backend/src/codegen.rs b/compiler/llvm_backend/src/codegen.rs index 4ef99af9..d2e4b43d 100644 --- a/compiler/llvm_backend/src/codegen.rs +++ b/compiler/llvm_backend/src/codegen.rs @@ -200,15 +200,20 @@ impl<'a> CodegenEngine<'a> { TerminatorKind::Unreachable => { LLVMBuildUnreachable(self.ctx.builder); } - TerminatorKind::Throw(_) => { + TerminatorKind::Throw(val) => { + let thrown_val = self.codegen_val(val)?; + let boxed_val = self.box_val(thrown_val)?; let i8_ptr_ty = LLVMPointerType(LLVMInt8TypeInContext(self.ctx.context), 0); - let fn_throw = self.get_or_declare_runtime_fn("ts_throw", LLVMVoidTypeInContext(self.ctx.context), &[i8_ptr_ty]); - let null_ptr = LLVMConstNull(i8_ptr_ty); + let fn_throw = self.get_or_declare_runtime_fn( + "ts_throw", + LLVMVoidTypeInContext(self.ctx.context), + &[i8_ptr_ty], + ); LLVMBuildCall2( self.ctx.builder, LLVMTypeOf(fn_throw), fn_throw, - [null_ptr].as_mut_ptr(), + [boxed_val].as_mut_ptr(), 1, c"".as_ptr(), ); diff --git a/compiler/llvm_backend/src/type_map.rs b/compiler/llvm_backend/src/type_map.rs index fd7dc32e..9d9f93ec 100644 --- a/compiler/llvm_backend/src/type_map.rs +++ b/compiler/llvm_backend/src/type_map.rs @@ -10,9 +10,9 @@ use techscript_ir::types::IRType; /// Maps a TechScript IRType to its corresponding LLVMTypeRef. /// # Safety - /// - /// Caller must ensure LLVM context is valid. - pub unsafe fn to_llvm_type(context: LLVMContextRef, ty: &IRType) -> LLVMTypeRef { +/// +/// Caller must ensure LLVM context is valid. +pub unsafe fn to_llvm_type(context: LLVMContextRef, ty: &IRType) -> LLVMTypeRef { match ty { IRType::Void => LLVMVoidTypeInContext(context), IRType::Int64 => LLVMInt64TypeInContext(context), diff --git a/stdlib/tests/stdlib_tests.rs b/stdlib/tests/stdlib_tests.rs index cf7e1aa6..f7df969f 100644 --- a/stdlib/tests/stdlib_tests.rs +++ b/stdlib/tests/stdlib_tests.rs @@ -1,10 +1,7 @@ use std::cell::RefCell; use std::collections::HashSet; use std::rc::Rc; -use techscript_runtime::{ - context::Capability, value::RuntimeValue, RuntimeConfig, - RuntimeContext, -}; +use techscript_runtime::{context::Capability, value::RuntimeValue, RuntimeConfig, RuntimeContext}; use techscript_stdlib::StdlibRegistry; #[test]