diff --git a/.github/scripts/edit-version.sh b/.github/scripts/edit-version.sh new file mode 100755 index 0000000..de1e1a2 --- /dev/null +++ b/.github/scripts/edit-version.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -euo pipefail + +# This script is used to edit the version in versions files + +echo "Editing files with given version: $1"; + +# Edit Cargo.toml +semantic-release-cargo prepare "$1" diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index a113b44..6dfcbf2 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -11,7 +11,7 @@ jobs: security_audit: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + - uses: actions/checkout@v4 - uses: actions-rs/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 59169f8..91c71ab 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,27 +8,10 @@ env: RUST_VERSION: 1.72.1 jobs: - validate: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 - - uses: MeilCli/regex-match@v1 - if: ${{ github.event_name == 'release' }} - name: SemVer Validation - id: regex-match - with: - search_string: ${{ github.event.release.tag_name }} - regex_pattern: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' - # SemVer Regex https://ihateregex.io/expr/semver/ - - name: SemVer check failed - if: ${{ github.event_name == 'release' && steps.regex-match.outputs.matched == 'false' }} - run: exit 1 - publish: runs-on: ubuntu-22.04 - needs: [validate] steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.RUST_VERSION }} @@ -37,5 +20,4 @@ jobs: run: make install-deps-apt - uses: katyo/publish-crates@v2 with: - dry-run: ${{ github.event_name != 'release' }} registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cfea02c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + workflow_dispatch: # only for release on develop branch + push: + branches: + - main + - rc + - experimental + - "[0-9]+.[0-9]+.x" + - "[0-9]+.x" + +# Only allow one release workflow to execute at a time, since each release +# workflow uses shared resources (git tags, package registries) +concurrency: + group: ${{ github.workflow }} + +jobs: + release: + runs-on: ubuntu-22.04 + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + id-token: write # to enable use of OIDC for npm provenance + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false # Semantic release need use SCOPED_GITHUB_TOKEN to create release + + - name: Install semantic-release-cargo + uses: EricCrosson/install-github-release-binary@v2 + with: + targets: semantic-release-cargo/semantic-release-cargo@v2.2.30 + + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.SCOPED_GITHUB_TOKEN }} + with: + semantic_version: 22.0.6 + extra_plugins: | + @semantic-release/changelog@6.0.3 + @semantic-release/git@10.0.1 + @semantic-release/exec@6.0.3 + conventional-changelog-conventionalcommits@7.0.2 diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 25e1f31..c421940 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -19,8 +19,11 @@ jobs: matrix: os: [ "ubuntu-latest", "ubuntu-20.04", "macos-12" ] + env: + SYSTEM: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || 'macos' }} + steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.RUST_VERSION }} @@ -28,27 +31,23 @@ jobs: - uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.os }} - - name: Install dependencies ubuntu - if: ${{ matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-latest' }} - run: make install-deps-apt - - name: Install dependencies macos - if: ${{ matrix.os == 'macos-12' }} - run: make install-deps-brew + - name: Install dependencies + run: make install-deps-${{ env.SYSTEM }} - name: Build & Test (Debug) - run: cargo test + run: make test-debug-${{ env.SYSTEM }} - name: Build & Test (Release) - run: cargo test --release + run: make test-release-${{ env.SYSTEM }} doc-rs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.RUST_VERSION }} components: clippy, rustfmt - name: Install dependencies ubuntu - run: make install-deps-apt + run: make install-deps-ubuntu - name: Generate Doc env: DOCS_RS: 1 @@ -57,14 +56,14 @@ jobs: pre-commit: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.RUST_VERSION }} components: clippy, rustfmt - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install pre-commit run: pip install pre-commit - name: Pre-commit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e13d8f9..42f6367 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.5.0 hooks: - id: check-byte-order-marker - id: check-case-conflict @@ -13,7 +13,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/pre-commit/pre-commit - rev: v2.13.0 + rev: v3.5.0 hooks: - id: validate_manifest - repo: https://github.com/doublify/pre-commit-rust diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..ff576ae --- /dev/null +++ b/.releaserc @@ -0,0 +1,72 @@ +{ + "tagFormat": "${version}", + "branches": [ + "main", + { + "name": "rc", + "prerelease": true + }, + { + "name": "experimental", + "prerelease": "exp" + }, + "+([0-9])?(.{+([0-9]),x}).x" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { "type": "perf", "scope": "*", "release": "patch" }, + { "type": "refactor", "scope": "*", "release": "patch" }, + { "type": "chore", "scope": "*", "release": "patch" } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { "type": "feat", "section": "Features" }, + { "type": "fix", "section": "Bug Fixes" }, + { "type": "perf", "section": "Performance Improvements" }, + { "type": "revert", "section": "Reverts" }, + { "type": "docs", "section": "Documentation" }, + { "type": "ci", "section": "CI/CD", "hidden": false }, + { "type": "chore", "section": "Miscellaneous Chores", "hidden": false }, + { "type": "style", "section": "Styles", "hidden": true }, + { "type": "refactor", "section": "Code Refactoring", "hidden": true }, + { "type": "test", "section": "Tests", "hidden": true }, + { "type": "build", "section": "Build System", "hidden": true } + ] + } + } + ], + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md" + } + ], + [ + "@semantic-release/exec", + { + "prepareCmd": "./.github/scripts/edit-version.sh ${nextRelease.version}" + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md", + "Cargo.toml", + "Cargo.lock" + ], + "message": "chore(release): ${nextRelease.version}\n\n[skip ci]" + } + ] + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..66da84e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +## [1.0.2](https://github.com/AzHicham/openslide-sys/compare/1.0.1...1.0.2) (2023-12-09) + + +### Miscellaneous Chores + +* **deps:** bump actions/checkout from 4.0.0 to 4.1.0 ([#43](https://github.com/AzHicham/openslide-sys/issues/43)) ([7ed80c3](https://github.com/AzHicham/openslide-sys/commit/7ed80c37f8ece0819658219a4ce2e2215750ba29)) +* **deps:** update actions/setup-python action to v5 ([#50](https://github.com/AzHicham/openslide-sys/issues/50)) ([30e8312](https://github.com/AzHicham/openslide-sys/commit/30e83120ac9f881e47dfdf48a2d0ba402f1c451f)) +* **deps:** update rust crate bindgen to 0.69 ([#47](https://github.com/AzHicham/openslide-sys/issues/47)) ([f534ae7](https://github.com/AzHicham/openslide-sys/commit/f534ae7e667ad30cdf39600fcda23daf9d3baf1a)) +* Update deps & ci ([#52](https://github.com/AzHicham/openslide-sys/issues/52)) ([e57cfd8](https://github.com/AzHicham/openslide-sys/commit/e57cfd88aedc493254cd627a3e153d089a0739da)) diff --git a/Cargo.lock b/Cargo.lock index ee97760..60396a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "bindgen" -version = "0.68.1" +version = "0.69.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" +checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2" dependencies = [ "bitflags", "cexpr", @@ -36,18 +36,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "cexpr" @@ -83,23 +74,12 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "errno" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -114,7 +94,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -131,9 +111,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" @@ -147,9 +127,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "log" @@ -159,9 +139,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "minimal-lexical" @@ -181,13 +161,13 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openslide-sys" -version = "1.0.1" +version = "1.0.2" dependencies = [ "bindgen", "pkg-config", @@ -217,9 +197,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -235,9 +215,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", @@ -247,9 +227,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -258,9 +238,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustc-hash" @@ -270,15 +250,15 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.14" +version = "0.38.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" +checksum = "bfeae074e687625746172d639330f1de242a178bf3189b51e35a7a21573513ac" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -289,9 +269,9 @@ checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "syn" -version = "2.0.37" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -344,7 +324,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "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]] @@ -353,13 +342,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "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]] @@ -368,38 +372,80 @@ 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" diff --git a/Cargo.toml b/Cargo.toml index f81ca90..8405012 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "openslide-sys" edition = "2021" -version = "1.0.1" +version = "1.0.2" authors = ["AzHicham "] description = "Low-level bindings to the openslide library" repository = "https://github.com/AzHicham/openslide-sys" @@ -19,5 +19,5 @@ dynamic-link = [] [dependencies] [build-dependencies] -bindgen = "0.68" +bindgen = "0.69" pkg-config = "0.3" diff --git a/Makefile b/Makefile index 85ba2e8..d58fa1f 100755 --- a/Makefile +++ b/Makefile @@ -1,8 +1,22 @@ .PHONY: install-deps-brew install-deps-apt -install-deps-brew: +install-deps-macos: brew install openslide -install-deps-apt: +install-deps-ubuntu: sudo apt-get update sudo apt-get install -y --no-install-recommends libopenslide-dev + +test-debug-ubuntu: + cargo test + +test-debug-macos: + cargo build + cargo test --features dynamic-link # cargo test with static-link fails on macos + +test-release-ubuntu: + cargo test --release + +test-release-macos: + cargo build --release + cargo test --release --features dynamic-link # cargo test with static-link fails on macos diff --git a/build.rs b/build.rs index c1e1451..78c3be7 100755 --- a/build.rs +++ b/build.rs @@ -38,7 +38,7 @@ fn main() { .header(include_dir.join("openslide.h").to_string_lossy()) // Tell cargo to invalidate the built crate whenever any of the // included header files changed. - .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) // Finish the builder and generate the bindings. .generate() // Unwrap the Result and panic on failure.