diff --git a/Cargo.lock b/Cargo.lock index 64f066c010521..528a343bfa401 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1362,7 +1362,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.101", ] @@ -1495,6 +1495,9 @@ name = "bumpalo" version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +dependencies = [ + "allocator-api2", +] [[package]] name = "bytecount" @@ -1809,6 +1812,12 @@ dependencies = [ "cc", ] +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -2015,9 +2024,9 @@ dependencies = [ [[package]] name = "cpp_demangle" -version = "0.4.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b446fd40bcc17eddd6a4a78f24315eb90afdb3334999ddfd4909985c47722442" +checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" dependencies = [ "cfg-if", ] @@ -2031,6 +2040,142 @@ dependencies = [ "libc", ] +[[package]] +name = "cranelift-assembler-x64" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "263cc79b8a23c29720eb596d251698f604546b48c34d0d84f8fd2761e5bf8888" +dependencies = [ + "cranelift-assembler-x64-meta", +] + +[[package]] +name = "cranelift-assembler-x64-meta" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b4a113455f8c0e13e3b3222a9c38d6940b958ff22573108be083495c72820e1" +dependencies = [ + "cranelift-srcgen", +] + +[[package]] +name = "cranelift-bforest" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f96dca41c5acf5d4312c1d04b3391e21a312f8d64ce31a2723a3bb8edd5d4d" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-bitset" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d821ed698dd83d9c012447eb63a5406c1e9c23732a2f674fb5b5015afd42202" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-codegen" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c52fdec4322cb8d5545a648047819aaeaa04e630f88d3a609c0d3c1a00e9a0" +dependencies = [ + "bumpalo", + "cranelift-assembler-x64", + "cranelift-bforest", + "cranelift-bitset", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli", + "hashbrown 0.15.3", + "log", + "pulley-interpreter", + "regalloc2", + "rustc-hash 2.1.1", + "serde", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af2c215e0c9afa8069aafb71d22aa0e0dde1048d9a5c3c72a83cacf9b61fcf4a" +dependencies = [ + "cranelift-assembler-x64-meta", + "cranelift-codegen-shared", + "cranelift-srcgen", + "pulley-interpreter", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97524b2446fc26a78142132d813679dda19f620048ebc9a9fbb0ac9f2d320dcb" + +[[package]] +name = "cranelift-control" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e32e900aee81f9e3cc493405ef667a7812cb5c79b5fc6b669e0a2795bda4b22" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16a2e28e0fa6b9108d76879d60fe1cc95ba90e1bcf52bac96496371044484ee" +dependencies = [ + "cranelift-bitset", + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-frontend" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "328181a9083d99762d85954a16065d2560394a862b8dc10239f39668df528b95" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e916f36f183e377e9a3ed71769f2721df88b72648831e95bb9fa6b0cd9b1c709" + +[[package]] +name = "cranelift-native" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc852cf04128877047dc2027aa1b85c64f681dc3a6a37ff45dcbfa26e4d52d2f" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-srcgen" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1a86340a16e74b4285cc86ac69458fa1c8e7aaff313da4a89d10efd3535ee" + [[package]] name = "crc32c" version = "0.6.8" @@ -2499,6 +2644,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + [[package]] name = "dirs" version = "6.0.0" @@ -2516,10 +2671,21 @@ checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ "libc", "option-ext", - "redox_users", + "redox_users 0.5.0", "windows-sys 0.59.0", ] +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users 0.4.6", + "winapi", +] + [[package]] name = "doc-comment" version = "0.3.1" @@ -2595,6 +2761,18 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "encode_unicode" version = "1.0.0" @@ -2667,9 +2845,9 @@ checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" [[package]] name = "encoding_rs" -version = "0.8.26" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -2877,6 +3055,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fancy-regex" version = "0.14.0" @@ -3128,6 +3312,28 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "fxprof-processed-profile" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +dependencies = [ + "bitflags 2.9.0", + "debugid", + "fxhash", + "serde", + "serde_json", +] + [[package]] name = "generator" version = "0.7.5" @@ -3216,6 +3422,11 @@ name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +dependencies = [ + "fallible-iterator 0.3.0", + "indexmap 2.9.0", + "stable_deref_trait", +] [[package]] name = "glob" @@ -3368,6 +3579,7 @@ dependencies = [ "allocator-api2", "equivalent", "foldhash", + "serde", ] [[package]] @@ -3955,6 +4167,26 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "ittapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" +dependencies = [ + "cc", +] + [[package]] name = "jemalloc_pprof" version = "0.7.0" @@ -4262,6 +4494,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "lexical-core" version = "1.0.5" @@ -4540,6 +4778,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + [[package]] name = "maplit" version = "1.0.2" @@ -4590,6 +4837,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix 0.38.44", +] + [[package]] name = "memmap2" version = "0.5.4" @@ -5662,7 +5918,7 @@ dependencies = [ "datadriven", "derivative", "fail", - "fallible-iterator", + "fallible-iterator 0.2.0", "futures", "headers", "http 1.2.0", @@ -5785,7 +6041,7 @@ dependencies = [ "differential-dataflow", "encoding", "enum-iterator", - "fallible-iterator", + "fallible-iterator 0.2.0", "hex", "hmac", "insta", @@ -5830,6 +6086,7 @@ dependencies = [ "tracing", "uncased", "uuid", + "wasmtime", "workspace-hack", ] @@ -6665,7 +6922,7 @@ dependencies = [ "bytes", "clap", "datadriven", - "fallible-iterator", + "fallible-iterator 0.2.0", "mz-ore", "postgres-protocol", "serde", @@ -7273,7 +7530,7 @@ dependencies = [ "chrono", "clap", "dec", - "fallible-iterator", + "fallible-iterator 0.2.0", "futures", "itertools 0.14.0", "junit-report", @@ -8155,6 +8412,9 @@ version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ + "crc32fast", + "hashbrown 0.15.3", + "indexmap 2.9.0", "memchr", ] @@ -8773,13 +9033,25 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + [[package]] name = "postgres" version = "0.19.8" source = "git+https://github.com/MaterializeInc/rust-postgres#c4b473b478b3adfbf8667d2fbe895d8423f1290b" dependencies = [ "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "futures-util", "log", "tokio", @@ -8805,7 +9077,7 @@ dependencies = [ "base64 0.22.1", "byteorder", "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "hmac", "md-5", "memchr", @@ -8836,7 +9108,7 @@ source = "git+https://github.com/MaterializeInc/rust-postgres#c4b473b478b3adfbf8 dependencies = [ "bytes", "chrono", - "fallible-iterator", + "fallible-iterator 0.2.0", "postgres-protocol", "serde", "serde_json", @@ -8849,7 +9121,7 @@ version = "0.11.0" source = "git+https://github.com/MaterializeInc/rust-postgres-array#f58d0101e5198e04e8692629018d9b58f8543534" dependencies = [ "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "postgres-protocol", "postgres-types", ] @@ -9217,6 +9489,17 @@ dependencies = [ "cc", ] +[[package]] +name = "pulley-interpreter" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69c819888a64024f9c6bc7facbed99dfb4dd0124abe4335b6a54eabaa68ef506" +dependencies = [ + "cranelift-bitset", + "log", + "wasmtime-math", +] + [[package]] name = "qcell" version = "0.5.4" @@ -9511,6 +9794,17 @@ dependencies = [ "bitflags 2.9.0", ] +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.10", + "libredox", + "thiserror 1.0.69", +] + [[package]] name = "redox_users" version = "0.5.0" @@ -9522,6 +9816,20 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "regalloc2" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc06e6b318142614e4a48bc725abbf08ff166694835c43c9dae5a9009704639a" +dependencies = [ + "allocator-api2", + "bumpalo", + "hashbrown 0.15.3", + "log", + "rustc-hash 2.1.1", + "smallvec", +] + [[package]] name = "regex" version = "1.11.1" @@ -9788,6 +10096,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + [[package]] name = "rustc_version" version = "0.4.0" @@ -10519,6 +10833,12 @@ dependencies = [ "lock_api", ] +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + [[package]] name = "ssh-key" version = "0.4.3" @@ -11175,7 +11495,7 @@ dependencies = [ "async-trait", "byteorder", "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "futures-channel", "futures-util", "log", @@ -11583,6 +11903,17 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "trait-variant" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "try-lock" version = "0.2.2" @@ -11799,6 +12130,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -12047,6 +12384,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.228.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d30290541f2d4242a162bbda76b8f2d8b1ac59eab3568ed6f2327d52c9b2c4" +dependencies = [ + "leb128fmt", + "wasmparser 0.228.0", +] + +[[package]] +name = "wasm-encoder" +version = "0.230.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4349d0943718e6e434b51b9639e876293093dca4b96384fb136ab5bd5ce6660" +dependencies = [ + "leb128fmt", + "wasmparser 0.230.0", +] + [[package]] name = "wasm-streams" version = "0.4.1" @@ -12060,6 +12417,317 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmparser" +version = "0.228.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4abf1132c1fdf747d56bbc1bb52152400c70f336870f968b85e89ea422198ae3" +dependencies = [ + "bitflags 2.9.0", + "hashbrown 0.15.3", + "indexmap 2.9.0", + "semver", + "serde", +] + +[[package]] +name = "wasmparser" +version = "0.230.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808198a69b5a0535583370a51d459baa14261dfab04800c4864ee9e1a14346ed" +dependencies = [ + "bitflags 2.9.0", + "indexmap 2.9.0", + "semver", +] + +[[package]] +name = "wasmprinter" +version = "0.228.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df64bd38c14db359d02ce2024c64eb161aa2618ccee5f3bc5acbbd65c9a875c" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser 0.228.0", +] + +[[package]] +name = "wasmtime" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab05ab5e27e0d76a9a7cd93d30baa600549945ff7dcae57559de9678e28f3b7e" +dependencies = [ + "addr2line", + "anyhow", + "async-trait", + "bitflags 2.9.0", + "bumpalo", + "cc", + "cfg-if", + "encoding_rs", + "fxprof-processed-profile", + "gimli", + "hashbrown 0.15.3", + "indexmap 2.9.0", + "ittapi", + "libc", + "log", + "mach2", + "memfd", + "object", + "once_cell", + "postcard", + "psm", + "pulley-interpreter", + "rayon", + "rustix 1.0.5", + "semver", + "serde", + "serde_derive", + "serde_json", + "smallvec", + "sptr", + "target-lexicon", + "trait-variant", + "wasm-encoder 0.228.0", + "wasmparser 0.228.0", + "wasmtime-asm-macros", + "wasmtime-cache", + "wasmtime-component-macro", + "wasmtime-component-util", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-math", + "wasmtime-slab", + "wasmtime-versioned-export-macros", + "wasmtime-winch", + "wat", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194241137d4c1a30a3c2d713016d3de7e2c4e25c9a1a49ef23fc9b850d9e2068" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-cache" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa71477c72baa24ae6ae64e7bca6831d3232b01fda24693311733f1e19136b68" +dependencies = [ + "anyhow", + "base64 0.22.1", + "directories-next", + "log", + "postcard", + "rustix 1.0.5", + "serde", + "serde_derive", + "sha2", + "toml", + "windows-sys 0.59.0", + "zstd", +] + +[[package]] +name = "wasmtime-component-macro" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5758acd6dadf89f904c8de8171ae33499c7809c8f892197344df5055199aeab3" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn 2.0.101", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-component-util" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3068c266bc21eb51e7b9a405550b193b8759b771d19aecc518ca838ea4782ef3" + +[[package]] +name = "wasmtime-cranelift" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925c030360b8084e450f29d4d772e89ba0a8855dd0a47e07dd11e7f5fd900b42" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "gimli", + "itertools 0.14.0", + "log", + "object", + "pulley-interpreter", + "smallvec", + "target-lexicon", + "thiserror 2.0.12", + "wasmparser 0.228.0", + "wasmtime-environ", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-environ" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58d78b12eb1f2d2ac85eff89693963ba9c13dd9c90796d92d83ff27b23b29fbe" +dependencies = [ + "anyhow", + "cpp_demangle", + "cranelift-bitset", + "cranelift-entity", + "gimli", + "indexmap 2.9.0", + "log", + "object", + "postcard", + "rustc-demangle", + "semver", + "serde", + "serde_derive", + "smallvec", + "target-lexicon", + "wasm-encoder 0.228.0", + "wasmparser 0.228.0", + "wasmprinter", + "wasmtime-component-util", +] + +[[package]] +name = "wasmtime-fiber" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced0efdb1553ada01704540d3cf3e525c93c8f5ca24a48d3e50ba5f2083c36ba" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "rustix 1.0.5", + "wasmtime-asm-macros", + "wasmtime-versioned-export-macros", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43014e680b0b61628ea30bc193f73fbc27723f373a9e353919039aca1d8536c" +dependencies = [ + "cc", + "object", + "rustix 1.0.5", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb399eaabd7594f695e1159d236bf40ef55babcb3af97f97c027864ed2104db6" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmtime-math" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a527168840e87fc06422b44e7540b4e38df7c84237abdad3dc2450dcde8ab38e" +dependencies = [ + "libm", +] + +[[package]] +name = "wasmtime-slab" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a3a2798fb5472381cebd72c1daa1f99bbfd6fb645bf8285db8b3a48405daec" + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5afcdcb7f97cce62f6f512182259bfed5d2941253ad43780b3a4e1ad72e4fea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "wasmtime-winch" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ac4f31e4657e385d53c71cf963868dc6efdff39fe657c873a0f5da8f465f164" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli", + "object", + "target-lexicon", + "wasmparser 0.228.0", + "wasmtime-cranelift", + "wasmtime-environ", + "winch-codegen", +] + +[[package]] +name = "wasmtime-wit-bindgen" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada7e868e5925341cdae32729cf02a8f2523b8e998286213e6f4a5af7309cb75" +dependencies = [ + "anyhow", + "heck", + "indexmap 2.9.0", + "wit-parser", +] + +[[package]] +name = "wast" +version = "230.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8edac03c5fa691551531533928443faf3dc61a44f814a235c7ec5d17b7b34f1" +dependencies = [ + "bumpalo", + "leb128fmt", + "memchr", + "unicode-width 0.2.0", + "wasm-encoder 0.230.0", +] + +[[package]] +name = "wat" +version = "1.230.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d77d62229e38db83eac32bacb5f61ebb952366ab0dae90cf2b3c07a65eea894" +dependencies = [ + "wast", +] + [[package]] name = "web-sys" version = "0.3.77" @@ -12146,6 +12814,24 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winch-codegen" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "108e1f810933ac36e7168313a0e5393c84a731f0394c3cb3e5f5667b378a03fc" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli", + "regalloc2", + "smallvec", + "target-lexicon", + "thiserror 2.0.12", + "wasmparser 0.228.0", + "wasmtime-cranelift", + "wasmtime-environ", +] + [[package]] name = "windows" version = "0.48.0" @@ -12509,6 +13195,24 @@ dependencies = [ "bitflags 2.9.0", ] +[[package]] +name = "wit-parser" +version = "0.228.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399ce56e28d79fd3abfa03fdc7ceb89ffec4d4b2674fe3a92056b7d845653c38" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.9.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.228.0", +] + [[package]] name = "workspace-hack" version = "0.0.0" diff --git a/misc/helm-charts/operator/values.yaml b/misc/helm-charts/operator/values.yaml index 24b610b61ccd3..c607edbfa2843 100644 --- a/misc/helm-charts/operator/values.yaml +++ b/misc/helm-charts/operator/values.yaml @@ -271,10 +271,10 @@ telemetry: # Network policies configuration networkPolicies: # -- Whether to enable network policies for securing communication between pods - enabled: false + enabled: true # -- Whether to enable internal communication between Materialize pods internal: - enabled: false + enabled: true # -- Whether to enable ingress to the SQL and HTTP interfaces # on environmentd or balancerd ingress: diff --git a/src/expr/Cargo.toml b/src/expr/Cargo.toml index 52fffbb3a84dc..ab1b4151365d4 100644 --- a/src/expr/Cargo.toml +++ b/src/expr/Cargo.toml @@ -67,6 +67,7 @@ uncased = "0.9.7" uuid = { version = "1.16.0", features = ["v5"] } proptest = { version = "1.6.0", default-features = false, features = ["std"] } proptest-derive = { version = "0.5.1", features = ["boxed_union"] } +wasmtime = "32.0.0" workspace-hack = { version = "0.0.0", path = "../workspace-hack", optional = true } smallvec = { version = "1.15.0" } diff --git a/src/expr/src/scalar.proto b/src/expr/src/scalar.proto index 769058a145906..581aadb2ee022 100644 --- a/src/expr/src/scalar.proto +++ b/src/expr/src/scalar.proto @@ -133,6 +133,7 @@ message ProtoUnaryFunc { } reserved 5, 6, 15, 104, 111, 115, 212, 306, 313, 321; oneof kind { + string unary_wasm = 123456; google.protobuf.Empty not = 1; google.protobuf.Empty is_null = 2; google.protobuf.Empty is_true = 121; @@ -670,6 +671,7 @@ message ProtoBinaryFunc { bool array_contains_array = 194; google.protobuf.Empty starts_with = 195; google.protobuf.Empty get_bit = 196; + google.protobuf.Empty wasm = 200; } } diff --git a/src/expr/src/scalar.rs b/src/expr/src/scalar.rs index 82f03af66c8aa..e08d81f93ba64 100644 --- a/src/expr/src/scalar.rs +++ b/src/expr/src/scalar.rs @@ -869,6 +869,12 @@ impl MirScalarExpr { Err(err.clone()), e.typ(column_types).scalar_type, ); + } else if let BinaryFunc::Wasm = func { + if expr2.is_literal() { + // We can at least precompile the regex. + let text = expr2.as_literal_str().unwrap().to_owned(); + *e = expr1.take().call_unary(UnaryFunc::UnaryWasm2(crate::func::UnaryWasm2 { text, data: Default::default() })); + } } else if let BinaryFunc::IsLikeMatch { case_insensitive } = func { if expr2.is_literal() { // We can at least precompile the regex. diff --git a/src/expr/src/scalar/func.rs b/src/expr/src/scalar/func.rs index 6ebc76f08824a..056e385192dc0 100644 --- a/src/expr/src/scalar/func.rs +++ b/src/expr/src/scalar/func.rs @@ -3320,6 +3320,7 @@ fn starts_with<'a>(a: Datum<'a>, b: Datum<'a>) -> Datum<'a> { #[derive(Ord, PartialOrd, Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash, MzReflect)] pub enum BinaryFunc { + Wasm, AddInt16, AddInt32, AddInt64, @@ -3516,6 +3517,111 @@ pub enum BinaryFunc { StartsWith, } +fn wasm<'a>(a: Datum<'a>, b: Datum<'a>) -> Result, EvalError> { + let mut wasm_state = WasmState::new(b.unwrap_str(), "logic"); + Ok(Datum::Int64(wasm_state.eval(a.unwrap_int64()))) +} + +pub struct WasmState { + engine: wasmtime::Engine, + module: wasmtime::Module, + store: wasmtime::Store<()>, + instance: wasmtime::Instance, + func: wasmtime::TypedFunc, +} + +impl WasmState { + fn eval(&mut self, input: i64) -> i64 { + self.func.call(&mut self.store, input).unwrap() + } + + fn new(text: &str, name: &str) -> Self { + use wasmtime::*; + let engine = Engine::default(); + let module = Module::new(&engine, text).unwrap(); + let mut store = Store::new(&engine, ()); + let instance = Instance::new(&mut store, &module, &[]).unwrap(); + let func = instance + .get_typed_func::(&mut store, name) + .unwrap(); + + Self { engine, module, store, instance, func } + } +} + +#[derive(Serialize, Deserialize)] +pub struct UnaryWasm2 { + pub text: String, + #[serde(skip)] + pub data: std::sync::Mutex>, +} + +impl<'a> EagerUnaryFunc<'a> for UnaryWasm2 { + type Input = i64; + type Output = Result; + + fn call(&self, a: i64) -> Result { + let mut lock = self.data.lock().unwrap(); + if lock.is_none() { + *lock = Some(WasmState::new(&self.text, "logic")); + } + + if let Some(wasm_state) = &mut *lock { + Ok(wasm_state.eval(a)) + } else { + unimplemented!() + } + } + + fn output_type(&self, input: ColumnType) -> ColumnType { + ScalarType::Int64.nullable(input.nullable) + } +} + +impl Ord for UnaryWasm2 { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.text.cmp(&other.text) + } +} +impl PartialOrd for UnaryWasm2 { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} +impl PartialEq for UnaryWasm2 { + fn eq(&self, other: &Self) -> bool { + self.text.eq(&other.text) + } +} +impl std::cmp::Eq for UnaryWasm2 { } +impl Clone for UnaryWasm2 { + fn clone(&self) -> Self { + Self { text: self.text.clone(), data: Default::default() } + } +} + + +impl fmt::Display for UnaryWasm2 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "wasm(...)") + } +} +impl fmt::Debug for UnaryWasm2 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "wasm(...)") + } +} +impl std::hash::Hash for UnaryWasm2 { + fn hash(&self, state: &mut H) where H: std::hash::Hasher { + self.text.hash(state) + } +} +impl MzReflect for UnaryWasm2 { + fn add_to_reflected_type_info(_rti: &mut mz_lowertest::ReflectedTypeInfo) { + } +} + + impl BinaryFunc { pub fn eval<'a>( &'a self, @@ -3530,6 +3636,7 @@ impl BinaryFunc { return Ok(Datum::Null); } match self { + BinaryFunc::Wasm => wasm(a, b), BinaryFunc::AddInt16 => add_int16(a, b), BinaryFunc::AddInt32 => add_int32(a, b), BinaryFunc::AddInt64 => add_int64(a, b), @@ -3823,6 +3930,7 @@ impl BinaryFunc { | EncodedBytesCharLength | SubDate => ScalarType::Int32.nullable(in_nullable), + Wasm | AddInt64 | SubInt64 | MulInt64 | DivInt64 | ModInt64 | BitAndInt64 | BitOrInt64 | BitXorInt64 | BitShiftLeftInt64 | BitShiftRightInt64 => { ScalarType::Int64.nullable(in_nullable) @@ -4004,7 +4112,8 @@ impl BinaryFunc { pub fn introduces_nulls(&self) -> bool { use BinaryFunc::*; match self { - AddInt16 + Wasm + | AddInt16 | AddInt32 | AddInt64 | AddUInt16 @@ -4343,7 +4452,8 @@ impl BinaryFunc { | RangeUnion | RangeIntersection | RangeDifference => true, - ToCharTimestamp + Wasm + | ToCharTimestamp | ToCharTimestampTz | AgeTimestamp | AgeTimestampTz @@ -4715,6 +4825,7 @@ impl BinaryFunc { BinaryFunc::PrettySql => (false, false), BinaryFunc::RegexpReplace { .. } => (false, false), BinaryFunc::StartsWith => (false, false), + BinaryFunc::Wasm => (false, false), } } } @@ -4933,6 +5044,7 @@ impl fmt::Display for BinaryFunc { limit ), BinaryFunc::StartsWith => f.write_str("starts_with"), + BinaryFunc::Wasm => f.write_str("wasm"), } } } @@ -5356,6 +5468,7 @@ impl RustType for BinaryFunc { }) } BinaryFunc::StartsWith => StartsWith(()), + BinaryFunc::Wasm => Wasm(()), }; ProtoBinaryFunc { kind: Some(kind) } } @@ -5570,6 +5683,7 @@ impl RustType for BinaryFunc { limit: inner.limit.into_rust()?, }), StartsWith(()) => Ok(BinaryFunc::StartsWith), + Wasm(()) => Ok(BinaryFunc::Wasm), } } else { Err(TryFromProtoError::missing_field("ProtoBinaryFunc::kind")) @@ -6068,7 +6182,8 @@ derive_unary!( KafkaMurmur2String, SeahashBytes, SeahashString, - Reverse + Reverse, + UnaryWasm2 ); impl UnaryFunc { @@ -6490,6 +6605,7 @@ impl RustType for UnaryFunc { use crate::scalar::proto_unary_func::Kind::*; use crate::scalar::proto_unary_func::*; let kind = match self { + UnaryFunc::UnaryWasm2(stuff) => UnaryWasm(stuff.text.clone()), UnaryFunc::Not(_) => Not(()), UnaryFunc::IsNull(_) => IsNull(()), UnaryFunc::IsTrue(_) => IsTrue(()), @@ -6903,6 +7019,7 @@ impl RustType for UnaryFunc { use crate::scalar::proto_unary_func::Kind::*; if let Some(kind) = proto.kind { match kind { + UnaryWasm(text) => Ok(UnaryFunc::UnaryWasm2(UnaryWasm2 { text: text.clone(), data: Default::default() })), Not(()) => Ok(impls::Not.into()), IsNull(()) => Ok(impls::IsNull.into()), IsTrue(()) => Ok(impls::IsTrue.into()), diff --git a/src/pgrepr-consts/src/oid.rs b/src/pgrepr-consts/src/oid.rs index 5c708852f481e..f82ea34fd10a6 100644 --- a/src/pgrepr-consts/src/oid.rs +++ b/src/pgrepr-consts/src/oid.rs @@ -777,3 +777,4 @@ pub const VIEW_MZ_WALLCLOCK_GLOBAL_LAG_OID: u32 = 17054; pub const SOURCE_MZ_WALLCLOCK_GLOBAL_LAG_HISTOGRAM_RAW_OID: u32 = 17055; pub const VIEW_MZ_WALLCLOCK_GLOBAL_LAG_HISTOGRAM_OID: u32 = 17056; pub const TABLE_MZ_SQL_SERVER_SOURCE_TABLES_OID: u32 = 17057; +pub const FUNC_WASM_OID: u32 = 17058; diff --git a/src/sql/src/func.rs b/src/sql/src/func.rs index ebac1098ff6d1..babc5828a5e6a 100644 --- a/src/sql/src/func.rs +++ b/src/sql/src/func.rs @@ -3852,6 +3852,9 @@ pub static MZ_CATALOG_BUILTINS: LazyLock> = LazyLoc "starts_with" => Scalar { params!(String, String) => BinaryFunc::StartsWith => Bool, 3696; }, + "wasm" => Scalar { + params!(Int64, String) => BinaryFunc::Wasm => Int64, oid::FUNC_WASM_OID; + }, "timezone_offset" => Scalar { params!(String, TimestampTz) => BinaryFunc::TimezoneOffset => RecordAny, oid::FUNC_TIMEZONE_OFFSET; },