diff --git a/.dockerignore b/.dockerignore index ab61171..a978a07 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,5 @@ target/ .git/ -bin/ *.md !README.md docs/ diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 0d40588..154ce2e 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -16,7 +16,7 @@ jobs: echo "::error::RELEASE_TOKEN secret is not configured. Tags pushed with the default GITHUB_TOKEN cannot trigger the Release workflow." exit 1 fi - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 token: ${{ secrets.RELEASE_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23f7c31..7fecde0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt @@ -20,31 +20,46 @@ jobs: dprint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: dprint/check@v2.2 + - uses: actions/checkout@v6 + - uses: dprint/check@v2.3 test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - run: cargo test --all build: runs-on: ubuntu-latest needs: [lint, test] + strategy: + matrix: + include: + - target: x86_64-unknown-linux-musl + arch: amd64 + - target: aarch64-unknown-linux-musl + arch: arm64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: cargo build --release - - uses: actions/upload-artifact@v4 with: - name: initium-binary - path: target/release/initium + targets: ${{ matrix.target }} + - name: Install zig and cargo-zigbuild + run: pip install ziglang && curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && cargo binstall -y cargo-zigbuild + - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Cross-compile for ${{ matrix.arch }} + run: cargo zigbuild --release --target ${{ matrix.target }} + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: sccache + - uses: actions/upload-artifact@v7 + with: + name: initium-${{ matrix.arch }} + path: target/${{ matrix.target }}/release/initium helm-lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: azure/setup-helm@v4 - run: helm plugin install --verify=false https://github.com/helm-unittest/helm-unittest.git --version v0.5.1 - run: helm lint charts/initium diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3dbfe61..a716bea 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,7 +48,7 @@ jobs: --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Run integration tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 006ce2c..707659b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,83 +3,148 @@ on: push: tags: - "v*" + workflow_dispatch: + inputs: + dry-run: + description: "Dry run — build and verify without pushing images or publishing" + type: boolean + default: true permissions: contents: read packages: write id-token: write +env: + DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry-run == true }} jobs: - release: + test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - run: cargo test --all - - name: Publish to crates.io - run: | - cargo publish 2>&1 || { - if cargo search initium --limit 1 | grep -q "$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')"; then - echo "::warning::Version already published to crates.io — skipping" - else - echo "::error::cargo publish failed" - exit 1 - fi - } + build: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - target: x86_64-unknown-linux-musl + arch: amd64 + - target: aarch64-unknown-linux-musl + arch: arm64 + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + - name: Install zig and cargo-zigbuild + run: pip install ziglang && curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && cargo binstall -y cargo-zigbuild + - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Cross-compile for ${{ matrix.arch }} + run: cargo zigbuild --release --target ${{ matrix.target }} env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: sccache + - uses: actions/upload-artifact@v7 + with: + name: initium-${{ matrix.arch }} + path: target/${{ matrix.target }}/release/initium + docker: + runs-on: ubuntu-latest + needs: [test, build] + steps: + - uses: actions/checkout@v6 + - uses: actions/download-artifact@v8 + with: + name: initium-amd64 + path: bin/ + - run: mv bin/initium bin/initium-amd64 && chmod +x bin/initium-amd64 + - uses: actions/download-artifact@v8 + with: + name: initium-arm64 + path: bin/ + - run: mv bin/initium bin/initium-arm64 && chmod +x bin/initium-arm64 + - name: Verify binaries + run: | + file bin/initium-amd64 bin/initium-arm64 + echo "amd64 size: $(du -h bin/initium-amd64 | cut -f1)" + echo "arm64 size: $(du -h bin/initium-arm64 | cut -f1)" - uses: sigstore/cosign-installer@v3 - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v3 + if: env.DRY_RUN == 'false' + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + if: env.DRY_RUN == 'false' with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract version id: version - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" - - uses: docker/build-push-action@v6 + run: | + if [[ "$GITHUB_REF" == refs/tags/v* ]]; then + echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" + else + echo "VERSION=dry-run-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + fi + - name: Build initium image + uses: docker/build-push-action@v7 id: build-main with: context: . platforms: linux/amd64,linux/arm64 - push: true - build-args: | - VERSION=${{ steps.version.outputs.VERSION }} + push: ${{ env.DRY_RUN == 'false' }} tags: | ghcr.io/kitstream/initium:${{ steps.version.outputs.VERSION }} ghcr.io/kitstream/initium:latest - cache-from: type=gha,scope=docker-main - cache-to: type=gha,mode=max,scope=docker-main sbom: true provenance: true - name: Sign initium image + if: env.DRY_RUN == 'false' run: cosign sign --yes ghcr.io/kitstream/initium@${{ steps.build-main.outputs.digest }} - name: SBOM attestation for initium image + if: env.DRY_RUN == 'false' run: | cosign attest --yes --type spdx \ --predicate <(docker buildx imagetools inspect ghcr.io/kitstream/initium@${{ steps.build-main.outputs.digest }} --format '{{json (index .SBOM "linux/amd64").SPDX}}') \ ghcr.io/kitstream/initium@${{ steps.build-main.outputs.digest }} - - uses: docker/build-push-action@v6 + - name: Build initium-jyq image + uses: docker/build-push-action@v7 id: build-jyq with: context: . file: Dockerfile.jyq platforms: linux/amd64,linux/arm64 - push: true - build-args: | - VERSION=${{ steps.version.outputs.VERSION }} + push: ${{ env.DRY_RUN == 'false' }} tags: | ghcr.io/kitstream/initium-jyq:${{ steps.version.outputs.VERSION }} ghcr.io/kitstream/initium-jyq:latest - cache-from: type=gha,scope=docker-jyq - cache-to: type=gha,mode=max,scope=docker-jyq sbom: true provenance: true - name: Sign initium-jyq image + if: env.DRY_RUN == 'false' run: cosign sign --yes ghcr.io/kitstream/initium-jyq@${{ steps.build-jyq.outputs.digest }} - name: SBOM attestation for initium-jyq image + if: env.DRY_RUN == 'false' run: | cosign attest --yes --type spdx \ --predicate <(docker buildx imagetools inspect ghcr.io/kitstream/initium-jyq@${{ steps.build-jyq.outputs.digest }} --format '{{json (index .SBOM "linux/amd64").SPDX}}') \ ghcr.io/kitstream/initium-jyq@${{ steps.build-jyq.outputs.digest }} + publish: + runs-on: ubuntu-latest + needs: [docker] + if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.dry-run == true) }} + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - name: Publish to crates.io + run: | + cargo publish 2>&1 || { + if cargo search initium --limit 1 | grep -q "$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')"; then + echo "::warning::Version already published to crates.io — skipping" + else + echo "::error::cargo publish failed" + exit 1 + fi + } + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e6ac155..fbea3ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Chores - Added integration tests for structured database connectivity: special-character passwords (URL-reserved chars like `@`, `:`, `/`, `?`, `#`, `%`), PostgreSQL `options` field (`connect_timeout`), and `create_if_missing` with non-existent database ([#50](https://github.com/KitStream/initium/issues/50)). +- Release workflow: replaced QEMU-emulated multi-arch Docker builds with native cross-compilation using `cargo-zigbuild` + `sccache`. Build time reduced from ~50 minutes to ~8-12 minutes. +- Release workflow: split into parallel `test`, `build` (matrix: amd64 + arm64), `docker`, and `publish` jobs. Crates.io publish now runs after Docker images are pushed. +- CI workflow: `build` job now cross-compiles for both amd64 and arm64 using `cargo-zigbuild` + `sccache`, warming the cache for release builds. +- Dockerfiles (`Dockerfile`, `Dockerfile.jyq`): replaced multi-stage Rust build with minimal images that COPY pre-built binaries. No more in-Docker compilation. +- Switched `mysql` crate from `native-tls` (OpenSSL) to `rustls-tls`, eliminating the OpenSSL dependency entirely. Binary size stays at ~5 MB. +- Makefile: added `cross-build` and `docker-multiarch` targets for local multi-arch builds. +- README: added Development section with cross-compilation and sccache setup instructions. ## [2.0.1] - 2026-03-14 diff --git a/Cargo.lock b/Cargo.lock index 229383d..80041c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,17 +8,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.17", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.12" @@ -82,7 +71,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -93,7 +82,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -102,12 +91,6 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - [[package]] name = "async-trait" version = "0.1.89" @@ -116,7 +99,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -125,6 +108,28 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "aws-lc-rs" +version = "1.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94bffc006df10ac2a68c83692d734a465f8ee6c5b384d8545a636f81d858f4bf" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4321e568ed89bb5a7d291a7f37997c2c0df89809d7b6d12062c81ddb54aa782e" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "base64" version = "0.21.7" @@ -137,19 +142,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bigdecimal" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6867f1565b3aad85681f1015055b087fcfd840d6aeee6eee7f2da317603695" -dependencies = [ - "autocfg", - "libm", - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -165,7 +157,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.117", + "syn", ] [[package]] @@ -174,18 +166,6 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -195,29 +175,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "borsh" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" -dependencies = [ - "borsh-derive", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0686c856aa6aac0c4498f936d7d6a02df690f614c03e4d906d1018062b5c5e2c" -dependencies = [ - "once_cell", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "btoi" version = "0.4.3" @@ -239,28 +196,6 @@ version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" -[[package]] -name = "bytecheck" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "byteorder" version = "1.5.0" @@ -300,12 +235,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "clang-sys" version = "1.8.1" @@ -348,7 +277,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -372,22 +301,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" -[[package]] -name = "core-foundation" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cpufeatures" version = "0.2.17" @@ -472,50 +385,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.117", -] - -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "deranged" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "powerfmt", -] - [[package]] name = "derive_utils" version = "0.15.0" @@ -524,7 +393,7 @@ checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -546,9 +415,15 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "either" version = "1.15.0" @@ -568,7 +443,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -608,37 +483,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", - "libz-sys", "miniz_oxide", ] -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "foldhash" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.2" @@ -649,66 +502,10 @@ dependencies = [ ] [[package]] -name = "frunk" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28aef0f9aa070bce60767c12ba9cb41efeaf1a2bc6427f87b7d83f11239a16d7" -dependencies = [ - "frunk_core", - "frunk_derives", - "frunk_proc_macros", - "serde", -] - -[[package]] -name = "frunk_core" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "476eeaa382e3462b84da5d6ba3da97b5786823c2d0d3a0d04ef088d073da225c" -dependencies = [ - "serde", -] - -[[package]] -name = "frunk_derives" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0b4095fc99e1d858e5b8c7125d2638372ec85aa0fe6c807105cf10b0265ca6c" -dependencies = [ - "frunk_proc_macro_helpers", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "frunk_proc_macro_helpers" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1952b802269f2db12ab7c0bd328d0ae8feaabf19f352a7b0af7bb0c5693abfce" -dependencies = [ - "frunk_core", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "frunk_proc_macros" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3462f590fa236005bd7ca4847f81438bd6fe0febd4d04e11968d4c2e96437e78" -dependencies = [ - "frunk_core", - "frunk_proc_macro_helpers", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "funty" -version = "2.0.0" +name = "fs_extra" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "futures-channel" @@ -802,22 +599,13 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] - [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.12", + "ahash", ] [[package]] @@ -948,12 +736,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "1.1.0" @@ -1085,12 +867,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "libm" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" - [[package]] name = "libredox" version = "0.1.12" @@ -1112,17 +888,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "libz-sys" -version = "1.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d118bbf3771060e7311cc7bb0545b01d08a8b4a7de949198dec1fa0ca1c0f7" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -1227,32 +992,17 @@ dependencies = [ "lru", "mysql_common", "named_pipe", - "native-tls", "pem", "percent-encoding", + "rustls", + "rustls-pemfile", "serde", "serde_json", "socket2 0.5.10", "twox-hash", "url", -] - -[[package]] -name = "mysql-common-derive" -version = "0.31.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63c3512cf11487168e0e9db7157801bf5273be13055a9cc95356dc9e0035e49c" -dependencies = [ - "darling", - "heck", - "num-bigint", - "proc-macro-crate", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.117", - "termcolor", - "thiserror", + "webpki", + "webpki-roots 0.26.11", ] [[package]] @@ -1262,10 +1012,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478b0ff3f7d67b79da2b96f56f334431aef65e15ba4b29dd74a4236e29582bdc" dependencies = [ "base64 0.21.7", - "bigdecimal", "bindgen", "bitflags", - "bitvec", "btoi", "byteorder", "bytes", @@ -1273,14 +1021,11 @@ dependencies = [ "cmake", "crc32fast", "flate2", - "frunk", "lazy_static", - "mysql-common-derive", "num-bigint", "num-traits", "rand 0.8.5", "regex", - "rust_decimal", "saturating", "serde", "serde_json", @@ -1289,7 +1034,6 @@ dependencies = [ "smallvec", "subprocess", "thiserror", - "time", "uuid", "zstd", ] @@ -1303,23 +1047,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "native-tls" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nom" version = "7.1.3" @@ -1340,12 +1067,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-conv" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" - [[package]] name = "num-integer" version = "0.1.46" @@ -1394,50 +1115,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" -[[package]] -name = "openssl" -version = "0.10.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "openssl-probe" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" - -[[package]] -name = "openssl-sys" -version = "0.9.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.5" @@ -1560,12 +1237,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.21" @@ -1582,38 +1253,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.117", -] - -[[package]] -name = "proc-macro-crate" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -1625,26 +1265,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "quote" version = "1.0.44" @@ -1660,12 +1280,6 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - [[package]] name = "rand" version = "0.8.5" @@ -1763,15 +1377,6 @@ version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" -[[package]] -name = "rend" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" -dependencies = [ - "bytecheck", -] - [[package]] name = "ring" version = "0.17.14" @@ -1786,35 +1391,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rkyv" -version = "0.7.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" -dependencies = [ - "bitvec", - "bytecheck", - "bytes", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "rusqlite" version = "0.31.0" @@ -1829,22 +1405,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "rust_decimal" -version = "1.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f703d19852dbf87cbc513643fa81428361eb6940f1ac14fd58155d295a3eb0" -dependencies = [ - "arrayvec", - "borsh", - "bytes", - "num-traits", - "rand 0.8.5", - "rkyv", - "serde", - "serde_json", -] - [[package]] name = "rustc-hash" version = "2.1.1" @@ -1861,7 +1421,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1870,6 +1430,7 @@ version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ + "aws-lc-rs", "log", "once_cell", "ring", @@ -1879,6 +1440,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "rustls-pki-types" version = "1.14.0" @@ -1894,6 +1464,7 @@ version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -1917,50 +1488,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71" -[[package]] -name = "schannel" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "security-framework" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "1.0.27" @@ -1994,7 +1527,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -2057,12 +1590,6 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" -[[package]] -name = "simdutf8" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" - [[package]] name = "siphasher" version = "1.0.2" @@ -2140,17 +1667,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.117" @@ -2170,15 +1686,9 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "tempfile" version = "3.25.0" @@ -2189,16 +1699,7 @@ dependencies = [ "getrandom 0.4.1", "once_cell", "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", + "windows-sys 0.60.2", ] [[package]] @@ -2218,36 +1719,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", -] - -[[package]] -name = "time" -version = "0.3.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" - -[[package]] -name = "time-macros" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" -dependencies = [ - "num-conv", - "time-core", + "syn", ] [[package]] @@ -2328,36 +1800,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml_datetime" -version = "0.7.5+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_edit" -version = "0.23.10+spec-1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" -dependencies = [ - "indexmap", - "toml_datetime", - "toml_parser", - "winnow", -] - -[[package]] -name = "toml_parser" -version = "1.0.9+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" -dependencies = [ - "winnow", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -2555,7 +1997,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.117", + "syn", "wasm-bindgen-shared", ] @@ -2612,6 +2054,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "webpki-roots" version = "0.26.11" @@ -2659,15 +2111,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2836,15 +2279,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" -[[package]] -name = "winnow" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" -dependencies = [ - "memchr", -] - [[package]] name = "wit-bindgen" version = "0.51.0" @@ -2875,7 +2309,7 @@ dependencies = [ "heck", "indexmap", "prettyplease", - "syn 2.0.117", + "syn", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -2891,7 +2325,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.117", + "syn", "wit-bindgen-core", "wit-bindgen-rust", ] @@ -2939,15 +2373,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - [[package]] name = "yoke" version = "0.8.1" @@ -2967,7 +2392,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", "synstructure", ] @@ -2988,7 +2413,7 @@ checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -3008,7 +2433,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", "synstructure", ] @@ -3048,7 +2473,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0de4f67..1a75a7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ mysql = ["dep:mysql"] base64 = "0.22" clap = { version = "4", features = ["derive", "env"] } minijinja = { version = "2", features = ["urlencode"] } -mysql = { version = "25", optional = true } +mysql = { version = "25", optional = true, default-features = false, features = ["minimal-rust", "rustls-tls", "buffer-pool"] } postgres = { version = "0.19", optional = true } rand = "0.8" rusqlite = { version = "0.31", features = ["bundled"], optional = true } diff --git a/Dockerfile b/Dockerfile index c52bafc..c248b4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,9 @@ -# Normalize root package version so the dependency cache survives version-only bumps. -# BuildKit uses content-based caching for COPY --from; the sed output is identical -# when only the version changed, so the expensive cargo build layer stays cached. -FROM rust:1.88-alpine AS deps -WORKDIR /src -COPY Cargo.toml Cargo.lock ./ -RUN sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.toml && \ - sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.lock +FROM alpine:3.21 AS certs +RUN apk add --no-cache ca-certificates -FROM rust:1.88-alpine AS builder -ARG VERSION=dev -RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static perl -WORKDIR /src -COPY --from=deps /src/Cargo.toml /src/Cargo.lock ./ -RUN mkdir src && echo 'fn main() {}' > src/main.rs && \ - cargo build --release && \ - rm -rf src target/release/deps/initium* target/release/initium* -COPY . . -RUN cargo build --release FROM scratch -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /src/target/release/initium /initium +COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +ARG TARGETARCH +COPY bin/initium-${TARGETARCH} /initium USER 65534:65534 ENTRYPOINT ["/initium"] diff --git a/Dockerfile.jyq b/Dockerfile.jyq index fad0f12..a1579e6 100644 --- a/Dockerfile.jyq +++ b/Dockerfile.jyq @@ -1,25 +1,6 @@ -# Normalize root package version so the dependency cache survives version-only bumps. -# BuildKit uses content-based caching for COPY --from; the sed output is identical -# when only the version changed, so the expensive cargo build layer stays cached. -FROM rust:1.88-alpine AS deps -WORKDIR /src -COPY Cargo.toml Cargo.lock ./ -RUN sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.toml && \ - sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.lock - -FROM rust:1.88-alpine AS builder -ARG VERSION=dev -RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static perl -WORKDIR /src -COPY --from=deps /src/Cargo.toml /src/Cargo.lock ./ -RUN mkdir src && echo 'fn main() {}' > src/main.rs && \ - cargo build --release && \ - rm -rf src target/release/deps/initium* target/release/initium* -COPY . . -RUN cargo build --release FROM alpine:3.21 -RUN apk add --no-cache jq yq ca-certificates \ - && rm -rf /var/cache/apk/* -COPY --from=builder /src/target/release/initium /initium +RUN apk add --no-cache jq yq ca-certificates && rm -rf /var/cache/apk/* +ARG TARGETARCH +COPY bin/initium-${TARGETARCH} /initium USER 65534:65534 ENTRYPOINT ["/initium"] diff --git a/Makefile b/Makefile index ef05799..0107e49 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,12 @@ BINARY := initium VERSION ?= dev IMAGE ?= ghcr.io/kitstream/initium COSIGN_IDENTITY := https://github.com/KitStream/initium/.github/workflows/release.yml@refs/tags/v$(VERSION) -.PHONY: all build test lint clean verify-image +TARGETS := x86_64-unknown-linux-musl aarch64-unknown-linux-musl +.PHONY: all build test lint clean verify-image cross-build docker-multiarch all: lint test build build: cargo build --release + @mkdir -p bin cp target/release/$(BINARY) bin/$(BINARY) test: cargo test @@ -15,9 +17,17 @@ lint: clean: cargo clean rm -rf bin/ -docker-build: - docker build -t ghcr.io/kitstream/initium:$(VERSION) . -docker-push: - docker push ghcr.io/kitstream/initium:$(VERSION) +cross-build: + @for target in $(TARGETS); do \ + cargo zigbuild --release --target $$target; \ + done + @mkdir -p bin + @cp target/x86_64-unknown-linux-musl/release/$(BINARY) bin/$(BINARY)-amd64 + @cp target/aarch64-unknown-linux-musl/release/$(BINARY) bin/$(BINARY)-arm64 +docker-multiarch: cross-build + docker buildx build --platform linux/amd64,linux/arm64 \ + -t $(IMAGE):$(VERSION) -t $(IMAGE):latest --push . + docker buildx build --platform linux/amd64,linux/arm64 \ + -f Dockerfile.jyq -t $(IMAGE)-jyq:$(VERSION) -t $(IMAGE)-jyq:latest --push . verify-image: cosign verify --certificate-oidc-issuer https://token.actions.githubusercontent.com --certificate-identity '$(COSIGN_IDENTITY)' $(IMAGE):$(VERSION) diff --git a/README.md b/README.md index e06e794..302eb4d 100644 --- a/README.md +++ b/README.md @@ -311,9 +311,8 @@ make test # Option 1: Use the pre-built image kubectl apply -f examples/nginx-waitfor/deployment.yaml -# Option 2: Build and push your own image -make docker-build VERSION=dev -make docker-push VERSION=dev +# Option 2: Cross-build and push multi-arch images +make docker-multiarch VERSION=dev # Option 3: Use the Helm chart helm install my-app charts/initium \ @@ -345,6 +344,37 @@ If you only need TCP/HTTP readiness checks, any of these tools work. Initium is - [Security](docs/security.md) — Threat model, safe defaults, PSA compatibility - [Architecture & Design](docs/design.md) — How Initium works and how to extend it +## Development + +### Prerequisites + +- [Rust toolchain](https://rustup.rs/) with musl targets: + ```bash + rustup target add x86_64-unknown-linux-musl aarch64-unknown-linux-musl + ``` +- [Zig](https://ziglang.org/) for cross-compilation: `brew install zig` +- [cargo-zigbuild](https://github.com/rust-cross/cargo-zigbuild): `cargo install cargo-zigbuild` +- (Optional) [sccache](https://github.com/mozilla/sccache) for build caching across worktrees: + ```bash + brew install sccache + export RUSTC_WRAPPER=sccache + ``` + +### Cross-compile for linux/amd64 and linux/arm64 + +```bash +make cross-build +file bin/initium-amd64 bin/initium-arm64 +``` + +### Build and push multi-arch Docker images + +```bash +make docker-multiarch VERSION=dev IMAGE=ghcr.io/kitstream/initium +``` + +This runs `cross-build` then uses `docker buildx` to assemble and push multi-arch images for both `initium` (scratch) and `initium-jyq` (alpine + jq/yq). + ## Contributing Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for build instructions, test commands, and PR expectations. See the [design doc](docs/design.md) for how to add new subcommands.