diff --git a/.github/workflows/release-pr-validation.yml b/.github/workflows/release-pr-validation.yml new file mode 100644 index 0000000000..0e36562c40 --- /dev/null +++ b/.github/workflows/release-pr-validation.yml @@ -0,0 +1,33 @@ +name: Release PR Validation + +permissions: + contents: read + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - main + +jobs: + validate-release: + # Only run on release PRs + if: contains(github.event.pull_request.labels.*.name, 'release') + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + + - name: Install cargo-release + run: cargo install cargo-release + + - name: Validate packages for publishing + run: ./scripts/validate-packages.sh diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml new file mode 100644 index 0000000000..ea49614248 --- /dev/null +++ b/.github/workflows/release-publish.yml @@ -0,0 +1,89 @@ +name: Publish Release + +on: + pull_request: + types: [closed] + branches: + - main + +jobs: + publish-release: + # Only run on merged release PRs + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + + - name: Install cargo-release + run: cargo install cargo-release + + - name: Configure git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Validate packages before publishing + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + echo "=========================================" + echo "Phase 1: Validation (dry-run)" + echo "=========================================" + ./scripts/validate-packages.sh "$BASE_SHA" "$HEAD_SHA" + + - name: Publish packages to crates.io + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + echo "" + echo "=========================================" + echo "Phase 2: Publishing (atomic)" + echo "=========================================" + ./scripts/validate-packages.sh --execute "$BASE_SHA" "$HEAD_SHA" + + - name: Create GitHub releases + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + echo "" + echo "=========================================" + echo "Phase 3: Creating GitHub releases" + echo "=========================================" + + # Detect packages that were published + PACKAGES_STRING=$(./scripts/detect-version-changes.sh "$BASE_SHA" "$HEAD_SHA") + read -ra PACKAGES <<< "$PACKAGES_STRING" + + for pkg in "${PACKAGES[@]}"; do + echo "----------------------------------------" + # Get the version from Cargo.toml + VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r ".packages[] | select(.name == \"$pkg\") | .version") + TAG="${pkg}-v${VERSION}" + + echo "Creating GitHub release for $TAG..." + if gh release create "$TAG" --generate-notes --title "$TAG"; then + echo "✓ Created release for $TAG" + else + echo "Warning: Failed to create release for $TAG" + fi + done + + echo "" + echo "✓ GitHub releases created" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 212ae4364b..692293f235 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -39,9 +39,10 @@ jobs: test_cmd: | cargo test -p light-concurrent-merkle-tree - name: batched-merkle-tree-simulate - packages: light-batched-merkle-tree + packages: light-batched-merkle-tree batched-merkle-tree-tests test_cmd: | - RUST_LOG=light_prover_client=debug cargo test -p light-batched-merkle-tree --features test-only -- --test test_simulate_transactions + cargo test -p light-batched-merkle-tree --features test-only + RUST_LOG=light_prover_client=debug cargo test -p batched-merkle-tree-tests -- --test test_simulate_transactions - name: program-libs-fast packages: aligned-sized light-hasher light-compressed-account light-account-checks \ @@ -60,12 +61,13 @@ jobs: cargo build -p light-zero-copy --no-default-features # Ensure no_std builds cargo test -p light-zero-copy-derive --all-features cargo test -p light-hash-set --all-features + cargo test -p batched-merkle-tree-tests -- --skip test_simulate_transactions --skip test_e2e - name: program-libs-slow - packages: light-bloom-filter light-indexed-merkle-tree light-batched-merkle-tree + packages: light-bloom-filter light-indexed-merkle-tree batched-merkle-tree-tests test_cmd: | cargo test -p light-bloom-filter --all-features cargo test -p light-indexed-merkle-tree --all-features - cargo test -p light-batched-merkle-tree --all-features -- --test test_e2e + cargo test -p batched-merkle-tree-tests -- --test test_e2e name: Test ${{ matrix.group.name }} diff --git a/.github/workflows/sdk-tests.yml b/.github/workflows/sdk-tests.yml index 39294a96ab..fa3bace267 100644 --- a/.github/workflows/sdk-tests.yml +++ b/.github/workflows/sdk-tests.yml @@ -56,7 +56,7 @@ jobs: - program: sdk-anchor-test-program sub-tests: '["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -p sdk-pinocchio-v1-test", "cargo-test-sbf -p sdk-pinocchio-v2-test"]' - program: sdk-libs - packages: light-sdk-macros light-sdk light-program-test light-client light-batched-merkle-tree + packages: light-sdk-macros light-sdk light-program-test light-client batched-merkle-tree-tests test_cmd: | cargo test -p light-sdk-macros cargo test -p light-sdk-macros --all-features @@ -66,7 +66,6 @@ jobs: cargo test -p light-client cargo test -p client-test cargo test -p light-sparse-merkle-tree - cargo test -p light-batched-merkle-tree --features test-only -- --skip test_simulate_transactions --skip test_e2e steps: - name: Checkout sources uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index f46b53dd48..571bfe9579 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -918,6 +918,26 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "batched-merkle-tree-tests" +version = "0.1.0" +dependencies = [ + "light-account-checks", + "light-batched-merkle-tree", + "light-bloom-filter", + "light-compressed-account", + "light-hasher", + "light-merkle-tree-metadata", + "light-merkle-tree-reference", + "light-prover-client", + "light-test-utils", + "light-zero-copy", + "rand 0.8.5", + "serial_test", + "solana-pubkey", + "tokio", +] + [[package]] name = "bb8" version = "0.8.6" @@ -3347,7 +3367,7 @@ dependencies = [ [[package]] name = "light-account-checks" -version = "0.3.0" +version = "0.4.0" dependencies = [ "borsh 0.10.4", "pinocchio", @@ -3362,7 +3382,7 @@ dependencies = [ [[package]] name = "light-batched-merkle-tree" -version = "0.3.0" +version = "0.4.2" dependencies = [ "aligned-sized", "borsh 0.10.4", @@ -3373,20 +3393,16 @@ dependencies = [ "light-macros", "light-merkle-tree-metadata", "light-merkle-tree-reference", - "light-prover-client", - "light-test-utils", "light-verifier", "light-zero-copy", "pinocchio", "rand 0.8.5", - "serial_test", "solana-account-info", "solana-msg", "solana-program-error", "solana-pubkey", "solana-sysvar", "thiserror 2.0.17", - "tokio", "zerocopy", ] @@ -3418,7 +3434,7 @@ dependencies = [ [[package]] name = "light-client" -version = "0.13.1" +version = "0.14.0" dependencies = [ "async-trait", "base64 0.13.1", @@ -3464,7 +3480,7 @@ dependencies = [ [[package]] name = "light-compressed-account" -version = "0.3.0" +version = "0.4.0" dependencies = [ "anchor-lang", "ark-bn254 0.5.0", @@ -3611,7 +3627,7 @@ dependencies = [ [[package]] name = "light-merkle-tree-metadata" -version = "0.3.0" +version = "0.4.0" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -3664,7 +3680,8 @@ dependencies = [ [[package]] name = "light-profiler-macro" version = "0.1.0" -source = "git+https://github.com/Lightprotocol/light-program-profiler?rev=36a75e14f54dd862bf2f338c97435ffc7e3e8de9#36a75e14f54dd862bf2f338c97435ffc7e3e8de9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea8e975b7151078d0ce470657b2cc5546d8dab75ad0fe8c62c5ac5b980eb6735" dependencies = [ "proc-macro2", "quote", @@ -3674,14 +3691,15 @@ dependencies = [ [[package]] name = "light-program-profiler" version = "0.1.0" -source = "git+https://github.com/Lightprotocol/light-program-profiler?rev=36a75e14f54dd862bf2f338c97435ffc7e3e8de9#36a75e14f54dd862bf2f338c97435ffc7e3e8de9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d6510198436b28f85a5995c6ccfff8ad58bbc5985e8d60cc5ea9702d4e52d2" dependencies = [ "light-profiler-macro", ] [[package]] name = "light-program-test" -version = "0.13.2" +version = "0.14.0" dependencies = [ "account-compression", "anchor-lang", @@ -3938,7 +3956,7 @@ dependencies = [ [[package]] name = "light-verifier" -version = "2.1.0" +version = "3.0.0" dependencies = [ "groth16-solana", "light-compressed-account", @@ -3950,29 +3968,26 @@ dependencies = [ [[package]] name = "light-zero-copy" -version = "0.2.0" +version = "0.3.0" dependencies = [ "borsh 0.10.4", "light-zero-copy-derive", "pinocchio", "rand 0.8.5", "solana-program-error", + "trybuild", "zerocopy", ] [[package]] name = "light-zero-copy-derive" -version = "0.1.0" +version = "0.3.0" dependencies = [ - "borsh 0.10.4", "lazy_static", - "light-zero-copy", "proc-macro2", "quote", "rand 0.8.5", "syn 2.0.106", - "trybuild", - "zerocopy", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 5db5bcb2d0..4c1cb00282 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ members = [ "sdk-libs/program-test", "xtask", "program-tests/account-compression-test", + "program-tests/batched-merkle-tree-test", "program-tests/compressed-token-test", "program-tests/e2e-test", "program-tests/registry-test", @@ -157,7 +158,7 @@ light-hash-set = { version = "2.1.0", path = "program-libs/hash-set" } light-indexed-merkle-tree = { version = "2.1.0", path = "program-libs/indexed-merkle-tree" } light-concurrent-merkle-tree = { version = "2.1.0", path = "program-libs/concurrent-merkle-tree" } light-sparse-merkle-tree = { version = "0.1.0", path = "sparse-merkle-tree" } -light-client = { path = "sdk-libs/client", version = "0.13.1" } +light-client = { path = "sdk-libs/client", version = "0.14.0" } light-hasher = { path = "program-libs/hasher", version = "3.1.0" } light-macros = { path = "program-libs/macros", version = "2.1.0" } light-merkle-tree-reference = { path = "program-tests/merkle-tree", version = "2.0.0" } @@ -167,11 +168,11 @@ light-sdk = { path = "sdk-libs/sdk", version = "0.13.0" } light-sdk-pinocchio = { path = "sdk-libs/sdk-pinocchio", version = "0.13.0" } light-sdk-macros = { path = "sdk-libs/macros", version = "0.13.0" } light-sdk-types = { path = "sdk-libs/sdk-types", version = "0.13.0" } -light-compressed-account = { path = "program-libs/compressed-account", version = "0.3.0" } -light-account-checks = { path = "program-libs/account-checks", version = "0.3.0" } -light-verifier = { path = "program-libs/verifier", version = "2.1.0" } -light-zero-copy = { path = "program-libs/zero-copy", version = "0.2.0" } -light-zero-copy-derive = { path = "program-libs/zero-copy-derive", version = "0.1.0" } +light-compressed-account = { path = "program-libs/compressed-account", version = "0.4.0" } +light-account-checks = { path = "program-libs/account-checks", version = "0.4.0" } +light-verifier = { path = "program-libs/verifier", version = "3.0.0" } +light-zero-copy = { path = "program-libs/zero-copy", version = "0.3.0" } +light-zero-copy-derive = { path = "program-libs/zero-copy-derive", version = "0.3.0" } photon-api = { path = "sdk-libs/photon-api", version = "0.51.0" } forester-utils = { path = "forester-utils", version = "2.0.0" } account-compression = { path = "programs/account-compression", version = "2.0.0", features = [ @@ -190,16 +191,16 @@ light-registry = { path = "programs/registry", version = "2.0.0", features = [ create-address-test-program = { path = "program-tests/create-address-test-program", version = "1.0.0", features = [ "cpi", ] } -light-program-test = { path = "sdk-libs/program-test", version = "0.13.2" } -light-batched-merkle-tree = { path = "program-libs/batched-merkle-tree", version = "0.3.0" } -light-merkle-tree-metadata = { path = "program-libs/merkle-tree-metadata", version = "0.3.0" } +light-program-test = { path = "sdk-libs/program-test", version = "0.14.0" } +light-batched-merkle-tree = { path = "program-libs/batched-merkle-tree", version = "0.4.2" } +light-merkle-tree-metadata = { path = "program-libs/merkle-tree-metadata", version = "0.4.0" } aligned-sized = { path = "program-libs/aligned-sized", version = "1.1.0" } light-bloom-filter = { path = "program-libs/bloom-filter", version = "0.3.0" } light-bounded-vec = { version = "2.0.0" } light-poseidon = { version = "0.3.0" } light-test-utils = { path = "program-tests/utils", version = "1.2.1" } light-indexed-array = { path = "program-libs/indexed-array", version = "0.1.0" } -light-program-profiler = { git = "https://github.com/Lightprotocol/light-program-profiler", rev = "36a75e14f54dd862bf2f338c97435ffc7e3e8de9", version = "0.1.0" } +light-program-profiler = { version = "0.1.0" } create-address-program-test = { path = "program-tests/create-address-test-program", version = "1.0.0" } groth16-solana = { version = "0.2.0" } bytemuck = { version = "1.19.0" } @@ -232,3 +233,22 @@ solana-program-runtime = { git = "https://github.com/Lightprotocol/agave", rev = solana-bpf-loader-program = { git = "https://github.com/Lightprotocol/agave", rev = "35e7c295981a195e61b4f4039a5a6ef707d2210d" } # Patch solana-program-memory to use older version where is_nonoverlapping is public solana-program-memory = { git = "https://github.com/anza-xyz/solana-sdk", rev = "1c1d667f161666f12f5a43ebef8eda9470a8c6ee" } + +[workspace.metadata.release] +allow-branch = ["main", "release/*"] +tag-name = "{{crate_name}}-v{{version}}" +publish = true +push = true +shared-version = false +sign-commit = false +sign-tag = false +# Update workspace dependencies when releasing +dependent-version = "upgrade" +# Don't consolidate commits - create one commit per package +consolidate-commits = false +# Don't verify (skip tests/build checks) +verify = false + +[workspace.metadata.release.rate-limit] +new-packages = 5 +existing-packages = 5 diff --git a/anchor-programs/system/Cargo.toml b/anchor-programs/system/Cargo.toml index 3519fd65a1..fedfdba10b 100644 --- a/anchor-programs/system/Cargo.toml +++ b/anchor-programs/system/Cargo.toml @@ -5,6 +5,7 @@ description = "ZK Compression on Solana" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/forester-utils/Cargo.toml b/forester-utils/Cargo.toml index cc7e1af82c..8f9ca48d9f 100644 --- a/forester-utils/Cargo.toml +++ b/forester-utils/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" license = "Apache-2.0" repository = "https://github.com/lightprotocol/light-protocol" description = "Utility library for Light's Forester node implementation" +publish = false [features] default = ["v2"] diff --git a/forester/Cargo.toml b/forester/Cargo.toml index 79601efe11..7d0a390285 100644 --- a/forester/Cargo.toml +++ b/forester/Cargo.toml @@ -2,6 +2,7 @@ name = "forester" version = "1.1.0" edition = "2021" +publish = false [dependencies] anchor-lang = { workspace = true } diff --git a/program-libs/account-checks/Cargo.toml b/program-libs/account-checks/Cargo.toml index 3f77092681..3812761937 100644 --- a/program-libs/account-checks/Cargo.toml +++ b/program-libs/account-checks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-account-checks" -version = "0.3.0" +version = "0.4.0" description = "Checks for solana accounts." repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" diff --git a/program-libs/batched-merkle-tree/Cargo.toml b/program-libs/batched-merkle-tree/Cargo.toml index 0786887e93..e52c5f0592 100644 --- a/program-libs/batched-merkle-tree/Cargo.toml +++ b/program-libs/batched-merkle-tree/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-batched-merkle-tree" -version = "0.3.0" +version = "0.4.2" description = "Batch Merkle tree implementation." repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" @@ -55,13 +55,9 @@ light-macros = { workspace = true } [dev-dependencies] rand = { workspace = true } -light-prover-client = { workspace = true, features = ["devenv"] } light-merkle-tree-reference = { workspace = true } -tokio = { workspace = true } -serial_test = { workspace = true } light-account-checks = { workspace = true, features = ["test-only"] } light-compressed-account = { workspace = true, features = ["new-unique"] } -light-test-utils = { workspace = true, features = ["test-only"] } [lints.rust.unexpected_cfgs] level = "allow" diff --git a/program-libs/compressed-account/Cargo.toml b/program-libs/compressed-account/Cargo.toml index ce2390b5d7..f9a6316b60 100644 --- a/program-libs/compressed-account/Cargo.toml +++ b/program-libs/compressed-account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-compressed-account" -version = "0.3.0" +version = "0.4.0" description = "Compressed account struct and common utility functions used in Light Protocol." repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" diff --git a/program-libs/merkle-tree-metadata/Cargo.toml b/program-libs/merkle-tree-metadata/Cargo.toml index 14fb348326..d43b432d2d 100644 --- a/program-libs/merkle-tree-metadata/Cargo.toml +++ b/program-libs/merkle-tree-metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-merkle-tree-metadata" -version = "0.3.0" +version = "0.4.0" description = "Merkle tree metadata for light-concurrent-merkle-tree, light-indexed-merkle-tree, light-batched-merkle-tree." repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" diff --git a/program-libs/verifier/Cargo.toml b/program-libs/verifier/Cargo.toml index f43ecbc597..7e6d9fab16 100644 --- a/program-libs/verifier/Cargo.toml +++ b/program-libs/verifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-verifier" -version = "2.1.0" +version = "3.0.0" description = "ZKP proof verifier used in Light Protocol" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" diff --git a/program-libs/zero-copy-derive/Cargo.toml b/program-libs/zero-copy-derive/Cargo.toml index 1cdc8254e8..ca5248e12b 100644 --- a/program-libs/zero-copy-derive/Cargo.toml +++ b/program-libs/zero-copy-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-zero-copy-derive" -version = "0.1.0" +version = "0.3.0" edition = "2021" license = "Apache-2.0" description = "Proc macro for zero-copy deserialization" @@ -19,8 +19,4 @@ syn = { version = "2.0", features = ["full", "extra-traits"] } lazy_static = "1.4" [dev-dependencies] -trybuild = "1.0" -rand = "0.8" -borsh = { workspace = true } -light-zero-copy = { workspace = true, features = ["std", "derive"] } -zerocopy = { workspace = true, features = ["derive"] } +rand = { workspace = true } diff --git a/program-libs/zero-copy/Cargo.toml b/program-libs/zero-copy/Cargo.toml index 67c2728d63..ba1ceb2691 100644 --- a/program-libs/zero-copy/Cargo.toml +++ b/program-libs/zero-copy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-zero-copy" -version = "0.2.0" +version = "0.3.0" description = "Zero copy vector and utils for Solana programs." repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" @@ -24,3 +24,5 @@ light-zero-copy-derive = { workspace = true, optional = true } rand = { workspace = true } zerocopy = { workspace = true, features = ["derive"] } borsh = { workspace = true } +trybuild = "1.0" +light-zero-copy-derive = { workspace = true } diff --git a/program-libs/zero-copy-derive/tests/instruction_data.rs b/program-libs/zero-copy/tests/derive/instruction_data.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/instruction_data.rs rename to program-libs/zero-copy/tests/derive/instruction_data.rs index e2a1be8926..9ad02cef54 100644 --- a/program-libs/zero-copy-derive/tests/instruction_data.rs +++ b/program-libs/zero-copy/tests/derive/instruction_data.rs @@ -15,13 +15,13 @@ use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout, Ref, Unaligned}; Copy, PartialEq, Clone, + Default, Immutable, FromBytes, IntoBytes, KnownLayout, BorshDeserialize, BorshSerialize, - Default, Unaligned, )] #[repr(C)] diff --git a/program-libs/zero-copy/tests/derive/main.rs b/program-libs/zero-copy/tests/derive/main.rs new file mode 100644 index 0000000000..597d5b4da1 --- /dev/null +++ b/program-libs/zero-copy/tests/derive/main.rs @@ -0,0 +1,5 @@ +#![cfg(feature = "mut")] + +pub mod instruction_data; +mod random; +mod ui; diff --git a/program-libs/zero-copy-derive/tests/random.rs b/program-libs/zero-copy/tests/derive/random.rs similarity index 99% rename from program-libs/zero-copy-derive/tests/random.rs rename to program-libs/zero-copy/tests/derive/random.rs index 41bfcc01fb..187eece048 100644 --- a/program-libs/zero-copy-derive/tests/random.rs +++ b/program-libs/zero-copy/tests/derive/random.rs @@ -9,7 +9,7 @@ use rand::{ Rng, }; -mod instruction_data; +use super::instruction_data; use instruction_data::{ CompressedAccount, CompressedAccountConfig, diff --git a/program-libs/zero-copy-derive/tests/ui.rs b/program-libs/zero-copy/tests/derive/ui.rs similarity index 68% rename from program-libs/zero-copy-derive/tests/ui.rs rename to program-libs/zero-copy/tests/derive/ui.rs index 473ff1aa0d..028701a7e4 100644 --- a/program-libs/zero-copy-derive/tests/ui.rs +++ b/program-libs/zero-copy/tests/derive/ui.rs @@ -6,10 +6,10 @@ fn ui_tests() { let t = trybuild::TestCases::new(); // Test cases that should compile successfully - t.pass("tests/ui/pass/*.rs"); + t.pass("tests/derive/ui/pass/*.rs"); // Test cases that should fail compilation with helpful error messages - //t.compile_fail("tests/ui/fail/*.rs"); + //t.compile_fail("tests/derive/ui/fail/*.rs"); } #[test] @@ -17,6 +17,6 @@ fn ui_tests_zerocopy_mut() { let t = trybuild::TestCases::new(); // Test ZeroCopyMut-specific cases - t.pass("tests/ui/pass_mut/*.rs"); - t.compile_fail("tests/ui/fail_mut/*.rs"); + t.pass("tests/derive/ui/pass_mut/*.rs"); + t.compile_fail("tests/derive/ui/fail_mut/*.rs"); } diff --git a/program-libs/zero-copy-derive/tests/ui/fail/01_empty_struct.rs b/program-libs/zero-copy/tests/derive/ui/fail/01_empty_struct.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/01_empty_struct.rs rename to program-libs/zero-copy/tests/derive/ui/fail/01_empty_struct.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/01_empty_struct.stderr b/program-libs/zero-copy/tests/derive/ui/fail/01_empty_struct.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/01_empty_struct.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/01_empty_struct.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/07_tuple_struct.rs b/program-libs/zero-copy/tests/derive/ui/fail/07_tuple_struct.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/07_tuple_struct.rs rename to program-libs/zero-copy/tests/derive/ui/fail/07_tuple_struct.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/07_tuple_struct.stderr b/program-libs/zero-copy/tests/derive/ui/fail/07_tuple_struct.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/07_tuple_struct.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/07_tuple_struct.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/08_newtype_pattern.rs b/program-libs/zero-copy/tests/derive/ui/fail/08_newtype_pattern.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/08_newtype_pattern.rs rename to program-libs/zero-copy/tests/derive/ui/fail/08_newtype_pattern.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/08_newtype_pattern.stderr b/program-libs/zero-copy/tests/derive/ui/fail/08_newtype_pattern.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/08_newtype_pattern.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/08_newtype_pattern.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/47_tuple_struct_empty.rs b/program-libs/zero-copy/tests/derive/ui/fail/47_tuple_struct_empty.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/47_tuple_struct_empty.rs rename to program-libs/zero-copy/tests/derive/ui/fail/47_tuple_struct_empty.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/47_tuple_struct_empty.stderr b/program-libs/zero-copy/tests/derive/ui/fail/47_tuple_struct_empty.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/47_tuple_struct_empty.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/47_tuple_struct_empty.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/48_tuple_single_field.rs b/program-libs/zero-copy/tests/derive/ui/fail/48_tuple_single_field.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/48_tuple_single_field.rs rename to program-libs/zero-copy/tests/derive/ui/fail/48_tuple_single_field.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/48_tuple_single_field.stderr b/program-libs/zero-copy/tests/derive/ui/fail/48_tuple_single_field.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/48_tuple_single_field.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/48_tuple_single_field.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/54_floating_point_types.rs b/program-libs/zero-copy/tests/derive/ui/fail/54_floating_point_types.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/54_floating_point_types.rs rename to program-libs/zero-copy/tests/derive/ui/fail/54_floating_point_types.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/54_floating_point_types.stderr b/program-libs/zero-copy/tests/derive/ui/fail/54_floating_point_types.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/54_floating_point_types.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/54_floating_point_types.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/55_usize_isize_types.rs b/program-libs/zero-copy/tests/derive/ui/fail/55_usize_isize_types.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/55_usize_isize_types.rs rename to program-libs/zero-copy/tests/derive/ui/fail/55_usize_isize_types.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/55_usize_isize_types.stderr b/program-libs/zero-copy/tests/derive/ui/fail/55_usize_isize_types.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/55_usize_isize_types.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/55_usize_isize_types.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/58_array_of_options.rs b/program-libs/zero-copy/tests/derive/ui/fail/58_array_of_options.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/58_array_of_options.rs rename to program-libs/zero-copy/tests/derive/ui/fail/58_array_of_options.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/58_array_of_options.stderr b/program-libs/zero-copy/tests/derive/ui/fail/58_array_of_options.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/58_array_of_options.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/58_array_of_options.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/67_char_type.rs b/program-libs/zero-copy/tests/derive/ui/fail/67_char_type.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/67_char_type.rs rename to program-libs/zero-copy/tests/derive/ui/fail/67_char_type.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/67_char_type.stderr b/program-libs/zero-copy/tests/derive/ui/fail/67_char_type.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/67_char_type.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/67_char_type.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/missing_repr_c.rs b/program-libs/zero-copy/tests/derive/ui/fail/missing_repr_c.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/missing_repr_c.rs rename to program-libs/zero-copy/tests/derive/ui/fail/missing_repr_c.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/missing_repr_c.stderr b/program-libs/zero-copy/tests/derive/ui/fail/missing_repr_c.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/missing_repr_c.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/missing_repr_c.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/unsupported_field_type.rs b/program-libs/zero-copy/tests/derive/ui/fail/unsupported_field_type.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/unsupported_field_type.rs rename to program-libs/zero-copy/tests/derive/ui/fail/unsupported_field_type.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/unsupported_field_type.stderr b/program-libs/zero-copy/tests/derive/ui/fail/unsupported_field_type.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/unsupported_field_type.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/unsupported_field_type.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/unsupported_tuple_struct.rs b/program-libs/zero-copy/tests/derive/ui/fail/unsupported_tuple_struct.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/unsupported_tuple_struct.rs rename to program-libs/zero-copy/tests/derive/ui/fail/unsupported_tuple_struct.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/unsupported_tuple_struct.stderr b/program-libs/zero-copy/tests/derive/ui/fail/unsupported_tuple_struct.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/unsupported_tuple_struct.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/unsupported_tuple_struct.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail/unsupported_union.rs b/program-libs/zero-copy/tests/derive/ui/fail/unsupported_union.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/unsupported_union.rs rename to program-libs/zero-copy/tests/derive/ui/fail/unsupported_union.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail/unsupported_union.stderr b/program-libs/zero-copy/tests/derive/ui/fail/unsupported_union.stderr similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail/unsupported_union.stderr rename to program-libs/zero-copy/tests/derive/ui/fail/unsupported_union.stderr diff --git a/program-libs/zero-copy-derive/tests/ui/fail_mut/missing_repr_c_mut.rs b/program-libs/zero-copy/tests/derive/ui/fail_mut/missing_repr_c_mut.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/fail_mut/missing_repr_c_mut.rs rename to program-libs/zero-copy/tests/derive/ui/fail_mut/missing_repr_c_mut.rs diff --git a/program-libs/zero-copy-derive/tests/ui/fail_mut/missing_repr_c_mut.stderr b/program-libs/zero-copy/tests/derive/ui/fail_mut/missing_repr_c_mut.stderr similarity index 84% rename from program-libs/zero-copy-derive/tests/ui/fail_mut/missing_repr_c_mut.stderr rename to program-libs/zero-copy/tests/derive/ui/fail_mut/missing_repr_c_mut.stderr index e6797a2e9d..9e3381adb9 100644 --- a/program-libs/zero-copy-derive/tests/ui/fail_mut/missing_repr_c_mut.stderr +++ b/program-libs/zero-copy/tests/derive/ui/fail_mut/missing_repr_c_mut.stderr @@ -1,5 +1,5 @@ error: ZeroCopyMut requires #[repr(C)] attribute for memory layout safety. Add #[repr(C)] above the zerocopymut declaration. - --> tests/ui/fail_mut/missing_repr_c_mut.rs:4:10 + --> tests/derive/ui/fail_mut/missing_repr_c_mut.rs:4:10 | 4 | #[derive(ZeroCopyMut)] | ^^^^^^^^^^^ diff --git a/program-libs/zero-copy-derive/tests/ui/pass/02_single_u8_field.rs b/program-libs/zero-copy/tests/derive/ui/pass/02_single_u8_field.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/02_single_u8_field.rs rename to program-libs/zero-copy/tests/derive/ui/pass/02_single_u8_field.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/03_all_primitives.rs b/program-libs/zero-copy/tests/derive/ui/pass/03_all_primitives.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/03_all_primitives.rs rename to program-libs/zero-copy/tests/derive/ui/pass/03_all_primitives.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/04_nested_vecs.rs b/program-libs/zero-copy/tests/derive/ui/pass/04_nested_vecs.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/04_nested_vecs.rs rename to program-libs/zero-copy/tests/derive/ui/pass/04_nested_vecs.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/05_nested_options.rs b/program-libs/zero-copy/tests/derive/ui/pass/05_nested_options.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/05_nested_options.rs rename to program-libs/zero-copy/tests/derive/ui/pass/05_nested_options.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/06_array_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/06_array_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/06_array_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/06_array_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/09_enum_unit_variants.rs b/program-libs/zero-copy/tests/derive/ui/pass/09_enum_unit_variants.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/09_enum_unit_variants.rs rename to program-libs/zero-copy/tests/derive/ui/pass/09_enum_unit_variants.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/10_enum_mixed_variants.rs b/program-libs/zero-copy/tests/derive/ui/pass/10_enum_mixed_variants.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/10_enum_mixed_variants.rs rename to program-libs/zero-copy/tests/derive/ui/pass/10_enum_mixed_variants.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/11_pubkey_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/11_pubkey_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/11_pubkey_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/11_pubkey_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/12_mixed_visibility.rs b/program-libs/zero-copy/tests/derive/ui/pass/12_mixed_visibility.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/12_mixed_visibility.rs rename to program-libs/zero-copy/tests/derive/ui/pass/12_mixed_visibility.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/13_large_struct.rs b/program-libs/zero-copy/tests/derive/ui/pass/13_large_struct.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/13_large_struct.rs rename to program-libs/zero-copy/tests/derive/ui/pass/13_large_struct.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/14_vec_of_arrays.rs b/program-libs/zero-copy/tests/derive/ui/pass/14_vec_of_arrays.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/14_vec_of_arrays.rs rename to program-libs/zero-copy/tests/derive/ui/pass/14_vec_of_arrays.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/15_option_vec.rs b/program-libs/zero-copy/tests/derive/ui/pass/15_option_vec.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/15_option_vec.rs rename to program-libs/zero-copy/tests/derive/ui/pass/15_option_vec.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/16_bool_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/16_bool_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/16_bool_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/16_bool_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/17_signed_integers.rs b/program-libs/zero-copy/tests/derive/ui/pass/17_signed_integers.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/17_signed_integers.rs rename to program-libs/zero-copy/tests/derive/ui/pass/17_signed_integers.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/18_zero_sized_arrays.rs b/program-libs/zero-copy/tests/derive/ui/pass/18_zero_sized_arrays.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/18_zero_sized_arrays.rs rename to program-libs/zero-copy/tests/derive/ui/pass/18_zero_sized_arrays.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/19_max_sized_array.rs b/program-libs/zero-copy/tests/derive/ui/pass/19_max_sized_array.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/19_max_sized_array.rs rename to program-libs/zero-copy/tests/derive/ui/pass/19_max_sized_array.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/20_nested_struct_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/20_nested_struct_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/20_nested_struct_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/20_nested_struct_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/21_enum_single_variant.rs b/program-libs/zero-copy/tests/derive/ui/pass/21_enum_single_variant.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/21_enum_single_variant.rs rename to program-libs/zero-copy/tests/derive/ui/pass/21_enum_single_variant.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/22_primitive_after_vec.rs b/program-libs/zero-copy/tests/derive/ui/pass/22_primitive_after_vec.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/22_primitive_after_vec.rs rename to program-libs/zero-copy/tests/derive/ui/pass/22_primitive_after_vec.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/23_multiple_options_after_vec.rs b/program-libs/zero-copy/tests/derive/ui/pass/23_multiple_options_after_vec.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/23_multiple_options_after_vec.rs rename to program-libs/zero-copy/tests/derive/ui/pass/23_multiple_options_after_vec.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/24_vec_option_vec.rs b/program-libs/zero-copy/tests/derive/ui/pass/24_vec_option_vec.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/24_vec_option_vec.rs rename to program-libs/zero-copy/tests/derive/ui/pass/24_vec_option_vec.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/25_all_optional.rs b/program-libs/zero-copy/tests/derive/ui/pass/25_all_optional.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/25_all_optional.rs rename to program-libs/zero-copy/tests/derive/ui/pass/25_all_optional.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/26_deep_nesting.rs b/program-libs/zero-copy/tests/derive/ui/pass/26_deep_nesting.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/26_deep_nesting.rs rename to program-libs/zero-copy/tests/derive/ui/pass/26_deep_nesting.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/27_mixed_arrays.rs b/program-libs/zero-copy/tests/derive/ui/pass/27_mixed_arrays.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/27_mixed_arrays.rs rename to program-libs/zero-copy/tests/derive/ui/pass/27_mixed_arrays.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/28_field_named_data.rs b/program-libs/zero-copy/tests/derive/ui/pass/28_field_named_data.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/28_field_named_data.rs rename to program-libs/zero-copy/tests/derive/ui/pass/28_field_named_data.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/29_field_named_bytes.rs b/program-libs/zero-copy/tests/derive/ui/pass/29_field_named_bytes.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/29_field_named_bytes.rs rename to program-libs/zero-copy/tests/derive/ui/pass/29_field_named_bytes.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/30_underscore_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/30_underscore_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/30_underscore_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/30_underscore_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/31_numeric_suffix_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/31_numeric_suffix_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/31_numeric_suffix_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/31_numeric_suffix_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/32_camel_case_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/32_camel_case_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/32_camel_case_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/32_camel_case_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/33_single_letter_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/33_single_letter_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/33_single_letter_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/33_single_letter_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/34_vec_of_bools.rs b/program-libs/zero-copy/tests/derive/ui/pass/34_vec_of_bools.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/34_vec_of_bools.rs rename to program-libs/zero-copy/tests/derive/ui/pass/34_vec_of_bools.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/35_option_bool.rs b/program-libs/zero-copy/tests/derive/ui/pass/35_option_bool.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/35_option_bool.rs rename to program-libs/zero-copy/tests/derive/ui/pass/35_option_bool.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/36_array_of_bools.rs b/program-libs/zero-copy/tests/derive/ui/pass/36_array_of_bools.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/36_array_of_bools.rs rename to program-libs/zero-copy/tests/derive/ui/pass/36_array_of_bools.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/37_meta_boundary_primitive.rs b/program-libs/zero-copy/tests/derive/ui/pass/37_meta_boundary_primitive.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/37_meta_boundary_primitive.rs rename to program-libs/zero-copy/tests/derive/ui/pass/37_meta_boundary_primitive.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/38_meta_boundary_option.rs b/program-libs/zero-copy/tests/derive/ui/pass/38_meta_boundary_option.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/38_meta_boundary_option.rs rename to program-libs/zero-copy/tests/derive/ui/pass/38_meta_boundary_option.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/39_enum_with_array.rs b/program-libs/zero-copy/tests/derive/ui/pass/39_enum_with_array.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/39_enum_with_array.rs rename to program-libs/zero-copy/tests/derive/ui/pass/39_enum_with_array.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/40_enum_discriminant_order.rs b/program-libs/zero-copy/tests/derive/ui/pass/40_enum_discriminant_order.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/40_enum_discriminant_order.rs rename to program-libs/zero-copy/tests/derive/ui/pass/40_enum_discriminant_order.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/41_struct_with_lifetime_name.rs b/program-libs/zero-copy/tests/derive/ui/pass/41_struct_with_lifetime_name.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/41_struct_with_lifetime_name.rs rename to program-libs/zero-copy/tests/derive/ui/pass/41_struct_with_lifetime_name.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/42_reserved_keywords.rs b/program-libs/zero-copy/tests/derive/ui/pass/42_reserved_keywords.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/42_reserved_keywords.rs rename to program-libs/zero-copy/tests/derive/ui/pass/42_reserved_keywords.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/43_alternating_types.rs b/program-libs/zero-copy/tests/derive/ui/pass/43_alternating_types.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/43_alternating_types.rs rename to program-libs/zero-copy/tests/derive/ui/pass/43_alternating_types.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/44_all_vecs.rs b/program-libs/zero-copy/tests/derive/ui/pass/44_all_vecs.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/44_all_vecs.rs rename to program-libs/zero-copy/tests/derive/ui/pass/44_all_vecs.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/45_single_vec.rs b/program-libs/zero-copy/tests/derive/ui/pass/45_single_vec.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/45_single_vec.rs rename to program-libs/zero-copy/tests/derive/ui/pass/45_single_vec.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/46_single_option.rs b/program-libs/zero-copy/tests/derive/ui/pass/46_single_option.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/46_single_option.rs rename to program-libs/zero-copy/tests/derive/ui/pass/46_single_option.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/49_max_meta_fields.rs b/program-libs/zero-copy/tests/derive/ui/pass/49_max_meta_fields.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/49_max_meta_fields.rs rename to program-libs/zero-copy/tests/derive/ui/pass/49_max_meta_fields.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/50_combination_all_features.rs b/program-libs/zero-copy/tests/derive/ui/pass/50_combination_all_features.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/50_combination_all_features.rs rename to program-libs/zero-copy/tests/derive/ui/pass/50_combination_all_features.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/51_deep_nested_structs.rs b/program-libs/zero-copy/tests/derive/ui/pass/51_deep_nested_structs.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/51_deep_nested_structs.rs rename to program-libs/zero-copy/tests/derive/ui/pass/51_deep_nested_structs.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/52_enum_containing_struct.rs b/program-libs/zero-copy/tests/derive/ui/pass/52_enum_containing_struct.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/52_enum_containing_struct.rs rename to program-libs/zero-copy/tests/derive/ui/pass/52_enum_containing_struct.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/53_enum_containing_vec.rs b/program-libs/zero-copy/tests/derive/ui/pass/53_enum_containing_vec.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/53_enum_containing_vec.rs rename to program-libs/zero-copy/tests/derive/ui/pass/53_enum_containing_vec.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/56_all_derives.rs b/program-libs/zero-copy/tests/derive/ui/pass/56_all_derives.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/56_all_derives.rs rename to program-libs/zero-copy/tests/derive/ui/pass/56_all_derives.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/57_option_of_array.rs b/program-libs/zero-copy/tests/derive/ui/pass/57_option_of_array.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/57_option_of_array.rs rename to program-libs/zero-copy/tests/derive/ui/pass/57_option_of_array.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/59_vec_of_options.rs b/program-libs/zero-copy/tests/derive/ui/pass/59_vec_of_options.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/59_vec_of_options.rs rename to program-libs/zero-copy/tests/derive/ui/pass/59_vec_of_options.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/60_option_pubkey.rs b/program-libs/zero-copy/tests/derive/ui/pass/60_option_pubkey.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/60_option_pubkey.rs rename to program-libs/zero-copy/tests/derive/ui/pass/60_option_pubkey.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/61_vec_pubkey.rs b/program-libs/zero-copy/tests/derive/ui/pass/61_vec_pubkey.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/61_vec_pubkey.rs rename to program-libs/zero-copy/tests/derive/ui/pass/61_vec_pubkey.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/62_array_pubkey.rs b/program-libs/zero-copy/tests/derive/ui/pass/62_array_pubkey.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/62_array_pubkey.rs rename to program-libs/zero-copy/tests/derive/ui/pass/62_array_pubkey.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/63_arrays_only.rs b/program-libs/zero-copy/tests/derive/ui/pass/63_arrays_only.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/63_arrays_only.rs rename to program-libs/zero-copy/tests/derive/ui/pass/63_arrays_only.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/64_option_first_field.rs b/program-libs/zero-copy/tests/derive/ui/pass/64_option_first_field.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/64_option_first_field.rs rename to program-libs/zero-copy/tests/derive/ui/pass/64_option_first_field.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/65_vec_of_vec.rs b/program-libs/zero-copy/tests/derive/ui/pass/65_vec_of_vec.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/65_vec_of_vec.rs rename to program-libs/zero-copy/tests/derive/ui/pass/65_vec_of_vec.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/66_triple_nested_option.rs b/program-libs/zero-copy/tests/derive/ui/pass/66_triple_nested_option.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/66_triple_nested_option.rs rename to program-libs/zero-copy/tests/derive/ui/pass/66_triple_nested_option.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/68_enum_containing_option.rs b/program-libs/zero-copy/tests/derive/ui/pass/68_enum_containing_option.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/68_enum_containing_option.rs rename to program-libs/zero-copy/tests/derive/ui/pass/68_enum_containing_option.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/69_very_long_field_names.rs b/program-libs/zero-copy/tests/derive/ui/pass/69_very_long_field_names.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/69_very_long_field_names.rs rename to program-libs/zero-copy/tests/derive/ui/pass/69_very_long_field_names.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/70_rust_type_field_names.rs b/program-libs/zero-copy/tests/derive/ui/pass/70_rust_type_field_names.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/70_rust_type_field_names.rs rename to program-libs/zero-copy/tests/derive/ui/pass/70_rust_type_field_names.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/basic_enum.rs b/program-libs/zero-copy/tests/derive/ui/pass/basic_enum.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/basic_enum.rs rename to program-libs/zero-copy/tests/derive/ui/pass/basic_enum.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/basic_struct.rs b/program-libs/zero-copy/tests/derive/ui/pass/basic_struct.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/basic_struct.rs rename to program-libs/zero-copy/tests/derive/ui/pass/basic_struct.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/complex_enum.rs b/program-libs/zero-copy/tests/derive/ui/pass/complex_enum.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/complex_enum.rs rename to program-libs/zero-copy/tests/derive/ui/pass/complex_enum.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/readme.md b/program-libs/zero-copy/tests/derive/ui/pass/readme.md similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/readme.md rename to program-libs/zero-copy/tests/derive/ui/pass/readme.md diff --git a/program-libs/zero-copy-derive/tests/ui/pass/repr_c_packed_test.rs b/program-libs/zero-copy/tests/derive/ui/pass/repr_c_packed_test.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/repr_c_packed_test.rs rename to program-libs/zero-copy/tests/derive/ui/pass/repr_c_packed_test.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/with_arrays.rs b/program-libs/zero-copy/tests/derive/ui/pass/with_arrays.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/with_arrays.rs rename to program-libs/zero-copy/tests/derive/ui/pass/with_arrays.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/with_options.rs b/program-libs/zero-copy/tests/derive/ui/pass/with_options.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/with_options.rs rename to program-libs/zero-copy/tests/derive/ui/pass/with_options.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/with_pubkey.rs b/program-libs/zero-copy/tests/derive/ui/pass/with_pubkey.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/with_pubkey.rs rename to program-libs/zero-copy/tests/derive/ui/pass/with_pubkey.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass/with_vectors.rs b/program-libs/zero-copy/tests/derive/ui/pass/with_vectors.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass/with_vectors.rs rename to program-libs/zero-copy/tests/derive/ui/pass/with_vectors.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass_mut/basic_mut.rs b/program-libs/zero-copy/tests/derive/ui/pass_mut/basic_mut.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass_mut/basic_mut.rs rename to program-libs/zero-copy/tests/derive/ui/pass_mut/basic_mut.rs diff --git a/program-libs/zero-copy-derive/tests/ui/pass_mut/complex_mut.rs b/program-libs/zero-copy/tests/derive/ui/pass_mut/complex_mut.rs similarity index 100% rename from program-libs/zero-copy-derive/tests/ui/pass_mut/complex_mut.rs rename to program-libs/zero-copy/tests/derive/ui/pass_mut/complex_mut.rs diff --git a/program-tests/account-compression-test/Cargo.toml b/program-tests/account-compression-test/Cargo.toml index 6f07ddbc56..efc50b01e5 100644 --- a/program-tests/account-compression-test/Cargo.toml +++ b/program-tests/account-compression-test/Cargo.toml @@ -3,6 +3,7 @@ name = "account-compression-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/program-tests/batched-merkle-tree-test/Cargo.toml b/program-tests/batched-merkle-tree-test/Cargo.toml new file mode 100644 index 0000000000..131931c079 --- /dev/null +++ b/program-tests/batched-merkle-tree-test/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "batched-merkle-tree-tests" +version = "0.1.0" +description = "Batch Merkle tree integration tests." +repository = "https://github.com/Lightprotocol/light-protocol" +license = "Apache-2.0" +edition = "2021" +publish = false + +[dev-dependencies] +light-batched-merkle-tree = { workspace = true , features = ["test-only", "solana"]} +rand = { workspace = true } +light-prover-client = { workspace = true, features = ["devenv"] } +light-merkle-tree-reference = { workspace = true } +tokio = { workspace = true } +serial_test = { workspace = true } +light-account-checks = { workspace = true, features = ["test-only"] } +light-compressed-account = { workspace = true, features = ["new-unique"] } +light-test-utils = { workspace = true, features = ["test-only"] } +light-hasher = { workspace = true, features = ["solana"] } +light-bloom-filter = { workspace = true, features = ["solana"] } +light-zero-copy = { workspace = true } +solana-pubkey = { workspace = true } +light-merkle-tree-metadata = { workspace = true } + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ['cfg(target_os, values("solana"))'] diff --git a/program-tests/batched-merkle-tree-test/src/lib.rs b/program-tests/batched-merkle-tree-test/src/lib.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/program-tests/batched-merkle-tree-test/src/lib.rs @@ -0,0 +1 @@ + diff --git a/program-libs/batched-merkle-tree/tests/account_access.rs b/program-tests/batched-merkle-tree-test/tests/account_access.rs similarity index 99% rename from program-libs/batched-merkle-tree/tests/account_access.rs rename to program-tests/batched-merkle-tree-test/tests/account_access.rs index ff45f13724..4e695d8f43 100644 --- a/program-libs/batched-merkle-tree/tests/account_access.rs +++ b/program-tests/batched-merkle-tree-test/tests/account_access.rs @@ -1,6 +1,3 @@ -#![cfg(feature = "test-only")] -#![cfg(feature = "solana")] - use light_account_checks::account_info::test_account_info::solana_program::TestAccount; use light_batched_merkle_tree::{ constants::{ACCOUNT_COMPRESSION_PROGRAM_ID, ADDRESS_TREE_INIT_ROOT_40}, diff --git a/program-libs/batched-merkle-tree/tests/initialize_address_tree.rs b/program-tests/batched-merkle-tree-test/tests/initialize_address_tree.rs similarity index 100% rename from program-libs/batched-merkle-tree/tests/initialize_address_tree.rs rename to program-tests/batched-merkle-tree-test/tests/initialize_address_tree.rs diff --git a/program-libs/batched-merkle-tree/tests/initialize_state_tree.rs b/program-tests/batched-merkle-tree-test/tests/initialize_state_tree.rs similarity index 100% rename from program-libs/batched-merkle-tree/tests/initialize_state_tree.rs rename to program-tests/batched-merkle-tree-test/tests/initialize_state_tree.rs diff --git a/program-libs/batched-merkle-tree/tests/merkle_tree.rs b/program-tests/batched-merkle-tree-test/tests/merkle_tree.rs similarity index 99% rename from program-libs/batched-merkle-tree/tests/merkle_tree.rs rename to program-tests/batched-merkle-tree-test/tests/merkle_tree.rs index 47a77ff87a..24f41dce39 100644 --- a/program-libs/batched-merkle-tree/tests/merkle_tree.rs +++ b/program-tests/batched-merkle-tree-test/tests/merkle_tree.rs @@ -1,4 +1,3 @@ -#![cfg(feature = "test-only")] #![allow(unused_assignments)] use std::cmp::min; diff --git a/program-libs/batched-merkle-tree/tests/queue.rs b/program-tests/batched-merkle-tree-test/tests/queue.rs similarity index 99% rename from program-libs/batched-merkle-tree/tests/queue.rs rename to program-tests/batched-merkle-tree-test/tests/queue.rs index d57c3fa686..38e0dbf958 100644 --- a/program-libs/batched-merkle-tree/tests/queue.rs +++ b/program-tests/batched-merkle-tree-test/tests/queue.rs @@ -1,4 +1,3 @@ -#![cfg(feature = "test-only")] use light_batched_merkle_tree::{ batch::Batch, constants::NUM_BATCHES, diff --git a/program-libs/batched-merkle-tree/tests/rollover_address_tree.rs b/program-tests/batched-merkle-tree-test/tests/rollover_address_tree.rs similarity index 99% rename from program-libs/batched-merkle-tree/tests/rollover_address_tree.rs rename to program-tests/batched-merkle-tree-test/tests/rollover_address_tree.rs index 09ac59bd15..5b73c98b64 100644 --- a/program-libs/batched-merkle-tree/tests/rollover_address_tree.rs +++ b/program-tests/batched-merkle-tree-test/tests/rollover_address_tree.rs @@ -1,4 +1,3 @@ -#![cfg(feature = "test-only")] use light_batched_merkle_tree::{ constants::NUM_BATCHES, errors::BatchedMerkleTreeError, diff --git a/program-libs/batched-merkle-tree/tests/rollover_state_tree.rs b/program-tests/batched-merkle-tree-test/tests/rollover_state_tree.rs similarity index 99% rename from program-libs/batched-merkle-tree/tests/rollover_state_tree.rs rename to program-tests/batched-merkle-tree-test/tests/rollover_state_tree.rs index 2f74e63f19..4b4f0e985b 100644 --- a/program-libs/batched-merkle-tree/tests/rollover_state_tree.rs +++ b/program-tests/batched-merkle-tree-test/tests/rollover_state_tree.rs @@ -1,4 +1,3 @@ -#![cfg(feature = "test-only")] use light_batched_merkle_tree::{ errors::BatchedMerkleTreeError, initialize_state_tree::{ diff --git a/program-tests/compressed-token-test/Cargo.toml b/program-tests/compressed-token-test/Cargo.toml index 8f7ba53810..9e3aa84e8a 100644 --- a/program-tests/compressed-token-test/Cargo.toml +++ b/program-tests/compressed-token-test/Cargo.toml @@ -3,6 +3,7 @@ name = "compressed-token-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/program-tests/create-address-test-program/Cargo.toml b/program-tests/create-address-test-program/Cargo.toml index 6a94aa779f..ba7ed0438e 100644 --- a/program-tests/create-address-test-program/Cargo.toml +++ b/program-tests/create-address-test-program/Cargo.toml @@ -5,6 +5,7 @@ description = "Test program using generalized account compression" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/program-tests/e2e-test/Cargo.toml b/program-tests/e2e-test/Cargo.toml index c426ba18d2..eb711647c5 100644 --- a/program-tests/e2e-test/Cargo.toml +++ b/program-tests/e2e-test/Cargo.toml @@ -3,6 +3,7 @@ name = "e2e-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/program-tests/registry-test/Cargo.toml b/program-tests/registry-test/Cargo.toml index 3712c6d286..42bd2846d0 100644 --- a/program-tests/registry-test/Cargo.toml +++ b/program-tests/registry-test/Cargo.toml @@ -3,6 +3,7 @@ name = "registry-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/program-tests/system-cpi-test/Cargo.toml b/program-tests/system-cpi-test/Cargo.toml index b84dc81a96..dde01c17c3 100644 --- a/program-tests/system-cpi-test/Cargo.toml +++ b/program-tests/system-cpi-test/Cargo.toml @@ -5,6 +5,7 @@ description = "Test program using generalized account compression" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/program-tests/system-cpi-v2-test/Cargo.toml b/program-tests/system-cpi-v2-test/Cargo.toml index 6c0fb0c08d..8093e50f65 100644 --- a/program-tests/system-cpi-v2-test/Cargo.toml +++ b/program-tests/system-cpi-v2-test/Cargo.toml @@ -5,6 +5,7 @@ description = "Test program using generalized account compression" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/program-tests/system-test/Cargo.toml b/program-tests/system-test/Cargo.toml index 9e5d07ebf3..3ef28c6aa1 100644 --- a/program-tests/system-test/Cargo.toml +++ b/program-tests/system-test/Cargo.toml @@ -3,6 +3,7 @@ name = "system-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/program-tests/utils/Cargo.toml b/program-tests/utils/Cargo.toml index 5ac0d3d6e6..00cb536fc3 100644 --- a/program-tests/utils/Cargo.toml +++ b/program-tests/utils/Cargo.toml @@ -5,6 +5,7 @@ description = "Utilities used in Light Protocol program tests" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [features] default = [] diff --git a/programs/account-compression/Cargo.toml b/programs/account-compression/Cargo.toml index 80cbb95903..cbe50c45ab 100644 --- a/programs/account-compression/Cargo.toml +++ b/programs/account-compression/Cargo.toml @@ -5,6 +5,7 @@ description = "Solana account compression program" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/programs/compressed-token/Cargo.toml b/programs/compressed-token/Cargo.toml index 4c1604dcdf..1ed38de11d 100644 --- a/programs/compressed-token/Cargo.toml +++ b/programs/compressed-token/Cargo.toml @@ -5,6 +5,7 @@ description = "Generalized token compression on Solana" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/programs/registry/Cargo.toml b/programs/registry/Cargo.toml index 9bb0937d59..2fb2645575 100644 --- a/programs/registry/Cargo.toml +++ b/programs/registry/Cargo.toml @@ -5,6 +5,7 @@ description = "Light core protocol logic" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/programs/system/Cargo.toml b/programs/system/Cargo.toml index 1134ca19a5..9817ee655f 100644 --- a/programs/system/Cargo.toml +++ b/programs/system/Cargo.toml @@ -5,6 +5,7 @@ description = "ZK Compression on Solana" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/scripts/create-release-pr.sh b/scripts/create-release-pr.sh new file mode 100755 index 0000000000..d4871e302f --- /dev/null +++ b/scripts/create-release-pr.sh @@ -0,0 +1,184 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Create release PR with current changes +# Usage: ./scripts/create-release-pr.sh [target-branch] +# Arguments: +# release-type: Type of release (program-libs or sdk-libs) +# target-branch: Branch to compare against (default: origin/main) + +if [ $# -lt 1 ] || [ $# -gt 2 ]; then + echo "Usage: $0 [target-branch]" + exit 1 +fi + +RELEASE_TYPE=$1 +TARGET_BRANCH="${2:-origin/main}" + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +if [[ ! "$RELEASE_TYPE" =~ ^(program-libs|sdk-libs)$ ]]; then + echo "Error: Release type must be 'program-libs' or 'sdk-libs'" + exit 1 +fi + +# Function to get version changes between two git refs +# Output format: One line per package: "package-name old-version new-version" +get_version_changes() { + local base_ref="$1" + local head_ref="$2" + + # Fetch if comparing against remote refs + if [[ "$base_ref" == origin/* ]]; then + local branch="${base_ref#origin/}" + git fetch origin "$branch" 2>/dev/null || true + fi + + # Get list of changed Cargo.toml files in program-libs, sdk-libs, and program-tests/merkle-tree + for file in $(git diff "$base_ref"..."$head_ref" --name-only -- '**/Cargo.toml' | grep -E '(program-libs|sdk-libs|program-tests/merkle-tree)/'); do + # Extract old and new version from the diff + local versions=$(git diff "$base_ref"..."$head_ref" "$file" | grep -E '^\+version|^-version' | grep -v '+++\|---') + local old_ver=$(echo "$versions" | grep '^-version' | head -1 | awk -F'"' '{print $2}') + local new_ver=$(echo "$versions" | grep '^\+version' | head -1 | awk -F'"' '{print $2}') + + # Only process if version actually changed + if [ -n "$old_ver" ] && [ -n "$new_ver" ] && [ "$old_ver" != "$new_ver" ]; then + # Extract actual package name from Cargo.toml + local pkg_name=$(grep '^name = ' "$file" | head -1 | awk -F'"' '{print $2}') + + if [ -n "$pkg_name" ]; then + echo "$pkg_name $old_ver $new_ver" + fi + fi + done +} + +# Check if there are changes +if git diff --quiet; then + echo "No changes detected. Please bump versions first." + exit 1 +fi + +echo "=========================================" +echo "Creating $RELEASE_TYPE release PR" +echo "=========================================" +echo "" + +# Show what changed +echo "Changed files:" +git diff --name-only | grep Cargo.toml || echo " (no Cargo.toml changes)" +echo "" + +# Detect packages with version changes +echo "Detecting packages with version changes..." +echo "Comparing against: $TARGET_BRANCH" +echo "" + +# Get version changes using the function +VERSION_CHANGES_RAW=$(get_version_changes "$TARGET_BRANCH" "HEAD") + +# Build packages array and formatted version changes +PACKAGES=() +VERSION_CHANGES="" +while IFS= read -r line; do + if [ -n "$line" ]; then + read -r pkg old_ver new_ver <<< "$line" + PACKAGES+=("$pkg") + VERSION_CHANGES="${VERSION_CHANGES} ${pkg}: ${old_ver} → ${new_ver}\n" + fi +done <<< "$VERSION_CHANGES_RAW" + +VERSION_CHANGES=$(echo -e "$VERSION_CHANGES") + +echo "Version changes:" +echo "$VERSION_CHANGES" + +# Create release branch +BRANCH_NAME="release/${RELEASE_TYPE}" +PR_TITLE="chore: bump ${RELEASE_TYPE} versions" + +echo "Will create:" +echo " Branch: $BRANCH_NAME" +echo " PR: $PR_TITLE" +echo "" +read -p "Create release branch and PR with these changes? (y/N) " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Cancelled." + exit 1 +fi + +echo "" +echo "=========================================" +echo "Running cargo release dry-run validation..." +echo "=========================================" +echo "" + +# Validate packages using the validation script +if "$SCRIPT_DIR/validate-packages.sh" "$TARGET_BRANCH" "HEAD"; then + echo "" + echo "✓ All crates validated successfully" +else + echo "" + echo "✗ Validation failed" + echo "" + echo "The GitHub Actions PR validation will run the same checks." + echo "Continue anyway and let CI validate? (y/N) " + read -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Cancelled." + exit 1 + fi +fi +echo "" + +echo "Creating release branch..." +git checkout -b "$BRANCH_NAME" + +# Commit changes +git add -A +git commit -m "chore(${RELEASE_TYPE}): bump versions" + +# Push branch +echo "Pushing branch to origin..." +git push -u origin "$BRANCH_NAME" + +# Create PR +echo "" +echo "Creating pull request..." + +# Capitalize first letter of release type (bash 3.2 compatible) +RELEASE_TYPE_CAPS="$(echo ${RELEASE_TYPE:0:1} | tr '[:lower:]' '[:upper:]')${RELEASE_TYPE:1}" + +# Build PR body with proper escaping +PR_BODY="## ${RELEASE_TYPE_CAPS} Release + +This PR bumps versions for ${RELEASE_TYPE} crates. + +### Version Bumps + +\`\`\` +${VERSION_CHANGES} +\`\`\` + +### Release Process +1. Versions bumped in Cargo.toml files +2. PR validation (dry-run) will run automatically +3. After merge, GitHub Action will publish each crate individually to crates.io and create releases + +--- +*Generated by \`scripts/create-release-pr.sh ${RELEASE_TYPE}\`*" + +gh pr create \ + --title "$PR_TITLE" \ + --body "$PR_BODY" \ + --label "release" + +echo "" +echo "Pull request created!" +echo "" +echo "Next steps:" +echo "1. Wait for PR checks to pass (dry-run validation)" +echo "2. Review and merge the PR" +echo "3. GitHub Action will automatically publish to crates.io and create releases" diff --git a/scripts/detect-version-changes.sh b/scripts/detect-version-changes.sh new file mode 100755 index 0000000000..3a31052d0d --- /dev/null +++ b/scripts/detect-version-changes.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Detect packages with version changes between two git refs +# Usage: ./scripts/detect-version-changes.sh [base-ref] [head-ref] +# Arguments: +# base-ref: Base reference to compare against (default: origin/main) +# head-ref: Head reference to compare (default: HEAD) +# Outputs: Space-separated list of package names to stdout + +BASE_REF="${1:-origin/main}" +HEAD_REF="${2:-HEAD}" + +# Fetch if comparing against remote refs +if [[ "$BASE_REF" == origin/* ]]; then + BRANCH="${BASE_REF#origin/}" + git fetch origin "$BRANCH" +fi + +# Extract packages with version changes +PACKAGES=() + +# Get list of changed Cargo.toml files in program-libs, sdk-libs, and program-tests/merkle-tree +for file in $(git diff "$BASE_REF"..."$HEAD_REF" --name-only -- '**/Cargo.toml' | grep -E '(program-libs|sdk-libs|program-tests/merkle-tree)/'); do + # Extract old and new version from the diff + versions=$(git diff "$BASE_REF"..."$HEAD_REF" "$file" | grep -E '^\+version|^-version' | grep -v '+++\|---') + old_ver=$(echo "$versions" | grep '^-version' | head -1 | awk -F'"' '{print $2}') + new_ver=$(echo "$versions" | grep '^\+version' | head -1 | awk -F'"' '{print $2}') + + # Only process if version actually changed + if [ -n "$old_ver" ] && [ -n "$new_ver" ] && [ "$old_ver" != "$new_ver" ]; then + # Extract actual package name from Cargo.toml + pkg_name=$(grep '^name = ' "$file" | head -1 | awk -F'"' '{print $2}') + + if [ -n "$pkg_name" ]; then + PACKAGES+=("$pkg_name") + fi + fi +done + +if [ ${#PACKAGES[@]} -eq 0 ]; then + echo "No packages with version changes detected" >&2 + exit 1 +fi + +# Output space-separated list to stdout +echo "${PACKAGES[*]}" diff --git a/scripts/validate-packages.sh b/scripts/validate-packages.sh new file mode 100755 index 0000000000..e304f07970 --- /dev/null +++ b/scripts/validate-packages.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Validate or publish packages using cargo-release +# Usage: +# ./scripts/validate-packages.sh [base-ref] [head-ref] # Dry-run validation +# ./scripts/validate-packages.sh --execute [base-ref] [head-ref] # Actual publish +# Arguments: +# --execute: Actually publish to crates.io (default: dry-run only) +# base-ref: Base reference to compare against (default: origin/main) +# head-ref: Head reference to compare (default: HEAD) +# Exits with 0 on success, 1 on failure + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Parse --execute flag +EXECUTE_FLAG="" +if [ "${1:-}" = "--execute" ]; then + EXECUTE_FLAG="--execute" + shift +fi + +BASE_REF="${1:-origin/main}" +HEAD_REF="${2:-HEAD}" + +echo "Detecting packages with version changes..." +echo "Comparing: $BASE_REF...$HEAD_REF" +echo "" + +# Detect packages using the detection script +PACKAGES_STRING=$("$SCRIPT_DIR/detect-version-changes.sh" "$BASE_REF" "$HEAD_REF") + +# Convert to array +read -ra PACKAGES <<< "$PACKAGES_STRING" + +if [ -n "$EXECUTE_FLAG" ]; then + echo "Publishing packages to crates.io..." +else + echo "Running dry-run validation for packages..." +fi +echo "Packages: ${PACKAGES[*]}" + +# Build package args for cargo-release +PACKAGE_ARGS="" +for pkg in "${PACKAGES[@]}"; do + PACKAGE_ARGS="$PACKAGE_ARGS -p $pkg" +done + +echo "" +if [ -n "$EXECUTE_FLAG" ]; then + echo "Running: cargo release publish $PACKAGE_ARGS --execute --no-confirm" +else + echo "Running: cargo release publish $PACKAGE_ARGS --allow-branch HEAD" +fi +echo "----------------------------------------" + +# cargo-release handles dependency ordering +# Without --execute: dry-run validation (allow HEAD for GitHub Actions detached checkout) +# With --execute: actual publish to crates.io (requires main or release/* branch) +if [ -n "$EXECUTE_FLAG" ]; then + cargo release publish $PACKAGE_ARGS --execute --no-confirm +else + cargo release publish $PACKAGE_ARGS --allow-branch HEAD +fi + +if [ $? -eq 0 ]; then + echo "" + if [ -n "$EXECUTE_FLAG" ]; then + echo "✓ All crates published successfully" + else + echo "✓ All crates validated successfully" + fi + exit 0 +else + echo "" + if [ -n "$EXECUTE_FLAG" ]; then + echo "✗ Publishing failed" + else + echo "✗ Validation failed" + fi + exit 1 +fi diff --git a/sdk-libs/client/Cargo.toml b/sdk-libs/client/Cargo.toml index 2bc1708dd7..f224066ed9 100644 --- a/sdk-libs/client/Cargo.toml +++ b/sdk-libs/client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-client" -version = "0.13.1" +version = "0.14.0" edition = "2021" license = "Apache-2.0" repository = "https://github.com/lightprotocol/light-protocol" diff --git a/sdk-libs/program-test/Cargo.toml b/sdk-libs/program-test/Cargo.toml index 8ee936eddf..98184f455e 100644 --- a/sdk-libs/program-test/Cargo.toml +++ b/sdk-libs/program-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-program-test" -version = "0.13.2" +version = "0.14.0" description = "A fast local test environment for Solana programs using compressed accounts and tokens." license = "MIT" edition = "2021" diff --git a/sdk-tests/client-test/Cargo.toml b/sdk-tests/client-test/Cargo.toml index 59e3dc76c1..1e0a043292 100644 --- a/sdk-tests/client-test/Cargo.toml +++ b/sdk-tests/client-test/Cargo.toml @@ -5,6 +5,7 @@ description = "Tests for light-client and light-program-test." repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["lib"] diff --git a/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/Cargo.toml b/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/Cargo.toml index f0faca1233..574f53df9a 100644 --- a/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/Cargo.toml +++ b/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/Cargo.toml @@ -4,6 +4,7 @@ version = "0.7.0" description = "Test program for Light SDK and Light Macros" edition = "2021" license = "Apache-2.0" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/sdk-tests/sdk-native-test/Cargo.toml b/sdk-tests/sdk-native-test/Cargo.toml index 979cfe922c..942bf05e84 100644 --- a/sdk-tests/sdk-native-test/Cargo.toml +++ b/sdk-tests/sdk-native-test/Cargo.toml @@ -5,6 +5,7 @@ description = "Test program using generalized account compression" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/sdk-tests/sdk-pinocchio-v1-test/Cargo.toml b/sdk-tests/sdk-pinocchio-v1-test/Cargo.toml index 623a741e17..b8ee71e2f1 100644 --- a/sdk-tests/sdk-pinocchio-v1-test/Cargo.toml +++ b/sdk-tests/sdk-pinocchio-v1-test/Cargo.toml @@ -5,6 +5,7 @@ description = "Test program using generalized account compression" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/sdk-tests/sdk-pinocchio-v2-test/Cargo.toml b/sdk-tests/sdk-pinocchio-v2-test/Cargo.toml index d4c61a7ac8..8789dfb2d3 100644 --- a/sdk-tests/sdk-pinocchio-v2-test/Cargo.toml +++ b/sdk-tests/sdk-pinocchio-v2-test/Cargo.toml @@ -5,6 +5,7 @@ description = "Test program using generalized account compression" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/sdk-tests/sdk-v1-native-test/Cargo.toml b/sdk-tests/sdk-v1-native-test/Cargo.toml index 89160fb969..a69e035b32 100644 --- a/sdk-tests/sdk-v1-native-test/Cargo.toml +++ b/sdk-tests/sdk-v1-native-test/Cargo.toml @@ -5,6 +5,7 @@ description = "Test program using generalized account compression" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/sparse-merkle-tree/Cargo.toml b/sparse-merkle-tree/Cargo.toml index ac8f7f6afa..79b6dd4525 100644 --- a/sparse-merkle-tree/Cargo.toml +++ b/sparse-merkle-tree/Cargo.toml @@ -5,6 +5,7 @@ description = "Implementation of a sparse indexed (and concurrent) Merkle tree i repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" +publish = false [dependencies] light-hasher = { workspace = true } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 8258907b2f..a96212b98f 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -2,6 +2,7 @@ name = "xtask" version = "1.1.0" edition = "2021" +publish = false [dependencies] account-compression = { workspace = true }