From b13fcb9081fd45ea7653ebad094d45e7651449a8 Mon Sep 17 00:00:00 2001 From: Ryan Walker Date: Tue, 3 May 2022 16:40:33 -0400 Subject: [PATCH 1/4] Upgrade to pgx 0.4.3 Went from 0.2.4 -> 0.3.0 -> 0.4.0 -> 0.4.3, editing the Cargo.toml, building, and testing, and the experience was largely unremarkable. Most of the changes come from followng the "Upgrading" section of the [0.4.0](https://github.com/tcdi/pgx/releases/tag/v0.4.0) release notes. Only other thing to note is that I ran into a *lot* of occurrences of the following error: ``` error[E0053]: method `input` has an incompatible type for trait --> extension/src/type_builder.rs:261:29 | 261 | fn input(input: &std::ffi::CStr) -> $name<'input> | ^^^^^^^^^^^^^^^ | | | expected struct `pgx::cstr_core::CStr`, found struct `std::ffi::CStr` | help: change the parameter type to match the trait: `&pgx::cstr_core::CStr` ``` Just blindly swapping in the `pgx::cstr_core` `CStr(ing)`s for the `std::ffi` ones made Rust much happier. --- Cargo.lock | 412 +++++++++++-------- Readme.md | 4 +- extension/.cargo/config | 19 +- extension/.cargo/pgx-linker-script.sh | 19 - extension/Cargo.toml | 8 +- extension/src/bin/sql-generator.rs | 2 - extension/src/datum_utils.rs | 4 +- extension/src/serialization.rs | 9 +- extension/src/time_vector/pipeline/lambda.rs | 2 +- extension/src/type_builder.rs | 2 +- extension/src/uddsketch.rs | 2 +- 11 files changed, 251 insertions(+), 232 deletions(-) delete mode 100755 extension/.cargo/pgx-linker-script.sh delete mode 100644 extension/src/bin/sql-generator.rs diff --git a/Cargo.lock b/Cargo.lock index 43ab3141..f0c624ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,27 +182,38 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.1" +version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453c49e5950bb0eb63bb3df640e31618846c89d5b7faa54040d76e98e0134375" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" dependencies = [ "bitflags", "cexpr", "clang-sys", - "clap", - "env_logger", "lazy_static", "lazycell", - "log", "peeking_take_while", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "which", ] +[[package]] +name = "bit-set" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bit_field" version = "0.10.1" @@ -221,18 +232,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitvec" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "block-buffer" version = "0.7.3" @@ -316,9 +315,9 @@ checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cexpr" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db507a7679252d2276ed0dd8113c6875ec56d3089f9225b2b42c30cc1f8e5c89" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ "nom", ] @@ -358,9 +357,9 @@ dependencies = [ [[package]] name = "color-eyre" -version = "0.5.11" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f1885697ee8a177096d42f158922251a41973117f6d8a234cee94b9509157b7" +checksum = "8ebf286c900a6d5867aeff75cfee3192857bb7f24b547d4f0df2ed6baa812c90" dependencies = [ "backtrace", "color-spantrace", @@ -368,19 +367,19 @@ dependencies = [ "indenter", "once_cell", "owo-colors", - "tracing-error 0.1.2", + "tracing-error", ] [[package]] name = "color-spantrace" -version = "0.1.6" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eee477a4a8a72f4addd4de416eb56d54bc307b284d6601bafdee1f4ea462d1" +checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" dependencies = [ "once_cell", "owo-colors", "tracing-core", - "tracing-error 0.1.2", + "tracing-error", ] [[package]] @@ -408,6 +407,12 @@ dependencies = [ name = "control_file_reader" version = "0.1.0" +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + [[package]] name = "cortex-m" version = "0.7.3" @@ -516,6 +521,22 @@ dependencies = [ "subtle", ] +[[package]] +name = "cstr_core" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "644828c273c063ab0d39486ba42a5d1f3a499d35529c759e763a9c6cb8a0fb08" +dependencies = [ + "cty", + "memchr", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + [[package]] name = "digest" version = "0.8.1" @@ -595,11 +616,8 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ - "atty", - "humantime", "log", "regex", - "termcolor", ] [[package]] @@ -614,9 +632,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221239d1d5ea86bf5d6f91c9d6bc3646ffe471b08ff9b0f91c44f115ac969d2b" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" dependencies = [ "indenter", "once_cell", @@ -634,6 +652,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fancy-regex" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6b8560a05112eb52f04b00e5d3790c0dd75d9d980eb8a122fb23b92a623ccf" +dependencies = [ + "bit-set", + "regex", +] + [[package]] name = "fixedbitset" version = "0.4.0" @@ -686,12 +714,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - [[package]] name = "futures" version = "0.3.17" @@ -871,9 +893,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heapless" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1ad878e07405df82b695089e63d278244344f80e764074d0bdfe99b89460f3" +checksum = "d076121838e03f862871315477528debffdb7462fb229216ecef91b1a3eb31eb" dependencies = [ "atomic-polyfill", "hash32", @@ -906,12 +928,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyperloglog" version = "0.1.0" @@ -980,9 +996,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "lazy_static" @@ -998,15 +1014,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.107" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219" +checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" [[package]] name = "libloading" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cf036d15402bea3c5d4de17b3fce76b3e4a56ebc1f577be0e7a72f7c607cf0" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ "cfg-if", "winapi 0.3.9", @@ -1018,6 +1034,21 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" + [[package]] name = "lock_api" version = "0.4.5" @@ -1085,9 +1116,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memoffset" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg", ] @@ -1108,6 +1139,12 @@ dependencies = [ "unicase", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.4.4" @@ -1186,14 +1223,12 @@ checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" [[package]] name = "nom" -version = "6.1.2" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" dependencies = [ - "bitvec", - "funty", "memchr", - "version_check", + "minimal-lexical", ] [[package]] @@ -1249,14 +1284,23 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", ] +[[package]] +name = "num_threads" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" +dependencies = [ + "libc", +] + [[package]] name = "object" version = "0.27.1" @@ -1268,9 +1312,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "opaque-debug" @@ -1296,9 +1340,9 @@ dependencies = [ [[package]] name = "owo-colors" -version = "1.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2386b4ebe91c2f7f51082d4cefa145d030e33a1842a96b12e4885cc3c01f7a55" +checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" [[package]] name = "parking_lot" @@ -1398,40 +1442,40 @@ dependencies = [ [[package]] name = "pgx" -version = "0.2.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fe3d7b5af6534a84b66109d175a9c944aa41744dab8e9385cb78f624f3a0050" +checksum = "c460dff28460a37f9b11ce656d83fadd2ecd8bae53b89f7d7be4ff3337cde969" dependencies = [ "atomic-traits", "bitflags", + "cstr_core", "enum-primitive-derive", "eyre", "hash32", "heapless", "num-traits", "once_cell", - "petgraph", "pgx-macros", "pgx-pg-sys", "pgx-utils", + "quote", "seahash", "serde", "serde_cbor", "serde_json", "time", "tracing", - "tracing-error 0.2.0", + "tracing-error", "uuid", ] [[package]] name = "pgx-macros" -version = "0.2.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0794ddeee7ff991c81cc8a1daa6f9f3b486ede60a6b58f26a68e63d842ffd8" +checksum = "930e43145e3cf6144ed71089e66f34c8d9e017f7f9c53d9e42ea15559916d473" dependencies = [ "pgx-utils", - "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1440,16 +1484,18 @@ dependencies = [ [[package]] name = "pgx-pg-sys" -version = "0.2.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497951e5c77c486eb6fef8e2f13123d8632bd7598f722c24ea4288ed70b3d446" +checksum = "e8252505bec328b016b7ce68319a17954c0858e31b442db28ca3d60602e394fa" dependencies = [ "bindgen", "build-deps", - "colored", + "color-eyre", + "eyre", "memoffset", "num_cpus", "once_cell", + "owo-colors", "pgx-macros", "pgx-utils", "proc-macro2", @@ -1460,13 +1506,14 @@ dependencies = [ [[package]] name = "pgx-tests" -version = "0.2.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bb7daa249b3b4a1c67201e739a0e676fff33c99fd2f2c16c09e815d00745a7" +checksum = "ef4828b4bed337a3adc4898f04bdde1a4185a8ec7a8af004be528a87918c920c" dependencies = [ - "colored", - "lazy_static", + "eyre", "libc", + "once_cell", + "owo-colors", "pgx", "pgx-macros", "pgx-utils", @@ -1480,17 +1527,18 @@ dependencies = [ [[package]] name = "pgx-utils" -version = "0.2.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f7b0970c6257f3cd415956df476270bc1eca2e07072c1cc4f0fc2cf4f5494b" +checksum = "80c485e64d4c25cac2882c2ec0b42a0a090debdee1156f2ee796e56c8e03876d" dependencies = [ - "clap", - "color-eyre", - "colored", + "atty", + "convert_case", "dirs", "env_proxy", "eyre", - "libloading", + "owo-colors", + "petgraph", + "prettyplease", "proc-macro2", "quote", "regex", @@ -1500,10 +1548,11 @@ dependencies = [ "serde_derive", "serde_json", "syn", + "syntect", "toml", "tracing", - "tracing-error 0.2.0", - "tracing-subscriber 0.3.1", + "tracing-error", + "tracing-subscriber", "unescape", "url", ] @@ -1538,6 +1587,20 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "plist" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" +dependencies = [ + "base64 0.13.0", + "indexmap", + "line-wrap", + "serde", + "time", + "xml-rs", +] + [[package]] name = "post-install" version = "0.1.0" @@ -1600,13 +1663,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] -name = "proc-macro-crate" -version = "1.1.0" +name = "prettyplease" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "d9e07e3a46d0771a8a06b5f4441527802830b43e679ba12f44960f48dd4c6803" dependencies = [ - "thiserror", - "toml", + "proc-macro2", + "syn", ] [[package]] @@ -1623,9 +1686,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.32" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] @@ -1666,19 +1729,13 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.10" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" - [[package]] name = "rand" version = "0.7.3" @@ -1778,9 +1835,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" dependencies = [ "autocfg", "crossbeam-deque", @@ -1790,14 +1847,13 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", "num_cpus", ] @@ -1822,9 +1878,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -1931,6 +1987,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + [[package]] name = "same-file" version = "1.0.6" @@ -1993,9 +2055,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.130" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" dependencies = [ "serde_derive", ] @@ -2024,9 +2086,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" dependencies = [ "proc-macro2", "quote", @@ -2035,9 +2097,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.69" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e466864e431129c7e0d3476b92f20458e5879919a0596c6472738d9fa2d342f8" +checksum = "f972498cf015f7c0746cac89ebe1d6ef10c293b94175a243a2d9442c163d9944" dependencies = [ "itoa", "ryu", @@ -2229,9 +2291,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.81" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" +checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" dependencies = [ "proc-macro2", "quote", @@ -2239,10 +2301,26 @@ dependencies = [ ] [[package]] -name = "tap" -version = "1.0.1" +name = "syntect" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +checksum = "8b20815bbe80ee0be06e6957450a841185fcf690fe0178f14d77a05ce2caa031" +dependencies = [ + "bincode", + "bitflags", + "fancy-regex", + "flate2", + "fnv", + "lazy_static", + "lazycell", + "plist", + "regex-syntax", + "serde", + "serde_derive", + "serde_json", + "walkdir", + "yaml-rust", +] [[package]] name = "tdigest" @@ -2266,15 +2344,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", -] - [[package]] name = "testrunner" version = "0.1.0" @@ -2317,29 +2386,30 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ "once_cell", ] [[package]] name = "time" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad" +checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" dependencies = [ "itoa", "libc", + "num_threads", "time-macros", ] [[package]] name = "time-macros" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25eb0ca3468fc0acc11828786797f6ef9aa1555e4a211a60d64cc8e4d1be47d6" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" [[package]] name = "time_weighted_average" @@ -2454,9 +2524,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] @@ -2474,9 +2544,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.29" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" dependencies = [ "cfg-if", "pin-project-lite", @@ -2486,9 +2556,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.18" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" +checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" dependencies = [ "proc-macro2", "quote", @@ -2497,21 +2567,12 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.21" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" dependencies = [ "lazy_static", -] - -[[package]] -name = "tracing-error" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d7c0b83d4a500748fa5879461652b361edf5c9d51ede2a2ac03875ca185e24" -dependencies = [ - "tracing", - "tracing-subscriber 0.2.25", + "valuable", ] [[package]] @@ -2521,7 +2582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" dependencies = [ "tracing", - "tracing-subscriber 0.3.1", + "tracing-subscriber", ] [[package]] @@ -2537,20 +2598,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80a4ddde70311d8da398062ecf6fc2c309337de6b0f77d6c27aff8d53f6fca52" +checksum = "4bc28f93baff38037f64e6f43d34cfa1605f27a49c34e8a04c5e78b0babf2596" dependencies = [ "ansi_term 0.12.1", "lazy_static", @@ -2673,6 +2723,12 @@ dependencies = [ "getrandom 0.2.3", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcell" version = "0.1.3" @@ -2729,15 +2785,6 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" -[[package]] -name = "which" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] - [[package]] name = "winapi" version = "0.2.8" @@ -2791,12 +2838,6 @@ dependencies = [ "winapi-build", ] -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - [[package]] name = "xml-rs" version = "0.8.4" @@ -2817,3 +2858,12 @@ name = "xshell-macros" version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4916a4a3cad759e499a3620523bf9545cc162d7a06163727dde97ce9aaa4cf39" + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] diff --git a/Readme.md b/Readme.md index b7da7c26..ee87f7c1 100644 --- a/Readme.md +++ b/Readme.md @@ -35,9 +35,9 @@ For Ubuntu you can follow the [postgres install instructions](https://www.postgr ```bash sudo apt-get install make gcc pkg-config clang postgresql-server-dev-13 libssl-dev ``` -and finally, [pgx](https://github.com/zombodb/pgx), which can be installed with +and finally, [pgx](https://github.com/tcdi/pgx), which can be installed with ```bash -cargo install --version '=0.2.4' cargo-pgx && cargo pgx init --pg13 pg_config +cargo install --version '=0.4.3' cargo-pgx && cargo pgx init --pg13 pg_config ``` ### 💾 Building and Installing the extension ### diff --git a/extension/.cargo/config b/extension/.cargo/config index 3d5465ea..84481985 100644 --- a/extension/.cargo/config +++ b/extension/.cargo/config @@ -1,16 +1,3 @@ -# Auto-generated by pgx. You may edit this, or delete it to have a new one created. - -[target.x86_64-unknown-linux-gnu] -linker = "./.cargo/pgx-linker-script.sh" - -[target.aarch64-unknown-linux-gnu] -linker = "./.cargo/pgx-linker-script.sh" - -[target.x86_64-apple-darwin] -linker = "./.cargo/pgx-linker-script.sh" - -[target.aarch64-apple-darwin] -linker = "./.cargo/pgx-linker-script.sh" - -[target.x86_64-unknown-freebsd] -linker = "./.cargo/pgx-linker-script.sh" +[build] +# Postgres symbols won't be available until runtime +rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"] \ No newline at end of file diff --git a/extension/.cargo/pgx-linker-script.sh b/extension/.cargo/pgx-linker-script.sh deleted file mode 100755 index c432e149..00000000 --- a/extension/.cargo/pgx-linker-script.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/env bash -# Auto-generated by pgx. You may edit this, or delete it to have a new one created. - -if [[ $CARGO_BIN_NAME == "sql-generator" ]]; then - UNAME=$(uname) - if [[ $UNAME == "Darwin" ]]; then - TEMP=$(mktemp pgx-XXX) - echo "*_pgx_internals_*" > ${TEMP} - gcc -exported_symbols_list ${TEMP} $@ - rm -rf ${TEMP} - else - TEMP=$(mktemp pgx-XXX) - echo "{ __pgx_internals_*; };" > ${TEMP} - gcc -Wl,-dynamic-list=${TEMP} $@ - rm -rf ${TEMP} - fi -else - gcc -Wl,-undefined,dynamic_lookup $@ -fi diff --git a/extension/Cargo.toml b/extension/Cargo.toml index cb98555c..1ad76a30 100644 --- a/extension/Cargo.toml +++ b/extension/Cargo.toml @@ -4,7 +4,7 @@ version = "0.3.0" edition = "2021" [lib] -crate-type = ["cdylib", "rlib"] +crate-type = ["cdylib"] [features] default = [] @@ -18,8 +18,8 @@ pg_test = ["approx"] [dependencies] # Keep synchronized with `cargo install --version N.N.N cargo-pgx` in Readme.md and docker/ci/Dockerfile # Also `pgx-tests` down below in `dev-dependencies`. -pgx = "=0.2.4" -pgx-macros = "=0.2.4" +pgx = "=0.4.3" +pgx-macros = "=0.4.3" encodings = {path="../crates/encodings"} flat_serialize = {path="../crates/flat_serialize/flat_serialize"} flat_serialize_macro = {path="../crates/flat_serialize/flat_serialize_macro"} @@ -51,5 +51,5 @@ spfunc = "0.1.0" statrs = "0.15.0" [dev-dependencies] -pgx-tests = "=0.2.4" +pgx-tests = "=0.4.3" approx = "0.4.0" diff --git a/extension/src/bin/sql-generator.rs b/extension/src/bin/sql-generator.rs deleted file mode 100644 index d7df8457..00000000 --- a/extension/src/bin/sql-generator.rs +++ /dev/null @@ -1,2 +0,0 @@ -/* Auto-generated by pgx. You may edit this, or delete it to have a new one created. */ -pgx::pg_binary_magic!(timescaledb_toolkit); diff --git a/extension/src/datum_utils.rs b/extension/src/datum_utils.rs index 4aac6502..4b42f756 100644 --- a/extension/src/datum_utils.rs +++ b/extension/src/datum_utils.rs @@ -76,7 +76,7 @@ impl DatumFromSerializedTextReader { } pub fn read_datum(&mut self, datum_str: &str) -> Datum { - let cstr = std::ffi::CString::new(datum_str).unwrap(); // TODO: error handling + let cstr = pgx::cstr_core::CString::new(datum_str).unwrap(); // TODO: error handling let cstr_ptr = cstr.as_ptr() as *mut std::os::raw::c_char; unsafe { pg_sys::InputFunctionCall(&mut self.flinfo, cstr_ptr, self.typ_io_param, -1) } } @@ -90,7 +90,7 @@ impl Serialize for TextSerializeableDatum { S: serde::Serializer, { let chars = unsafe { pg_sys::OutputFunctionCall(self.1, self.0) }; - let cstr = unsafe { std::ffi::CStr::from_ptr(chars) }; + let cstr = unsafe { pgx::cstr_core::CStr::from_ptr(chars) }; serializer.serialize_str(cstr.to_str().unwrap()) } } diff --git a/extension/src/serialization.rs b/extension/src/serialization.rs index 103cb1e8..458766f7 100644 --- a/extension/src/serialization.rs +++ b/extension/src/serialization.rs @@ -1,9 +1,12 @@ - -use std::{convert::TryInto, ffi::CStr, os::raw::{c_char, c_int}}; -pub use self::types::{PgTypId, ShortTypeId}; pub use self::collations::PgCollationId; pub use self::functions::PgProcId; +pub use self::types::{PgTypId, ShortTypeId}; +use std::{ + convert::TryInto, + os::raw::{c_char, c_int}, +}; +use pgx::cstr_core::CStr; use pgx::pg_sys; mod functions; diff --git a/extension/src/time_vector/pipeline/lambda.rs b/extension/src/time_vector/pipeline/lambda.rs index 30561208..8760f078 100644 --- a/extension/src/time_vector/pipeline/lambda.rs +++ b/extension/src/time_vector/pipeline/lambda.rs @@ -41,7 +41,7 @@ impl<'input> InOutFuncs for Lambda<'input> { } } - fn input(input: &std::ffi::CStr) -> Self + fn input(input: &pgx::cstr_core::CStr) -> Self where Self: Sized, { diff --git a/extension/src/type_builder.rs b/extension/src/type_builder.rs index 1ac95b47..56589868 100644 --- a/extension/src/type_builder.rs +++ b/extension/src/type_builder.rs @@ -258,7 +258,7 @@ macro_rules! ron_inout_funcs { } } - fn input(input: &std::ffi::CStr) -> $name<'input> + fn input(input: &pgx::cstr_core::CStr) -> $name<'input> where Self: Sized, { diff --git a/extension/src/uddsketch.rs b/extension/src/uddsketch.rs index a39f7a17..d87b24cf 100644 --- a/extension/src/uddsketch.rs +++ b/extension/src/uddsketch.rs @@ -268,7 +268,7 @@ impl<'input> InOutFuncs for UddSketch<'input> { } } - fn input(input: &std::ffi::CStr) -> Self + fn input(input: &pgx::cstr_core::CStr) -> Self where Self: Sized, { From 3a0ff553502807514e6cb97aafbc5c535617fb48 Mon Sep 17 00:00:00 2001 From: Ryan Walker Date: Thu, 12 May 2022 15:07:29 -0400 Subject: [PATCH 2/4] Upgrade to pgx 0.4.4 --- Cargo.lock | 184 +++++++++++++++++++++++++------------------ Readme.md | 7 +- extension/Cargo.toml | 6 +- 3 files changed, 115 insertions(+), 82 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f0c624ab..e1f648dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,9 +125,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" @@ -246,9 +246,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ "generic-array 0.14.4", ] @@ -512,13 +512,13 @@ dependencies = [ ] [[package]] -name = "crypto-mac" -version = "0.11.1" +name = "crypto-common" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" dependencies = [ "generic-array 0.14.4", - "subtle", + "typenum", ] [[package]] @@ -548,11 +548,13 @@ dependencies = [ [[package]] name = "digest" -version = "0.9.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ - "generic-array 0.14.4", + "block-buffer 0.10.2", + "crypto-common", + "subtle", ] [[package]] @@ -914,12 +916,11 @@ dependencies = [ [[package]] name = "hmac" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "crypto-mac", - "digest 0.9.0", + "digest 0.10.3", ] [[package]] @@ -976,15 +977,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "itertools" version = "0.10.3" @@ -1051,10 +1043,11 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ + "autocfg", "scopeguard", ] @@ -1099,13 +1092,11 @@ dependencies = [ [[package]] name = "md-5" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" +checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582" dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest 0.10.3", ] [[package]] @@ -1274,9 +1265,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", "libm", @@ -1322,12 +1313,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - [[package]] name = "ordered-float" version = "1.1.1" @@ -1346,27 +1331,25 @@ checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ "cfg-if", - "instant", "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "windows-sys", ] [[package]] @@ -1442,16 +1425,15 @@ dependencies = [ [[package]] name = "pgx" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c460dff28460a37f9b11ce656d83fadd2ecd8bae53b89f7d7be4ff3337cde969" +checksum = "541daadd2b8b6bcbcca8772c03dcdec968f97ea54e0faca7b0299a8eec4e6869" dependencies = [ "atomic-traits", "bitflags", "cstr_core", "enum-primitive-derive", "eyre", - "hash32", "heapless", "num-traits", "once_cell", @@ -1466,14 +1448,14 @@ dependencies = [ "time", "tracing", "tracing-error", - "uuid", + "uuid 1.0.0", ] [[package]] name = "pgx-macros" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930e43145e3cf6144ed71089e66f34c8d9e017f7f9c53d9e42ea15559916d473" +checksum = "90af33a34d24228eedae09bd34f6c57a8f89dcc910bd5b6d08dac1c4816b17c3" dependencies = [ "pgx-utils", "proc-macro2", @@ -1484,9 +1466,9 @@ dependencies = [ [[package]] name = "pgx-pg-sys" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8252505bec328b016b7ce68319a17954c0858e31b442db28ca3d60602e394fa" +checksum = "2b93a0a406092cd49372344542f1e04f009203c746060d76b9014cb144e7bbb8" dependencies = [ "bindgen", "build-deps", @@ -1506,9 +1488,9 @@ dependencies = [ [[package]] name = "pgx-tests" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4828b4bed337a3adc4898f04bdde1a4185a8ec7a8af004be528a87918c920c" +checksum = "e1c08b94a24472166ca4bb57ecf1ef3a6db37b25e58b5a9a3c3ade8b322fef36" dependencies = [ "eyre", "libc", @@ -1527,9 +1509,9 @@ dependencies = [ [[package]] name = "pgx-utils" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c485e64d4c25cac2882c2ec0b42a0a090debdee1156f2ee796e56c8e03876d" +checksum = "3b8719c1423a83062bd22670f9d9e2e7bb1cf2044c57e9b74986f421641f3841" dependencies = [ "atty", "convert_case", @@ -1611,9 +1593,9 @@ dependencies = [ [[package]] name = "postgres" -version = "0.19.2" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb76d6535496f633fa799bb872ffb4790e9cbdedda9d35564ca0252f930c0dd5" +checksum = "c8bbcd5f6deb39585a0d9f4ef34c4a41c25b7ad26d23c75d837d78c8e7adc85f" dependencies = [ "bytes", "fallible-iterator", @@ -1625,9 +1607,9 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b145e6a4ed52cb316a27787fc20fe8a25221cb476479f61e4e0327c15b98d91a" +checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" dependencies = [ "base64 0.13.0", "byteorder", @@ -1643,9 +1625,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04619f94ba0cc80999f4fc7073607cb825bc739a883cb6d20900fc5e009d6b0d" +checksum = "ebd6e8b7189a73169290e89bd24c771071f1012d8fe6f738f5226531f0b03d89" dependencies = [ "bytes", "fallible-iterator", @@ -2115,20 +2097,18 @@ dependencies = [ "block-buffer 0.7.3", "digest 0.8.1", "fake-simd", - "opaque-debug 0.2.3", + "opaque-debug", ] [[package]] name = "sha2" -version = "0.9.8" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ - "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest 0.10.3", ] [[package]] @@ -2234,7 +2214,7 @@ dependencies = [ "postgres", "pulldown-cmark", "rayon", - "uuid", + "uuid 0.8.2", "walkdir", ] @@ -2487,9 +2467,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c07a6ceeeb8515d53998ac4487788a21884e79d5651490bc31a7289f20a7d7" +checksum = "19c88a47a23c5d2dc9ecd28fb38fba5fc7e5ddc1fe64488ec145076b0c71c8ae" dependencies = [ "async-trait", "byteorder", @@ -2510,16 +2490,16 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" dependencies = [ "bytes", "futures-core", "futures-sink", - "log", "pin-project-lite", "tokio", + "tracing", ] [[package]] @@ -2723,6 +2703,15 @@ dependencies = [ "getrandom 0.2.3", ] +[[package]] +name = "uuid" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfcd319456c4d6ea10087ed423473267e1a071f3bc0aa89f80d60997843c6f0" +dependencies = [ + "getrandom 0.2.3", +] + [[package]] name = "valuable" version = "0.1.0" @@ -2828,6 +2817,49 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "ws2_32-sys" version = "0.2.1" diff --git a/Readme.md b/Readme.md index ee87f7c1..9c82f4da 100644 --- a/Readme.md +++ b/Readme.md @@ -37,9 +37,11 @@ sudo apt-get install make gcc pkg-config clang postgresql-server-dev-13 libssl-d ``` and finally, [pgx](https://github.com/tcdi/pgx), which can be installed with ```bash -cargo install --version '=0.4.3' cargo-pgx && cargo pgx init --pg13 pg_config +cargo install --version '=0.4.4' cargo-pgx && cargo pgx init --pg13 pg_config ``` +Installing from source is also available on macOS and requires the same set of prerequisites and set up commands listed above. + ### 💾 Building and Installing the extension ### Download or clone this repository, and switch to the `extension` subdirectory, e.g. @@ -71,8 +73,7 @@ hop on the [Discussions forum](https://github.com/timescale/timescaledb-toolkit/ See above for prerequisites and installation instructions. -You can run tests against a postgres version -`pg12`, or `pg13` using +You can run tests against a postgres version `pg12`, `pg13`, or `pg14` using ``` cargo pgx test ${postgres_version} diff --git a/extension/Cargo.toml b/extension/Cargo.toml index 1ad76a30..6e550452 100644 --- a/extension/Cargo.toml +++ b/extension/Cargo.toml @@ -18,8 +18,8 @@ pg_test = ["approx"] [dependencies] # Keep synchronized with `cargo install --version N.N.N cargo-pgx` in Readme.md and docker/ci/Dockerfile # Also `pgx-tests` down below in `dev-dependencies`. -pgx = "=0.4.3" -pgx-macros = "=0.4.3" +pgx = "=0.4.4" +pgx-macros = "=0.4.4" encodings = {path="../crates/encodings"} flat_serialize = {path="../crates/flat_serialize/flat_serialize"} flat_serialize_macro = {path="../crates/flat_serialize/flat_serialize_macro"} @@ -51,5 +51,5 @@ spfunc = "0.1.0" statrs = "0.15.0" [dev-dependencies] -pgx-tests = "=0.4.3" +pgx-tests = "=0.4.4" approx = "0.4.0" From 9ffaefc3f0c29ad8cf8ef8423a0addd877d8eb73 Mon Sep 17 00:00:00 2001 From: Ryan Walker Date: Wed, 25 May 2022 13:53:07 -0400 Subject: [PATCH 3/4] Upgrade to pgx 0.4.5 --- Cargo.lock | 77 +++++++++++++++++++++++++------------------- Readme.md | 2 +- extension/Cargo.toml | 6 ++-- 3 files changed, 48 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1f648dc..506677b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -895,12 +895,13 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heapless" -version = "0.7.10" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d076121838e03f862871315477528debffdb7462fb229216ecef91b1a3eb31eb" +checksum = "8a08e755adbc0ad283725b29f4a4883deee15336f372d5f61fae59efec40f983" dependencies = [ "atomic-polyfill", "hash32", + "rustc_version 0.4.0", "spin", "stable_deref_trait", ] @@ -1006,9 +1007,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.125" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "libloading" @@ -1425,9 +1426,9 @@ dependencies = [ [[package]] name = "pgx" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "541daadd2b8b6bcbcca8772c03dcdec968f97ea54e0faca7b0299a8eec4e6869" +checksum = "00f3f571b70d230cba9ec46c530000469710ef2c1ea3eadf56d7bc8a62b3510c" dependencies = [ "atomic-traits", "bitflags", @@ -1453,9 +1454,9 @@ dependencies = [ [[package]] name = "pgx-macros" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90af33a34d24228eedae09bd34f6c57a8f89dcc910bd5b6d08dac1c4816b17c3" +checksum = "b854e9b42fa8940b5fa393915df75db559384f14663c8966eb5161b554ff5842" dependencies = [ "pgx-utils", "proc-macro2", @@ -1466,9 +1467,9 @@ dependencies = [ [[package]] name = "pgx-pg-sys" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b93a0a406092cd49372344542f1e04f009203c746060d76b9014cb144e7bbb8" +checksum = "57be652efd8d69525ba4ec04743b2aa2feb024ef7c5d39d35f9bf5638bf64d48" dependencies = [ "bindgen", "build-deps", @@ -1488,9 +1489,9 @@ dependencies = [ [[package]] name = "pgx-tests" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c08b94a24472166ca4bb57ecf1ef3a6db37b25e58b5a9a3c3ade8b322fef36" +checksum = "e9012d509f69898cc15762c3feb78b6a61b3a66a533084351f6afe89c78b8e47" dependencies = [ "eyre", "libc", @@ -1509,9 +1510,9 @@ dependencies = [ [[package]] name = "pgx-utils" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b8719c1423a83062bd22670f9d9e2e7bb1cf2044c57e9b74986f421641f3841" +checksum = "ce5d334b177a9cd741521d01ebea505417adddaef4d368753b34ac4a43052674" dependencies = [ "atty", "convert_case", @@ -1668,11 +1669,11 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.37" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1817,9 +1818,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" dependencies = [ "autocfg", "crossbeam-deque", @@ -1963,6 +1964,15 @@ dependencies = [ "semver 0.11.0", ] +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.9", +] + [[package]] name = "ryu" version = "1.0.5" @@ -2079,9 +2089,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f972498cf015f7c0746cac89ebe1d6ef10c293b94175a243a2d9442c163d9944" +checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" dependencies = [ "itoa", "ryu", @@ -2271,20 +2281,20 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.92" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" +checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] name = "syntect" -version = "4.6.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b20815bbe80ee0be06e6957450a841185fcf690fe0178f14d77a05ce2caa031" +checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8" dependencies = [ "bincode", "bitflags", @@ -2292,12 +2302,13 @@ dependencies = [ "flate2", "fnv", "lazy_static", - "lazycell", + "once_cell", "plist", "regex-syntax", "serde", "serde_derive", "serde_json", + "thiserror", "walkdir", "yaml-rust", ] @@ -2647,6 +2658,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +[[package]] +name = "unicode-ident" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" + [[package]] name = "unicode-normalization" version = "0.1.19" @@ -2662,12 +2679,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "update-tester" version = "0.2.0" diff --git a/Readme.md b/Readme.md index 9c82f4da..245f12dc 100644 --- a/Readme.md +++ b/Readme.md @@ -37,7 +37,7 @@ sudo apt-get install make gcc pkg-config clang postgresql-server-dev-13 libssl-d ``` and finally, [pgx](https://github.com/tcdi/pgx), which can be installed with ```bash -cargo install --version '=0.4.4' cargo-pgx && cargo pgx init --pg13 pg_config +cargo install --version '=0.4.5' cargo-pgx && cargo pgx init --pg13 pg_config ``` Installing from source is also available on macOS and requires the same set of prerequisites and set up commands listed above. diff --git a/extension/Cargo.toml b/extension/Cargo.toml index 6e550452..f8aa0c32 100644 --- a/extension/Cargo.toml +++ b/extension/Cargo.toml @@ -18,8 +18,8 @@ pg_test = ["approx"] [dependencies] # Keep synchronized with `cargo install --version N.N.N cargo-pgx` in Readme.md and docker/ci/Dockerfile # Also `pgx-tests` down below in `dev-dependencies`. -pgx = "=0.4.4" -pgx-macros = "=0.4.4" +pgx = "=0.4.5" +pgx-macros = "=0.4.5" encodings = {path="../crates/encodings"} flat_serialize = {path="../crates/flat_serialize/flat_serialize"} flat_serialize_macro = {path="../crates/flat_serialize/flat_serialize_macro"} @@ -51,5 +51,5 @@ spfunc = "0.1.0" statrs = "0.15.0" [dev-dependencies] -pgx-tests = "=0.4.4" +pgx-tests = "=0.4.5" approx = "0.4.0" From 73d1a7eb98c55479208f325cafe7905ad06b6ac0 Mon Sep 17 00:00:00 2001 From: Eric Gillespie Date: Wed, 25 May 2022 09:56:47 -0500 Subject: [PATCH 4/4] Force pgx 0.4 tool onto PATH. Leave TODO about making this default after merge. --- docker/ci/Dockerfile | 1 + tools/build | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docker/ci/Dockerfile b/docker/ci/Dockerfile index 38546a73..346985f3 100644 --- a/docker/ci/Dockerfile +++ b/docker/ci/Dockerfile @@ -12,6 +12,7 @@ USER postgres RUN cargo install cargo-pgx --version '=0.2.4' --root /home/postgres/pgx/0.2 \ && cargo install cargo-pgx --version '=0.4.5' --root /home/postgres/pgx/0.4 +# TODO After we upgrade to 0.4 change this to 0.4 and remove the hack in tools/build . ENV PATH "/home/postgres/pgx/0.2/bin/:${PATH}" RUN set -ex \ diff --git a/tools/build b/tools/build index 20df6937..6075ca26 100755 --- a/tools/build +++ b/tools/build @@ -2,6 +2,9 @@ set -ex +# TODO After we upgrade to 0.4 make this change in docker/ci/Dockerfile and then remove this line. +export PATH=/home/postgres/pgx/0.4/bin:$PATH + print() { printf '%s\n' "$*" }