cargo-c-0.10.11+cargo-0.86.0/.cargo_vcs_info.json0000644000000001360000000000100143250ustar { "git": { "sha1": "c6da659efddf1ff1c6e7322f72654f018907cc2d" }, "path_in_vcs": "" }cargo-c-0.10.11+cargo-0.86.0/.github/FUNDING.yml000064400000000000000000000001231046102023000162660ustar 00000000000000# These are supported funding model platforms liberapay: lu_zero github: lu-zero cargo-c-0.10.11+cargo-0.86.0/.github/actions-rs/grcov.yml000064400000000000000000000000661046102023000204040ustar 00000000000000ignore-not-existing: true ignore: - "/*" - "../*" cargo-c-0.10.11+cargo-0.86.0/.github/dependabot.yml000064400000000000000000000006701046102023000173100ustar 00000000000000version: 2 updates: - package-ecosystem: github-actions directory: "/" schedule: interval: daily - package-ecosystem: cargo directory: "/" schedule: interval: daily open-pull-requests-limit: 10 ignore: - dependency-name: cbindgen versions: - 0.17.0 - 0.18.0 - 0.19.0 - dependency-name: cargo versions: - 0.50.0 - 0.51.0 - 0.52.0 - dependency-name: serde versions: - 1.0.123 cargo-c-0.10.11+cargo-0.86.0/.github/workflows/deploy.yml000064400000000000000000000071771046102023000205450ustar 00000000000000name: deploy on: push: tags: - 'v*.*.*' - 'pre-*.*.*' jobs: windows-binaries: strategy: matrix: conf: - msvc - gnu include: - conf: msvc toolchain: stable - conf: gnu toolchain: stable-x86_64-pc-windows-gnu runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: Install stable uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.toolchain }} - name: Build cargo-c run: | cargo build --profile release-strip - name: Create zip run: | cd target/release-strip 7z a ../../cargo-c-windows-${{ matrix.conf }}.zip ` "cargo-capi.exe" ` "cargo-cbuild.exe" ` "cargo-cinstall.exe" ` "cargo-ctest.exe" - name: Upload binaries uses: actions/upload-artifact@v4 with: name: cargo-c-windows-${{ matrix.conf }}-binaries path: cargo-c-windows-${{ matrix.conf }}.zip linux-binaries: strategy: fail-fast: false matrix: target: - i686-unknown-linux-musl - x86_64-unknown-linux-musl - powerpc64le-unknown-linux-gnu - aarch64-unknown-linux-musl runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: stable - name: Install cross run: | cargo install cross --git https://github.com/cross-rs/cross - name: Build cargo-c run: | cross build --target ${{ matrix.target }} \ --features=vendored-openssl \ --profile release-strip - name: Create tar run: | cd target/${{ matrix.target }}/release-strip tar -czvf $GITHUB_WORKSPACE/cargo-c-${{ matrix.target }}.tar.gz \ cargo-capi \ cargo-cbuild \ cargo-cinstall \ cargo-ctest - name: Upload binaries uses: actions/upload-artifact@v4 with: name: cargo-c-linux-binaries-${{ matrix.target }} path: cargo-c-${{ matrix.target }}.tar.gz macos-binaries: runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: Install stable uses: dtolnay/rust-toolchain@stable with: toolchain: stable - name: Build cargo-c run: | cargo build --features=vendored-openssl --profile release-strip - name: Create zip run: | cd target/release-strip zip $GITHUB_WORKSPACE/cargo-c-macos.zip \ cargo-capi \ cargo-cbuild \ cargo-cinstall \ cargo-ctest - name: Upload binaries uses: actions/upload-artifact@v4 with: name: cargo-c-macos-binaries path: cargo-c-macos.zip deploy: needs: [windows-binaries, linux-binaries, macos-binaries] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install stable uses: dtolnay/rust-toolchain@stable with: toolchain: stable - name: Download zip files uses: actions/download-artifact@v4 - name: Create Cargo.lock run: | cargo update - name: Create a release uses: softprops/action-gh-release@v2 with: files: | Cargo.lock cargo-c-linux-binaries*/*.tar.gz cargo-c-macos-binaries/cargo-c-macos.zip cargo-c-windows-msvc-binaries/cargo-c-windows-msvc.zip cargo-c-windows-gnu-binaries/cargo-c-windows-gnu.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} cargo-c-0.10.11+cargo-0.86.0/.github/workflows/example-project.yml000064400000000000000000000103531046102023000223360ustar 00000000000000name: Build example project on: [push, pull_request] env: CARGO_TERM_COLOR: always jobs: example-project: strategy: matrix: include: - os: ubuntu-latest # x86_64: - os: macos-13 # arm64: - os: macos-latest - os: windows-latest toolchain-suffix: -gnu - os: windows-latest toolchain-suffix: -msvc runs-on: ${{ matrix.os }} steps: - name: Clone Git repository uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable${{ matrix.toolchain-suffix }} - name: Install pkgconf if: runner.os == 'Windows' uses: msys2/setup-msys2@v2 id: msys2 with: msystem: ucrt64 install: mingw-w64-ucrt-x86_64-pkgconf - name: Put pkgconf on PATH if: runner.os == 'Windows' run: Add-Content $env:GITHUB_PATH "${{ steps.msys2.outputs.msys2-location }}\ucrt64\bin" - name: Install cargo-c applet run: cargo install --path . - name: Test example project working-directory: example-project run: cargo test --verbose - name: Build C API for example project working-directory: example-project run: cargo cbuild --verbose --release - name: Run C API tests for example project working-directory: example-project run: cargo ctest --verbose --release - name: Install into /usr/local if: runner.os != 'Windows' working-directory: example-project run: sudo -E env PATH=$PATH cargo cinstall --verbose --release --prefix=/usr/local - name: Install into MSYS2 root if: runner.os == 'Windows' working-directory: example-project run: cargo cinstall --verbose --release --prefix="${{ steps.msys2.outputs.msys2-location }}\ucrt64" - name: Test pkgconf if: runner.os == 'macOS' run: | set -x pkgconf --version test "$(pkgconf --cflags example_project)" = "-I/usr/local/include/example-project-0.1" test "$(pkgconf --libs example_project)" = "-L/usr/local/lib -lexample-project" - name: Test pkgconf if: runner.os == 'Linux' run: | set -x pkgconf --version ARCHDIR=`dpkg-architecture -qDEB_HOST_MULTIARCH` # ubuntu seems to add trailing spaces for no specific reasons. CFLAGS=$(pkgconf --cflags example_project) LIBS=$(pkgconf --libs example_project) test "${CFLAGS%% }" = "-I/usr/local/include/example-project-0.1" test "${LIBS%% }" = "-L/usr/local/lib/${ARCHDIR} -lexample-project" - name: Test pkgconf if: runner.os == 'Windows' shell: bash run: | set -x pkgconf --version # use --define-variable=prefix=C:/foo to test relative libdir/includedir generation # https://github.com/lu-zero/cargo-c/commit/76a66cd72eb4271501557eebea7060821e63b702 test "$(pkgconf --define-variable=prefix=C:/foo --cflags example_project)" = "-IC:/foo/include/example-project-0.1" test "$(pkgconf --define-variable=prefix=C:/foo --libs example_project)" = "-LC:/foo/lib -lexample-project" - name: Update dynamic linker cache if: runner.os == 'Linux' run: sudo ldconfig - name: Test usage from C (using Makefile) if: runner.os != 'Windows' working-directory: example-project/usage-from-c run: make - name: Setup Meson + Ninja if: runner.os == 'Windows' && matrix.toolchain-suffix == '-msvc' run: | python3 -m pip install --upgrade pip setuptools wheel python3 -m pip install meson ninja - name: Setup MSVC for test if: runner.os == 'Windows' && matrix.toolchain-suffix == '-msvc' uses: ilammy/msvc-dev-cmd@v1 with: arch: x86_64 - name: Test usage from C (Meson) if: runner.os == 'Windows' && matrix.toolchain-suffix == '-msvc' working-directory: example-project/usage-from-c env: PKG_CONFIG: pkgconf run: | meson setup build meson compile -C build meson test -C build cargo-c-0.10.11+cargo-0.86.0/.github/workflows/rust.yml000064400000000000000000000040571046102023000202400ustar 00000000000000name: Rust on: [push, pull_request] jobs: rustfmt-clippy: name: Format and Clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install stable uses: dtolnay/rust-toolchain@stable with: toolchain: stable components: clippy, rustfmt - name: Run rustfmt run: | cargo fmt --all -- --check - name: Run clippy uses: actions-rs-plus/clippy-check@v2.2.1 with: args: --all -- -D warnings coverage: needs: arch-test name: Code coverage runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: stable - name: Install grcov env: LINK: https://github.com/mozilla/grcov/releases/download GRCOV_VERSION: 0.8.7 run: | curl -L "$LINK/v$GRCOV_VERSION/grcov-x86_64-unknown-linux-gnu.tar.bz2" | tar xj -C $HOME/.cargo/bin - name: Set up MinGW uses: egor-tensin/setup-mingw@v2 with: platform: x64 cc: false - name: Run grcov id: coverage run: bash coverage.sh - name: Codecov upload uses: codecov/codecov-action@v5 with: files: coverage.lcov arch-test: needs: rustfmt-clippy strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-latest] toolchain: [nightly, stable] include: - toolchain: nightly-gnu os: windows-latest - toolchain: stable-gnu os: windows-latest name: ${{matrix.os}}-${{matrix.toolchain}} runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v4 - name: Install ${{matrix.toolchain}} uses: dtolnay/rust-toolchain@stable with: toolchain: ${{matrix.toolchain}} - name: Build run: | cargo build --verbose - name: Run tests run: | cargo test --verbose cargo-c-0.10.11+cargo-0.86.0/.gitignore000064400000000000000000000001371046102023000151060ustar 00000000000000/target **/*.rs.bk Cargo.lock /example-project/target/ /example-project/usage-from-c/run_tests cargo-c-0.10.11+cargo-0.86.0/Cargo.lock0000644000002721460000000000100123140ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "adler2" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", "version_check", "zerocopy", ] [[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "annotate-snippets" version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" dependencies = [ "anstyle", "unicode-width", ] [[package]] name = "anstream" version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", "once_cell", "windows-sys 0.59.0", ] [[package]] name = "anyhow" version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "arc-swap" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayref" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bitflags" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitmaps" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" dependencies = [ "typenum", ] [[package]] name = "blake3" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1230237285e3e10cde447185e8975408ae24deaa67205ce684805c25bc0c7937" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", "memmap2", ] [[package]] name = "block-buffer" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "bstr" version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "regex-automata 0.4.9", "serde", ] [[package]] name = "bumpalo" version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "bytesize" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d2c12f985c78475a6b8d629afd0c360260ef34cfef52efccdcfd31972f81c2e" [[package]] name = "cargo" version = "0.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62fdf5dbde4bf8d8149a4d32568d28d92af9dc4a4975727d89bd8dfb69fb810e" dependencies = [ "annotate-snippets", "anstream", "anstyle", "anyhow", "base64", "blake3", "bytesize", "cargo-credential", "cargo-credential-libsecret", "cargo-credential-macos-keychain", "cargo-credential-wincred", "cargo-platform", "cargo-util", "cargo-util-schemas", "clap", "clap_complete", "color-print", "crates-io", "curl", "curl-sys", "filetime", "flate2", "git2", "git2-curl", "gix", "glob", "hex", "hmac", "home", "http-auth", "humantime", "ignore", "im-rc", "indexmap", "itertools 0.13.0", "jobserver", "lazycell", "libc", "libgit2-sys", "memchr", "opener", "openssl", "os_info", "pasetors", "pathdiff", "rand", "regex", "rusqlite", "rustc-hash", "rustc-stable-hash", "rustfix", "same-file", "semver", "serde", "serde-untagged", "serde_ignored", "serde_json", "sha1", "shell-escape", "supports-hyperlinks", "supports-unicode", "tar", "tempfile", "thiserror 1.0.69", "time", "toml", "toml_edit", "tracing", "tracing-chrome", "tracing-subscriber", "unicase", "unicode-width", "url", "walkdir", "windows-sys 0.59.0", ] [[package]] name = "cargo-c" version = "0.10.11+cargo-0.86.0" dependencies = [ "anyhow", "cargo", "cargo-util", "cbindgen", "cc", "clap", "glob", "implib", "itertools 0.14.0", "log", "object", "regex", "semver", "serde", "serde_derive", "serde_json", "toml", ] [[package]] name = "cargo-credential" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1ef5080adde1db190e901884d2c400990856c2a23201c5a181b910a6dbdf2a" dependencies = [ "anyhow", "libc", "serde", "serde_json", "thiserror 1.0.69", "time", "windows-sys 0.59.0", ] [[package]] name = "cargo-credential-libsecret" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2d33572942f4b5f59376b7041198c56b5585404c59172c62fff2372dedba102" dependencies = [ "anyhow", "cargo-credential", "libloading", ] [[package]] name = "cargo-credential-macos-keychain" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41e699cfa3f0a45e8973839768622302a03ab7148c126e96215c2e3e1fc82375" dependencies = [ "cargo-credential", "security-framework", ] [[package]] name = "cargo-credential-wincred" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62219d774bd2d26e803d75d7dfd234022173af157eb9d6f887016839db4d1f19" dependencies = [ "cargo-credential", "windows-sys 0.59.0", ] [[package]] name = "cargo-platform" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84982c6c0ae343635a3a4ee6dedef965513735c8b183caa7289fa6e27399ebd4" dependencies = [ "serde", ] [[package]] name = "cargo-util" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "932c5376dc904ef005f0d229a5edc1116f40a78a18d30cdc992ec5acbeffd4d9" dependencies = [ "anyhow", "core-foundation", "filetime", "hex", "ignore", "jobserver", "libc", "miow", "same-file", "sha2", "shell-escape", "tempfile", "tracing", "walkdir", "windows-sys 0.59.0", ] [[package]] name = "cargo-util-schemas" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f905f68f8cb8a8182592d9858a5895360f0a5b08b6901fdb10498fb91829804" dependencies = [ "semver", "serde", "serde-untagged", "serde-value", "thiserror 1.0.69", "toml", "unicode-xid", "url", ] [[package]] name = "cbindgen" version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff" dependencies = [ "heck 0.4.1", "indexmap", "log", "proc-macro2", "quote", "serde", "serde_json", "syn", "tempfile", "toml", ] [[package]] name = "cc" version = "1.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" dependencies = [ "jobserver", "libc", "shlex", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" dependencies = [ "clap_builder", "clap_derive", ] [[package]] name = "clap_builder" version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" dependencies = [ "anstream", "anstyle", "clap_lex", "strsim", "terminal_size", ] [[package]] name = "clap_complete" version = "4.5.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e3040c8291884ddf39445dc033c70abc2bc44a42f0a3a00571a0f483a83f0cd" dependencies = [ "clap", "clap_lex", "is_executable", "shlex", ] [[package]] name = "clap_derive" version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", "syn", ] [[package]] name = "clap_lex" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "clru" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "color-print" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3aa954171903797d5623e047d9ab69d91b493657917bdfb8c2c80ecaf9cdb6f4" dependencies = [ "color-print-proc-macro", ] [[package]] name = "color-print-proc-macro" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "692186b5ebe54007e45a59aea47ece9eb4108e141326c304cdc91699a7118a22" dependencies = [ "nom", "proc-macro2", "quote", "syn", ] [[package]] name = "colorchoice" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" 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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] [[package]] name = "crates-io" version = "0.40.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3278cae111be507cd074ac10cac0ca4638c90911f978a849c1b96086381d347c" dependencies = [ "curl", "percent-encoding", "serde", "serde_json", "thiserror 1.0.69", "url", ] [[package]] name = "crc32fast" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-bigint" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core", "subtle", "zeroize", ] [[package]] name = "crypto-common" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", "typenum", ] [[package]] name = "ct-codecs" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b916ba8ce9e4182696896f015e8a5ae6081b305f74690baa8465e35f5a142ea4" [[package]] name = "curl" version = "0.4.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9fb4d13a1be2b58f14d60adba57c9834b78c62fd86c3e76a148f732686e9265" dependencies = [ "curl-sys", "libc", "openssl-probe", "openssl-sys", "schannel", "socket2", "windows-sys 0.52.0", ] [[package]] name = "curl-sys" version = "0.4.80+curl-8.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55f7df2eac63200c3ab25bde3b2268ef2ee56af3d238e76d61f01c3c49bff734" dependencies = [ "cc", "libc", "libnghttp2-sys", "libz-sys", "openssl-sys", "pkg-config", "vcpkg", "windows-sys 0.52.0", ] [[package]] name = "dbus" version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" dependencies = [ "libc", "libdbus-sys", "winapi", ] [[package]] name = "der" version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", "zeroize", ] [[package]] name = "deranged" version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", ] [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "const-oid", "crypto-common", "subtle", ] [[package]] name = "displaydoc" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "dunce" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest", "elliptic-curve", "rfc6979", "signature", "spki", ] [[package]] name = "ed25519-compact" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9b3460f44bea8cd47f45a0c70892f1eff856d97cd55358b2f73f663789f6190" dependencies = [ "getrandom 0.2.15", ] [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", "digest", "ff", "generic-array", "group", "hkdf", "pem-rfc7468", "pkcs8", "rand_core", "sec1", "subtle", "zeroize", ] [[package]] name = "encoding_rs" version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "erased-serde" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" dependencies = [ "serde", "typeid", ] [[package]] name = "errno" version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fallible-streaming-iterator" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "faster-hex" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" dependencies = [ "serde", ] [[package]] name = "fastrand" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "ff" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core", "subtle", ] [[package]] name = "fiat-crypto" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "filetime" version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", "libredox", "windows-sys 0.59.0", ] [[package]] name = "flate2" version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" 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.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "generic-array" version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", "zeroize", ] [[package]] name = "getrandom" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] name = "getrandom" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" dependencies = [ "cfg-if", "js-sys", "libc", "wasi 0.13.3+wasi-0.2.2", "wasm-bindgen", "windows-targets 0.52.6", ] [[package]] name = "git2" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ "bitflags", "libc", "libgit2-sys", "log", "openssl-probe", "openssl-sys", "url", ] [[package]] name = "git2-curl" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68ff14527a1c242320039b138376f8e0786697a1b7b172bc44f6efda3ab9079f" dependencies = [ "curl", "git2", "log", "url", ] [[package]] name = "gix" version = "0.69.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d0eebdaecdcf405d5433a36f85e4f058cf4de48ee2604388be0dbccbaad353e" dependencies = [ "gix-actor", "gix-attributes", "gix-command", "gix-commitgraph", "gix-config", "gix-credentials", "gix-date", "gix-diff", "gix-dir", "gix-discover", "gix-features", "gix-filter", "gix-fs", "gix-glob", "gix-hash", "gix-hashtable", "gix-ignore", "gix-index", "gix-lock", "gix-negotiate", "gix-object", "gix-odb", "gix-pack", "gix-path", "gix-pathspec", "gix-prompt", "gix-protocol", "gix-ref", "gix-refspec", "gix-revision", "gix-revwalk", "gix-sec", "gix-shallow", "gix-submodule", "gix-tempfile", "gix-trace", "gix-transport", "gix-traverse", "gix-url", "gix-utils", "gix-validate", "gix-worktree", "once_cell", "prodash", "smallvec", "thiserror 2.0.11", ] [[package]] name = "gix-actor" version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20018a1a6332e065f1fcc8305c1c932c6b8c9985edea2284b3c79dc6fa3ee4b2" dependencies = [ "bstr", "gix-date", "gix-utils", "itoa", "thiserror 2.0.11", "winnow 0.6.26", ] [[package]] name = "gix-attributes" version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddf9bf852194c0edfe699a2d36422d2c1f28f73b7c6d446c3f0ccd3ba232cadc" dependencies = [ "bstr", "gix-glob", "gix-path", "gix-quote", "gix-trace", "kstring", "smallvec", "thiserror 2.0.11", "unicode-bom", ] [[package]] name = "gix-bitmap" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1db9765c69502650da68f0804e3dc2b5f8ccc6a2d104ca6c85bc40700d37540" dependencies = [ "thiserror 2.0.11", ] [[package]] name = "gix-chunk" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b1f1d8764958699dc764e3f727cef280ff4d1bd92c107bbf8acd85b30c1bd6f" dependencies = [ "thiserror 2.0.11", ] [[package]] name = "gix-command" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb410b84d6575db45e62025a9118bdbf4d4b099ce7575a76161e898d9ca98df1" dependencies = [ "bstr", "gix-path", "gix-trace", "shell-words", ] [[package]] name = "gix-commitgraph" version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8da6591a7868fb2b6dabddea6b09988b0b05e0213f938dbaa11a03dd7a48d85" dependencies = [ "bstr", "gix-chunk", "gix-features", "gix-hash", "memmap2", "thiserror 2.0.11", ] [[package]] name = "gix-config" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6649b406ca1f99cb148959cf00468b231f07950f8ec438cc0903cda563606f19" dependencies = [ "bstr", "gix-config-value", "gix-features", "gix-glob", "gix-path", "gix-ref", "gix-sec", "memchr", "once_cell", "smallvec", "thiserror 2.0.11", "unicode-bom", "winnow 0.6.26", ] [[package]] name = "gix-config-value" version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11365144ef93082f3403471dbaa94cfe4b5e72743bdb9560719a251d439f4cee" dependencies = [ "bitflags", "bstr", "gix-path", "libc", "thiserror 2.0.11", ] [[package]] name = "gix-credentials" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82a50c56b785c29a151ab4ccf74a83fe4e21d2feda0d30549504b4baed353e0a" dependencies = [ "bstr", "gix-command", "gix-config-value", "gix-path", "gix-prompt", "gix-sec", "gix-trace", "gix-url", "thiserror 2.0.11", ] [[package]] name = "gix-date" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c57c477b645ee248b173bb1176b52dd528872f12c50375801a58aaf5ae91113f" dependencies = [ "bstr", "itoa", "jiff", "thiserror 2.0.11", ] [[package]] name = "gix-diff" version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8e92566eccbca205a0a0f96ffb0327c061e85bc5c95abbcddfe177498aa04f6" dependencies = [ "bstr", "gix-hash", "gix-object", "thiserror 2.0.11", ] [[package]] name = "gix-dir" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fba2ffbcf4bd34438e8a8367ccbc94870549903d1f193a14f47eb6b0967e1293" dependencies = [ "bstr", "gix-discover", "gix-fs", "gix-ignore", "gix-index", "gix-object", "gix-path", "gix-pathspec", "gix-trace", "gix-utils", "gix-worktree", "thiserror 2.0.11", ] [[package]] name = "gix-discover" version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83bf6dfa4e266a4a9becb4d18fc801f92c3f7cc6c433dd86fdadbcf315ffb6ef" dependencies = [ "bstr", "dunce", "gix-fs", "gix-hash", "gix-path", "gix-ref", "gix-sec", "thiserror 2.0.11", ] [[package]] name = "gix-features" version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d85d673f2e022a340dba4713bed77ef2cf4cd737d2f3e0f159d45e0935fd81f" dependencies = [ "bytes", "crc32fast", "crossbeam-channel", "flate2", "gix-hash", "gix-trace", "gix-utils", "libc", "once_cell", "parking_lot", "prodash", "sha1_smol", "thiserror 2.0.11", "walkdir", ] [[package]] name = "gix-filter" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d0ecdee5667f840ba20c7fe56d63f8e1dc1e6b3bfd296151fe5ef07c874790a" dependencies = [ "bstr", "encoding_rs", "gix-attributes", "gix-command", "gix-hash", "gix-object", "gix-packetline-blocking", "gix-path", "gix-quote", "gix-trace", "gix-utils", "smallvec", "thiserror 2.0.11", ] [[package]] name = "gix-fs" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3d4fac505a621f97e5ce2c69fdc425742af00c0920363ca4074f0eb48b1db9" dependencies = [ "fastrand", "gix-features", "gix-utils", ] [[package]] name = "gix-glob" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aaf69a6bec0a3581567484bf99a4003afcaf6c469fd4214352517ea355cf3435" dependencies = [ "bitflags", "bstr", "gix-features", "gix-path", ] [[package]] name = "gix-hash" version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", "thiserror 2.0.11", ] [[package]] name = "gix-hashtable" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef65b256631078ef733bc5530c4e6b1c2e7d5c2830b75d4e9034ab3997d18fe" dependencies = [ "gix-hash", "hashbrown 0.14.5", "parking_lot", ] [[package]] name = "gix-ignore" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b1fb24d2a4af0aa7438e2771d60c14a80cf2c9bd55c29cf1712b841f05bb8a" dependencies = [ "bstr", "gix-glob", "gix-path", "gix-trace", "unicode-bom", ] [[package]] name = "gix-index" version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "270645fd20556b64c8ffa1540d921b281e6994413a0ca068596f97e9367a257a" dependencies = [ "bitflags", "bstr", "filetime", "fnv", "gix-bitmap", "gix-features", "gix-fs", "gix-hash", "gix-lock", "gix-object", "gix-traverse", "gix-utils", "gix-validate", "hashbrown 0.14.5", "itoa", "libc", "memmap2", "rustix", "smallvec", "thiserror 2.0.11", ] [[package]] name = "gix-lock" version = "15.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", "thiserror 2.0.11", ] [[package]] name = "gix-negotiate" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d27f830a16405386e9c83b9d5be8261fe32bbd6b3caf15bd1b284c6b2b7ef1a8" dependencies = [ "bitflags", "gix-commitgraph", "gix-date", "gix-hash", "gix-object", "gix-revwalk", "smallvec", "thiserror 2.0.11", ] [[package]] name = "gix-object" version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42d58010183ef033f31088479b4eb92b44fe341b35b62d39eb8b185573d77ea" dependencies = [ "bstr", "gix-actor", "gix-date", "gix-features", "gix-hash", "gix-hashtable", "gix-path", "gix-utils", "gix-validate", "itoa", "smallvec", "thiserror 2.0.11", "winnow 0.6.26", ] [[package]] name = "gix-odb" version = "0.66.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb780eceb3372ee204469478de02eaa34f6ba98247df0186337e0333de97d0ae" dependencies = [ "arc-swap", "gix-date", "gix-features", "gix-fs", "gix-hash", "gix-hashtable", "gix-object", "gix-pack", "gix-path", "gix-quote", "parking_lot", "tempfile", "thiserror 2.0.11", ] [[package]] name = "gix-pack" version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4158928929be29cae7ab97afc8e820a932071a7f39d8ba388eed2380c12c566c" dependencies = [ "clru", "gix-chunk", "gix-features", "gix-hash", "gix-hashtable", "gix-object", "gix-path", "gix-tempfile", "memmap2", "parking_lot", "smallvec", "thiserror 2.0.11", ] [[package]] name = "gix-packetline" version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e5ae6bc3ac160a6bf44a55f5537813ca3ddb08549c0fd3e7ef699c73c439cd" dependencies = [ "bstr", "faster-hex", "gix-trace", "thiserror 2.0.11", ] [[package]] name = "gix-packetline-blocking" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1cbf8767c6abd5a6779f586702b5bcd8702380f4208219449cf1c9d0cd1e17c" dependencies = [ "bstr", "faster-hex", "gix-trace", "thiserror 2.0.11", ] [[package]] name = "gix-path" version = "0.10.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c40f12bb65a8299be0cfb90fe718e3be236b7a94b434877012980863a883a99f" dependencies = [ "bstr", "gix-trace", "home", "once_cell", "thiserror 2.0.11", ] [[package]] name = "gix-pathspec" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c472dfbe4a4e96fcf7efddcd4771c9037bb4fdea2faaabf2f4888210c75b81e" dependencies = [ "bitflags", "bstr", "gix-attributes", "gix-config-value", "gix-glob", "gix-path", "thiserror 2.0.11", ] [[package]] name = "gix-prompt" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79f2185958e1512b989a007509df8d61dca014aa759a22bee80cfa6c594c3b6d" dependencies = [ "gix-command", "gix-config-value", "parking_lot", "rustix", "thiserror 2.0.11", ] [[package]] name = "gix-protocol" version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c84642e8b6fed7035ce9cc449593019c55b0ec1af7a5dce1ab8a0636eaaeb067" dependencies = [ "bstr", "gix-credentials", "gix-date", "gix-features", "gix-hash", "gix-lock", "gix-negotiate", "gix-object", "gix-ref", "gix-refspec", "gix-revwalk", "gix-shallow", "gix-trace", "gix-transport", "gix-utils", "maybe-async", "thiserror 2.0.11", "winnow 0.6.26", ] [[package]] name = "gix-quote" version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e49357fccdb0c85c0d3a3292a9f6db32d9b3535959b5471bb9624908f4a066c6" dependencies = [ "bstr", "gix-utils", "thiserror 2.0.11", ] [[package]] name = "gix-ref" version = "0.49.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91b61776c839d0f1b7114901179afb0947aa7f4d30793ca1c56d335dfef485f" dependencies = [ "gix-actor", "gix-features", "gix-fs", "gix-hash", "gix-lock", "gix-object", "gix-path", "gix-tempfile", "gix-utils", "gix-validate", "memmap2", "thiserror 2.0.11", "winnow 0.6.26", ] [[package]] name = "gix-refspec" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00c056bb747868c7eb0aeb352c9f9181ab8ca3d0a2550f16470803500c6c413d" dependencies = [ "bstr", "gix-hash", "gix-revision", "gix-validate", "smallvec", "thiserror 2.0.11", ] [[package]] name = "gix-revision" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61e1ddc474405a68d2ce8485705dd72fe6ce959f2f5fe718601ead5da2c8f9e7" dependencies = [ "bstr", "gix-commitgraph", "gix-date", "gix-hash", "gix-object", "gix-revwalk", "thiserror 2.0.11", ] [[package]] name = "gix-revwalk" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "510026fc32f456f8f067d8f37c34088b97a36b2229d88a6a5023ef179fcb109d" dependencies = [ "gix-commitgraph", "gix-date", "gix-hash", "gix-hashtable", "gix-object", "smallvec", "thiserror 2.0.11", ] [[package]] name = "gix-sec" version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d84dae13271f4313f8d60a166bf27e54c968c7c33e2ffd31c48cafe5da649875" dependencies = [ "bitflags", "gix-path", "libc", "windows-sys 0.52.0", ] [[package]] name = "gix-shallow" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d2673242e87492cb6ff671f0c01f689061ca306c4020f137197f3abc84ce01" dependencies = [ "bstr", "gix-hash", "gix-lock", "thiserror 2.0.11", ] [[package]] name = "gix-submodule" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2455f8c0fcb6ebe2a6e83c8f522d30615d763eb2ef7a23c7d929f9476e89f5c" dependencies = [ "bstr", "gix-config", "gix-path", "gix-pathspec", "gix-refspec", "gix-url", "thiserror 2.0.11", ] [[package]] name = "gix-tempfile" version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2feb86ef094cc77a4a9a5afbfe5de626897351bbbd0de3cb9314baf3049adb82" dependencies = [ "gix-fs", "libc", "once_cell", "parking_lot", "tempfile", ] [[package]] name = "gix-trace" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c396a2036920c69695f760a65e7f2677267ccf483f25046977d87e4cb2665f7" [[package]] name = "gix-transport" version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd04d91e507a8713cfa2318d5a85d75b36e53a40379cc7eb7634ce400ecacbaf" dependencies = [ "base64", "bstr", "curl", "gix-command", "gix-credentials", "gix-features", "gix-packetline", "gix-quote", "gix-sec", "gix-url", "thiserror 2.0.11", ] [[package]] name = "gix-traverse" version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ed47d648619e23e93f971d2bba0d10c1100e54ef95d2981d609907a8cabac89" dependencies = [ "bitflags", "gix-commitgraph", "gix-date", "gix-hash", "gix-hashtable", "gix-object", "gix-revwalk", "smallvec", "thiserror 2.0.11", ] [[package]] name = "gix-url" version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d096fb733ba6bd3f5403dba8bd72bdd8809fe2b347b57844040b8f49c93492d9" dependencies = [ "bstr", "gix-features", "gix-path", "percent-encoding", "thiserror 2.0.11", "url", ] [[package]] name = "gix-utils" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff08f24e03ac8916c478c8419d7d3c33393da9bb41fa4c24455d5406aeefd35f" dependencies = [ "bstr", "fastrand", "unicode-normalization", ] [[package]] name = "gix-validate" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eaa01c3337d885617c0a42e92823922a2aea71f4caeace6fe87002bdcadbd90" dependencies = [ "bstr", "thiserror 2.0.11", ] [[package]] name = "gix-worktree" version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "756dbbe15188fa22540d5eab941f8f9cf511a5364d5aec34c88083c09f4bea13" dependencies = [ "bstr", "gix-attributes", "gix-features", "gix-fs", "gix-glob", "gix-hash", "gix-ignore", "gix-index", "gix-object", "gix-path", "gix-validate", ] [[package]] name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "globset" version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", "log", "regex-automata 0.4.9", "regex-syntax 0.8.5", ] [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core", "subtle", ] [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", ] [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "foldhash", ] [[package]] name = "hashlink" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ "hashbrown 0.14.5", ] [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] [[package]] name = "hmac" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ "digest", ] [[package]] name = "home" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "http-auth" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "150fa4a9462ef926824cf4519c84ed652ca8f4fbae34cb8af045b5cbcaf98822" dependencies = [ "memchr", ] [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "icu_collections" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ "displaydoc", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_locid" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ "displaydoc", "litemap", "tinystr", "writeable", "zerovec", ] [[package]] name = "icu_locid_transform" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" dependencies = [ "displaydoc", "icu_locid", "icu_locid_transform_data", "icu_provider", "tinystr", "zerovec", ] [[package]] name = "icu_locid_transform_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] name = "icu_normalizer" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", "utf16_iter", "utf8_iter", "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] name = "icu_properties" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ "displaydoc", "icu_collections", "icu_locid_transform", "icu_properties_data", "icu_provider", "tinystr", "zerovec", ] [[package]] name = "icu_properties_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] name = "icu_provider" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ "displaydoc", "icu_locid", "icu_provider_macros", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_provider_macros" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "idna" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ "idna_adapter", "smallvec", "utf8_iter", ] [[package]] name = "idna_adapter" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ "icu_normalizer", "icu_properties", ] [[package]] name = "ignore" version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" dependencies = [ "crossbeam-deque", "globset", "log", "memchr", "regex-automata 0.4.9", "same-file", "walkdir", "winapi-util", ] [[package]] name = "im-rc" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1955a75fa080c677d3972822ec4bad316169ab1cfc6c257a942c2265dbe5fe" dependencies = [ "bitmaps", "rand_core", "rand_xoshiro", "sized-chunks", "typenum", "version_check", ] [[package]] name = "implib" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "598bf7096215f835b0f70c94d7b033da3cbf66181b619f25e54d65adaf825e62" dependencies = [ "memoffset", "object", ] [[package]] name = "indexmap" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown 0.15.2", ] [[package]] name = "is_executable" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4a1b5bad6f9072935961dfbf1cced2f3d129963d091b6f69f007fe04e758ae2" dependencies = [ "winapi", ] [[package]] name = "is_terminal_polyfill" version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] [[package]] name = "itertools" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] [[package]] name = "itoa" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c04ef77ae73f3cf50510712722f0c4e8b46f5aaa1bf5ffad2ae213e6495e78e5" dependencies = [ "jiff-tzdb-platform", "log", "portable-atomic", "portable-atomic-util", "serde", "windows-sys 0.59.0", ] [[package]] name = "jiff-tzdb" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf2cec2f5d266af45a071ece48b1fb89f3b00b2421ac3a5fe10285a6caaa60d3" [[package]] name = "jiff-tzdb-platform" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a63c62e404e7b92979d2792352d885a7f8f83fd1d0d31eea582d77b2ceca697e" dependencies = [ "jiff-tzdb", ] [[package]] name = "jobserver" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", ] [[package]] name = "kstring" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "558bf9508a558512042d3095138b1f7b8fe90c5467d94f9f1da28b3731c5dbd1" dependencies = [ "static_assertions", ] [[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libdbus-sys" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" dependencies = [ "cc", "pkg-config", ] [[package]] name = "libgit2-sys" version = "0.17.0+1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" dependencies = [ "cc", "libc", "libssh2-sys", "libz-sys", "openssl-sys", "pkg-config", ] [[package]] name = "libloading" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets 0.52.6", ] [[package]] name = "libnghttp2-sys" version = "0.1.11+1.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b6c24e48a7167cffa7119da39d577fa482e66c688a4aac016bee862e1a713c4" dependencies = [ "cc", "libc", ] [[package]] name = "libredox" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags", "libc", "redox_syscall", ] [[package]] name = "libsqlite3-sys" version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ "cc", "pkg-config", "vcpkg", ] [[package]] name = "libssh2-sys" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" dependencies = [ "cc", "libc", "libz-sys", "openssl-sys", "pkg-config", "vcpkg", ] [[package]] name = "libz-sys" version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "linux-raw-sys" version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", ] [[package]] name = "log" version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "matchers" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata 0.1.10", ] [[package]] name = "maybe-async" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] [[package]] name = "memoffset" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] [[package]] name = "miow" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "359f76430b20a79f9e20e115b3428614e654f04fab314482fc0fda0ebd3c6044" dependencies = [ "windows-sys 0.48.0", ] [[package]] name = "nom" version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", ] [[package]] name = "normpath" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "nu-ansi-term" version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ "overload", "winapi", ] [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "object" version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "crc32fast", "hashbrown 0.15.2", "indexmap", "memchr", ] [[package]] name = "once_cell" version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "opener" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0812e5e4df08da354c851a3376fead46db31c2214f849d3de356d774d057681" dependencies = [ "bstr", "dbus", "normpath", "windows-sys 0.59.0", ] [[package]] name = "openssl" version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" 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", ] [[package]] name = "openssl-probe" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" version = "300.4.2+3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" dependencies = [ "cc", ] [[package]] name = "openssl-sys" version = "0.9.106" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" dependencies = [ "cc", "libc", "openssl-src", "pkg-config", "vcpkg", ] [[package]] name = "ordered-float" version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" dependencies = [ "num-traits", ] [[package]] name = "orion" version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd806049e71da4c4a7880466b37afdc5a4c5b35a398b0d4fd9ff5d278d3b4db9" dependencies = [ "fiat-crypto", "subtle", "zeroize", ] [[package]] name = "os_info" version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a604e53c24761286860eba4e2c8b23a0161526476b1de520139d69cdb85a6b5" dependencies = [ "log", "windows-sys 0.52.0", ] [[package]] name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "p384" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" dependencies = [ "ecdsa", "elliptic-curve", "primeorder", "sha2", ] [[package]] name = "parking_lot" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", "windows-targets 0.52.6", ] [[package]] name = "pasetors" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c54944fa25a6e7c9c5b3315f118d360cc00d555cf53bb2b2fdf32dd31c71b729" dependencies = [ "ct-codecs", "ed25519-compact", "getrandom 0.3.1", "orion", "p384", "rand_core", "regex", "serde", "serde_json", "sha2", "subtle", "time", "zeroize", ] [[package]] name = "pathdiff" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "pem-rfc7468" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ "base64ct", ] [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", ] [[package]] name = "pkg-config" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "portable-atomic-util" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" dependencies = [ "portable-atomic", ] [[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.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ "zerocopy", ] [[package]] name = "primeorder" version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ "elliptic-curve", ] [[package]] name = "proc-macro2" version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "prodash" version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a266d8d6020c61a437be704c5e618037588e1985c7dbb7bf8d265db84cffe325" dependencies = [ "log", "parking_lot", ] [[package]] name = "quote" version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", "rand_core", ] [[package]] name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", ] [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom 0.2.15", ] [[package]] name = "rand_xoshiro" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" dependencies = [ "rand_core", ] [[package]] name = "redox_syscall" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" dependencies = [ "bitflags", ] [[package]] name = "regex" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", "regex-automata 0.4.9", "regex-syntax 0.8.5", ] [[package]] name = "regex-automata" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ "regex-syntax 0.6.29", ] [[package]] name = "regex-automata" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", "regex-syntax 0.8.5", ] [[package]] name = "regex-syntax" version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rfc6979" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac", "subtle", ] [[package]] name = "rusqlite" version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" dependencies = [ "bitflags", "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", "smallvec", ] [[package]] name = "rustc-hash" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc-stable-hash" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2febf9acc5ee5e99d1ad0afcdbccc02d87aa3f857a1f01f825b80eacf8edfcd1" [[package]] name = "rustfix" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f66156d7471ff4f12253cd7fd76dfe637a595a9418168154e8570f3947fe9a8" dependencies = [ "serde", "serde_json", "thiserror 1.0.69", "tracing", ] [[package]] name = "rustix" version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", "windows-sys 0.59.0", ] [[package]] name = "ryu" version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "same-file" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ "winapi-util", ] [[package]] name = "schannel" version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", "generic-array", "pkcs8", "subtle", "zeroize", ] [[package]] name = "security-framework" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ "bitflags", "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "semver" version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" dependencies = [ "serde", ] [[package]] name = "serde" version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde-untagged" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2676ba99bd82f75cae5cbd2c8eda6fa0b8760f18978ea840e980dd5567b5c5b6" dependencies = [ "erased-serde", "serde", "typeid", ] [[package]] name = "serde-value" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" dependencies = [ "ordered-float", "serde", ] [[package]] name = "serde_derive" version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_ignored" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8e319a36d1b52126a0d608f24e93b2d81297091818cd70625fcf50a15d84ddf" dependencies = [ "serde", ] [[package]] name = "serde_json" version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" dependencies = [ "itoa", "memchr", "ryu", "serde", ] [[package]] name = "serde_spanned" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] [[package]] name = "sha1" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", "digest", ] [[package]] name = "sha1_smol" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", "digest", ] [[package]] name = "sharded-slab" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "shell-escape" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" [[package]] name = "shell-words" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signature" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core", ] [[package]] name = "sized-chunks" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" dependencies = [ "bitmaps", "typenum", ] [[package]] name = "smallvec" version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "spki" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", ] [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "supports-hyperlinks" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" [[package]] name = "supports-unicode" version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "synstructure" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "tar" version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" dependencies = [ "filetime", "libc", ] [[package]] name = "tempfile" version = "3.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" dependencies = [ "cfg-if", "fastrand", "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", ] [[package]] name = "terminal_size" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ "rustix", "windows-sys 0.59.0", ] [[package]] name = "thiserror" version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl 1.0.69", ] [[package]] name = "thiserror" version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ "thiserror-impl 2.0.11", ] [[package]] name = "thiserror-impl" version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "thiserror-impl" version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "thread_local" version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", ] [[package]] name = "time" version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", "num-conv", "powerfmt", "serde", "time-core", "time-macros", ] [[package]] name = "time-core" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", ] [[package]] name = "tinystr" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ "displaydoc", "zerovec", ] [[package]] name = "tinyvec" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "toml" version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit", ] [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow 0.7.3", ] [[package]] name = "tracing" version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "tracing-chrome" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf0a738ed5d6450a9fb96e86a23ad808de2b727fd1394585da5cdd6788ffe724" dependencies = [ "serde_json", "tracing-core", "tracing-subscriber", ] [[package]] name = "tracing-core" version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", ] [[package]] name = "tracing-log" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ "log", "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", "once_cell", "regex", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", ] [[package]] name = "typeid" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] name = "typenum" version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicase" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-bom" version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-normalization" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "unicode-xid" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] [[package]] name = "utf16_iter" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] name = "utf8_iter" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "utf8parse" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", ] [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" version = "0.13.3+wasi-0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" dependencies = [ "wit-bindgen-rt", ] [[package]] name = "wasm-bindgen" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ "unicode-ident", ] [[package]] name = "winapi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets 0.48.5", ] [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm 0.48.5", "windows_aarch64_msvc 0.48.5", "windows_i686_gnu 0.48.5", "windows_i686_msvc 0.48.5", "windows_x86_64_gnu 0.48.5", "windows_x86_64_gnullvm 0.48.5", "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" dependencies = [ "memchr", ] [[package]] name = "winnow" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" dependencies = [ "memchr", ] [[package]] name = "wit-bindgen-rt" version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ "bitflags", ] [[package]] name = "write16" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" [[package]] name = "writeable" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "yoke" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", "yoke-derive", "zerofrom", ] [[package]] name = "yoke-derive" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "zerofrom" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zerovec" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" dependencies = [ "yoke", "zerofrom", "zerovec-derive", ] [[package]] name = "zerovec-derive" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", "syn", ] cargo-c-0.10.11+cargo-0.86.0/Cargo.toml0000644000000043670000000000100123350ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.83" name = "cargo-c" version = "0.10.11+cargo-0.86.0" authors = ["Luca Barbato "] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Helper program to build and install c-like libraries" readme = "README.md" keywords = [ "cargo", "cdylib", ] categories = [ "command-line-utilities", "development-tools::cargo-plugins", ] license = "MIT" repository = "https://github.com/lu-zero/cargo-c" [features] default = [] vendored-openssl = ["cargo/vendored-openssl"] [lib] name = "cargo_c" path = "src/lib.rs" [[bin]] name = "cargo-capi" path = "src/bin/capi.rs" [[bin]] name = "cargo-cbuild" path = "src/bin/cbuild.rs" [[bin]] name = "cargo-cinstall" path = "src/bin/cinstall.rs" [[bin]] name = "cargo-ctest" path = "src/bin/ctest.rs" [dependencies.anyhow] version = "1.0" [dependencies.cargo] version = "0.86.0" [dependencies.cargo-util] version = "0.2" [dependencies.cbindgen] version = "0.28.0" default-features = false [dependencies.cc] version = "1.0" [dependencies.clap] version = "4.5.18" features = [ "color", "derive", "cargo", "string", "wrap_help", ] [dependencies.glob] version = "0.3" [dependencies.implib] version = "0.3.5" [dependencies.itertools] version = "0.14" [dependencies.log] version = "0.4" [dependencies.object] version = "0.36.4" features = [ "std", "read_core", "pe", ] default-features = false [dependencies.regex] version = "1.5.6" [dependencies.semver] version = "1.0.3" [dependencies.serde] version = "1.0.123" [dependencies.serde_derive] version = "1.0" [dependencies.serde_json] version = "1.0.62" [dependencies.toml] version = "0.8" [profile.release-strip] inherits = "release" strip = "symbols" cargo-c-0.10.11+cargo-0.86.0/Cargo.toml.orig000064400000000000000000000025041046102023000160050ustar 00000000000000[package] name = "cargo-c" version = "0.10.11+cargo-0.86.0" authors = ["Luca Barbato "] description = "Helper program to build and install c-like libraries" license = "MIT" edition = "2021" readme = "README.md" repository = "https://github.com/lu-zero/cargo-c" categories = ["command-line-utilities", "development-tools::cargo-plugins"] keywords = ["cargo", "cdylib"] rust-version = "1.83" [[bin]] name = "cargo-capi" path = "src/bin/capi.rs" [[bin]] name = "cargo-cinstall" path = "src/bin/cinstall.rs" [[bin]] name = "cargo-cbuild" path = "src/bin/cbuild.rs" [[bin]] name = "cargo-ctest" path = "src/bin/ctest.rs" [dependencies] cargo = "0.86.0" cargo-util = "0.2" semver = "1.0.3" log = "0.4" clap = { version = "4.5.18", features = ["color", "derive", "cargo", "string", "wrap_help"] } regex = "1.5.6" cbindgen = { version="0.28.0", default-features=false } toml = "0.8" serde = "1.0.123" serde_derive = "1.0" serde_json = "1.0.62" anyhow = "1.0" cc = "1.0" glob = "0.3" itertools = "0.14" implib = "0.3.5" object = { version = "0.36.4", default-features = false, features = ["std", "read_core", "pe"] } [features] default = [] vendored-openssl = ["cargo/vendored-openssl"] [profile.release-strip] inherits = "release" strip = "symbols" # To avoid #414 [workspace] exclude = ["example-project", "example-workspace"] cargo-c-0.10.11+cargo-0.86.0/LICENSE000064400000000000000000000020551046102023000141240ustar 00000000000000MIT License Copyright (c) 2019 Luca Barbato Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. cargo-c-0.10.11+cargo-0.86.0/README.md000064400000000000000000000302001046102023000143670ustar 00000000000000# Cargo C-ABI helpers [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Crates.io](https://img.shields.io/crates/v/cargo-c.svg)](https://crates.io/crates/cargo-c) [![Build Status](https://github.com/lu-zero/cargo-c/workflows/Rust/badge.svg)](https://github.com/lu-zero/cargo-c/actions?query=workflow:Rust) [![cargo-c chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://rust-av.zulipchat.com/#narrow/stream/254255-cargo-c) [![dependency status](https://deps.rs/repo/github/lu-zero/cargo-c/status.svg)](https://deps.rs/repo/github/lu-zero/cargo-c) [cargo](https://doc.rust-lang.org/cargo) applet to build and install C-ABI compatible dynamic and static libraries. It produces and installs a correct [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) file, a static library and a dynamic library, and a C header to be used by any C (and C-compatible) software. ## Installation **cargo-c** may be installed from [crates.io](https://crates.io/crates/cargo-c). ``` sh cargo install cargo-c ``` The `rustc` version supported is the same as the one supported by the `cargo` version embedded in the package version, or as set in the [rust-version](https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field) field. You must have the **cargo** build [requirements](https://github.com/rust-lang/cargo#compiling-from-source) satisfied in order to build **cargo-c**: * `git` * `pkg-config` (on Unix, used to figure out the host-provided headers/libraries) * `curl` (on Unix) * OpenSSL headers (only for Unix, this is the `libssl-dev` package on deb-based distributions) You may pass `--features=vendored-openssl` if you have problems building openssl-sys using the host-provided OpenSSL. ``` sh cargo install cargo-c --features=vendored-openssl ``` ## Usage ``` sh # build the library, create the .h header, create the .pc file $ cargo cbuild --destdir=${D} --prefix=/usr --libdir=/usr/lib64 ``` ``` sh # build the library, create the .h header, create the .pc file, build and run the tests $ cargo ctest ``` ``` sh # build the library, create the .h header, create the .pc file and install all of it $ cargo cinstall --destdir=${D} --prefix=/usr --libdir=/usr/lib64 ``` For a more in-depth explanation of how `cargo-c` works and how to use it for your crates, read [Building Crates so they Look Like C ABI Libraries][dev.to]. ### The TL;DR: This is the ideal setup for a project that wants to keep their C-API within the main crate: - [Create][diff-1] a `capi.rs` with the C-API you want to expose and use ~~`#[cfg(cargo_c)]`~~`#[cfg(feature="capi")]` to hide it when you build a normal rust library. - [Make sure][diff-2] you have a lib target and if you are using a workspace the first member is the crate you want to export, that means that you might have [to add a "." member at the start of the list][diff-3]. - ~~Since Rust 1.38, also add "staticlib" to the "lib" `crate-type`.~~ Do not specify the `crate-type`, cargo-c will add the correct library target by itself. - You may use the feature `capi` to add C-API-specific optional dependencies. > **NOTE**: It must be always present in `Cargo.toml` - Remember to [add][diff-4] a [`cbindgen.toml`][cbindgen-toml] and fill it with at least the include guard and probably you want to set the language to C (it defaults to C++) - Once you are happy with the result update your documentation to tell the user to install `cargo-c` and do `cargo cinstall --prefix=/usr --destdir=/tmp/some-place` or something along those lines. If you plan to keep the bindings as a separate crate and do not need to autogenerate the headers you may just [populate Cargo.toml][diff-5]: - Add a `capi` feature, since it is used by cargo-c to identify packages that has to be built as C-libraries within a workspace. - Set the entry in `package.metadata.capi.header.generate` to `false`. - Optionally override the path to the header to a custom one instead of the default one. [diff-1]: https://github.com/RustAudio/lewton/pull/50/commits/557cb4ce35beedf6d6bfaa481f29936094a71669 [diff-2]: https://github.com/RustAudio/lewton/pull/50/commits/e7ea8fff6423213d1892e86d51c0c499d8904dc1 [diff-3]: https://github.com/xiph/rav1e/pull/1381/commits/7d558125f42f4b503bcdcda5a82765da76a227e0#diff-80398c5faae3c069e4e6aa2ed11b28c0R94 [diff-4]: https://github.com/RustAudio/lewton/pull/51/files [diff-5]: https://github.com/linebender/resvg/commit/c0777c7ce26bf40efed7ba38d0a70e5af83feb78 [cbindgen-toml]: https://github.com/eqrion/cbindgen/blob/master/docs.md#cbindgentoml ## Advanced You may override various aspects of `cargo-c` via settings in `Cargo.toml` under the `package.metadata.capi` key ```toml [package.metadata.capi] # Configures the minimum required cargo-c version. Trying to run with an # older version causes an error. min_version = "0.6.10" ``` ### Header Generation ```toml [package.metadata.capi.header] # Used as header file name. By default this is equal to the crate name. # The name can be with or without the header filename extension `.h` name = "new_name" # Install the header into a subdirectory with the name of the crate. This # is enabled by default, pass `false` or "" to disable it. subdirectory = "libfoo-2.0/foo" # Generate the header file with `cbindgen`, or copy a pre-generated header # from the `assets` subdirectory. By default a header is generated. generation = true # Can be use to disable header generation completely. # This can be used when generating dynamic modules instead of an actual library. enabled = true ``` ### `pkg-config` File Generation ```toml [package.metadata.capi.pkg_config] # Used as the package name in the pkg-config file and defaults to the crate name. name = "libfoo" # Used as the pkg-config file name and defaults to the crate name. filename = "libfoo-2.0" # Used as the package description in the pkg-config file and defaults to the crate description. description = "some description" # Used as the package version in the pkg-config file and defaults to the crate version. version = "1.2.3" # Used as the Requires field in the pkg-config file, if defined requires = "gstreamer-1.0, gstreamer-base-1.0" # Used as the Requires.private field in the pkg-config file, if defined requires_private = "gobject-2.0, glib-2.0 >= 2.56.0, gmodule-2.0" # Strip the include search path from the last n components, useful to support installing in a # subdirectory but then include with the path. By default it is 0. strip_include_path_components = 1 ``` ### Library Generation ```toml [package.metadata.capi.library] # Used as the library name and defaults to the crate name. This might get # prefixed with `lib` depending on the target platform. name = "new_name" # Used as library version and defaults to the crate version. How this is used # depends on the target platform. version = "1.2.3" # Used to install the library to a subdirectory of `libdir`. install_subdir = "gstreamer-1.0" # Used to disable versioning links when installing the dynamic library versioning = false # Instead of using semver, select a fixed number of version components for your SONAME version suffix: # Setting this to 1 with a version of 0.0.0 allows a suffix of `.so.0` # Setting this to 3 always includes the full version in the SONAME (indicate any update is ABI breaking) #version_suffix_components = 2 # Add `-Cpanic=abort` to the RUSTFLAGS automatically, it may be useful in case # something might panic in the crates used by the library. rustflags = "-Cpanic=abort" # Used to disable the generation of additional import library file in platforms # that have the concept such as Windows import_library = false ``` ### Custom data install ```toml [package.metadata.capi.install.data] # Used to install the data to a subdirectory of `datadir`. By default it is the same as `name` subdirectory = "foodata" # Copy the pre-generated data files found in {root_dir}/{from} to {datadir}/{to}/{matched subdirs} # If {from} is a single path instead of a glob, the destination is {datapath}/{to}. # datapath is {datadir}/{subdirectory} asset = [{from="pattern/with/or/without/**/*", to="destination"}] # Copy the pre-generated data files found in {OUT_DIR}/{from} to {includedir}/{to}/{matched subdirs} # If {from} is a single path instead of a glob, the destination is {datapath}/{to}. # datapath is {datadir}/{subdirectory} generated = [{from="pattern/with/or/without/**/*", to="destination"}] [package.metadata.capi.install.include] # Copy the pre-generated includes found in {root_dir}/{from} to {includedir}/{to}/{matched subdirs} # If {from} is a single path instead of a glob, the destination is {includepath}/{to}. # includepath is {includedir}/{header.subdirectory} asset = [{from="pattern/with/or/without/**/*", to="destination"}] # Copy the pre-generated includes found in {OUT_DIR}/{from} to {includedir}/{to}/{matched subdirs} # If {from} is a single path instead of a glob, the destination is {includedpath}/{to}. # includepath is {includedir}/{header.subdirectory} generated = [{from="pattern/with/or/without/**/*", to="destination"}] ``` ### Notes Do **not** pass `RUSTFLAGS` that are managed by cargo through other means, (e.g. the flags driven by `[profiles]` or the flags driven by `[target.<>]`), cargo-c effectively builds as if the *target* is always explicitly passed. ## Users - [ebur128](https://github.com/sdroege/ebur128#c-api) - [gcode-rs](https://github.com/Michael-F-Bryan/gcode-rs) - [gst-plugins-rs](https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs) - [lewton](https://github.com/RustAudio/lewton) - [libdovi](https://github.com/quietvoid/dovi_tool/tree/main/dolby_vision#libdovi-c-api) - [libimagequant](https://github.com/ImageOptim/libimagequant#building-with-cargo-c) - [librsvg](https://github.com/GNOME/librsvg/blob/main/rsvg/meson.build) - [rav1e](https://github.com/xiph/rav1e) - [rustls-ffi](https://github.com/rustls/rustls-ffi) - [sled](https://github.com/spacejam/sled/tree/master/bindings/sled-native) - [pathfinder](https://github.com/servo/pathfinder#c) - [udbserver](https://github.com/bet4it/udbserver) ## Status - [x] cli - [x] build command - [x] install command - [x] test command - [x] cargo applet support - [x] build targets - [x] pkg-config generation - [x] header generation (cbindgen integration) - [x] `staticlib` support - [x] `cdylib` support - [x] Generate version information in the header - [ ] Make it tunable - [x] Extra Cargo.toml keys - [x] Better status reporting [dev.to]: https://dev.to/luzero/building-crates-so-they-look-like-c-abi-libraries-1ibn [using]: https://dev.to/luzero/building-crates-so-they-look-like-c-abi-libraries-1ibn#using-cargoc ## Availability [![Packaging status](https://repology.org/badge/vertical-allrepos/cargo-c.svg)](https://repology.org/project/cargo-c/versions) ## Troubleshooting ### Shared libraries are not built on musl systems When running on a musl-based system (e.g. Alpine Linux), it could be that using the `cdylib` library type results in the following error (as reported [here](https://github.com/lu-zero/cargo-c/issues/180)): > Error: CliError { error: Some(cannot produce cdylib for as the target x86_64-unknown-linux-musl does not support these crate types), exit_code: 101 } This suggests that Rust was not built with `crt-static=false` and it typically happens if Rust has been installed through rustup. Shared libraries can be enabled manually in this case, by editing the file `.cargo/config` like so: ```toml # .cargo/config [target.x86_64-unknown-linux-musl] rustflags = [ "-C", "target-feature=-crt-static", ] ``` However, it is preferred to install Rust through the system package manager instead of rustup (e.g. with `apk add rust`), because the provided package should already handle this (see e.g. [here](https://git.alpinelinux.org/aports/tree/main/rust/APKBUILD?h=3.19-stable#n232)). ### On Debian-like system the libdir includes the host triplet by default In order to accomodate Debian's [multiarch](https://wiki.debian.org/Multiarch/Implementation) approach the `cargo-c` default for the `libdir` is `lib/` on such system. Either pass an explicit `--libdir` or pass `--target` to return to the common `libdir=lib` default. ## Acknowledgements This software has been partially developed in the scope of the H2020 project SIFIS-Home with GA n. 952652. cargo-c-0.10.11+cargo-0.86.0/codecov.yml000064400000000000000000000003311046102023000152570ustar 00000000000000coverage: status: project: default: target: 80% # the required coverage value threshold: 10% # the leniency in hitting the target patch: default: informational: true cargo-c-0.10.11+cargo-0.86.0/coverage.sh000064400000000000000000000031651046102023000152510ustar 00000000000000export LLVM_PROFILE_FILE="cargo-c-%p-%m.profraw" export RUSTFLAGS=-Cinstrument-coverage export CARGO_INCREMENTAL=0 rustup default stable cargo build cargo test rustup target add x86_64-pc-windows-gnu unset RUSTFLAGS function run() { echo "$*" $* } for project in example-project example-workspace; do run target/debug/cargo-capi capi --help run target/debug/cargo-capi capi test --manifest-path=${project}/Cargo.toml run target/debug/cargo-capi capi clean --manifest-path=${project}/Cargo.toml run target/debug/cargo-capi capi build --manifest-path=${project}/Cargo.toml run target/debug/cargo-capi capi install --manifest-path=${project}/Cargo.toml --destdir=/tmp/staging run target/debug/cargo-capi clean --manifest-path=${project}/Cargo.toml run target/debug/cargo-cbuild --help run target/debug/cargo-cbuild clean --manifest-path=${project}/Cargo.toml run target/debug/cargo-cbuild cbuild --manifest-path=${project}/Cargo.toml run target/debug/cargo-ctest metadata --help run target/debug/cargo-ctest ctest --manifest-path=${project}/Cargo.toml run target/debug/cargo-cinstall --help run target/debug/cargo-cinstall cinstall --manifest-path=${project}/Cargo.toml --destdir=/tmp/staging run target/debug/cargo-cinstall clean --manifest-path=${project}/Cargo.toml run target/debug/cargo-cinstall cinstall --manifest-path=${project}/Cargo.toml --destdir=/tmp/staging-win --target=x86_64-pc-windows-gnu --dlltool=x86_64-w64-mingw32-dlltool done grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov cargo-c-0.10.11+cargo-0.86.0/src/bin/capi.rs000064400000000000000000000042701046102023000157410ustar 00000000000000use cargo_c::build::{cbuild, ctest}; use cargo_c::cli::*; use cargo_c::config::*; use cargo_c::install::cinstall; use cargo::util::command_prelude::flag; use cargo::util::command_prelude::ArgMatchesExt; use cargo::{CliResult, GlobalContext}; use clap::*; fn main() -> CliResult { let mut config = GlobalContext::default()?; let cli_build = subcommand_build("build", "Build the crate C-API"); let cli_install = subcommand_install("install", "Install the crate C-API"); let cli_test = subcommand_test("test"); let mut app = main_cli().subcommand( Command::new("capi") .allow_external_subcommands(true) .about("Build or install the crate C-API") .arg(flag("version", "Print version info and exit").short('V')) .subcommand(cli_build) .subcommand(cli_install) .subcommand(cli_test), ); let args = app.clone().get_matches(); let (cmd, subcommand_args, default_profile) = match args.subcommand() { Some(("capi", args)) => match args.subcommand() { Some(("build", args)) => ("build", args, "dev"), Some(("test", args)) => ("test", args, "dev"), Some(("install", args)) => ("install", args, "release"), Some((cmd, args)) => { return run_cargo_fallback(cmd, args); } _ => { // No subcommand provided. app.print_help()?; return Ok(()); } }, Some((cmd, args)) => { return run_cargo_fallback(cmd, args); } _ => { app.print_help()?; return Ok(()); } }; if subcommand_args.flag("version") { println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); return Ok(()); } global_context_configure(&mut config, subcommand_args)?; let mut ws = subcommand_args.workspace(&config)?; let (packages, compile_opts) = cbuild(&mut ws, &config, subcommand_args, default_profile)?; if cmd == "install" { cinstall(&ws, &packages)?; } else if cmd == "test" { ctest(&ws, subcommand_args, &packages, compile_opts)?; } Ok(()) } cargo-c-0.10.11+cargo-0.86.0/src/bin/cbuild.rs000064400000000000000000000021331046102023000162630ustar 00000000000000use cargo::util::command_prelude::ArgMatchesExt; use cargo::CliResult; use cargo::GlobalContext; use cargo_c::build::*; use cargo_c::cli::{main_cli, run_cargo_fallback, subcommand_build}; use cargo_c::config::*; fn main() -> CliResult { let mut config = GlobalContext::default()?; let subcommand = subcommand_build("cbuild", "Build the crate C-API"); let mut app = main_cli().subcommand(subcommand); let args = app.clone().get_matches(); let subcommand_args = match args.subcommand() { Some(("cbuild", args)) => args, Some((cmd, args)) => { return run_cargo_fallback(cmd, args); } _ => { // No subcommand provided. app.print_help()?; return Ok(()); } }; if subcommand_args.flag("version") { println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); return Ok(()); } global_context_configure(&mut config, subcommand_args)?; let mut ws = subcommand_args.workspace(&config)?; let _ = cbuild(&mut ws, &config, subcommand_args, "dev")?; Ok(()) } cargo-c-0.10.11+cargo-0.86.0/src/bin/cinstall.rs000064400000000000000000000023211046102023000166310ustar 00000000000000use cargo::util::command_prelude::ArgMatchesExt; use cargo::CliResult; use cargo::GlobalContext; use cargo_c::build::cbuild; use cargo_c::cli::{main_cli, run_cargo_fallback, subcommand_install}; use cargo_c::config::global_context_configure; use cargo_c::install::cinstall; fn main() -> CliResult { let mut config = GlobalContext::default()?; let subcommand = subcommand_install("cinstall", "Install the crate C-API"); let mut app = main_cli().subcommand(subcommand); let args = app.clone().get_matches(); let subcommand_args = match args.subcommand() { Some(("cinstall", args)) => args, Some((cmd, args)) => { return run_cargo_fallback(cmd, args); } _ => { // No subcommand provided. app.print_help()?; return Ok(()); } }; if subcommand_args.flag("version") { println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); return Ok(()); } global_context_configure(&mut config, subcommand_args)?; let mut ws = subcommand_args.workspace(&config)?; let (packages, _) = cbuild(&mut ws, &config, subcommand_args, "release")?; cinstall(&ws, &packages)?; Ok(()) } cargo-c-0.10.11+cargo-0.86.0/src/bin/ctest.rs000064400000000000000000000021101046102023000161360ustar 00000000000000use cargo::util::command_prelude::*; use cargo_c::build::*; use cargo_c::cli::{main_cli, run_cargo_fallback, subcommand_test}; use cargo_c::config::*; fn main() -> CliResult { let mut config = GlobalContext::default()?; let subcommand = subcommand_test("ctest"); let mut app = main_cli().subcommand(subcommand); let args = app.clone().get_matches(); let subcommand_args = match args.subcommand() { Some(("ctest", args)) => args, Some((cmd, args)) => { return run_cargo_fallback(cmd, args); } _ => { // No subcommand provided. app.print_help()?; return Ok(()); } }; if subcommand_args.flag("version") { println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); return Ok(()); } global_context_configure(&mut config, subcommand_args)?; let mut ws = subcommand_args.workspace(&config)?; let (packages, compile_opts) = cbuild(&mut ws, &config, subcommand_args, "dev")?; ctest(&ws, subcommand_args, &packages, compile_opts) } cargo-c-0.10.11+cargo-0.86.0/src/build.rs000064400000000000000000001303231046102023000153530ustar 00000000000000use std::collections::HashMap; use std::hash::{DefaultHasher, Hash, Hasher}; use std::io::Read; use std::path::{Path, PathBuf}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; use cargo::core::compiler::{unit_graph::UnitDep, unit_graph::UnitGraph, Executor, Unit}; use cargo::core::profiles::Profiles; use cargo::core::{FeatureValue, Package, PackageId, Target, TargetKind, Workspace}; use cargo::ops::{self, CompileFilter, CompileOptions, FilterRule, LibRule}; use cargo::util::command_prelude::{ArgMatches, ArgMatchesExt, CompileMode, ProfileChecking}; use cargo::util::interning::InternedString; use cargo::{CliResult, GlobalContext}; use anyhow::Context as _; use cargo_util::paths::{copy, create_dir_all, open, read, read_bytes, write}; use implib::def::ModuleDef; use implib::{Flavor, ImportLibrary, MachineType}; use itertools::Itertools; use semver::Version; use crate::build_targets::BuildTargets; use crate::install::InstallPaths; use crate::pkg_config_gen::PkgConfig; use crate::target; /// Build the C header fn build_include_file( ws: &Workspace, name: &str, version: &Version, root_output: &Path, root_path: &Path, ) -> anyhow::Result<()> { ws.gctx() .shell() .status("Building", "header file using cbindgen")?; let mut header_name = PathBuf::from(name); header_name.set_extension("h"); let include_path = root_output.join(header_name); let crate_path = root_path; // TODO: map the errors let mut config = cbindgen::Config::from_root_or_default(crate_path); let warning = config.autogen_warning.unwrap_or_default(); let version_info = format!( "\n#define {0}_MAJOR {1}\n#define {0}_MINOR {2}\n#define {0}_PATCH {3}\n", name.to_uppercase().replace('-', "_"), version.major, version.minor, version.patch ); config.autogen_warning = Some(warning + &version_info); cbindgen::Builder::new() .with_crate(crate_path) .with_config(config) .generate() .unwrap() .write_to_file(include_path); Ok(()) } /// Copy the pre-built C header from the asset directory to the root_dir fn copy_prebuilt_include_file( ws: &Workspace, build_targets: &BuildTargets, root_output: &Path, ) -> anyhow::Result<()> { let mut shell = ws.gctx().shell(); shell.status("Populating", "uninstalled header directory")?; for (from, to) in build_targets.extra.include.iter() { let to = root_output.join("include").join(to); create_dir_all(to.parent().unwrap())?; copy(from, to)?; } Ok(()) } fn build_pc_file(name: &str, root_output: &Path, pc: &PkgConfig) -> anyhow::Result<()> { let pc_path = root_output.join(format!("{name}.pc")); let buf = pc.render(); write(pc_path, buf) } fn build_pc_files( ws: &Workspace, filename: &str, root_output: &Path, pc: &PkgConfig, ) -> anyhow::Result<()> { ws.gctx().shell().status("Building", "pkg-config files")?; build_pc_file(filename, root_output, pc)?; let pc_uninstalled = pc.uninstalled(root_output); build_pc_file( &format!("{filename}-uninstalled"), root_output, &pc_uninstalled, ) } fn patch_target( pkg: &mut Package, library_types: LibraryTypes, capi_config: &CApiConfig, ) -> anyhow::Result<()> { use cargo::core::compiler::CrateType; let manifest = pkg.manifest_mut(); let targets = manifest.targets_mut(); let mut kinds = Vec::with_capacity(2); if library_types.staticlib { kinds.push(CrateType::Staticlib); } if library_types.cdylib { kinds.push(CrateType::Cdylib); } for target in targets.iter_mut().filter(|t| t.is_lib()) { target.set_kind(TargetKind::Lib(kinds.to_vec())); target.set_name(&capi_config.library.name); } Ok(()) } /// Build def file for windows-msvc fn build_def_file( ws: &Workspace, name: &str, target: &target::Target, targetdir: &Path, ) -> anyhow::Result<()> { if target.os == "windows" && target.env == "msvc" { ws.gctx().shell().status("Building", ".def file")?; // Parse the .dll as an object file let dll_path = targetdir.join(format!("{}.dll", name.replace('-', "_"))); let dll_content = std::fs::read(&dll_path)?; let dll_file = object::File::parse(&*dll_content)?; // Create the .def output file let def_file = cargo_util::paths::create(targetdir.join(format!("{name}.def")))?; write_def_file(dll_file, def_file)?; } Ok(()) } fn write_def_file(dll_file: object::File, mut def_file: W) -> anyhow::Result { use object::read::Object; writeln!(def_file, "EXPORTS")?; for export in dll_file.exports()? { def_file.write_all(export.name())?; def_file.write_all(b"\n")?; } Ok(def_file) } /// Build import library for windows fn build_implib_file( ws: &Workspace, build_targets: &BuildTargets, name: &str, target: &target::Target, targetdir: &Path, ) -> anyhow::Result<()> { if target.os == "windows" { ws.gctx().shell().status("Building", "implib")?; let def_path = targetdir.join(format!("{name}.def")); let def_contents = cargo_util::paths::read(&def_path)?; let flavor = match target.env.as_str() { "msvc" => Flavor::Msvc, _ => Flavor::Gnu, }; let machine_type = match target.arch.as_str() { "x86_64" => MachineType::AMD64, "x86" => MachineType::I386, "aarch64" => MachineType::ARM64, _ => { return Err(anyhow::anyhow!( "Windows support for {} is not implemented yet.", target.arch )) } }; let lib_name = build_targets .shared_output_file_name() .unwrap() .into_string() .unwrap(); let implib_path = build_targets.impl_lib.as_ref().unwrap(); let implib_file = cargo_util::paths::create(implib_path)?; write_implib(implib_file, lib_name, machine_type, flavor, &def_contents)?; } Ok(()) } fn write_implib( mut w: W, lib_name: String, machine_type: MachineType, flavor: Flavor, def_contents: &str, ) -> anyhow::Result { let mut module_def = ModuleDef::parse(def_contents, machine_type)?; module_def.import_name = lib_name; let import_library = ImportLibrary::from_def(module_def, machine_type, flavor); import_library.write_to(&mut w)?; Ok(w) } #[derive(Debug)] struct FingerPrint { id: PackageId, root_output: PathBuf, build_targets: BuildTargets, install_paths: InstallPaths, static_libs: String, hasher: DefaultHasher, } #[derive(serde::Serialize, serde::Deserialize)] struct Cache { hash: String, static_libs: String, } impl FingerPrint { fn new( id: &PackageId, root_output: &Path, build_targets: &BuildTargets, install_paths: &InstallPaths, capi_config: &CApiConfig, ) -> Self { let mut hasher = DefaultHasher::new(); capi_config.hash(&mut hasher); Self { id: id.to_owned(), root_output: root_output.to_owned(), build_targets: build_targets.clone(), install_paths: install_paths.clone(), static_libs: String::new(), hasher, } } fn hash(&self) -> anyhow::Result> { let mut hasher = self.hasher.clone(); self.install_paths.hash(&mut hasher); let mut paths: Vec<&PathBuf> = Vec::new(); if let Some(include) = &self.build_targets.include { paths.push(include); } paths.extend(&self.build_targets.static_lib); paths.extend(&self.build_targets.shared_lib); for path in paths.iter() { if let Ok(buf) = read_bytes(path) { hasher.write(&buf); } else { return Ok(None); }; } let hash = hasher.finish(); // the hash is stored in a toml file which does not support u64 so store // it as a string to prevent overflows. Ok(Some(hash.to_string())) } fn path(&self) -> PathBuf { // Use the crate name in the cache file as the same target dir // may be used to build various libs self.root_output .join(format!("cargo-c-{}.cache", self.id.name())) } fn load_previous(&self) -> anyhow::Result { let mut f = open(self.path())?; let mut cache_str = String::new(); f.read_to_string(&mut cache_str)?; let cache = toml::de::from_str(&cache_str)?; Ok(cache) } fn is_valid(&self) -> bool { match (self.load_previous(), self.hash()) { (Ok(prev), Ok(Some(current))) => prev.hash == current, _ => false, } } fn store(&self) -> anyhow::Result<()> { if let Some(hash) = self.hash()? { let cache = Cache { hash, static_libs: self.static_libs.to_owned(), }; let buf = toml::ser::to_string(&cache)?; write(self.path(), buf)?; } Ok(()) } } #[derive(Debug, Hash)] pub struct CApiConfig { pub header: HeaderCApiConfig, pub pkg_config: PkgConfigCApiConfig, pub library: LibraryCApiConfig, pub install: InstallCApiConfig, } #[derive(Debug, Hash)] pub struct HeaderCApiConfig { pub name: String, pub subdirectory: String, pub generation: bool, pub enabled: bool, } #[derive(Debug, Hash)] pub struct PkgConfigCApiConfig { pub name: String, pub filename: String, pub description: String, pub version: String, pub requires: Option, pub requires_private: Option, pub strip_include_path_components: usize, } #[derive(Debug, Hash)] pub enum VersionSuffix { Major, MajorMinor, MajorMinorPatch, } #[derive(Debug, Hash)] pub struct LibraryCApiConfig { pub name: String, pub version: Version, pub install_subdir: Option, pub versioning: bool, pub version_suffix_components: Option, pub import_library: bool, pub rustflags: Vec, } impl LibraryCApiConfig { pub fn sover(&self) -> String { let major = self.version.major; let minor = self.version.minor; let patch = self.version.patch; match self.version_suffix_components { None => match (major, minor, patch) { (0, 0, patch) => format!("0.0.{patch}"), (0, minor, _) => format!("0.{minor}"), (major, _, _) => format!("{major}"), }, Some(VersionSuffix::Major) => format!("{major}"), Some(VersionSuffix::MajorMinor) => format!("{major}.{minor}"), Some(VersionSuffix::MajorMinorPatch) => format!("{major}.{minor}.{patch}"), } } } #[derive(Debug, Default, Hash)] pub struct InstallCApiConfig { pub include: Vec, pub data: Vec, } #[derive(Debug, Hash)] pub enum InstallTarget { Asset(InstallTargetPaths), Generated(InstallTargetPaths), } #[derive(Clone, Debug, Hash)] pub struct InstallTargetPaths { /// pattern to feed to glob::glob() /// /// if the InstallTarget is Asset its root is the the root_path /// if the InstallTarget is Generated its root is the root_output pub from: String, /// The path to be joined to the canonical directory to install the files discovered by the /// glob, e.g. `{includedir}/{to}` for includes. pub to: String, } impl InstallTargetPaths { pub fn from_value(value: &toml::value::Value, default_to: &str) -> anyhow::Result { let from = value .get("from") .and_then(|v| v.as_str()) .ok_or_else(|| anyhow::anyhow!("a from field is required"))?; let to = value .get("to") .and_then(|v| v.as_str()) .unwrap_or(default_to); Ok(InstallTargetPaths { from: from.to_string(), to: to.to_string(), }) } pub fn install_paths( &self, root: &Path, ) -> anyhow::Result> { let pattern = root.join(&self.from); let base_pattern = if self.from.contains("/**") { pattern .iter() .take_while(|&c| c != std::ffi::OsStr::new("**")) .collect() } else { pattern.parent().unwrap().to_path_buf() }; let pattern = pattern.to_str().unwrap(); let to = PathBuf::from(&self.to); let g = glob::glob(pattern)?.filter_map(move |p| { if let Ok(p) = p { if p.is_file() { let from = p; let to = to.join(from.strip_prefix(&base_pattern).unwrap()); Some((from, to)) } else { None } } else { None } }); Ok(g) } } fn load_manifest_capi_config( pkg: &Package, rustc_target: &target::Target, ) -> anyhow::Result { let name = &pkg .manifest() .targets() .iter() .find(|t| t.is_lib()) .unwrap() .crate_name(); let root_path = pkg.root().to_path_buf(); let manifest_str = read(&root_path.join("Cargo.toml"))?; let toml = manifest_str.parse::()?; let capi = toml .get("package") .and_then(|v| v.get("metadata")) .and_then(|v| v.get("capi")); if let Some(min_version) = capi .as_ref() .and_then(|capi| capi.get("min_version")) .and_then(|v| v.as_str()) { let min_version = Version::parse(min_version)?; let version = Version::parse(env!("CARGO_PKG_VERSION"))?; if min_version > version { anyhow::bail!( "Minimum required cargo-c version is {} but using cargo-c version {}", min_version, version ); } } let header = capi.and_then(|v| v.get("header")); let subdirectory = header .as_ref() .and_then(|h| h.get("subdirectory")) .map(|v| { if let Ok(b) = v.clone().try_into::() { Ok(if b { String::from(name) } else { String::from("") }) } else { v.clone().try_into::() } }) .unwrap_or_else(|| Ok(String::from(name)))?; let header = if let Some(capi) = capi { HeaderCApiConfig { name: header .as_ref() .and_then(|h| h.get("name")) .or_else(|| capi.get("header_name")) .map(|v| v.clone().try_into()) .unwrap_or_else(|| Ok(String::from(name)))?, subdirectory, generation: header .as_ref() .and_then(|h| h.get("generation")) .map(|v| v.clone().try_into()) .unwrap_or(Ok(true))?, enabled: header .as_ref() .and_then(|h| h.get("enabled")) .map(|v| v.clone().try_into()) .unwrap_or(Ok(true))?, } } else { HeaderCApiConfig { name: String::from(name), subdirectory: String::from(name), generation: true, enabled: true, } }; let pc = capi.and_then(|v| v.get("pkg_config")); let mut pc_name = String::from(name); let mut pc_filename = String::from(name); let mut description = String::from( pkg.manifest() .metadata() .description .as_deref() .unwrap_or(""), ); let mut version = pkg.version().to_string(); let mut requires = None; let mut requires_private = None; let mut strip_include_path_components = 0; if let Some(pc) = pc { if let Some(override_name) = pc.get("name").and_then(|v| v.as_str()) { pc_name = String::from(override_name); } if let Some(override_filename) = pc.get("filename").and_then(|v| v.as_str()) { pc_filename = String::from(override_filename); } if let Some(override_description) = pc.get("description").and_then(|v| v.as_str()) { description = String::from(override_description); } if let Some(override_version) = pc.get("version").and_then(|v| v.as_str()) { version = String::from(override_version); } if let Some(req) = pc.get("requires").and_then(|v| v.as_str()) { requires = Some(String::from(req)); } if let Some(req) = pc.get("requires_private").and_then(|v| v.as_str()) { requires_private = Some(String::from(req)); } strip_include_path_components = pc .get("strip_include_path_components") .map(|v| v.clone().try_into()) .unwrap_or_else(|| Ok(0))? } let pkg_config = PkgConfigCApiConfig { name: pc_name, filename: pc_filename, description, version, requires, requires_private, strip_include_path_components, }; let library = capi.and_then(|v| v.get("library")); let mut lib_name = String::from(name); let mut version = pkg.version().clone(); let mut install_subdir = None; let mut versioning = true; let mut version_suffix_components = None; let mut import_library = true; let mut rustflags = Vec::new(); if let Some(library) = library { if let Some(override_name) = library.get("name").and_then(|v| v.as_str()) { lib_name = String::from(override_name); } if let Some(override_version) = library.get("version").and_then(|v| v.as_str()) { version = Version::parse(override_version)?; } if let Some(subdir) = library.get("install_subdir").and_then(|v| v.as_str()) { install_subdir = Some(String::from(subdir)); } versioning = library .get("versioning") .and_then(|v| v.as_bool()) .unwrap_or(true); if let Some(value) = library.get("version_suffix_components") { let value = value.as_integer().with_context(|| { format!("Value for `version_suffix_components` is not an integer: {value:?}") })?; version_suffix_components = Some(match value { 1 => VersionSuffix::Major, 2 => VersionSuffix::MajorMinor, 3 => VersionSuffix::MajorMinorPatch, _ => anyhow::bail!("Out of range value for version suffix components: {value}"), }); } import_library = library .get("import_library") .and_then(|v| v.as_bool()) .unwrap_or(true); if let Some(args) = library.get("rustflags").and_then(|v| v.as_str()) { let args = args .split(' ') .map(str::trim) .filter(|s| !s.is_empty()) .map(str::to_string); rustflags.extend(args); } } if rustc_target.os == "android" { versioning = false; } let library = LibraryCApiConfig { name: lib_name, version, install_subdir, versioning, version_suffix_components, import_library, rustflags, }; let default_assets_include = InstallTargetPaths { from: "assets/capi/include/**/*".to_string(), to: header.subdirectory.clone(), }; let header_name = if header.name.ends_with(".h") { format!("assets/{}", header.name) } else { format!("assets/{}.h", header.name) }; let default_legacy_asset_include = InstallTargetPaths { from: header_name, to: header.subdirectory.clone(), }; let default_generated_include = InstallTargetPaths { from: "capi/include/**/*".to_string(), to: header.subdirectory.clone(), }; let mut include_targets = vec![ InstallTarget::Asset(default_assets_include), InstallTarget::Asset(default_legacy_asset_include), InstallTarget::Generated(default_generated_include), ]; let mut data_targets = Vec::new(); let mut data_subdirectory = name.clone(); fn custom_install_target_paths( root: &toml::Value, subdirectory: &str, targets: &mut Vec, ) -> anyhow::Result<()> { if let Some(assets) = root.get("asset").and_then(|v| v.as_array()) { for asset in assets { let target_paths = InstallTargetPaths::from_value(asset, subdirectory)?; targets.push(InstallTarget::Asset(target_paths)); } } if let Some(generated) = root.get("generated").and_then(|v| v.as_array()) { for gen in generated { let target_paths = InstallTargetPaths::from_value(gen, subdirectory)?; targets.push(InstallTarget::Generated(target_paths)); } } Ok(()) } let install = capi.and_then(|v| v.get("install")); if let Some(install) = install { if let Some(includes) = install.get("include") { custom_install_target_paths(includes, &header.subdirectory, &mut include_targets)?; } if let Some(data) = install.get("data") { if let Some(subdir) = data.get("subdirectory").and_then(|v| v.as_str()) { data_subdirectory = String::from(subdir); } custom_install_target_paths(data, &data_subdirectory, &mut data_targets)?; } } let default_assets_data = InstallTargetPaths { from: "assets/capi/share/**/*".to_string(), to: data_subdirectory.clone(), }; let default_generated_data = InstallTargetPaths { from: "capi/share/**/*".to_string(), to: data_subdirectory, }; data_targets.extend([ InstallTarget::Asset(default_assets_data), InstallTarget::Generated(default_generated_data), ]); let install = InstallCApiConfig { include: include_targets, data: data_targets, }; Ok(CApiConfig { header, pkg_config, library, install, }) } fn compile_options( ws: &Workspace, gctx: &GlobalContext, args: &ArgMatches, profile: InternedString, compile_mode: CompileMode, ) -> anyhow::Result { use cargo::core::compiler::CompileKind; let mut compile_opts = args.compile_options(gctx, compile_mode, Some(ws), ProfileChecking::Custom)?; compile_opts.build_config.requested_profile = profile; std::rc::Rc::get_mut(&mut compile_opts.cli_features.features) .unwrap() .insert(FeatureValue::new("capi".into())); compile_opts.filter = CompileFilter::new( LibRule::True, FilterRule::none(), FilterRule::none(), FilterRule::none(), FilterRule::none(), ); compile_opts.build_config.unit_graph = false; let rustc = gctx.load_global_rustc(Some(ws))?; // Always set the target, requested_kinds is a vec of a single element. if compile_opts.build_config.requested_kinds[0].is_host() { compile_opts.build_config.requested_kinds = CompileKind::from_requested_targets(gctx, &[rustc.host.to_string()])? } Ok(compile_opts) } #[derive(Default)] struct Exec { ran: AtomicBool, link_line: Mutex>, } use cargo::CargoResult; use cargo_util::ProcessBuilder; impl Executor for Exec { fn exec( &self, cmd: &ProcessBuilder, id: PackageId, _target: &Target, _mode: CompileMode, on_stdout_line: &mut dyn FnMut(&str) -> CargoResult<()>, on_stderr_line: &mut dyn FnMut(&str) -> CargoResult<()>, ) -> CargoResult<()> { self.ran.store(true, Ordering::Relaxed); cmd.exec_with_streaming( on_stdout_line, &mut |s| { #[derive(serde::Deserialize, Debug)] struct Message { message: String, level: String, } if let Ok(msg) = serde_json::from_str::(s) { // suppress the native-static-libs messages if msg.level == "note" { if msg.message.starts_with("Link against the following native artifacts when linking against this static library") { Ok(()) } else if let Some(link_line) = msg.message.strip_prefix("native-static-libs:") { self.link_line.lock().unwrap().insert(id, link_line.to_string()); Ok(()) } else { on_stderr_line(s) } } else { on_stderr_line(s) } } else { on_stderr_line(s) } }, false, ) .map(drop) } } use cargo::core::compiler::{unit_graph, UnitInterner}; use cargo::ops::create_bcx; fn set_deps_args( dep: &UnitDep, graph: &UnitGraph, extra_compiler_args: &mut HashMap>, global_args: &[String], ) { if !dep.unit_for.is_for_host() { for dep in graph[&dep.unit].iter() { set_deps_args(dep, graph, extra_compiler_args, global_args); } extra_compiler_args .entry(dep.unit.clone()) .or_insert_with(|| global_args.to_owned()); } } fn compile_with_exec( ws: &Workspace<'_>, options: &CompileOptions, exec: &Arc, rustc_target: &target::Target, root_output: &Path, args: &ArgMatches, ) -> CargoResult> { ws.emit_warnings()?; let interner = UnitInterner::new(); let mut bcx = create_bcx(ws, options, &interner)?; let unit_graph = &bcx.unit_graph; let extra_compiler_args = &mut bcx.extra_compiler_args; for unit in bcx.roots.iter() { let pkg = &unit.pkg; let capi_config = load_manifest_capi_config(pkg, rustc_target)?; let name = &capi_config.library.name; let install_paths = InstallPaths::new(name, rustc_target, args, &capi_config); let pkg_rustflags = &capi_config.library.rustflags; let mut leaf_args: Vec = rustc_target .shared_object_link_args(&capi_config, &install_paths.libdir, root_output) .into_iter() .flat_map(|l| ["-C".to_string(), format!("link-arg={l}")]) .collect(); leaf_args.extend(pkg_rustflags.clone()); leaf_args.push("--cfg".into()); leaf_args.push("cargo_c".into()); leaf_args.push("--print".into()); leaf_args.push("native-static-libs".into()); if args.flag("crt-static") { leaf_args.push("-C".into()); leaf_args.push("target-feature=+crt-static".into()); } extra_compiler_args.insert(unit.clone(), leaf_args.to_owned()); for dep in unit_graph[unit].iter() { set_deps_args(dep, unit_graph, extra_compiler_args, pkg_rustflags); } } if options.build_config.unit_graph { unit_graph::emit_serialized_unit_graph(&bcx.roots, &bcx.unit_graph, ws.gctx())?; return Ok(HashMap::new()); } let cx = cargo::core::compiler::BuildRunner::new(&bcx)?; let r = cx.compile(exec)?; let out_dirs = r .cdylibs .iter() .filter_map(|l| { let id = l.unit.pkg.package_id(); if let Some(ref m) = l.script_meta { if let Some(env) = r.extra_env.get(m) { env.iter().find_map(|e| { if e.0 == "OUT_DIR" { Some((id, PathBuf::from(&e.1))) } else { None } }) } else { None } } else { None } }) .collect(); Ok(out_dirs) } #[derive(Debug)] pub struct CPackage { pub version: Version, pub root_path: PathBuf, pub capi_config: CApiConfig, pub build_targets: BuildTargets, pub install_paths: InstallPaths, finger_print: FingerPrint, } impl CPackage { fn from_package( pkg: &mut Package, args: &ArgMatches, library_types: LibraryTypes, rustc_target: &target::Target, root_output: &Path, ) -> anyhow::Result { let id = pkg.package_id(); let version = pkg.version().clone(); let root_path = pkg.root().to_path_buf(); let capi_config = load_manifest_capi_config(pkg, rustc_target)?; patch_target(pkg, library_types, &capi_config)?; let name = &capi_config.library.name; let install_paths = InstallPaths::new(name, rustc_target, args, &capi_config); let build_targets = BuildTargets::new( name, rustc_target, root_output, library_types, &capi_config, args.get_flag("meson"), )?; let finger_print = FingerPrint::new( &id, root_output, &build_targets, &install_paths, &capi_config, ); Ok(CPackage { version, root_path, capi_config, build_targets, install_paths, finger_print, }) } } fn deprecation_warnings(ws: &Workspace, args: &ArgMatches) -> anyhow::Result<()> { if args.contains_id("dlltool") { ws.gctx() .shell() .warn("The `dlltool` support is now builtin. The cli option is deprecated and will be removed in the future")?; } Ok(()) } /// What library types to build #[derive(Debug, Clone, Copy)] pub struct LibraryTypes { pub staticlib: bool, pub cdylib: bool, } impl LibraryTypes { fn from_target(target: &target::Target) -> Self { // for os == "none", cdylib does not make sense. By default cdylib is also not built on // musl, but that can be overriden by the user. That is useful when musl is being used as // main libc, e.g. in Alpine, Gentoo and OpenWRT // // See also // // - https://github.com/lu-zero/cargo-c?tab=readme-ov-file#shared-libraries-are-not-built-on-musl-systems // - https://github.com/lu-zero/cargo-c/issues/180 Self { staticlib: true, cdylib: target.os != "none" && target.env != "musl", } } fn from_args(target: &target::Target, args: &ArgMatches) -> Self { match args.get_many::("library-type") { Some(library_types) => Self::from_library_types(target, library_types), None => Self::from_target(target), } } pub(crate) fn from_library_types>( target: &target::Target, library_types: impl Iterator, ) -> Self { let (mut staticlib, mut cdylib) = (false, false); for library_type in library_types { staticlib |= library_type.as_ref() == "staticlib"; cdylib |= library_type.as_ref() == "cdylib"; } // when os is none, a cdylib cannot be produced // forcing a cdylib for musl is allowed here (see [`LibraryTypes::from_target`]) cdylib &= target.os != "none"; Self { staticlib, cdylib } } const fn only_staticlib(self) -> bool { self.staticlib && !self.cdylib } const fn only_cdylib(self) -> bool { self.cdylib && !self.staticlib } } fn static_libraries(link_line: &str, rustc_target: &target::Target) -> String { link_line .trim() .split(' ') .filter(|s| { if rustc_target.env == "msvc" && s.starts_with("/defaultlib") { return false; } !s.is_empty() }) .unique() .map(|lib| { if rustc_target.env == "msvc" && lib.ends_with(".lib") { return format!("-l{}", lib.trim_end_matches(".lib")); } lib.trim().to_string() }) .filter(|s| !s.is_empty()) .collect::>() .join(" ") } pub fn cbuild( ws: &mut Workspace, config: &GlobalContext, args: &ArgMatches, default_profile: &str, ) -> anyhow::Result<(Vec, CompileOptions)> { deprecation_warnings(ws, args)?; let (target, is_target_overridden) = match args.targets()?.as_slice() { [] => (config.load_global_rustc(Some(ws))?.host.to_string(), false), [target] => (target.to_string(), true), [..] => anyhow::bail!("Multiple targets not supported yet"), }; let rustc_target = target::Target::new(Some(&target), is_target_overridden)?; let library_types = LibraryTypes::from_args(&rustc_target, args); let profile = args.get_profile_name(default_profile, ProfileChecking::Custom)?; let profiles = Profiles::new(ws, profile)?; let mut compile_opts = compile_options(ws, config, args, profile, CompileMode::Build)?; // TODO: there must be a simpler way to get the right path. let root_output = ws .target_dir() .as_path_unlocked() .to_path_buf() .join(PathBuf::from(target)) .join(profiles.get_dir_name()); let mut members = Vec::new(); let mut pristine = false; let requested: Vec<_> = compile_opts .spec .get_packages(ws)? .iter() .map(|p| p.package_id()) .collect(); let capi_feature = InternedString::new("capi"); let is_relevant_package = |package: &Package| { package.library().is_some() && package.summary().features().contains_key(&capi_feature) && requested.contains(&package.package_id()) }; for m in ws.members_mut().filter(|p| is_relevant_package(p)) { let cpkg = CPackage::from_package(m, args, library_types, &rustc_target, &root_output)?; pristine |= cpkg.finger_print.load_previous().is_err() || !cpkg.finger_print.is_valid(); members.push(cpkg); } // If the cache is somehow missing force a full rebuild; compile_opts.build_config.force_rebuild |= pristine; let exec = Arc::new(Exec::default()); let out_dirs = compile_with_exec( ws, &compile_opts, &(exec.clone() as Arc), &rustc_target, &root_output, args, )?; for cpkg in members.iter_mut() { let out_dir = out_dirs.get(&cpkg.finger_print.id).map(|p| p.as_path()); cpkg.build_targets .extra .setup(&cpkg.capi_config, &cpkg.root_path, out_dir)?; if cpkg.capi_config.header.generation { let mut header_name = PathBuf::from(&cpkg.capi_config.header.name); header_name.set_extension("h"); let from = root_output.join(&header_name); let to = Path::new(&cpkg.capi_config.header.subdirectory).join(&header_name); cpkg.build_targets.extra.include.push((from, to)); } } if pristine { // restore the default to make sure the tests do not trigger a second rebuild. compile_opts.build_config.force_rebuild = false; } let new_build = exec.ran.load(Ordering::Relaxed); for cpkg in members.iter_mut() { // it is a new build, build the additional files and update update the cache if new_build { let name = &cpkg.capi_config.library.name; let (pkg_config_static_libs, static_libs) = if library_types.only_cdylib() { (String::new(), String::new()) } else if let Some(libs) = exec.link_line.lock().unwrap().get(&cpkg.finger_print.id) { (static_libraries(libs, &rustc_target), libs.to_string()) } else { (String::new(), String::new()) }; let capi_config = &cpkg.capi_config; let build_targets = &cpkg.build_targets; let mut pc = PkgConfig::from_workspace(name, &cpkg.install_paths, args, capi_config); if library_types.only_staticlib() { pc.add_lib(&pkg_config_static_libs); } pc.add_lib_private(&pkg_config_static_libs); build_pc_files(ws, &capi_config.pkg_config.filename, &root_output, &pc)?; if !library_types.only_staticlib() && capi_config.library.import_library { let lib_name = name; build_def_file(ws, lib_name, &rustc_target, &root_output)?; build_implib_file(ws, build_targets, lib_name, &rustc_target, &root_output)?; } if capi_config.header.enabled { let header_name = &capi_config.header.name; if capi_config.header.generation { build_include_file( ws, header_name, &cpkg.version, &root_output, &cpkg.root_path, )?; } copy_prebuilt_include_file(ws, build_targets, &root_output)?; } if name.contains('-') { let from_build_targets = BuildTargets::new( &name.replace('-', "_"), &rustc_target, &root_output, library_types, capi_config, args.get_flag("meson"), )?; if let (Some(from_static_lib), Some(to_static_lib)) = ( from_build_targets.static_lib.as_ref(), build_targets.static_lib.as_ref(), ) { copy(from_static_lib, to_static_lib)?; } if let (Some(from_shared_lib), Some(to_shared_lib)) = ( from_build_targets.shared_lib.as_ref(), build_targets.shared_lib.as_ref(), ) { copy(from_shared_lib, to_shared_lib)?; } if let (Some(from_debug_info), Some(to_debug_info)) = ( from_build_targets.debug_info.as_ref(), build_targets.debug_info.as_ref(), ) { copy(from_debug_info, to_debug_info)?; } } // This can be supplied to Rust, so it must be in // linker-native syntax cpkg.finger_print.static_libs = static_libs; cpkg.finger_print.store()?; } else { // It is not a new build, recover the static_libs value from the cache cpkg.finger_print.static_libs = cpkg.finger_print.load_previous()?.static_libs; } ws.gctx().shell().verbose(|s| { let path = &format!("PKG_CONFIG_PATH=\"{}\"", root_output.display()); s.note(path) })?; } Ok((members, compile_opts)) } pub fn ctest( ws: &Workspace, args: &ArgMatches, packages: &[CPackage], mut compile_opts: CompileOptions, ) -> CliResult { compile_opts.build_config.requested_profile = args.get_profile_name("test", ProfileChecking::Custom)?; compile_opts.build_config.mode = CompileMode::Test; compile_opts.filter = ops::CompileFilter::new( LibRule::Default, // compile the library, so the unit tests can be run filtered FilterRule::none(), // we do not have binaries FilterRule::All, // compile the tests, so the integration tests can be run filtered FilterRule::none(), // specify --examples to unit test binaries filtered FilterRule::none(), // specify --benches to unit test benchmarks filtered ); compile_opts.target_rustc_args = None; let ops = ops::TestOptions { no_run: args.flag("no-run"), no_fail_fast: args.flag("no-fail-fast"), compile_opts, }; let test_args = args.get_one::("TESTNAME").into_iter(); let test_args = test_args.chain(args.get_many::("args").unwrap_or_default()); let test_args = test_args.map(String::as_str).collect::>(); use std::ffi::OsString; let mut cflags = OsString::new(); for pkg in packages { let static_lib_path = pkg.build_targets.static_lib.as_ref().unwrap(); let builddir = static_lib_path.parent().unwrap(); cflags.push("-I"); cflags.push(builddir); cflags.push(" "); // We push the full path here to work around macos ld not supporting the -l:{filename} syntax cflags.push(static_lib_path); // We push the static_libs as CFLAGS as well to avoid mangling the options on msvc cflags.push(" "); cflags.push(&pkg.finger_print.static_libs); } std::env::set_var("INLINE_C_RS_CFLAGS", cflags); ops::run_tests(ws, &ops, &test_args) } #[cfg(test)] mod tests { use super::*; use semver::Version; fn make_test_library_config(version: &str) -> LibraryCApiConfig { LibraryCApiConfig { name: "example".to_string(), version: Version::parse(version).unwrap(), install_subdir: None, versioning: true, version_suffix_components: None, import_library: true, rustflags: vec![], } } #[test] pub fn test_semver_zero_zero_zero() { let library = make_test_library_config("0.0.0"); let sover = library.sover(); assert_eq!(sover, "0.0.0"); } #[test] pub fn test_semver_zero_one_zero() { let library = make_test_library_config("0.1.0"); let sover = library.sover(); assert_eq!(sover, "0.1"); } #[test] pub fn test_semver_one_zero_zero() { let library = make_test_library_config("1.0.0"); let sover = library.sover(); assert_eq!(sover, "1"); } #[test] pub fn text_one_fixed_zero_zero_zero() { let mut library = make_test_library_config("0.0.0"); library.version_suffix_components = Some(VersionSuffix::Major); let sover = library.sover(); assert_eq!(sover, "0"); } #[test] pub fn text_two_fixed_one_zero_zero() { let mut library = make_test_library_config("1.0.0"); library.version_suffix_components = Some(VersionSuffix::MajorMinor); let sover = library.sover(); assert_eq!(sover, "1.0"); } #[test] pub fn text_three_fixed_one_zero_zero() { let mut library = make_test_library_config("1.0.0"); library.version_suffix_components = Some(VersionSuffix::MajorMinorPatch); let sover = library.sover(); assert_eq!(sover, "1.0.0"); } #[test] pub fn test_lib_listing() { let libs_osx = "-lSystem -lc -lm"; let libs_linux = "-lgcc_s -lutil -lrt -lpthread -lm -ldl -lc"; let libs_hurd = "-lgcc_s -lutil -lrt -lpthread -lm -ldl -lc"; let libs_msvc = "kernel32.lib advapi32.lib kernel32.lib ntdll.lib userenv.lib ws2_32.lib kernel32.lib ws2_32.lib kernel32.lib msvcrt.lib /defaultlib:msvcrt"; let libs_mingw = "-lkernel32 -ladvapi32 -lkernel32 -lntdll -luserenv -lws2_32 -lkernel32 -lws2_32 -lkernel32"; let target_osx = target::Target::new(Some("x86_64-apple-darwin"), false).unwrap(); let target_linux = target::Target::new(Some("x86_64-unknown-linux-gnu"), false).unwrap(); let target_hurd = target::Target::new(Some("x86_64-unknown-hurd-gnu"), false).unwrap(); let target_msvc = target::Target::new(Some("x86_64-pc-windows-msvc"), false).unwrap(); let target_mingw = target::Target::new(Some("x86_64-pc-windows-gnu"), false).unwrap(); assert_eq!(static_libraries(libs_osx, &target_osx), "-lSystem -lc -lm"); assert_eq!( static_libraries(libs_linux, &target_linux), "-lgcc_s -lutil -lrt -lpthread -lm -ldl -lc" ); assert_eq!( static_libraries(libs_hurd, &target_hurd), "-lgcc_s -lutil -lrt -lpthread -lm -ldl -lc" ); assert_eq!( static_libraries(libs_msvc, &target_msvc), "-lkernel32 -ladvapi32 -lntdll -luserenv -lws2_32 -lmsvcrt" ); assert_eq!( static_libraries(libs_mingw, &target_mingw), "-lkernel32 -ladvapi32 -lntdll -luserenv -lws2_32" ); } } cargo-c-0.10.11+cargo-0.86.0/src/build_targets.rs000064400000000000000000000245021046102023000171050ustar 00000000000000use std::ffi::OsString; use std::path::{Path, PathBuf}; use crate::build::{CApiConfig, InstallTarget, LibraryTypes}; use crate::install::LibType; use crate::target::Target; #[derive(Debug, Default, Clone)] pub struct ExtraTargets { pub include: Vec<(PathBuf, PathBuf)>, pub data: Vec<(PathBuf, PathBuf)>, } impl ExtraTargets { pub fn setup( &mut self, capi_config: &CApiConfig, root_dir: &Path, out_dir: Option<&Path>, ) -> anyhow::Result<()> { self.include = extra_targets(&capi_config.install.include, root_dir, out_dir)?; self.data = extra_targets(&capi_config.install.data, root_dir, out_dir)?; Ok(()) } } fn extra_targets( targets: &[InstallTarget], root_path: &Path, root_output: Option<&Path>, ) -> anyhow::Result> { use itertools::*; targets .iter() .filter_map(|t| match t { InstallTarget::Asset(paths) => Some(paths.install_paths(root_path)), InstallTarget::Generated(paths) => { root_output.map(|root_output| paths.install_paths(root_output)) } }) .flatten_ok() .collect() } #[derive(Debug, Clone)] pub struct BuildTargets { pub name: String, pub include: Option, pub static_lib: Option, pub shared_lib: Option, pub impl_lib: Option, pub debug_info: Option, pub def: Option, pub pc: PathBuf, pub target: Target, pub extra: ExtraTargets, pub use_meson_naming_convention: bool, } impl BuildTargets { pub fn new( name: &str, target: &Target, targetdir: &Path, library_types: LibraryTypes, capi_config: &CApiConfig, use_meson_naming_convention: bool, ) -> anyhow::Result { let pc = targetdir.join(format!("{}.pc", &capi_config.pkg_config.filename)); let include = if capi_config.header.enabled && capi_config.header.generation { Some(targetdir.join(&capi_config.header.name).with_extension("h")) } else { None }; let Some(file_names) = FileNames::from_target(target, name, targetdir, use_meson_naming_convention) else { return Err(anyhow::anyhow!( "The target {}-{} is not supported yet", target.os, target.env )); }; Ok(BuildTargets { pc, include, static_lib: library_types.staticlib.then_some(file_names.static_lib), shared_lib: library_types.cdylib.then_some(file_names.shared_lib), impl_lib: file_names.impl_lib, debug_info: file_names.debug_info, def: file_names.def, use_meson_naming_convention, name: name.into(), target: target.clone(), extra: Default::default(), }) } fn lib_type(&self) -> LibType { LibType::from_build_targets(self) } pub fn debug_info_file_name(&self, bindir: &Path, libdir: &Path) -> Option { match self.lib_type() { // FIXME: Requires setting split-debuginfo to packed and // specifying the corresponding file name convention // in BuildTargets::new. LibType::So | LibType::Dylib => { Some(libdir.join(self.debug_info.as_ref()?.file_name()?)) } LibType::Windows => Some(bindir.join(self.debug_info.as_ref()?.file_name()?)), } } pub fn static_output_file_name(&self) -> Option { match self.lib_type() { LibType::Windows => { if self.static_lib.is_some() && self.use_meson_naming_convention { Some(format!("lib{}.a", self.name).into()) } else { Some(self.static_lib.as_ref()?.file_name()?.to_owned()) } } _ => Some(self.static_lib.as_ref()?.file_name()?.to_owned()), } } pub fn shared_output_file_name(&self) -> Option { match self.lib_type() { LibType::Windows => { if self.shared_lib.is_some() && self.use_meson_naming_convention && self.target.env == "gnu" { Some(format!("lib{}.dll", self.name).into()) } else { Some(self.shared_lib.as_ref()?.file_name()?.to_owned()) } } _ => Some(self.shared_lib.as_ref()?.file_name()?.to_owned()), } } } #[derive(Debug, PartialEq, Eq)] struct FileNames { static_lib: PathBuf, shared_lib: PathBuf, impl_lib: Option, debug_info: Option, def: Option, } impl FileNames { fn from_target( target: &Target, lib_name: &str, targetdir: &Path, use_meson_naming_convention: bool, ) -> Option { let (shared_lib, static_lib, impl_lib, debug_info, def) = match target.os.as_str() { "none" | "linux" | "freebsd" | "dragonfly" | "netbsd" | "android" | "haiku" | "illumos" | "openbsd" | "emscripten" | "hurd" => { let static_lib = targetdir.join(format!("lib{lib_name}.a")); let shared_lib = targetdir.join(format!("lib{lib_name}.so")); (shared_lib, static_lib, None, None, None) } "macos" | "ios" | "tvos" | "visionos" => { let static_lib = targetdir.join(format!("lib{lib_name}.a")); let shared_lib = targetdir.join(format!("lib{lib_name}.dylib")); (shared_lib, static_lib, None, None, None) } "windows" => { let shared_lib = targetdir.join(format!("{lib_name}.dll")); let def = targetdir.join(format!("{lib_name}.def")); if target.env == "msvc" { let static_lib = targetdir.join(format!("{lib_name}.lib")); let impl_lib = if use_meson_naming_convention { targetdir.join(format!("{lib_name}.lib")) } else { targetdir.join(format!("{lib_name}.dll.lib")) }; let pdb = Some(targetdir.join(format!("{lib_name}.pdb"))); (shared_lib, static_lib, Some(impl_lib), pdb, Some(def)) } else { let static_lib = targetdir.join(format!("lib{lib_name}.a")); let impl_lib = if use_meson_naming_convention { targetdir.join(format!("lib{lib_name}.dll.a")) } else { targetdir.join(format!("{lib_name}.dll.a")) }; let pdb = None; (shared_lib, static_lib, Some(impl_lib), pdb, Some(def)) } } _ => return None, }; Some(Self { static_lib, shared_lib, impl_lib, debug_info, def, }) } } #[cfg(test)] mod test { use std::path::{Path, PathBuf}; use super::{FileNames, Target}; #[test] fn unix() { for os in [ "none", "linux", "freebsd", "dragonfly", "netbsd", "android", "haiku", "illumos", "emscripten", "hurd", ] { let target = Target { is_target_overridden: false, arch: String::from(""), os: os.to_string(), env: String::from(""), }; let file_names = FileNames::from_target(&target, "ferris", Path::new("/foo/bar"), false); let expected = FileNames { static_lib: PathBuf::from("/foo/bar/libferris.a"), shared_lib: PathBuf::from("/foo/bar/libferris.so"), impl_lib: None, debug_info: None, def: None, }; assert_eq!(file_names.unwrap(), expected); } } #[test] fn apple() { for os in ["macos", "ios", "tvos", "visionos"] { let target = Target { is_target_overridden: false, arch: String::from(""), os: os.to_string(), env: String::from(""), }; let file_names = FileNames::from_target(&target, "ferris", Path::new("/foo/bar"), false); let expected = FileNames { static_lib: PathBuf::from("/foo/bar/libferris.a"), shared_lib: PathBuf::from("/foo/bar/libferris.dylib"), impl_lib: None, debug_info: None, def: None, }; assert_eq!(file_names.unwrap(), expected); } } #[test] fn windows_msvc() { let target = Target { is_target_overridden: false, arch: String::from(""), os: String::from("windows"), env: String::from("msvc"), }; let file_names = FileNames::from_target(&target, "ferris", Path::new("/foo/bar"), false); let expected = FileNames { static_lib: PathBuf::from("/foo/bar/ferris.lib"), shared_lib: PathBuf::from("/foo/bar/ferris.dll"), impl_lib: Some(PathBuf::from("/foo/bar/ferris.dll.lib")), debug_info: Some(PathBuf::from("/foo/bar/ferris.pdb")), def: Some(PathBuf::from("/foo/bar/ferris.def")), }; assert_eq!(file_names.unwrap(), expected); } #[test] fn windows_gnu() { let target = Target { is_target_overridden: false, arch: String::from(""), os: String::from("windows"), env: String::from("gnu"), }; let file_names = FileNames::from_target(&target, "ferris", Path::new("/foo/bar"), false); let expected = FileNames { static_lib: PathBuf::from("/foo/bar/libferris.a"), shared_lib: PathBuf::from("/foo/bar/ferris.dll"), impl_lib: Some(PathBuf::from("/foo/bar/ferris.dll.a")), debug_info: None, def: Some(PathBuf::from("/foo/bar/ferris.def")), }; assert_eq!(file_names.unwrap(), expected); } } cargo-c-0.10.11+cargo-0.86.0/src/cli.rs000064400000000000000000000211071046102023000150220ustar 00000000000000use std::ffi::{OsStr, OsString}; use std::path::PathBuf; use cargo::util::command_prelude::CommandExt; use cargo::util::command_prelude::{flag, multi_opt, opt}; use cargo::util::{style, CliError, CliResult}; use cargo_util::{ProcessBuilder, ProcessError}; use clap::{Arg, ArgAction, ArgMatches, Command, CommandFactory, Parser}; use crate::target::Target; // TODO: convert to a function using cargo opt() #[allow(dead_code)] #[derive(Clone, Debug, Parser)] struct Common { /// Path to directory where target should be copied to #[clap(long = "destdir")] destdir: Option, /// Directory path used to construct the values of /// `bindir`, `datarootdir`, `includedir`, `libdir` /// /// If they are absolute the prefix is ignored. #[clap(long = "prefix", default_value = "/usr/local")] prefix: PathBuf, /// Path to directory for installing generated library files #[clap(long = "libdir", default_value = "lib")] libdir: PathBuf, /// Path to directory for installing generated headers files #[clap(long = "includedir", default_value = "include")] includedir: PathBuf, /// Path to directory for installing generated executable files #[clap(long = "bindir", default_value = "bin")] bindir: Option, /// Path to directory for installing generated pkg-config .pc files /// /// [default: {libdir}/pkgconfig] #[clap(long = "pkgconfigdir")] pkgconfigdir: Option, /// Path to directory for installing read-only data #[clap(long = "datarootdir", default_value = "share")] datarootdir: PathBuf, /// Path to directory for installing read-only application-specific data /// /// [default: {datarootdir}] #[clap(long = "datadir")] datadir: Option, #[clap(long = "dlltool")] /// Use the provided dlltool when building for the windows-gnu targets. (deprecated and no-op) dlltool: Option, #[clap(long = "crt-static")] /// Build the library embedding the C runtime crt_static: bool, /// Use the Linux/Meson library naming convention on Windows #[clap(long = "meson-paths", default_value = "false")] meson: bool, } pub fn main_cli() -> Command { let styles = { clap::builder::styling::Styles::styled() .header(style::HEADER) .usage(style::USAGE) .literal(style::LITERAL) .placeholder(style::PLACEHOLDER) .error(style::ERROR) .valid(style::VALID) .invalid(style::INVALID) }; clap::command!() .dont_collapse_args_in_usage(true) .allow_external_subcommands(true) .styles(styles) } fn base_cli() -> Command { let default_target = Target::new::<&str>(None, false); let app = Common::command() .allow_external_subcommands(true) .arg(flag("version", "Print version info and exit").short('V')) .arg(flag("list", "List installed commands")) .arg(opt("explain", "Run `rustc --explain CODE`").value_name("CODE")) .arg( opt( "verbose", "Use verbose output (-vv very verbose/build.rs output)", ) .short('v') .action(ArgAction::Count) .global(true), ) .arg_silent_suggestion() .arg( opt("color", "Coloring: auto, always, never") .value_name("WHEN") .global(true), ) .arg(flag("frozen", "Require Cargo.lock and cache are up to date").global(true)) .arg(flag("locked", "Require Cargo.lock is up to date").global(true)) .arg(flag("offline", "Run without accessing the network").global(true)) .arg(multi_opt("config", "KEY=VALUE", "Override a configuration value").global(true)) .arg( Arg::new("unstable-features") .help("Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details") .short('Z') .value_name("FLAG") .action(ArgAction::Append) .global(true), ) .arg_parallel() .arg_targets_all( "Build only this package's library", "Build only the specified binary", "Build all binaries", "Build only the specified example", "Build all examples", "Build only the specified test target", "Build all tests", "Build only the specified bench target", "Build all benches", "Build all targets", ) .arg( multi_opt( "library-type", "LIBRARY-TYPE", "Build only a type of library", ) .global(true) .ignore_case(true) .value_parser(["cdylib", "staticlib"]), ) .arg_profile("Build artifacts with the specified profile") .arg_features() .arg_target_triple("Build for the target triple") .arg_target_dir() .arg_manifest_path() .arg_message_format() .arg_build_plan(); if let Ok(t) = default_target { app.mut_arg("prefix", |a| { a.default_value(t.default_prefix().as_os_str().to_os_string()) }) .mut_arg("libdir", |a| { a.default_value(t.default_libdir().as_os_str().to_os_string()) }) .mut_arg("datadir", |a| { a.default_value(t.default_datadir().as_os_str().to_os_string()) }) .mut_arg("includedir", |a| { a.default_value(t.default_includedir().as_os_str().to_os_string()) }) } else { app } } pub fn subcommand_build(name: &'static str, about: &'static str) -> Command { base_cli() .name(name) .about(about) .arg_release("Build artifacts in release mode, with optimizations") .arg_package_spec_no_all( "Package to build (see `cargo help pkgid`)", "Build all packages in the workspace", "Exclude packages from the build", ) .after_help( " Compilation can be configured via the use of profiles which are configured in the manifest. The default profile for this command is `dev`, but passing the --release flag will use the `release` profile instead. ", ) } pub fn subcommand_install(name: &'static str, about: &'static str) -> Command { base_cli() .name(name) .about(about) .arg(flag("debug", "Build in debug mode instead of release mode")) .arg_release( "Build artifacts in release mode, with optimizations. This is the default behavior.", ) .arg_package_spec_no_all( "Package to install (see `cargo help pkgid`)", "Install all packages in the workspace", "Exclude packages from being installed", ) .after_help( " Compilation can be configured via the use of profiles which are configured in the manifest. The default profile for this command is `release`, but passing the --debug flag will use the `dev` profile instead. ", ) } pub fn subcommand_test(name: &'static str) -> Command { base_cli() .name(name) .about("Test the crate C-API") .arg( Arg::new("TESTNAME") .action(ArgAction::Set) .help("If specified, only run tests containing this string in their names"), ) .arg( Arg::new("args") .help("Arguments for the test binary") .num_args(0..) .last(true), ) .arg_release("Build artifacts in release mode, with optimizations") .arg_package_spec_no_all( "Package to run tests for", "Test all packages in the workspace", "Exclude packages from the test", ) .arg(flag("no-run", "Compile, but don't run tests")) .arg(flag("no-fail-fast", "Run all tests regardless of failure")) } pub fn run_cargo_fallback(subcommand: &str, subcommand_args: &ArgMatches) -> CliResult { let cargo = std::env::var("CARGO_C_CARGO").unwrap_or_else(|_| "cargo".to_owned()); let mut args = vec![OsStr::new(subcommand)]; args.extend( subcommand_args .get_many::("") .unwrap_or_default() .map(OsStr::new), ); let err = match ProcessBuilder::new(cargo).args(&args).exec_replace() { Ok(()) => return Ok(()), Err(e) => e, }; if let Some(perr) = err.downcast_ref::() { if let Some(code) = perr.code { return Err(CliError::code(code)); } } Err(CliError::new(err, 101)) } cargo-c-0.10.11+cargo-0.86.0/src/config.rs000064400000000000000000000023561046102023000155250ustar 00000000000000use std::env; use cargo::util::command_prelude::{ArgMatches, ArgMatchesExt}; use cargo::{CliResult, GlobalContext}; // Take the original cargo instance and save it as a separate env var if not already set. fn setup_env() { if env::var("CARGO_C_CARGO").is_err() { let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_owned()); env::set_var("CARGO_C_CARGO", cargo); } } pub fn global_context_configure(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult { let arg_target_dir = &args.value_of_path("target-dir", gctx); let config_args: Vec<_> = args .get_many::("config") .unwrap_or_default() .map(|s| s.to_owned()) .collect(); gctx.configure( args.verbose(), args.flag("quiet"), args.get_one::("color").map(String::as_str), args.flag("frozen"), args.flag("locked"), args.flag("offline"), arg_target_dir, &args .get_many::("unstable-features") .unwrap_or_default() .map(|s| s.to_owned()) .collect::>(), &config_args, )?; // Make sure that the env-vars are correctly set at this point. setup_env(); Ok(()) } cargo-c-0.10.11+cargo-0.86.0/src/install.rs000064400000000000000000000303541046102023000157250ustar 00000000000000use clap::ArgMatches; use std::path::{Component, Path, PathBuf}; use cargo::core::Workspace; use cargo_util::paths::{self, create_dir_all}; use crate::build::*; use crate::build_targets::BuildTargets; use crate::target::Target; pub fn copy, Q: AsRef>(ws: &Workspace, from: P, to: Q) -> anyhow::Result { ws.gctx().shell().verbose(|shell| { shell.status( "Copying", format!("{} to {}", from.as_ref().display(), to.as_ref().display()), ) })?; paths::copy(from, to) } fn append_to_destdir(destdir: Option<&Path>, path: &Path) -> PathBuf { if let Some(destdir) = destdir { let mut joined = destdir.to_path_buf(); for component in path.components() { match component { Component::Prefix(_) | Component::RootDir => {} _ => joined.push(component), }; } joined } else { path.to_path_buf() } } #[cfg(test)] mod tests { use std::path::{Path, PathBuf}; #[test] fn append_to_destdir() { assert_eq!( super::append_to_destdir(Some(Path::new(r"/foo")), &PathBuf::from(r"/bar/./..")), PathBuf::from(r"/foo/bar/./..") ); assert_eq!( super::append_to_destdir(Some(Path::new(r"foo")), &PathBuf::from(r"bar")), PathBuf::from(r"foo/bar") ); assert_eq!( super::append_to_destdir(Some(Path::new(r"")), &PathBuf::from(r"")), PathBuf::from(r"") ); if cfg!(windows) { assert_eq!( super::append_to_destdir(Some(Path::new(r"X:\foo")), &PathBuf::from(r"Y:\bar")), PathBuf::from(r"X:\foo\bar") ); assert_eq!( super::append_to_destdir(Some(Path::new(r"A:\foo")), &PathBuf::from(r"B:bar")), PathBuf::from(r"A:\foo\bar") ); assert_eq!( super::append_to_destdir(Some(Path::new(r"\foo")), &PathBuf::from(r"\bar")), PathBuf::from(r"\foo\bar") ); assert_eq!( super::append_to_destdir( Some(Path::new(r"C:\dest")), Path::new(r"\\server\share\foo\bar") ), PathBuf::from(r"C:\\dest\\foo\\bar") ); } } } pub(crate) enum LibType { So, Dylib, Windows, } impl LibType { pub(crate) fn from_build_targets(build_targets: &BuildTargets) -> Self { let target = &build_targets.target; let os = &target.os; let env = &target.env; match (os.as_str(), env.as_str()) { ("linux", _) | ("freebsd", _) | ("dragonfly", _) | ("netbsd", _) | ("android", _) | ("haiku", _) | ("illumos", _) | ("openbsd", _) | ("emscripten", _) | ("hurd", _) => LibType::So, ("macos", _) | ("ios", _) | ("tvos", _) | ("visionos", _) => LibType::Dylib, ("windows", _) => LibType::Windows, _ => unimplemented!("The target {}-{} is not supported yet", os, env), } } } pub(crate) struct UnixLibNames { canonical: String, with_main_ver: String, with_full_ver: String, } impl UnixLibNames { pub(crate) fn new(lib_type: LibType, library: &LibraryCApiConfig) -> Option { let lib_name = &library.name; let lib_version = &library.version; let main_version = library.sover(); match lib_type { LibType::So => { let lib = format!("lib{lib_name}.so"); let lib_with_full_ver = format!( "{}.{}.{}.{}", lib, lib_version.major, lib_version.minor, lib_version.patch ); let lib_with_main_ver = format!("{}.{}", lib, main_version); Some(Self { canonical: lib, with_main_ver: lib_with_main_ver, with_full_ver: lib_with_full_ver, }) } LibType::Dylib => { let lib = format!("lib{lib_name}.dylib"); let lib_with_main_ver = format!("lib{}.{}.dylib", lib_name, main_version); let lib_with_full_ver = format!( "lib{}.{}.{}.{}.dylib", lib_name, lib_version.major, lib_version.minor, lib_version.patch ); Some(Self { canonical: lib, with_main_ver: lib_with_main_ver, with_full_ver: lib_with_full_ver, }) } LibType::Windows => None, } } fn links(&self, install_path_lib: &Path) { if self.with_main_ver != self.with_full_ver { let mut ln_sf = std::process::Command::new("ln"); ln_sf.arg("-sf"); ln_sf .arg(&self.with_full_ver) .arg(install_path_lib.join(&self.with_main_ver)); let _ = ln_sf.status().unwrap(); } let mut ln_sf = std::process::Command::new("ln"); ln_sf.arg("-sf"); ln_sf .arg(&self.with_full_ver) .arg(install_path_lib.join(&self.canonical)); let _ = ln_sf.status().unwrap(); } pub(crate) fn install( &self, ws: &Workspace, capi_config: &CApiConfig, shared_lib: &Path, install_path_lib: &Path, ) -> anyhow::Result<()> { if capi_config.library.versioning { copy(ws, shared_lib, install_path_lib.join(&self.with_full_ver))?; self.links(install_path_lib); } else { copy(ws, shared_lib, install_path_lib.join(&self.canonical))?; } Ok(()) } } pub fn cinstall(ws: &Workspace, packages: &[CPackage]) -> anyhow::Result<()> { for pkg in packages { let paths = &pkg.install_paths; let capi_config = &pkg.capi_config; let build_targets = &pkg.build_targets; let destdir = &paths.destdir; let mut install_path_lib = paths.libdir.clone(); if let Some(subdir) = &capi_config.library.install_subdir { install_path_lib.push(subdir); } let install_path_bin = append_to_destdir(destdir.as_deref(), &paths.bindir); let install_path_lib = append_to_destdir(destdir.as_deref(), &install_path_lib); let install_path_pc = append_to_destdir(destdir.as_deref(), &paths.pkgconfigdir); let install_path_include = append_to_destdir(destdir.as_deref(), &paths.includedir); let install_path_data = append_to_destdir(destdir.as_deref(), &paths.datadir); create_dir_all(&install_path_lib)?; create_dir_all(&install_path_pc)?; ws.gctx().shell().status("Installing", "pkg-config file")?; copy( ws, &build_targets.pc, install_path_pc.join(build_targets.pc.file_name().unwrap()), )?; if capi_config.header.enabled { ws.gctx().shell().status("Installing", "header file")?; for (from, to) in build_targets.extra.include.iter() { let to = install_path_include.join(to); create_dir_all(to.parent().unwrap())?; copy(ws, from, to)?; } } if !build_targets.extra.data.is_empty() { ws.gctx().shell().status("Installing", "data file")?; for (from, to) in build_targets.extra.data.iter() { let to = install_path_data.join(to); create_dir_all(to.parent().unwrap())?; copy(ws, from, to)?; } } if let Some(ref static_lib) = build_targets.static_lib { ws.gctx().shell().status("Installing", "static library")?; let file_name = build_targets.static_output_file_name().unwrap(); copy(ws, static_lib, install_path_lib.join(file_name))?; } if let Some(ref shared_lib) = build_targets.shared_lib { ws.gctx().shell().status("Installing", "shared library")?; let lib_type = LibType::from_build_targets(build_targets); match lib_type { LibType::So | LibType::Dylib => { let lib = UnixLibNames::new(lib_type, &capi_config.library).unwrap(); lib.install(ws, capi_config, shared_lib, &install_path_lib)?; } LibType::Windows => { let lib_name = build_targets.shared_output_file_name().unwrap(); if capi_config.library.install_subdir.is_none() { let install_path_bin = append_to_destdir(destdir.as_deref(), &paths.bindir); create_dir_all(&install_path_bin)?; copy(ws, shared_lib, install_path_bin.join(lib_name))?; } else { // We assume they are plugins, install them in the custom libdir path copy(ws, shared_lib, install_path_lib.join(lib_name))?; } if capi_config.library.import_library { let impl_lib = build_targets.impl_lib.as_ref().unwrap(); let impl_lib_name = impl_lib.file_name().unwrap(); copy(ws, impl_lib, install_path_lib.join(impl_lib_name))?; let def = build_targets.def.as_ref().unwrap(); let def_name = def.file_name().unwrap(); copy(ws, def, install_path_lib.join(def_name))?; } } } } if let Some(ref debug_info) = build_targets.debug_info { if debug_info.exists() { ws.gctx() .shell() .status("Installing", "debugging information")?; let destination_path = build_targets .debug_info_file_name(&install_path_bin, &install_path_lib) .unwrap(); create_dir_all(destination_path.parent().unwrap())?; copy(ws, debug_info, destination_path)?; } else { ws.gctx() .shell() .verbose(|shell| shell.status("Absent", "debugging information"))?; } } } Ok(()) } #[derive(Debug, Hash, Clone)] pub struct InstallPaths { pub subdir_name: PathBuf, pub destdir: Option, pub prefix: PathBuf, pub libdir: PathBuf, pub includedir: PathBuf, pub datadir: PathBuf, pub bindir: PathBuf, pub pkgconfigdir: PathBuf, } fn get_path_or(args: &ArgMatches, id: &str, f: impl FnOnce() -> PathBuf) -> PathBuf { if matches!( args.value_source(id), Some(clap::parser::ValueSource::DefaultValue) ) { f() } else { args.get_one::(id).unwrap().to_owned() } } impl InstallPaths { pub fn new( _name: &str, rustc_target: &Target, args: &ArgMatches, capi_config: &CApiConfig, ) -> Self { let destdir = args.get_one::("destdir").map(PathBuf::from); let prefix = get_path_or(args, "prefix", || rustc_target.default_prefix()); let libdir = prefix.join(get_path_or(args, "libdir", || { rustc_target.default_libdir() })); let includedir = prefix.join(get_path_or(args, "includedir", || { rustc_target.default_includedir() })); let datarootdir = prefix.join(get_path_or(args, "datarootdir", || { rustc_target.default_datadir() })); let datadir = args .get_one::("datadir") .map(|d| prefix.join(d)) .unwrap_or_else(|| datarootdir.clone()); let subdir_name = PathBuf::from(&capi_config.header.subdirectory); let bindir = prefix.join(args.get_one::("bindir").unwrap()); let pkgconfigdir = args .get_one::("pkgconfigdir") .map(|d| prefix.join(d)) .unwrap_or_else(|| libdir.join("pkgconfig")); InstallPaths { subdir_name, destdir, prefix, libdir, includedir, datadir, bindir, pkgconfigdir, } } } cargo-c-0.10.11+cargo-0.86.0/src/lib.rs000064400000000000000000000001741046102023000150220ustar 00000000000000pub mod build; pub mod build_targets; pub mod cli; pub mod config; pub mod install; pub mod pkg_config_gen; pub mod target; cargo-c-0.10.11+cargo-0.86.0/src/pkg_config_gen.rs000064400000000000000000000333231046102023000172150ustar 00000000000000#![allow(dead_code)] use crate::build::CApiConfig; use crate::install::InstallPaths; use std::path::{Component, Path, PathBuf}; fn canonicalize>(path: P) -> String { let mut stack = Vec::with_capacity(16); struct Item<'a> { separator: bool, component: Component<'a>, } let mut separator = false; for component in path.as_ref().components() { match component { Component::RootDir => { separator = true; } Component::Prefix(_) => stack.push(Item { separator: false, component, }), Component::ParentDir => { let _ = stack.pop(); } Component::CurDir => stack.push(Item { separator: false, component, }), Component::Normal(_) => { stack.push(Item { separator, component, }); separator = true; } } } if stack.is_empty() { String::from("/") } else { let mut buf = String::with_capacity(64); for item in stack { if item.separator { buf.push('/'); } buf.push_str(&item.component.as_os_str().to_string_lossy()); } buf } } #[derive(Debug, Clone)] pub struct PkgConfig { prefix: PathBuf, exec_prefix: PathBuf, includedir: PathBuf, libdir: PathBuf, name: String, description: String, version: String, requires: Vec, requires_private: Vec, libs: Vec, libs_private: Vec, cflags: Vec, conflicts: Vec, } impl PkgConfig { /// /// Build a pkgconfig structure with the following defaults: /// /// prefix=/usr/local /// exec_prefix=${prefix} /// includedir=${prefix}/include /// libdir=${exec_prefix}/lib /// /// Name: $name /// Description: $description /// Version: $version /// Cflags: -I${includedir}/$name /// Libs: -L${libdir} -l$name /// pub fn new(_name: &str, capi_config: &CApiConfig) -> Self { let requires = match &capi_config.pkg_config.requires { Some(reqs) => reqs.split(',').map(|s| s.trim().to_string()).collect(), _ => Vec::new(), }; let requires_private = match &capi_config.pkg_config.requires_private { Some(reqs) => reqs.split(',').map(|s| s.trim().to_string()).collect(), _ => Vec::new(), }; let mut libdir = PathBuf::new(); libdir.push("${libdir}"); if let Some(subdir) = &capi_config.library.install_subdir { libdir.push(subdir); } let libs = vec![ format!("-L{}", libdir.display()), format!("-l{}", capi_config.library.name), ]; let cflags = if capi_config.header.enabled { let includedir = Path::new("${includedir}").join(&capi_config.header.subdirectory); let includedir = includedir .ancestors() .nth(capi_config.pkg_config.strip_include_path_components) .unwrap_or_else(|| Path::new("")); format!("-I{}", canonicalize(includedir)) } else { String::from("") }; PkgConfig { name: capi_config.pkg_config.name.clone(), description: capi_config.pkg_config.description.clone(), version: capi_config.pkg_config.version.clone(), prefix: "/usr/local".into(), exec_prefix: "${prefix}".into(), includedir: "${prefix}/include".into(), libdir: "${exec_prefix}/lib".into(), libs, libs_private: Vec::new(), requires, requires_private, cflags: vec![cflags], conflicts: Vec::new(), } } pub(crate) fn from_workspace( name: &str, install_paths: &InstallPaths, args: &clap::ArgMatches, capi_config: &CApiConfig, ) -> Self { let mut pc = PkgConfig::new(name, capi_config); pc.prefix.clone_from(&install_paths.prefix); // TODO: support exec_prefix if args.contains_id("includedir") { if let Ok(suffix) = install_paths.includedir.strip_prefix(&pc.prefix) { pc.includedir = PathBuf::from("${prefix}").join(suffix); } else { pc.includedir.clone_from(&install_paths.includedir); } } if args.contains_id("libdir") { if let Ok(suffix) = install_paths.libdir.strip_prefix(&pc.prefix) { pc.libdir = PathBuf::from("${prefix}").join(suffix); } else { pc.libdir.clone_from(&install_paths.libdir); } } pc } pub(crate) fn uninstalled(&self, output: &Path) -> Self { let mut uninstalled = self.clone(); uninstalled.prefix = output.to_path_buf(); uninstalled.includedir = "${prefix}/include".into(); uninstalled.libdir = "${prefix}".into(); // First libs item is the search path uninstalled.libs[0] = "-L${prefix}".into(); uninstalled } pub fn set_description>(&mut self, descr: S) -> &mut Self { descr.as_ref().clone_into(&mut self.description); self } pub fn set_libs>(&mut self, lib: S) -> &mut Self { let lib = lib.as_ref().to_owned(); self.libs.clear(); self.libs.push(lib); self } pub fn add_lib>(&mut self, lib: S) -> &mut Self { let lib = lib.as_ref().to_owned(); self.libs.push(lib); self } pub fn set_libs_private>(&mut self, lib: S) -> &mut Self { let lib = lib.as_ref().to_owned(); self.libs_private.clear(); self.libs_private.push(lib); self } pub fn add_lib_private>(&mut self, lib: S) -> &mut Self { let lib = lib.as_ref().to_owned(); self.libs_private.push(lib); self } pub fn set_cflags>(&mut self, flag: S) -> &mut Self { let flag = flag.as_ref().to_owned(); self.cflags.clear(); self.cflags.push(flag); self } pub fn add_cflag>(&mut self, flag: S) -> &mut Self { let flag = flag.as_ref(); self.cflags.push(flag.to_owned()); self } pub fn render(&self) -> String { // writing to a String only fails on OOM, which we disregard self.render_help(String::with_capacity(1024)).unwrap() } fn render_help(&self, mut w: W) -> Result { writeln!(w, "prefix={}", canonicalize(&self.prefix))?; writeln!(w, "exec_prefix={}", canonicalize(&self.exec_prefix))?; writeln!(w, "libdir={}", canonicalize(&self.libdir))?; writeln!(w, "includedir={}", canonicalize(&self.includedir))?; writeln!(w)?; writeln!(w, "Name: {}", self.name)?; writeln!(w, "Description: {}", self.description.replace('\n', " "))?; // avoid endlines writeln!(w, "Version: {}", self.version)?; writeln!(w, "Libs: {}", self.libs.join(" "))?; writeln!(w, "Cflags: {}", self.cflags.join(" "))?; if !self.libs_private.is_empty() { writeln!(w, "Libs.private: {}", self.libs_private.join(" "))?; } if !self.requires.is_empty() { writeln!(w, "Requires: {}", self.requires.join(", "))?; } if !self.requires_private.is_empty() { let joined = self.requires_private.join(", "); writeln!(w, "Requires.private: {}", joined)?; } Ok(w) } } #[cfg(test)] mod test { use super::*; use semver::Version; #[test] fn simple() { let mut pkg = PkgConfig::new( "foo", &CApiConfig { header: crate::build::HeaderCApiConfig { name: "foo".into(), subdirectory: "".into(), generation: true, enabled: true, }, pkg_config: crate::build::PkgConfigCApiConfig { name: "foo".into(), filename: "foo".into(), description: "".into(), version: "0.1".into(), requires: Some("somelib, someotherlib".into()), requires_private: Some("someprivatelib >= 1.0".into()), strip_include_path_components: 0, }, library: crate::build::LibraryCApiConfig { name: "foo".into(), version: Version::parse("0.1.0").unwrap(), install_subdir: None, versioning: true, version_suffix_components: None, import_library: true, rustflags: Vec::default(), }, install: Default::default(), }, ); pkg.add_lib("-lbar").add_cflag("-DFOO"); let expected = concat!( "prefix=/usr/local\n", "exec_prefix=${prefix}\n", "libdir=${exec_prefix}/lib\n", "includedir=${prefix}/include\n", "\n", "Name: foo\n", "Description: \n", "Version: 0.1\n", "Libs: -L${libdir} -lfoo -lbar\n", "Cflags: -I${includedir} -DFOO\n", "Requires: somelib, someotherlib\n", "Requires.private: someprivatelib >= 1.0\n", ); assert_eq!(expected, pkg.render()); } mod test_canonicalize { use super::canonicalize; #[test] fn test_absolute_path() { let path = "/home/user/docs"; let result = canonicalize(path); assert_eq!(result, "/home/user/docs"); } #[test] fn test_relative_path() { let path = "home/user/docs"; let result = canonicalize(path); assert_eq!(result, "home/user/docs"); } #[test] fn test_current_directory() { let path = "/home/user/./docs"; let result = canonicalize(path); assert_eq!(result, "/home/user/docs"); } #[test] fn test_parent_directory() { let path = "/home/user/../docs"; let result = canonicalize(path); assert_eq!(result, "/home/docs"); } #[test] fn test_mixed_dots_and_parent_dirs() { let path = "/home/./user/../docs/./files"; let result = canonicalize(path); assert_eq!(result, "/home/docs/files"); } #[test] fn test_multiple_consecutive_slashes() { let path = "/home//user///docs"; let result = canonicalize(path); assert_eq!(result, "/home/user/docs"); } #[test] fn test_empty_path() { let path = ""; let result = canonicalize(path); assert_eq!(result, "/"); } #[test] fn test_single_dot() { let path = "."; let result = canonicalize(path); assert_eq!(result, "."); } #[test] fn test_single_dot_in_absolute_path() { let path = "/."; let result = canonicalize(path); assert_eq!(result, "/"); } #[test] fn test_trailing_slash() { let path = "/home/user/docs/"; let result = canonicalize(path); assert_eq!(result, "/home/user/docs"); } #[test] fn test_dots_complex_case() { let path = "/a/b/./c/../d//e/./../f"; let result = canonicalize(path); assert_eq!(result, "/a/b/d/f"); } #[cfg(windows)] mod windows { use std::path::Path; use super::*; #[test] fn test_canonicalize_basic_windows_path() { let input = Path::new(r"C:\Users\test\..\Documents"); let expected = r"C:/Users/Documents"; let result = canonicalize(input); assert_eq!(result, expected); } #[test] fn test_canonicalize_with_current_dir() { let input = Path::new(r"C:\Users\.\Documents"); let expected = r"C:/Users/Documents"; let result = canonicalize(input); assert_eq!(result, expected); } #[test] fn test_canonicalize_with_double_parent_dir() { let input = Path::new(r"C:\Users\test\..\..\Documents"); let expected = r"C:/Documents"; let result = canonicalize(input); assert_eq!(result, expected); } #[test] fn test_canonicalize_with_trailing_slash() { let input = Path::new(r"C:\Users\test\..\Documents\"); let expected = r"C:/Users/Documents"; let result = canonicalize(input); assert_eq!(result, expected); } #[test] fn test_canonicalize_relative_path() { let input = Path::new(r"Users\test\..\Documents"); let expected = r"Users/Documents"; let result = canonicalize(input); assert_eq!(result, expected); } #[test] fn test_canonicalize_current_dir_only() { let input = Path::new(r".\"); let expected = r"."; let result = canonicalize(input); assert_eq!(result, expected); } } } } cargo-c-0.10.11+cargo-0.86.0/src/target.rs000064400000000000000000000136071046102023000155470ustar 00000000000000use std::env::consts; use std::path::{Path, PathBuf}; use anyhow::*; use crate::build::CApiConfig; /// Split a target string to its components /// /// Because of https://github.com/rust-lang/rust/issues/61558 /// It uses internally `rustc` to validate the string. #[derive(Clone, Debug)] pub struct Target { pub is_target_overridden: bool, pub arch: String, // pub vendor: String, pub os: String, pub env: String, } impl Target { pub fn new>( target: Option, is_target_overridden: bool, ) -> Result { let rustc = std::env::var("RUSTC").unwrap_or_else(|_| "rustc".into()); let mut cmd = std::process::Command::new(rustc); cmd.arg("--print").arg("cfg"); if let Some(target) = target { cmd.arg("--target").arg(target); } let out = cmd.output()?; if out.status.success() { fn match_re(re: regex::Regex, s: &str) -> String { re.captures(s) .map_or("", |cap| cap.get(1).unwrap().as_str()) .to_owned() } let arch_re = regex::Regex::new(r#"target_arch="(.+)""#).unwrap(); // let vendor_re = regex::Regex::new(r#"target_vendor="(.+)""#).unwrap(); let os_re = regex::Regex::new(r#"target_os="(.+)""#).unwrap(); let env_re = regex::Regex::new(r#"target_env="(.+)""#).unwrap(); let s = std::str::from_utf8(&out.stdout).unwrap(); Ok(Target { arch: match_re(arch_re, s), // vendor: match_re(vendor_re, s), os: match_re(os_re, s), env: match_re(env_re, s), is_target_overridden, }) } else { Err(anyhow!("Cannot run {:?}", cmd)) } } /// Build a list of linker arguments pub fn shared_object_link_args( &self, capi_config: &CApiConfig, libdir: &Path, target_dir: &Path, ) -> Vec { let mut lines = Vec::new(); let lib_name = &capi_config.library.name; let version = &capi_config.library.version; let major = version.major; let minor = version.minor; let patch = version.patch; let os = &self.os; let env = &self.env; let sover = capi_config.library.sover(); if os == "android" { lines.push(format!("-Wl,-soname,lib{lib_name}.so")); } else if os == "linux" || os == "freebsd" || os == "dragonfly" || os == "netbsd" || os == "haiku" || os == "illumos" || os == "openbsd" || os == "hurd" { lines.push(if capi_config.library.versioning { format!("-Wl,-soname,lib{lib_name}.so.{sover}") } else { format!("-Wl,-soname,lib{lib_name}.so") }); } else if os == "macos" || os == "ios" || os == "tvos" || os == "visionos" { let line = if capi_config.library.versioning { format!("-Wl,-install_name,{1}/lib{0}.{5}.dylib,-current_version,{2}.{3}.{4},-compatibility_version,{5}", lib_name, libdir.display(), major, minor, patch, sover) } else { format!( "-Wl,-install_name,{1}/lib{0}.dylib", lib_name, libdir.display() ) }; lines.push(line); // Enable larger LC_RPATH and install_name entries lines.push("-Wl,-headerpad_max_install_names".to_string()); } else if os == "windows" && env == "gnu" { // This is only set up to work on GNU toolchain versions of Rust lines.push(format!( "-Wl,--output-def,{}", target_dir.join(format!("{lib_name}.def")).display() )); } // Emscripten doesn't support soname or other dynamic linking flags (yet). // See: https://github.com/emscripten-core/emscripten/blob/3.1.39/emcc.py#L92-L94 // else if os == "emscripten" lines } fn is_freebsd(&self) -> bool { self.os.eq_ignore_ascii_case("freebsd") } fn is_haiku(&self) -> bool { self.os.eq_ignore_ascii_case("haiku") } fn is_windows(&self) -> bool { self.os.eq_ignore_ascii_case("windows") } pub fn default_libdir(&self) -> PathBuf { if self.is_target_overridden || self.is_freebsd() { return "lib".into(); } if PathBuf::from("/etc/debian_version").exists() { let pc = std::process::Command::new("dpkg-architecture") .arg("-qDEB_HOST_MULTIARCH") .output(); if let std::result::Result::Ok(v) = pc { if v.status.success() { let archpath = String::from_utf8_lossy(&v.stdout); return format!("lib/{}", archpath.trim()).into(); } } } if consts::ARCH.eq_ignore_ascii_case(&self.arch) && consts::OS.eq_ignore_ascii_case(&self.os) { let usr_lib64 = PathBuf::from("/usr/lib64"); if usr_lib64.exists() && !usr_lib64.is_symlink() { return "lib64".into(); } } "lib".into() } pub fn default_prefix(&self) -> PathBuf { if self.is_windows() { "c:/".into() } else if self.is_haiku() { "/boot/system/non-packaged".into() } else { "/usr/local".into() } } pub fn default_datadir(&self) -> PathBuf { if self.is_haiku() { return "data".into(); } "share".into() } pub fn default_includedir(&self) -> PathBuf { if self.is_haiku() { return "develop/headers".into(); } "include".into() } }