cargo-c-0.9.29+cargo-0.76.0/.cargo_vcs_info.json0000644000000001360000000000100142650ustar { "git": { "sha1": "c1dda062fd405f1b19d270798744acd9d65627a8" }, "path_in_vcs": "" }cargo-c-0.9.29+cargo-0.76.0/.github/FUNDING.yml000064400000000000000000000001231046102023000162260ustar 00000000000000# These are supported funding model platforms liberapay: lu_zero github: lu-zero cargo-c-0.9.29+cargo-0.76.0/.github/actions-rs/grcov.yml000064400000000000000000000000661046102023000203440ustar 00000000000000ignore-not-existing: true ignore: - "/*" - "../*" cargo-c-0.9.29+cargo-0.76.0/.github/dependabot.yml000064400000000000000000000005431046102023000172470ustar 00000000000000version: 2 updates: - 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.9.29+cargo-0.76.0/.github/workflows/deploy.yml000064400000000000000000000071251046102023000204760ustar 00000000000000name: deploy on: push: tags: - 'v*.*.*' 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@v2 - 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@v2 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@v2 - 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 zip 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@v2 with: name: cargo-c-linux-binaries path: cargo-c-${{ matrix.target }}.tar.gz macos-binaries: runs-on: macos-latest steps: - uses: actions/checkout@v2 - 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@v2 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@v2 - name: Install stable uses: dtolnay/rust-toolchain@stable with: toolchain: stable - name: Download zip files uses: actions/download-artifact@v2 - name: Create Cargo.lock run: | cargo update - name: Create a release uses: softprops/action-gh-release@v1 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.9.29+cargo-0.76.0/.github/workflows/example-project.yml000064400000000000000000000042231046102023000222750ustar 00000000000000name: Build example project on: [push, pull_request] env: CARGO_TERM_COLOR: always jobs: example-project: strategy: matrix: include: - os: ubuntu-latest - 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@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable${{ matrix.toolchain-suffix }} - 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 temporary location working-directory: example-project run: | cargo cinstall --verbose --release --destdir=temp - name: Copy installed files to /usr/local if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') working-directory: example-project run: | sudo cp -r temp/usr/local/* /usr/local/ - name: Test pkg-config if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') run: | set -x test "$(pkg-config --cflags example_project)" = "-I/usr/local/include/example-project-0.1" test "$(pkg-config --libs example_project)" = "-L/usr/local/lib -lexample-project" - name: Update dynamic linker cache if: startsWith(matrix.os, 'ubuntu') run: | sudo ldconfig - name: Test usage from C (using Makefile) if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') working-directory: example-project/usage-from-c run: | make cargo-c-0.9.29+cargo-0.76.0/.github/workflows/rust.yml000064400000000000000000000040531046102023000201740ustar 00000000000000name: Rust on: [push, pull_request] jobs: rustfmt-clippy: name: Format and Clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - 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.0.0 with: args: --all -- -D warnings --verbose coverage: needs: arch-test name: Code coverage runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - 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@v3 with: files: coverage.lcov arch-test: needs: rustfmt-clippy strategy: matrix: os: [ubuntu-latest, windows-latest, macos-12] 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@v3 - 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.9.29+cargo-0.76.0/.gitignore000064400000000000000000000001371046102023000150460ustar 00000000000000/target **/*.rs.bk Cargo.lock /example-project/target/ /example-project/usage-from-c/run_tests cargo-c-0.9.29+cargo-0.76.0/Cargo.lock0000644000002334470000000000100122550ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "anstream" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", "utf8parse", ] [[package]] name = "anstyle" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys 0.52.0", ] [[package]] name = "anyhow" version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9d19de80eff169429ac1e9f48fffb163916b448a44e8e046186232046d9e1f9" [[package]] name = "arc-swap" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitmaps" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" dependencies = [ "typenum", ] [[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.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "regex-automata 0.4.3", "serde", ] [[package]] name = "btoi" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" dependencies = [ "num-traits", ] [[package]] name = "bumpalo" version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytesize" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" [[package]] name = "cargo" version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86cb275625d5f6445b70d6c544230c3db747dd8b23ae65faa7d5d095e4f6d293" dependencies = [ "anstream", "anstyle", "anyhow", "base64", "bytesize", "cargo-credential", "cargo-credential-libsecret", "cargo-credential-macos-keychain", "cargo-credential-wincred", "cargo-platform", "cargo-util", "clap", "color-print", "crates-io", "curl", "curl-sys", "filetime", "flate2", "git2", "git2-curl", "gix", "gix-features 0.35.0", "glob", "hex", "hmac", "home", "http-auth", "humantime", "ignore", "im-rc", "indexmap 2.1.0", "itertools 0.11.0", "jobserver", "lazycell", "libc", "libgit2-sys", "memchr", "opener", "openssl", "os_info", "pasetors", "pathdiff", "pulldown-cmark", "rand", "rustfix", "semver", "serde", "serde-untagged", "serde-value", "serde_ignored", "serde_json", "sha1", "shell-escape", "supports-hyperlinks", "syn 2.0.43", "tar", "tempfile", "time", "toml 0.8.8", "toml_edit 0.20.7", "tracing", "tracing-subscriber", "unicase", "unicode-width", "unicode-xid", "url", "walkdir", "windows-sys 0.48.0", ] [[package]] name = "cargo-c" version = "0.9.29+cargo-0.76.0" dependencies = [ "anyhow", "cargo", "cargo-util", "cbindgen", "cc", "clap", "glob", "itertools 0.12.0", "log", "regex", "semver", "serde", "serde_derive", "serde_json", "toml 0.8.8", "windows-sys 0.52.0", ] [[package]] name = "cargo-credential" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1eb63e2bf69272d1d7236a7d3083a75a8437c9ce69465a1665caa7c3a213d757" dependencies = [ "anyhow", "libc", "serde", "serde_json", "thiserror", "time", "windows-sys 0.48.0", ] [[package]] name = "cargo-credential-libsecret" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e66f527855fced262c773931afd15340dcb0b5094f009fcb97e51dde994bc09" dependencies = [ "anyhow", "cargo-credential", "libloading", ] [[package]] name = "cargo-credential-macos-keychain" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e07c6d49412548e3bbe9824c9259253bf0355e9f4bd22aa859ea22db154ac0b5" dependencies = [ "cargo-credential", "security-framework", ] [[package]] name = "cargo-credential-wincred" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba2353aca6dcb405fab527445d65bf35b64b56f47509bba516bb0be2800f70b4" dependencies = [ "cargo-credential", "windows-sys 0.48.0", ] [[package]] name = "cargo-platform" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] [[package]] name = "cargo-util" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb2bdd1d8ab2353ddd763881eaba60cb53f1deee0ff9d271b9f0e4cdbcd063fb" dependencies = [ "anyhow", "core-foundation", "filetime", "hex", "jobserver", "libc", "miow", "same-file", "sha2", "shell-escape", "tempfile", "tracing", "walkdir", "windows-sys 0.48.0", ] [[package]] name = "cbindgen" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da6bc11b07529f16944307272d5bd9b22530bc7d05751717c9d416586cedab49" dependencies = [ "heck", "indexmap 1.9.3", "log", "proc-macro2", "quote", "serde", "serde_json", "syn 1.0.109", "tempfile", "toml 0.5.11", ] [[package]] name = "cc" version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", ] [[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.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", "clap_derive", ] [[package]] name = "clap_builder" version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", "clap_lex", "strsim", "terminal_size", ] [[package]] name = "clap_derive" version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", "syn 2.0.43", ] [[package]] name = "clap_lex" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "clru" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" [[package]] name = "color-print" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a858372ff14bab9b1b30ea504f2a4bc534582aee3e42ba2d41d2a7baba63d5d" dependencies = [ "color-print-proc-macro", ] [[package]] name = "color-print-proc-macro" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57e37866456a721d0a404439a1adae37a31be4e0055590d053dfe6981e05003f" dependencies = [ "nom", "proc-macro2", "quote", "syn 1.0.109", ] [[package]] name = "colorchoice" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "core-foundation-sys" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] [[package]] name = "crates-io" version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4530c82103cc1a9c776970623b07b0f5ad097c477b1b0c69d114eb1132db1a8" dependencies = [ "curl", "percent-encoding", "serde", "serde_json", "thiserror", "url", ] [[package]] name = "crc32fast" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] [[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.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" [[package]] name = "curl" version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" dependencies = [ "curl-sys", "libc", "openssl-probe", "openssl-sys", "schannel", "socket2", "winapi", ] [[package]] name = "curl-sys" version = "0.4.70+curl-8.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c0333d8849afe78a4c8102a429a446bfdd055832af071945520e835ae2d841e" dependencies = [ "cc", "libc", "libnghttp2-sys", "libz-sys", "openssl-sys", "pkg-config", "vcpkg", "windows-sys 0.48.0", ] [[package]] name = "der" version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "pem-rfc7468", "zeroize", ] [[package]] name = "deranged" version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" 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 = "dunce" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[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.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a667e6426df16c2ac478efa4a439d0e674cba769c5556e8cf221739251640c8c" dependencies = [ "getrandom", ] [[package]] name = "either" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[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.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4adbf0983fe06bd3a5c19c8477a637c2389feb0994eca7a59e3b961054aa7c0a" dependencies = [ "serde", ] [[package]] name = "errno" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "faster-hex" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "239f7bfb930f820ab16a9cd95afc26f88264cf6905c960b340a615384aa3338a" dependencies = [ "serde", ] [[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.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[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.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "filetime" version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", "redox_syscall", "windows-sys 0.52.0", ] [[package]] name = "flate2" version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "libz-sys", "miniz_oxide", ] [[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.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", "libc", "wasi", "wasm-bindgen", ] [[package]] name = "git2" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" dependencies = [ "bitflags 2.4.1", "libc", "libgit2-sys", "log", "openssl-probe", "openssl-sys", "url", ] [[package]] name = "git2-curl" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78e26b61608c573ffd26fc79061a823aa5147449a1afe1f61679a21e2031f7c3" dependencies = [ "curl", "git2", "log", "url", ] [[package]] name = "gix" version = "0.55.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "002667cd1ebb789313d0d0afe3d23b2821cf3b0e91605095f0e6d8751f0ceeea" dependencies = [ "gix-actor", "gix-attributes", "gix-commitgraph", "gix-config", "gix-credentials", "gix-date", "gix-diff", "gix-discover", "gix-features 0.36.1", "gix-filter", "gix-fs", "gix-glob", "gix-hash", "gix-hashtable", "gix-ignore", "gix-index", "gix-lock", "gix-macros", "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-submodule", "gix-tempfile", "gix-trace", "gix-transport", "gix-traverse", "gix-url", "gix-utils", "gix-validate", "gix-worktree", "once_cell", "parking_lot", "prodash", "smallvec", "thiserror", "unicode-normalization", ] [[package]] name = "gix-actor" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eadca029ef716b4378f7afb19f7ee101fde9e58ba1f1445971315ac866db417" dependencies = [ "bstr", "btoi", "gix-date", "itoa", "thiserror", "winnow", ] [[package]] name = "gix-attributes" version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f395469d38c76ec47cd1a6c5a53fbc3f13f737b96eaf7535f4e6b367e643381" dependencies = [ "bstr", "gix-glob", "gix-path", "gix-quote", "gix-trace", "kstring", "smallvec", "thiserror", "unicode-bom", ] [[package]] name = "gix-bitmap" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d49e1a13a30d3f88be4bceae184dd13a2d3fb9ffa7515f7ed7ae771b857f4916" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d411ecd9b558b0c20b3252b7e409eec48eabc41d18324954fe526bac6e2db55f" dependencies = [ "thiserror", ] [[package]] name = "gix-command" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c576cfbf577f72c097b5f88aedea502cd62952bdc1fb3adcab4531d5525a4c7" dependencies = [ "bstr", ] [[package]] name = "gix-commitgraph" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85a7007ba021f059803afaf6f8a48872422abc20550ac12ede6ddea2936cec36" dependencies = [ "bstr", "gix-chunk", "gix-features 0.36.1", "gix-hash", "memmap2 0.9.3", "thiserror", ] [[package]] name = "gix-config" version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cae98c6b4c66c09379bc35274b172587d6b0ac369a416c39128ad8c6454f9bb" dependencies = [ "bstr", "gix-config-value", "gix-features 0.36.1", "gix-glob", "gix-path", "gix-ref", "gix-sec", "memchr", "once_cell", "smallvec", "thiserror", "unicode-bom", "winnow", ] [[package]] name = "gix-config-value" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6419db582ea84dfb58c7e7b0af7fd62c808aa14954af2936a33f89b0f4ed018e" dependencies = [ "bitflags 2.4.1", "bstr", "gix-path", "libc", "thiserror", ] [[package]] name = "gix-credentials" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c5c5d74069b842a1861e581027ac6b7ad9ff66f5911c89b9f45484d7ebda6a4" dependencies = [ "bstr", "gix-command", "gix-config-value", "gix-path", "gix-prompt", "gix-sec", "gix-url", "thiserror", ] [[package]] name = "gix-date" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "468dfbe411f335f01525a1352271727f8e7772075a93fa747260f502086b30be" dependencies = [ "bstr", "itoa", "thiserror", "time", ] [[package]] name = "gix-diff" version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "931394f69fb8c9ed6afc0aae3487bd869e936339bcc13ed8884472af072e0554" dependencies = [ "gix-hash", "gix-object", "thiserror", ] [[package]] name = "gix-discover" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a45d5cf0321178883e38705ab2b098f625d609a7d4c391b33ac952eff2c490f2" dependencies = [ "bstr", "dunce", "gix-hash", "gix-path", "gix-ref", "gix-sec", "thiserror", ] [[package]] name = "gix-features" version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b9ff423ae4983f762659040d13dd7a5defbd54b6a04ac3cc7347741cec828cd" dependencies = [ "crossbeam-channel", "gix-hash", "gix-trace", "libc", "parking_lot", ] [[package]] name = "gix-features" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d46a4a5c6bb5bebec9c0d18b65ada20e6517dbd7cf855b87dd4bbdce3a771b2" dependencies = [ "bytes", "crc32fast", "flate2", "gix-hash", "gix-trace", "libc", "once_cell", "prodash", "sha1_smol", "thiserror", "walkdir", ] [[package]] name = "gix-filter" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92f674d3fdb6b1987b04521ec9a5b7be8650671f2c4bbd17c3c81e2a364242ff" dependencies = [ "bstr", "encoding_rs", "gix-attributes", "gix-command", "gix-hash", "gix-object", "gix-packetline-blocking", "gix-path", "gix-quote", "gix-trace", "smallvec", "thiserror", ] [[package]] name = "gix-fs" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20e86eb040f5776a5ade092282e51cdcad398adb77d948b88d17583c2ae4e107" dependencies = [ "gix-features 0.36.1", ] [[package]] name = "gix-glob" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5db19298c5eeea2961e5b3bf190767a2d1f09b8802aeb5f258e42276350aff19" dependencies = [ "bitflags 2.4.1", "bstr", "gix-features 0.36.1", "gix-path", ] [[package]] name = "gix-hash" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f8cf8c2266f63e582b7eb206799b63aa5fa68ee510ad349f637dfe2d0653de0" dependencies = [ "faster-hex 0.9.0", "thiserror", ] [[package]] name = "gix-hashtable" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "feb61880816d7ec4f0b20606b498147d480860ddd9133ba542628df2f548d3ca" dependencies = [ "gix-hash", "hashbrown 0.14.3", "parking_lot", ] [[package]] name = "gix-ignore" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a215cc8cf21645bca131fcf6329d3ebd46299c47dbbe27df71bb1ca9e328b879" dependencies = [ "bstr", "gix-glob", "gix-path", "unicode-bom", ] [[package]] name = "gix-index" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c83a4fcc121b2f2e109088f677f89f85e7a8ebf39e8e6659c0ae54d4283b1650" dependencies = [ "bitflags 2.4.1", "bstr", "btoi", "filetime", "gix-bitmap", "gix-features 0.36.1", "gix-fs", "gix-hash", "gix-lock", "gix-object", "gix-traverse", "itoa", "memmap2 0.7.1", "smallvec", "thiserror", ] [[package]] name = "gix-lock" version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5c65e6a29830a435664891ced3f3c1af010f14900226019590ee0971a22f37" dependencies = [ "gix-tempfile", "gix-utils", "thiserror", ] [[package]] name = "gix-macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae" dependencies = [ "proc-macro2", "quote", "syn 2.0.43", ] [[package]] name = "gix-negotiate" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a5cdcf491ecc9ce39dcc227216c540355fe0024ae7c38e94557752ca5ebb67f" dependencies = [ "bitflags 2.4.1", "gix-commitgraph", "gix-date", "gix-hash", "gix-object", "gix-revwalk", "smallvec", "thiserror", ] [[package]] name = "gix-object" version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "740f2a44267f58770a1cb3a3d01d14e67b089c7136c48d4bddbb3cfd2bf86a51" dependencies = [ "bstr", "btoi", "gix-actor", "gix-date", "gix-features 0.36.1", "gix-hash", "gix-validate", "itoa", "smallvec", "thiserror", "winnow", ] [[package]] name = "gix-odb" version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8630b56cb80d8fa684d383dad006a66401ee8314e12fbf0e566ddad8c115143b" dependencies = [ "arc-swap", "gix-date", "gix-features 0.36.1", "gix-hash", "gix-object", "gix-pack", "gix-path", "gix-quote", "parking_lot", "tempfile", "thiserror", ] [[package]] name = "gix-pack" version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1431ba2e30deff1405920693d54ab231c88d7c240dd6ccc936ee223d8f8697c3" dependencies = [ "clru", "gix-chunk", "gix-features 0.36.1", "gix-hash", "gix-hashtable", "gix-object", "gix-path", "gix-tempfile", "memmap2 0.7.1", "parking_lot", "smallvec", "thiserror", ] [[package]] name = "gix-packetline" version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a8384b1e964151aff0d5632dd9b191059d07dff358b96bd940f1b452600d7ab" dependencies = [ "bstr", "faster-hex 0.8.1", "thiserror", ] [[package]] name = "gix-packetline-blocking" version = "0.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8395f7501c84d6a1fe902035fdfd8cd86d89e2dd6be0200ec1a72fd3c92d39" dependencies = [ "bstr", "faster-hex 0.8.1", "thiserror", ] [[package]] name = "gix-path" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86d6fac2fabe07b67b7835f46d07571f68b11aa1aaecae94fe722ea4ef305e1" dependencies = [ "bstr", "gix-trace", "home", "once_cell", "thiserror", ] [[package]] name = "gix-pathspec" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dbbb92f75a38ef043c8bb830b339b38d0698d7f3746968b5fcbade7a880494d" dependencies = [ "bitflags 2.4.1", "bstr", "gix-attributes", "gix-config-value", "gix-glob", "gix-path", "thiserror", ] [[package]] name = "gix-prompt" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c9a913769516f5e9d937afac206fb76428e3d7238e538845842887fda584678" dependencies = [ "gix-command", "gix-config-value", "parking_lot", "rustix", "thiserror", ] [[package]] name = "gix-protocol" version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "391e3feabdfa5f90dad6673ce59e3291ac28901b2ff248d86c5a7fbde0391e0e" dependencies = [ "bstr", "btoi", "gix-credentials", "gix-date", "gix-features 0.36.1", "gix-hash", "gix-transport", "maybe-async", "thiserror", "winnow", ] [[package]] name = "gix-quote" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f84845efa535468bc79c5a87b9d29219f1da0313c8ecf0365a5daa7e72786f2" dependencies = [ "bstr", "btoi", "thiserror", ] [[package]] name = "gix-ref" version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ec2f6d07ac88d2fb8007ee3fa3e801856fb9d82e7366ec0ca332eb2c9d74a52" dependencies = [ "gix-actor", "gix-date", "gix-features 0.36.1", "gix-fs", "gix-hash", "gix-lock", "gix-object", "gix-path", "gix-tempfile", "gix-validate", "memmap2 0.7.1", "thiserror", "winnow", ] [[package]] name = "gix-refspec" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb0974cc41dbdb43a180c7f67aa481e1c1e160fcfa8f4a55291fd1126c1a6e7" dependencies = [ "bstr", "gix-hash", "gix-revision", "gix-validate", "smallvec", "thiserror", ] [[package]] name = "gix-revision" version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ca97ac73459a7f3766aa4a5638a6e37d56d4c7962bc1986fbaf4883d0772588" dependencies = [ "bstr", "gix-date", "gix-hash", "gix-hashtable", "gix-object", "gix-revwalk", "gix-trace", "thiserror", ] [[package]] name = "gix-revwalk" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a16d8c892e4cd676d86f0265bf9d40cefd73d8d94f86b213b8b77d50e77efae0" dependencies = [ "gix-commitgraph", "gix-date", "gix-hash", "gix-hashtable", "gix-object", "smallvec", "thiserror", ] [[package]] name = "gix-sec" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a36ea2c5907d64a9b4b5d3cc9f430e6c30f0509646b5e38eb275ca57c5bf29e2" dependencies = [ "bitflags 2.4.1", "gix-path", "libc", "windows", ] [[package]] name = "gix-submodule" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bba78c8d12aa24370178453ec3a472ff08dfaa657d116229f57f2c9cd469a1c2" dependencies = [ "bstr", "gix-config", "gix-path", "gix-pathspec", "gix-refspec", "gix-url", "thiserror", ] [[package]] name = "gix-tempfile" version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388dd29114a86ec69b28d1e26d6d63a662300ecf61ab3f4cc578f7d7dc9e7e23" dependencies = [ "gix-fs", "libc", "once_cell", "parking_lot", "tempfile", ] [[package]] name = "gix-trace" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b686a35799b53a9825575ca3f06481d0a053a409c4d97ffcf5ddd67a8760b497" [[package]] name = "gix-transport" version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f209a93364e24f20319751bc11092272e2f3fe82bb72592b2822679cf5be752" dependencies = [ "base64", "bstr", "curl", "gix-command", "gix-credentials", "gix-features 0.36.1", "gix-packetline", "gix-quote", "gix-sec", "gix-url", "thiserror", ] [[package]] name = "gix-traverse" version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14d050ec7d4e1bb76abf0636cf4104fb915b70e54e3ced9a4427c999100ff38a" dependencies = [ "gix-commitgraph", "gix-date", "gix-hash", "gix-hashtable", "gix-object", "gix-revwalk", "smallvec", "thiserror", ] [[package]] name = "gix-url" version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c427a1a11ccfa53a4a2da47d9442c2241deee63a154bc15cc14b8312fbc4005" dependencies = [ "bstr", "gix-features 0.36.1", "gix-path", "home", "thiserror", "url", ] [[package]] name = "gix-utils" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f82c41937f00e15a1f6cb0b55307f0ca1f77f4407ff2bf440be35aa688c6a3e" dependencies = [ "fastrand", ] [[package]] name = "gix-validate" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b7d8e4274be69f284bbc7e6bb2ccf7065dbcdeba22d8c549f2451ae426883f" dependencies = [ "bstr", "thiserror", ] [[package]] name = "gix-worktree" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddaf79e721dba64fe726a42f297a3c8ed42e55cdc0d81ca68452f2def3c2d7fd" dependencies = [ "bstr", "gix-attributes", "gix-features 0.36.1", "gix-fs", "gix-glob", "gix-hash", "gix-ignore", "gix-index", "gix-object", "gix-path", ] [[package]] name = "glob" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", "log", "regex-automata 0.4.3", "regex-syntax 0.8.2", ] [[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.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[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.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "http-auth" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "643c9bbf6a4ea8a656d6b4cd53d34f79e3f841ad5203c1a55fb7d761923bc255" dependencies = [ "memchr", ] [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "idna" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", ] [[package]] name = "ignore" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" dependencies = [ "crossbeam-deque", "globset", "log", "memchr", "regex-automata 0.4.3", "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 = "indexmap" version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", ] [[package]] name = "indexmap" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown 0.14.3", ] [[package]] name = "is-terminal" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", "windows-sys 0.52.0", ] [[package]] name = "itertools" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] [[package]] name = "itertools" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" dependencies = [ "either", ] [[package]] name = "itoa" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] [[package]] name = "js-sys" version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] [[package]] name = "kstring" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" dependencies = [ "static_assertions", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[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.151" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libgit2-sys" version = "0.16.1+1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" dependencies = [ "cc", "libc", "libssh2-sys", "libz-sys", "openssl-sys", "pkg-config", ] [[package]] name = "libloading" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", "windows-sys 0.48.0", ] [[package]] name = "libnghttp2-sys" version = "0.1.8+1.55.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fae956c192dadcdb5dace96db71fa0b827333cce7c7b38dc71446f024d8a340" dependencies = [ "cc", "libc", ] [[package]] name = "libssh2-sys" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" dependencies = [ "cc", "libc", "libz-sys", "openssl-sys", "pkg-config", "vcpkg", ] [[package]] name = "libz-sys" version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "linux-raw-sys" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", ] [[package]] name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[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.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] [[package]] name = "memchr" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" dependencies = [ "libc", ] [[package]] name = "memmap2" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" dependencies = [ "libc", ] [[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.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[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.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" dependencies = [ "windows-sys 0.48.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-traits" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "num_threads" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ "libc", ] [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opener" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c62dcb6174f9cb326eac248f07e955d5d559c272730b6c03e396b443b562788" dependencies = [ "bstr", "normpath", "winapi", ] [[package]] name = "openssl" version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", "once_cell", "openssl-macros", "openssl-sys", ] [[package]] name = "openssl-macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", "syn 2.0.43", ] [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" version = "300.2.1+3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fe476c29791a5ca0d1273c697e96085bbabbbea2ef7afd5617e78a4b40332d3" dependencies = [ "cc", ] [[package]] name = "openssl-sys" version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" 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.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abdb10181903c8c4b016ba45d6d6d5af1a1e2a461aa4763a83b87f5df4695e5" dependencies = [ "fiat-crypto", "subtle", "zeroize", ] [[package]] name = "os_info" version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" dependencies = [ "log", "serde", "winapi", ] [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" dependencies = [ "ecdsa", "elliptic-curve", "primeorder", "sha2", ] [[package]] name = "parking_lot" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", "windows-targets 0.48.5", ] [[package]] name = "pasetors" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b36d47c66f2230dd1b7143d9afb2b4891879020210eddf2ccb624e529b96dba" dependencies = [ "ct-codecs", "ed25519-compact", "getrandom", "orion", "p384", "rand_core", "regex", "serde", "serde_json", "sha2", "subtle", "time", "zeroize", ] [[package]] name = "pathdiff" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[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.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[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.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[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.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[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.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" dependencies = [ "unicode-ident", ] [[package]] name = "prodash" version = "26.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "794b5bf8e2d19b53dcdcec3e4bba628e20f5b6062503ba89281fa7037dd7bbcf" dependencies = [ "parking_lot", ] [[package]] name = "pulldown-cmark" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", "unicase", ] [[package]] name = "quote" version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 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", ] [[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.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", "regex-automata 0.4.3", "regex-syntax 0.8.2", ] [[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.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", "regex-syntax 0.8.2", ] [[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.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rfc6979" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac", "subtle", ] [[package]] name = "rustfix" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481" dependencies = [ "anyhow", "log", "serde", "serde_json", ] [[package]] name = "rustix" version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "ryu" version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[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.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ "windows-sys 0.52.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 = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "semver" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] [[package]] name = "serde" version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde-untagged" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c8ee00373d8674ba1eb5f93943817357863610d90caa9bac126eccf3e185dac" dependencies = [ "erased-serde", "serde", ] [[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.193" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", "syn 2.0.43", ] [[package]] name = "serde_ignored" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80c31d5c53fd39f208e770f5a20a0bb214dee2a8d0d8adba18e19ad95a482ca5" dependencies = [ "serde", ] [[package]] name = "serde_json" version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", "serde", ] [[package]] name = "serde_spanned" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" 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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[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 = "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.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", ] [[package]] name = "spki" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", ] [[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.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "supports-hyperlinks" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" dependencies = [ "is-terminal", ] [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "syn" version = "2.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "tar" version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" dependencies = [ "filetime", "libc", ] [[package]] name = "tempfile" version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", "redox_syscall", "rustix", "windows-sys 0.52.0", ] [[package]] name = "terminal_size" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ "rustix", "windows-sys 0.48.0", ] [[package]] name = "thiserror" version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" dependencies = [ "proc-macro2", "quote", "syn 2.0.43", ] [[package]] name = "thread_local" version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if", "once_cell", ] [[package]] name = "time" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", "libc", "num_threads", "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.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] [[package]] name = "tinyvec" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 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.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] [[package]] name = "toml" version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit 0.21.0", ] [[package]] name = "toml_datetime" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", "winnow", ] [[package]] name = "toml_edit" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", "winnow", ] [[package]] name = "tracing" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", "syn 2.0.43", ] [[package]] name = "tracing-core" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 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.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", "once_cell", "regex", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", ] [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] [[package]] name = "unicode-bidi" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[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.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] [[package]] name = "utf8parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "valuable" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[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.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" 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 = "wasm-bindgen" version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", "syn 2.0.43", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", "syn 2.0.43", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[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.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] [[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" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ "windows-targets 0.48.5", ] [[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.0", ] [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm 0.52.0", "windows_aarch64_msvc 0.52.0", "windows_i686_gnu 0.52.0", "windows_i686_msvc 0.52.0", "windows_x86_64_gnu 0.52.0", "windows_x86_64_gnullvm 0.52.0", "windows_x86_64_msvc 0.52.0", ] [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" version = "0.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" dependencies = [ "memchr", ] [[package]] name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" cargo-c-0.9.29+cargo-0.76.0/Cargo.toml0000644000000043230000000000100122650ustar # 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.72" name = "cargo-c" version = "0.9.29+cargo-0.76.0" authors = ["Luca Barbato "] 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" [profile.release-strip] inherits = "release" strip = "symbols" [[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.anyhow] version = "1.0" [dependencies.cargo] version = "0.76.0" [dependencies.cargo-util] version = "0.2" [dependencies.cbindgen] version = "0.26.0" default-features = false [dependencies.cc] version = "1.0" [dependencies.clap] version = "4.0.29" features = [ "color", "derive", "cargo", ] [dependencies.glob] version = "0.3" [dependencies.itertools] version = "0.12" [dependencies.log] version = "0.4" [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" [features] default = [] vendored-openssl = ["cargo/vendored-openssl"] [target."cfg(windows)".dependencies.windows-sys] version = "0.52" features = [ "Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_Console", "Win32_System_Threading", "Win32_System_JobObjects", "Win32_Security", "Win32_System_SystemServices", ] cargo-c-0.9.29+cargo-0.76.0/Cargo.toml.orig000064400000000000000000000026331046102023000157500ustar 00000000000000[package] name = "cargo-c" version = "0.9.29+cargo-0.76.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.72" [[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.76.0" cargo-util = "0.2" semver = "1.0.3" log = "0.4" clap = { version="4.0.29", features=["color", "derive", "cargo"] } regex = "1.5.6" cbindgen = { version="0.26.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.12" # workaround cargo [target.'cfg(windows)'.dependencies.windows-sys] version = "0.52" features = [ "Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_Console", "Win32_System_Threading", "Win32_System_JobObjects", "Win32_Security", "Win32_System_SystemServices" ] [features] default = [] vendored-openssl = ["cargo/vendored-openssl"] [profile.release-strip] inherits = "release" strip = "symbols" cargo-c-0.9.29+cargo-0.76.0/LICENSE000064400000000000000000000020551046102023000140640ustar 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.9.29+cargo-0.76.0/README.md000064400000000000000000000240121046102023000143330ustar 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: - [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. [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 [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) - [rav1e](https://github.com/xiph/rav1e) - [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) ## Acknowledgements This software has been partially developed in the scope of the H2020 project SIFIS-Home with GA n. 952652. cargo-c-0.9.29+cargo-0.76.0/codecov.yml000064400000000000000000000003311046102023000152170ustar 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.9.29+cargo-0.76.0/coverage.sh000064400000000000000000000031651046102023000152110ustar 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.9.29+cargo-0.76.0/src/bin/capi.rs000064400000000000000000000044701046102023000157030ustar 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; use cargo::Config; use clap::*; fn main() -> CliResult { let mut config = Config::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 = clap::command!() .dont_collapse_args_in_usage(true) .allow_external_subcommands(true) .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(()); } config_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, &config, subcommand_args, &packages, compile_opts)?; } Ok(()) } cargo-c-0.9.29+cargo-0.76.0/src/bin/cbuild.rs000064400000000000000000000022571046102023000162320ustar 00000000000000use cargo::util::command_prelude::ArgMatchesExt; use cargo::CliResult; use cargo::Config; use cargo_c::build::*; use cargo_c::cli::run_cargo_fallback; use cargo_c::cli::subcommand_build; use cargo_c::config::*; fn main() -> CliResult { let mut config = Config::default()?; let subcommand = subcommand_build("cbuild", "Build the crate C-API"); let mut app = clap::command!() .dont_collapse_args_in_usage(true) .allow_external_subcommands(true) .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(()); } config_configure(&mut config, subcommand_args)?; let mut ws = subcommand_args.workspace(&config)?; let _ = cbuild(&mut ws, &config, subcommand_args, "dev")?; Ok(()) } cargo-c-0.9.29+cargo-0.76.0/src/bin/cinstall.rs000064400000000000000000000024351046102023000165770ustar 00000000000000use cargo::util::command_prelude::ArgMatchesExt; use cargo::CliResult; use cargo::Config; use cargo_c::build::cbuild; use cargo_c::cli::run_cargo_fallback; use cargo_c::cli::subcommand_install; use cargo_c::config::config_configure; use cargo_c::install::cinstall; fn main() -> CliResult { let mut config = Config::default()?; let subcommand = subcommand_install("cinstall", "Install the crate C-API"); let mut app = clap::command!() .dont_collapse_args_in_usage(true) .allow_external_subcommands(true) .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(()); } config_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.9.29+cargo-0.76.0/src/bin/ctest.rs000064400000000000000000000023251046102023000161060ustar 00000000000000use cargo::util::command_prelude::*; use cargo::CliResult; use cargo::Config; use cargo_c::build::*; use cargo_c::cli::run_cargo_fallback; use cargo_c::cli::subcommand_test; use cargo_c::config::*; fn main() -> CliResult { let mut config = Config::default()?; let subcommand = subcommand_test("ctest"); let mut app = clap::command!() .dont_collapse_args_in_usage(true) .allow_external_subcommands(true) .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(()); } config_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, &config, subcommand_args, &packages, compile_opts) } cargo-c-0.9.29+cargo-0.76.0/src/build.rs000064400000000000000000001236101046102023000153140ustar 00000000000000use std::collections::HashMap; use std::io::{BufRead, BufReader, Read, Write}; use std::path::{Path, PathBuf}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; use cargo::core::compiler::unit_graph::UnitDep; use cargo::core::compiler::unit_graph::UnitGraph; use cargo::core::compiler::Unit; use cargo::core::{compiler::Executor, profiles::Profiles}; use cargo::core::{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, Config}; use anyhow::Context as _; use cargo_util::paths::{copy, create, create_dir_all, open, read, read_bytes, write}; 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.config() .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.config().shell(); shell.status("Populating", "uninstalled header directory")?; let path = &format!("PKG_CONFIG_PATH=\"{}\"", root_output.display()); shell.verbose(move |s| s.note(path))?; 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.config().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, libkinds: &[&str], capi_config: &CApiConfig, ) -> anyhow::Result<()> { use cargo::core::compiler::CrateType; let manifest = pkg.manifest_mut(); let targets = manifest.targets_mut(); let kinds: Vec<_> = libkinds .iter() .map(|&kind| match kind { "staticlib" => CrateType::Staticlib, "cdylib" => CrateType::Cdylib, _ => unreachable!(), }) .collect(); for target in targets.iter_mut() { if target.is_lib() { target.set_kind(TargetKind::Lib(kinds.clone())); 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<()> { let os = &target.os; let env = &target.env; if os == "windows" && env == "msvc" { ws.config() .shell() .status("Building", ".def file using dumpbin")?; let txt_path = targetdir.join(format!("{name}.txt")); let target_str = format!("{}-pc-windows-msvc", &target.arch); let mut dumpbin = match cc::windows_registry::find(&target_str, "dumpbin.exe") { Some(command) => command, None => std::process::Command::new("dumpbin"), }; dumpbin .arg("/EXPORTS") .arg(targetdir.join(format!("{}.dll", name.replace('-', "_")))); dumpbin.arg(format!("/OUT:{}", txt_path.to_str().unwrap())); let out = dumpbin.output()?; if out.status.success() { let txt_file = open(txt_path)?; let buf_reader = BufReader::new(txt_file); let mut def_file = create(targetdir.join(format!("{name}.def")))?; writeln!(def_file, "EXPORTS")?; // The Rust loop below is analogue to the following loop. // for /f "skip=19 tokens=4" %A in (file.txt) do echo %A > file.def // The most recent versions of dumpbin adds three lines of copyright // information before the relevant content. // If the "/OUT:file.txt" dumpbin's option is used, the three // copyright lines are added to the shell, so the txt file // contains three lines less. // The Rust loop first skips 16 lines and then, for each line, // deletes all the characters up to the fourth space included // (skip=16 tokens=4) for line in buf_reader .lines() .skip(16) .take_while(|l| !l.as_ref().unwrap().is_empty()) .map(|l| { l.unwrap() .as_str() .split_whitespace() .nth(3) .unwrap() .to_string() }) { writeln!(def_file, "\t{line}")?; } Ok(()) } else { Err(anyhow::anyhow!("Command failed {:?}", dumpbin)) } } else { Ok(()) } } /// Build import library for windows-gnu fn build_implib_file( ws: &Workspace, name: &str, target: &target::Target, targetdir: &Path, dlltool: &Path, ) -> anyhow::Result<()> { let os = &target.os; let env = &target.env; if os == "windows" { let arch = &target.arch; if env == "gnu" { ws.config() .shell() .status("Building", "implib using dlltool")?; let binutils_arch = match arch.as_str() { "x86_64" => "i386:x86-64", "x86" => "i386", "aarch64" => "arm64", _ => unimplemented!("Windows support for {} is not implemented yet.", arch), }; let mut dlltool_command = std::process::Command::new(dlltool.to_str().unwrap_or("dlltool")); dlltool_command.arg("-m").arg(binutils_arch); dlltool_command.arg("-D").arg(format!("{name}.dll")); dlltool_command .arg("-l") .arg(targetdir.join(format!("{name}.dll.a"))); dlltool_command .arg("-d") .arg(targetdir.join(format!("{name}.def"))); let out = dlltool_command.output()?; if out.status.success() { Ok(()) } else { Err(anyhow::anyhow!("Command failed {:?}", dlltool_command)) } } else { ws.config().shell().status("Building", "implib using lib")?; let target_str = format!("{}-pc-windows-msvc", &target.arch); let mut lib = match cc::windows_registry::find(&target_str, "lib.exe") { Some(command) => command, None => std::process::Command::new("lib"), }; let lib_arch = match arch.as_str() { "x86_64" => "X64", "x86" => "IX86", _ => unimplemented!("Windows support for {} is not implemented yet.", arch), }; lib.arg(format!( "/DEF:{}", targetdir.join(format!("{name}.def")).display() )); lib.arg(format!("/MACHINE:{lib_arch}")); lib.arg(format!("/NAME:{name}.dll")); lib.arg(format!( "/OUT:{}", targetdir.join(format!("{name}.dll.lib")).display() )); let out = lib.output()?; if out.status.success() { Ok(()) } else { Err(anyhow::anyhow!("Command failed {:?}", lib)) } } } else { Ok(()) } } #[derive(Debug)] struct FingerPrint { id: PackageId, root_output: PathBuf, build_targets: BuildTargets, install_paths: InstallPaths, static_libs: String, } #[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, ) -> Self { 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(), } } fn hash(&self) -> anyhow::Result> { use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; let mut hasher = DefaultHasher::new(); 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)] pub struct CApiConfig { pub header: HeaderCApiConfig, pub pkg_config: PkgConfigCApiConfig, pub library: LibraryCApiConfig, pub install: InstallCApiConfig, } #[derive(Debug)] pub struct HeaderCApiConfig { pub name: String, pub subdirectory: String, pub generation: bool, pub enabled: bool, } #[derive(Debug)] 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)] pub enum VersionSuffix { Major, MajorMinor, MajorMinorPatch, } #[derive(Debug)] 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)] pub struct InstallCApiConfig { pub include: Vec, pub data: Vec, } #[derive(Debug)] pub enum InstallTarget { Asset(InstallTargetPaths), Generated(InstallTargetPaths), } #[derive(Clone, Debug)] 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) -> 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); } } 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, config: &Config, args: &ArgMatches, profile: InternedString, compile_mode: CompileMode, ) -> anyhow::Result { use cargo::core::compiler::CompileKind; let mut compile_opts = args.compile_options(config, 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 = config.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(config, &[rustc.host.to_string()])? } Ok(compile_opts) } #[derive(Default)] struct Exec { ran: AtomicBool, link_line: Mutex>, } use cargo::core::*; 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; use cargo::util::profile; 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)?; let name = &capi_config.library.name; let install_paths = InstallPaths::new(name, 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| vec!["-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.config())?; return Ok(HashMap::new()); } let _p = profile::start("compiling"); let cx = cargo::core::compiler::Context::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, libkinds: &[&str], 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)?; patch_target(pkg, libkinds, &capi_config)?; let name = &capi_config.library.name; let install_paths = InstallPaths::new(name, args, &capi_config); let build_targets = BuildTargets::new(name, rustc_target, root_output, libkinds, &capi_config)?; let finger_print = FingerPrint::new(&id, root_output, &build_targets, &install_paths); Ok(CPackage { version, root_path, capi_config, build_targets, install_paths, finger_print, }) } } pub fn cbuild( ws: &mut Workspace, config: &Config, args: &ArgMatches, default_profile: &str, ) -> anyhow::Result<(Vec, CompileOptions)> { let rustc = config.load_global_rustc(Some(ws))?; let targets = args.targets()?; let target = match targets.len() { 0 => rustc.host.to_string(), 1 => targets[0].to_string(), _ => { anyhow::bail!("Multiple targets not supported yet"); } }; let rustc_target = target::Target::new(&target)?; let default_kind = || match (rustc_target.os.as_str(), rustc_target.env.as_str()) { ("none", _) | (_, "musl") => vec!["staticlib"], _ => vec!["staticlib", "cdylib"], }; let libkinds = args .get_many::("library-type") .map_or_else(default_kind, |v| v.map(String::as_str).collect::>()); let only_staticlib = !libkinds.contains(&"cdylib"); let only_cdylib = !libkinds.contains(&"staticlib"); let profile = args.get_profile_name(config, 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 capi_feature = InternedString::new("capi"); 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(); for m in ws.members_mut().filter(|m| { m.library().is_some() && m.summary().features().contains_key(&capi_feature) && requested.contains(&m.package_id()) }) { let cpkg = CPackage::from_package(m, args, &libkinds, &rustc_target, &root_output)?; pristine = pristine || cpkg.finger_print.load_previous().is_err(); members.push(cpkg); } if pristine { // If the cache is somehow missing force a full rebuild; compile_opts.build_config.force_rebuild = true; } 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 the hash value does not match. if new_build && !cpkg.finger_print.is_valid() { let name = &cpkg.capi_config.library.name; let static_libs = if only_cdylib { "".to_string() } else { exec.link_line .lock() .unwrap() .values() .next() .unwrap() .to_string() }; 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 only_staticlib { pc.add_lib(&static_libs); } pc.add_lib_private(&static_libs); build_pc_files(ws, &capi_config.pkg_config.filename, &root_output, &pc)?; if !only_staticlib && capi_config.library.import_library { let lib_name = name; build_def_file(ws, lib_name, &rustc_target, &root_output)?; let mut dlltool = std::env::var_os("DLLTOOL") .map(PathBuf::from) .unwrap_or_else(|| PathBuf::from("dlltool")); // dlltool argument overwrites environment var if args.contains_id("dlltool") { dlltool = args .get_one::("dlltool") .map(PathBuf::from) .unwrap(); } build_implib_file(ws, lib_name, &rustc_target, &root_output, &dlltool)?; } 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, &libkinds, capi_config, )?; 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)?; } } 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; } } Ok((members, compile_opts)) } pub fn ctest( ws: &Workspace, config: &Config, args: &ArgMatches, packages: &[CPackage], mut compile_opts: CompileOptions, ) -> CliResult { compile_opts.build_config.requested_profile = args.get_profile_name(config, "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"); } } cargo-c-0.9.29+cargo-0.76.0/src/build_targets.rs000064400000000000000000000103431046102023000170430ustar 00000000000000use std::path::{Path, PathBuf}; use crate::build::{CApiConfig, InstallTarget}; 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 include: Option, pub static_lib: Option, pub shared_lib: Option, pub impl_lib: Option, pub def: Option, pub pc: PathBuf, pub target: Target, pub extra: ExtraTargets, } impl BuildTargets { pub fn new( name: &str, target: &Target, targetdir: &Path, libkinds: &[&str], capi_config: &CApiConfig, ) -> anyhow::Result { let pc = targetdir.join(format!("{}.pc", &capi_config.pkg_config.filename)); let include = if capi_config.header.enabled { let mut header_name = PathBuf::from(&capi_config.header.name); header_name.set_extension("h"); Some(targetdir.join(&header_name)) } else { None }; let lib_name = name; let os = &target.os; let env = &target.env; let (shared_lib, static_lib, impl_lib, def) = match (os.as_str(), env.as_str()) { ("none", _) | ("linux", _) | ("freebsd", _) | ("dragonfly", _) | ("netbsd", _) | ("android", _) | ("haiku", _) | ("illumos", _) | ("emscripten", _) => { 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) } ("macos", _) | ("ios", _) => { 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) } ("windows", env) => { let static_lib = if env == "msvc" { targetdir.join(format!("{lib_name}.lib")) } else { targetdir.join(format!("lib{lib_name}.a")) }; let shared_lib = targetdir.join(format!("{lib_name}.dll")); let impl_lib = if env == "msvc" { targetdir.join(format!("{lib_name}.dll.lib")) } else { targetdir.join(format!("{lib_name}.dll.a")) }; let def = targetdir.join(format!("{lib_name}.def")); (shared_lib, static_lib, Some(impl_lib), Some(def)) } _ => unimplemented!("The target {}-{} is not supported yet", os, env), }; let static_lib = if libkinds.contains(&"staticlib") { Some(static_lib) } else { None }; // Bare metal does not support shared objects let shared_lib = if libkinds.contains(&"cdylib") && os.as_str() != "none" { Some(shared_lib) } else { None }; Ok(BuildTargets { pc, include, static_lib, shared_lib, impl_lib, def, target: target.clone(), extra: Default::default(), }) } } cargo-c-0.9.29+cargo-0.76.0/src/cli.rs000064400000000000000000000163301046102023000147640ustar 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::{CliError, CliResult}; use cargo_util::{ProcessBuilder, ProcessError}; use clap::{Arg, ArgAction, ArgMatches, Command, CommandFactory, Parser}; // 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 default values of /// includedir, libdir, bindir, pkgconfigdir #[clap(long = "prefix")] prefix: Option, /// Path to directory for installing generated library files #[clap(long = "libdir")] libdir: Option, /// Path to directory for installing generated headers files #[clap(long = "includedir")] includedir: Option, /// Path to directory for installing generated executable files #[clap(long = "bindir")] bindir: Option, /// Path to directory for installing generated pkg-config .pc files #[clap(long = "pkgconfigdir")] pkgconfigdir: Option, /// Path to directory for installing read-only data (defaults to {prefix}/share) #[clap(long = "datarootdir")] datarootdir: Option, /// Path to directory for installing read-only application-specific data /// (defaults to {datarootdir}) #[clap(long = "datadir")] datadir: Option, #[clap(long = "dlltool")] /// Use the provided dlltool when building for the windows-gnu targets. dlltool: Option, #[clap(long = "crt-static")] /// Build the library embedding the C runtime crt_static: bool, } fn base_cli() -> Command { 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_quiet() .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_jobs() .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_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() } pub fn subcommand_build(name: &'static str, about: &'static str) -> Command { base_cli() .name(name) .about(about) .arg( multi_opt( "library-type", "LIBRARY-TYPE", "Build only a type of library", ) .global(true) .ignore_case(true) .value_parser(["cdylib", "staticlib"]), ) .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( multi_opt( "library-type", "LIBRARY-TYPE", "Build only a type of library", ) .global(true) .ignore_case(true) .value_parser(["cdylib", "staticlib"]), ) .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() .trailing_var_arg(true) .name(name) .about("Test the crate C-API") .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.9.29+cargo-0.76.0/src/config.rs000064400000000000000000000023361046102023000154630ustar 00000000000000use std::env; use cargo::util::command_prelude::{ArgMatches, ArgMatchesExt}; use cargo::{CliResult, Config}; // 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 config_configure(config: &mut Config, args: &ArgMatches) -> CliResult { let arg_target_dir = &args.value_of_path("target-dir", config); let config_args: Vec<_> = args .get_many::("config") .unwrap_or_default() .map(|s| s.to_owned()) .collect(); config.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.9.29+cargo-0.76.0/src/install.rs000064400000000000000000000255471046102023000156750ustar 00000000000000use clap::ArgMatches; use std::path::{Component, Path, PathBuf}; use cargo::core::Workspace; use cargo_util::paths::{copy, create_dir_all}; use crate::build::*; use crate::build_targets::BuildTargets; 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", _) | ("emscripten", _) => LibType::So, ("macos", _) | ("ios", _) => 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, capi_config: &CApiConfig, shared_lib: &Path, install_path_lib: &Path, ) -> anyhow::Result<()> { if capi_config.library.versioning { copy(shared_lib, install_path_lib.join(&self.with_full_ver))?; self.links(install_path_lib); } else { copy(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_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.config() .shell() .status("Installing", "pkg-config file")?; copy( &build_targets.pc, install_path_pc.join(build_targets.pc.file_name().unwrap()), )?; if capi_config.header.enabled { ws.config().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(from, to)?; } } if !build_targets.extra.data.is_empty() { ws.config().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(from, to)?; } } if let Some(ref static_lib) = build_targets.static_lib { ws.config().shell().status("Installing", "static library")?; copy( static_lib, install_path_lib.join(static_lib.file_name().unwrap()), )?; } if let Some(ref shared_lib) = build_targets.shared_lib { ws.config().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(capi_config, shared_lib, &install_path_lib)?; } LibType::Windows => { let lib_name = shared_lib.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(shared_lib, install_path_bin.join(lib_name))?; } else { // We assume they are plugins, install them in the custom libdir path copy(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(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(def, install_path_lib.join(def_name))?; } } } } } 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, } impl InstallPaths { pub fn new(_name: &str, args: &ArgMatches, capi_config: &CApiConfig) -> Self { let destdir = args.get_one::("destdir").map(PathBuf::from); let prefix = args .get_one::("prefix") .map(PathBuf::from) .unwrap_or_else(|| "/usr/local".into()); let libdir = args .get_one::("libdir") .map(PathBuf::from) .unwrap_or_else(|| prefix.join("lib")); let includedir = args .get_one::("includedir") .map(PathBuf::from) .unwrap_or_else(|| prefix.join("include")); let datarootdir = args .get_one::("datarootdir") .map(PathBuf::from) .unwrap_or_else(|| prefix.join("share")); let datadir = args .get_one::("datadir") .map(PathBuf::from) .unwrap_or_else(|| datarootdir.clone()); let subdir_name = PathBuf::from(&capi_config.header.subdirectory); let bindir = args .get_one::("bindir") .map(PathBuf::from) .unwrap_or_else(|| prefix.join("bin")); let pkgconfigdir = args .get_one::("pkgconfigdir") .map(PathBuf::from) .unwrap_or_else(|| libdir.join("pkgconfig")); InstallPaths { subdir_name, destdir, prefix, libdir, includedir, datadir, bindir, pkgconfigdir, } } } cargo-c-0.9.29+cargo-0.76.0/src/lib.rs000064400000000000000000000001741046102023000147620ustar 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.9.29+cargo-0.76.0/src/pkg_config_gen.rs000064400000000000000000000212101046102023000171450ustar 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 separator = ""; let out = path .as_ref() .components() .map(|p| match p { Component::RootDir => { separator = "/"; String::new() } Component::Prefix(_) => p.as_os_str().to_string_lossy().to_string(), _ => { let c = format!("{}{}", separator, p.as_os_str().to_string_lossy()); separator = "/"; c } }) .collect::(); if out.is_empty() { "/".to_string() } else { out } } #[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 = install_paths.prefix.clone(); // TODO: support exec_prefix if args.contains_id("includedir") { if let Ok(suffix) = install_paths.includedir.strip_prefix(&pc.prefix) { let mut includedir = PathBuf::from("${prefix}"); includedir.push(suffix); pc.includedir = includedir; } else { pc.includedir = install_paths.includedir.clone(); } } if args.contains_id("libdir") { if let Ok(suffix) = install_paths.libdir.strip_prefix(&pc.prefix) { let mut libdir = PathBuf::from("${prefix}"); libdir.push(suffix); pc.libdir = libdir; } else { pc.libdir = install_paths.libdir.clone(); } } 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 { self.description = descr.as_ref().to_owned(); 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 { let mut base = format!( "prefix={} exec_prefix={} libdir={} includedir={} Name: {} Description: {} Version: {} Libs: {} Cflags: {}", canonicalize(&self.prefix), canonicalize(&self.exec_prefix), canonicalize(&self.libdir), canonicalize(&self.includedir), self.name, // avoid endlines self.description.replace('\n', " "), self.version, self.libs.join(" "), self.cflags.join(" "), ); if !self.libs_private.is_empty() { base.push_str( " Libs.private: ", ); base.push_str(&self.libs_private.join(" ")); } if !self.requires.is_empty() { base.push_str( " Requires: ", ); base.push_str(&self.requires.join(", ")); } if !self.requires_private.is_empty() { base.push_str( " Requires.private: ", ); base.push_str(&self.requires_private.join(", ")); } /* Conflicts: Libs.private: ).to_owned() */ base.push('\n'); base } } #[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"); println!("{:?}\n{}", pkg, pkg.render()); } } cargo-c-0.9.29+cargo-0.76.0/src/target.rs000064400000000000000000000075111046102023000155040ustar 00000000000000use std::path::Path; 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 arch: String, // pub vendor: String, pub os: String, pub env: String, } impl Target { pub fn new>(target: T) -> 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"); 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), }) } 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" { 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" { 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 } }