From 66fa6c93b20b8bacc097b9d0a6fa59d9e7a4bded Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:05:23 -0700 Subject: [PATCH] Test that pgrx can build after publishing (#1796) Test that pgrx will always build after we publish it. It should never again take an excessive amount of time to release pgrx, because we will always be confident we are ready to release. This does not finish making the release "turnkey", but it does take care of every obstacle to such. Note that there is a technicality: we are "only" testing that our _package_ builds. We are not actually pulling a published-to-cargo release and testing it. We are not running the `cargo publish --dry-run` command, either, because there is no `cargo publish --workspace`. Instead, we are packaging the workspace and rebuilding *that package*. This unfortunately demands that we factor out all the packages in the workspace that are not going to be published. Other details of the refactoring are informed by these oddities: - `package.publish = false` doesn't play well with the extensions to `cargo package --workspace`: https://github.com/rust-lang/cargo/issues/14356 - `workspace.exclude = []` does not properly support globs: https://github.com/rust-lang/cargo/issues/6009 - We *need* to reuse the same `CARGO_TARGET_DIR` for building and testing our many examples or we run out of storage space on the runners. --- .cargo/config.toml | 6 + .github/workflows/tests.yml | 67 ++-- Cargo.lock | 327 ----------------- Cargo.toml | 6 +- {ci => tools}/license-check.sh | 0 {ci => tools}/rustup.sh | 2 + tools/version-updater/Cargo.lock | 337 ++++++++++++++++++ .../version-updater}/Cargo.toml | 8 +- .../version-updater}/src/main.rs | 0 update-versions.sh | 4 +- 10 files changed, 390 insertions(+), 367 deletions(-) rename {ci => tools}/license-check.sh (100%) rename {ci => tools}/rustup.sh (83%) create mode 100644 tools/version-updater/Cargo.lock rename {pgrx-version-updater => tools/version-updater}/Cargo.toml (92%) rename {pgrx-version-updater => tools/version-updater}/src/main.rs (100%) diff --git a/.cargo/config.toml b/.cargo/config.toml index 13c456b5d..51de46865 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,9 @@ +[alias] +b = "build --features" +c = "check --features" +t = "test --features" +r = "run --features" + [target.'cfg(target_os="macos")'] # Postgres symbols won't be available until runtime rustflags = ["-Clink-arg=-Wl,-undefined,dynamic_lookup"] diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c59269d2d..2ba8ea963 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,6 +15,7 @@ env: CARGO_INCREMENTAL: "false" SCCACHE_MAX_FRAME_LENGTH: 100000000 # CARGO_LOG: cargo::core::compiler::fingerprint=info # Uncomment this to output compiler fingerprint info + TOOL_DIR: ./tools jobs: lintck: @@ -43,7 +44,7 @@ jobs: mkdir -p /home/runner/.cache/sccache echo "" - ./ci/rustup.sh + "$TOOL_DIR"/rustup.sh # https://stackoverflow.com/questions/57968497/how-do-i-set-an-env-var-with-a-bash-expression-in-github-actions/57969570#57969570 @@ -77,7 +78,7 @@ jobs: run: cargo fmt --all -- --check - name: Run license check - run: cargo install cargo-deny --locked && ./ci/license-check.sh + run: cargo install cargo-deny --locked && "$TOOL_DIR"/license-check.sh # We can't lint most crates because they require "cargo pgrx init" to build - name: Clippy -Dwarnings sql-entity-graph @@ -149,7 +150,7 @@ jobs: zlib1g-dev echo "" - ./ci/rustup.sh + "$TOOL_DIR"/rustup.sh echo "----- Set up cross compilation -----" sudo apt-get install -y --fix-missing crossbuild-essential-arm64 @@ -250,88 +251,88 @@ jobs: - name: Run aggregate example tests - run: cargo test --package aggregate --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/aggregate/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run arrays example tests - run: cargo test --package arrays --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/arrays/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run bad_ideas example tests - run: cargo test --package bad_ideas --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/bad_ideas/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run bgworker example tests - run: cargo test --package bgworker --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/bgworker/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run bytea example tests - run: cargo test --package bytea --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/bytea/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run composite_type example tests - run: cargo test --package composite_type --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/composite_type/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run custom_libname example tests - run: cargo test --package custom_libname --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/custom_libname/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run custom_types example tests - run: cargo test --package custom_types --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/custom_types/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run custom_types without schema generation example tests - run: cargo test --package custom_types --features "pg$PG_VER no-schema-generation" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/custom_types/Cargo.toml --features "pg$PG_VER no-schema-generation" --no-default-features - name: Run custom_sql example tests - run: cargo test --package custom_sql --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/custom_sql/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run datetime example tests - run: cargo test --package datetime --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/datetime/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run errors example tests - run: cargo test --package errors --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/errors/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run nostd example tests - run: cargo test --package nostd --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/nostd/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run numeric example tests - run: cargo test --package numeric --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/numeric/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run pgtrybuilder example tests - run: cargo test --package pgtrybuilder --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/pgtrybuilder/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run operators example tests - run: cargo test --package operators --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/operators/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run range example tests - run: cargo test --package range --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/range/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run schemas example tests - run: cargo test --package schemas --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/schemas/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run shmem example tests - run: cargo test --package shmem --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/shmem/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run spi example tests - run: cargo test --package spi --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/spi/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run spi_srf example tests - run: cargo test --package spi_srf --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/spi_srf/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run srf example tests - run: cargo test --package srf --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/srf/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run strings example tests - run: cargo test --package strings --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/strings/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run triggers example tests - run: cargo test --package triggers --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/triggers/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run versioned_custom_libname_so example tests - run: cargo test --package versioned_custom_libname_so --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/versioned_custom_libname_so/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run versioned_so example tests - run: cargo test --package versioned_so --features "pg$PG_VER" --no-default-features + run: CARGO_TARGET_DIR="$(pwd)/target" cargo test --manifest-path=pgrx-examples/versioned_so/Cargo.toml --features "pg$PG_VER" --no-default-features - name: Run `cargo pgrx schema` against the versioned_custom_libname_so example - run: cargo pgrx schema pg$PG_VER --package versioned_custom_libname_so + run: cd pgrx-examples/versioned_custom_libname_so && cargo pgrx schema pg$PG_VER - name: Test that version bumps work - run: ./update-versions.sh 0.0.999-rc.999 + run: ./update-versions.sh 0.0.999-rc.999 && cargo +nightly package --workspace -Zpackage-workspace --allow-dirty --features "pg$PG_VER" # Attempt to make the cache payload slightly smaller. - name: Clean up built PGRX files @@ -401,7 +402,7 @@ jobs: zlib1g-dev echo "" - ./ci/rustup.sh + "$TOOL_DIR"/rustup.sh echo "----- Outputting env -----" env @@ -528,7 +529,7 @@ jobs: # ls -lath `$(which pg_config) --pkglibdir` `$(which pg_config) --sharedir`/extension echo "" - ./ci/rustup.sh + "$TOOL_DIR"/rustup.sh echo "----- Outputting env -----" env diff --git a/Cargo.lock b/Cargo.lock index 785d832fe..aa6243188 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,33 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - -[[package]] -name = "aggregate" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "serde", -] - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.2" @@ -107,16 +80,6 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" -[[package]] -name = "arrays" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "rand", - "serde", -] - [[package]] name = "async-trait" version = "0.1.77" @@ -170,16 +133,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "bad_ideas" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "rand", - "ureq", -] - [[package]] name = "base64" version = "0.21.7" @@ -195,14 +148,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bgworker" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - [[package]] name = "bincode" version = "1.3.3" @@ -286,15 +231,6 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" -[[package]] -name = "bytea" -version = "0.0.0" -dependencies = [ - "libflate", - "pgrx", - "pgrx-tests", -] - [[package]] name = "byteorder" version = "1.5.0" @@ -594,15 +530,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "composite_type" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "serde", -] - [[package]] name = "concolor-control" version = "0.0.7" @@ -645,15 +572,6 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - [[package]] name = "cpufeatures" version = "0.2.12" @@ -727,48 +645,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "custom_libname" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - -[[package]] -name = "custom_sql" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "serde", -] - -[[package]] -name = "custom_types" -version = "0.0.0" -dependencies = [ - "maplit", - "pgrx", - "pgrx-tests", - "serde", -] - -[[package]] -name = "dary_heap" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" - -[[package]] -name = "datetime" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "rand", -] - [[package]] name = "deranged" version = "0.3.11" @@ -847,14 +723,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "errors" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - [[package]] name = "eyre" version = "0.6.12" @@ -1080,15 +948,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.14.3" @@ -1270,30 +1129,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "libflate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7d5654ae1795afc7ff76f4365c2c8791b0feb18e8996a96adad8ffd7c3b2bf" -dependencies = [ - "adler32", - "core2", - "crc32fast", - "dary_heap", - "libflate_lz77", -] - -[[package]] -name = "libflate_lz77" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5f52fb8c451576ec6b79d3f4deb327398bc05bbdbd99021a6e77a4c855d524" -dependencies = [ - "core2", - "hashbrown 0.13.2", - "rle-decode-fast", -] - [[package]] name = "libgit2-sys" version = "0.15.2+1.6.4" @@ -1387,12 +1222,6 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "matchers" version = "0.1.0" @@ -1472,15 +1301,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nostd" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "serde", -] - [[package]] name = "ntapi" version = "0.4.1" @@ -1510,15 +1330,6 @@ dependencies = [ "libm", ] -[[package]] -name = "numeric" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "rand", -] - [[package]] name = "object" version = "0.32.2" @@ -1578,15 +1389,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "operators" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "serde", -] - [[package]] name = "overload" version = "0.1.1" @@ -1789,24 +1591,6 @@ dependencies = [ "trybuild", ] -[[package]] -name = "pgrx-version-updater" -version = "0.1.1" -dependencies = [ - "clap", - "owo-colors 4.0.0", - "toml_edit 0.22.12", - "walkdir", -] - -[[package]] -name = "pgtrybuilder" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - [[package]] name = "phf" version = "0.11.2" @@ -2010,14 +1794,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "range" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - [[package]] name = "rayon" version = "1.8.1" @@ -2111,12 +1887,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rle-decode-fast" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -2236,15 +2006,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "schemas" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "serde", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -2405,16 +2166,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "shmem" -version = "0.0.0" -dependencies = [ - "heapless", - "pgrx", - "pgrx-tests", - "serde", -] - [[package]] name = "siphasher" version = "0.3.11" @@ -2466,22 +2217,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "spi" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - -[[package]] -name = "spi_srf" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - [[package]] name = "spin" version = "0.9.8" @@ -2494,15 +2229,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" -[[package]] -name = "srf" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "rand", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2520,14 +2246,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "strings" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - [[package]] name = "strsim" version = "0.10.0" @@ -2915,15 +2633,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "triggers" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", - "thiserror", -] - [[package]] name = "trybuild" version = "1.0.89" @@ -3061,22 +2770,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "versioned_custom_libname_so" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - -[[package]] -name = "versioned_so" -version = "0.0.0" -dependencies = [ - "pgrx", - "pgrx-tests", -] - [[package]] name = "wait-timeout" version = "0.2.0" @@ -3423,23 +3116,3 @@ checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index 077378105..a6708776c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,9 @@ members = [ "pgrx-pg-sys", "pgrx-sql-entity-graph", "pgrx-tests", - "pgrx-version-updater", +] +exclude = [ + # "pgrx-examples/*", "pgrx-examples/aggregate", "pgrx-examples/arrays", "pgrx-examples/bad_ideas", @@ -38,12 +40,12 @@ members = [ "pgrx-examples/schemas", "pgrx-examples/shmem", "pgrx-examples/spi", + "pgrx-examples/spi_srf", "pgrx-examples/srf", "pgrx-examples/strings", "pgrx-examples/triggers", "pgrx-examples/versioned_custom_libname_so", "pgrx-examples/versioned_so", - "pgrx-examples/spi_srf", ] diff --git a/ci/license-check.sh b/tools/license-check.sh similarity index 100% rename from ci/license-check.sh rename to tools/license-check.sh diff --git a/ci/rustup.sh b/tools/rustup.sh similarity index 83% rename from ci/rustup.sh rename to tools/rustup.sh index 9adf093d7..5845bae96 100755 --- a/ci/rustup.sh +++ b/tools/rustup.sh @@ -8,6 +8,8 @@ else chmod +x rustup-init.sh ./rustup-init.sh -y fi +# we want nightly to be always-available for some tests, even if we don't default to it +rustup update nightly rustup update "${RUST_TOOLCHAIN:-stable}" rustup default "${RUST_TOOLCHAIN:-stable}" # only needed for cross-compile tests but we want consistent rust configuration diff --git a/tools/version-updater/Cargo.lock b/tools/version-updater/Cargo.lock new file mode 100644 index 000000000..d7df30150 --- /dev/null +++ b/tools/version-updater/Cargo.lock @@ -0,0 +1,337 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "clap" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "indexmap" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "owo-colors" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" + +[[package]] +name = "pgrx-version-updater" +version = "0.1.1" +dependencies = [ + "clap", + "owo-colors", + "toml_edit", + "walkdir", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] diff --git a/pgrx-version-updater/Cargo.toml b/tools/version-updater/Cargo.toml similarity index 92% rename from pgrx-version-updater/Cargo.toml rename to tools/version-updater/Cargo.toml index 42be60826..d640d34e5 100644 --- a/pgrx-version-updater/Cargo.toml +++ b/tools/version-updater/Cargo.toml @@ -15,10 +15,12 @@ edition = "2021" authors = ["PgCentral Foundation, Inc. "] license = "MIT" description = "Standalone tool to update PGRX Cargo.toml versions and dependencies in preparation for a release." +publish = false [dependencies] -owo-colors.workspace = true -walkdir.workspace = true - clap = { version = "4.4.2", features = [ "env", "derive" ] } +owo-colors = "4" toml_edit = { version = "0.22" } +walkdir = "2" + +[workspace] diff --git a/pgrx-version-updater/src/main.rs b/tools/version-updater/src/main.rs similarity index 100% rename from pgrx-version-updater/src/main.rs rename to tools/version-updater/src/main.rs diff --git a/update-versions.sh b/update-versions.sh index 0170d7b0d..b0f294403 100755 --- a/update-versions.sh +++ b/update-versions.sh @@ -47,7 +47,7 @@ INCLUDE_FOR_DEP_UPDATES=( # versions bumped at release time. EXCLUDE_FROM_VERSION_BUMP=( 'cargo-pgrx/src/templates/cargo_toml' - 'pgrx-version-updater/Cargo.toml' + 'tools/version-updater/Cargo.toml' ) # Exclude all pgrx-examples Cargo.toml files from version bumping @@ -56,7 +56,7 @@ for file in pgrx-examples/**/Cargo.toml; do done # shellcheck disable=SC2086,SC2068 -cargo run --bin pgrx-version-updater \ +cargo run --manifest-path=./tools/version-updater/Cargo.toml \ update-files \ --update-version "$VERSION" \ ${INCLUDE_FOR_DEP_UPDATES[@]/#/-i } \