From e1ad40a3efee772c106da4ce9e2cda0119ab46e4 Mon Sep 17 00:00:00 2001 From: phiresky Date: Fri, 26 May 2023 15:14:02 +0200 Subject: [PATCH] remove rkv, run cross with bash in release.yml --- .github/workflows/release.yml | 210 +++++++++++++++++----------------- Cargo.lock | 146 ----------------------- Cargo.toml | 1 - 3 files changed, 105 insertions(+), 252 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed23b90..0fce365 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,14 +18,14 @@ on: # branches: # - ag/release tags: - - 'v[0-9]+.[0-9]+.[0-9]+*' + - "v[0-9]+.[0-9]+.[0-9]+*" jobs: create-release: name: create-release runs-on: ubuntu-latest # env: - # Set to force version number, e.g., when no tag exists. - # RG_VERSION: TEST-0.0.0 + # Set to force version number, e.g., when no tag exists. + # RG_VERSION: TEST-0.0.0 steps: - name: Create artifacts directory run: mkdir artifacts @@ -62,7 +62,7 @@ jobs: build-release: name: build-release - needs: ['create-release'] + needs: ["create-release"] runs-on: ${{ matrix.os }} env: # For some builds, we use cross to test on 32-bit and big-endian @@ -78,124 +78,124 @@ jobs: matrix: build: [linux, linux-arm, macos, win-msvc] include: - - build: linux - os: ubuntu-18.04 - rust: nightly - target: x86_64-unknown-linux-musl - - build: linux-arm - os: ubuntu-18.04 - rust: nightly - target: arm-unknown-linux-gnueabihf - - build: macos - os: macos-latest - rust: nightly - target: x86_64-apple-darwin - - build: win-msvc - os: windows-2019 - rust: nightly - target: x86_64-pc-windows-msvc + - build: linux + os: ubuntu-18.04 + rust: nightly + target: x86_64-unknown-linux-musl + - build: linux-arm + os: ubuntu-18.04 + rust: nightly + target: arm-unknown-linux-gnueabihf + - build: macos + os: macos-latest + rust: nightly + target: x86_64-apple-darwin + - build: win-msvc + os: windows-2019 + rust: nightly + target: x86_64-pc-windows-msvc #- build: win-gnu # os: windows-2019 # rust: nightly-x86_64-gnu # target: x86_64-pc-windows-gnu steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 1 + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 - - name: Install packages (Ubuntu) - if: matrix.os == 'ubuntu-18.04' - run: | - ci/ubuntu-install-packages + - name: Install packages (Ubuntu) + if: matrix.os == 'ubuntu-18.04' + run: | + ci/ubuntu-install-packages - - name: Install packages (macOS) - if: matrix.os == 'macos-latest' - run: | - ci/macos-install-packages + - name: Install packages (macOS) + if: matrix.os == 'macos-latest' + run: | + ci/macos-install-packages - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust }} - profile: minimal - override: true - target: ${{ matrix.target }} + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + profile: minimal + override: true + target: ${{ matrix.target }} - - name: Use Cross - # if: matrix.os != 'windows-2019' - run: | - cargo install cross - echo "CARGO=cross" >> $GITHUB_ENV - echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV - echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV + - name: Use Cross + shell: bash + run: | + cargo install cross + echo "CARGO=cross" >> $GITHUB_ENV + echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV + echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV - - name: Show command used for Cargo - run: | - echo "cargo command is: ${{ env.CARGO }}" - echo "target flag is: ${{ env.TARGET_FLAGS }}" - echo "target dir is: ${{ env.TARGET_DIR }}" + - name: Show command used for Cargo + run: | + echo "cargo command is: ${{ env.CARGO }}" + echo "target flag is: ${{ env.TARGET_FLAGS }}" + echo "target dir is: ${{ env.TARGET_DIR }}" - - name: Get release download URL - uses: actions/download-artifact@v1 - with: - name: artifacts - path: artifacts + - name: Get release download URL + uses: actions/download-artifact@v1 + with: + name: artifacts + path: artifacts - - name: Set release upload URL and release version - shell: bash - run: | - echo "RELEASE_UPLOAD_URL=$(cat artifacts/release-upload-url)" >> $GITHUB_ENV - echo "release upload url: $RELEASE_UPLOAD_URL" - echo "RELEASE_VERSION=$(cat artifacts/release-version)" >> $GITHUB_ENV - echo "release version: $RELEASE_VERSION" + - name: Set release upload URL and release version + shell: bash + run: | + echo "RELEASE_UPLOAD_URL=$(cat artifacts/release-upload-url)" >> $GITHUB_ENV + echo "release upload url: $RELEASE_UPLOAD_URL" + echo "RELEASE_VERSION=$(cat artifacts/release-version)" >> $GITHUB_ENV + echo "release version: $RELEASE_VERSION" - - name: Build release binary - run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }} + - name: Build release binary + run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }} - - name: Strip release binary (linux and macos) - if: matrix.build == 'linux' || matrix.build == 'macos' - run: | - strip "target/${{ matrix.target }}/release/rga" "target/${{ matrix.target }}/release/rga-preproc" + - name: Strip release binary (linux and macos) + if: matrix.build == 'linux' || matrix.build == 'macos' + run: | + strip "target/${{ matrix.target }}/release/rga" "target/${{ matrix.target }}/release/rga-preproc" - - name: Strip release binary (arm) - if: matrix.build == 'linux-arm' - run: | - docker run --rm -v \ - "$PWD/target:/target:Z" \ - rustembedded/cross:arm-unknown-linux-gnueabihf \ - arm-linux-gnueabihf-strip \ - /target/arm-unknown-linux-gnueabihf/release/rga \ - /target/arm-unknown-linux-gnueabihf/release/rga-preproc + - name: Strip release binary (arm) + if: matrix.build == 'linux-arm' + run: | + docker run --rm -v \ + "$PWD/target:/target:Z" \ + rustembedded/cross:arm-unknown-linux-gnueabihf \ + arm-linux-gnueabihf-strip \ + /target/arm-unknown-linux-gnueabihf/release/rga \ + /target/arm-unknown-linux-gnueabihf/release/rga-preproc - - name: Build archive - shell: bash - run: | - staging="ripgrep_all-${{ env.RELEASE_VERSION }}-${{ matrix.target }}" - mkdir -p "$staging"/doc + - name: Build archive + shell: bash + run: | + staging="ripgrep_all-${{ env.RELEASE_VERSION }}-${{ matrix.target }}" + mkdir -p "$staging"/doc - cp {README.md,LICENSE.md} "$staging/" - cp CHANGELOG.md "$staging/doc/" + cp {README.md,LICENSE.md} "$staging/" + cp CHANGELOG.md "$staging/doc/" - if [ "${{ matrix.os }}" = "windows-2019" ]; then - cp "target/${{ matrix.target }}/release/rga.exe" "$staging/" - cp "target/${{ matrix.target }}/release/rga-preproc.exe" "$staging/" - 7z a "$staging.zip" "$staging" - echo "ASSET=$staging.zip" >> $GITHUB_ENV - else - cp "target/${{ matrix.target }}/release/rga" "$staging/" - cp "target/${{ matrix.target }}/release/rga-preproc" "$staging/" - tar czf "$staging.tar.gz" "$staging" - echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV - fi + if [ "${{ matrix.os }}" = "windows-2019" ]; then + cp "target/${{ matrix.target }}/release/rga.exe" "$staging/" + cp "target/${{ matrix.target }}/release/rga-preproc.exe" "$staging/" + 7z a "$staging.zip" "$staging" + echo "ASSET=$staging.zip" >> $GITHUB_ENV + else + cp "target/${{ matrix.target }}/release/rga" "$staging/" + cp "target/${{ matrix.target }}/release/rga-preproc" "$staging/" + tar czf "$staging.tar.gz" "$staging" + echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV + fi - - name: Upload release archive - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: ${{ env.ASSET }} - asset_name: ${{ env.ASSET }} - asset_content_type: application/octet-stream + - name: Upload release archive + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: ${{ env.ASSET }} + asset_name: ${{ env.ASSET }} + asset_content_type: application/octet-stream diff --git a/Cargo.lock b/Cargo.lock index 81cd196..b93e70a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,12 +139,6 @@ dependencies = [ "backtrace", ] -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - [[package]] name = "async-compression" version = "0.3.15" @@ -326,12 +320,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - [[package]] name = "bytes" version = "1.4.0" @@ -718,15 +706,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "form_urlencoded" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" -dependencies = [ - "percent-encoding", -] - [[package]] name = "futures-core" version = "0.3.28" @@ -906,22 +885,6 @@ dependencies = [ "cc", ] -[[package]] -name = "id-arena" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" - -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "indexmap" version = "1.9.3" @@ -1024,29 +987,6 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" -[[package]] -name = "lmdb-rkv" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447a296f7aca299cfbb50f4e4f3d49451549af655fb7215d7f8c0c3d64bad42b" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "libc", - "lmdb-rkv-sys", -] - -[[package]] -name = "lmdb-rkv-sys" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b9ce6b3be08acefa3003c57b7565377432a89ec24476bbe72e11d101f852fe" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "lock_api" version = "0.4.9" @@ -1227,15 +1167,6 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" -[[package]] -name = "ordered-float" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc2dbde8f8a79f2102cc474ceb0ad68e3b80b85289ea62389b60e66777e4213" -dependencies = [ - "num-traits", -] - [[package]] name = "output_vt100" version = "0.1.3" @@ -1280,12 +1211,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" -[[package]] -name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - [[package]] name = "petgraph" version = "0.6.3" @@ -1477,7 +1402,6 @@ dependencies = [ "pretty-bytes", "pretty_assertions", "regex", - "rkv", "rusqlite", "schemars", "serde", @@ -1494,29 +1418,6 @@ dependencies = [ "tree_magic_mini", ] -[[package]] -name = "rkv" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6006704273063c72952370ad236b8d58556dcc4f99a95ced4d9ad40f3e80a69" -dependencies = [ - "arrayref", - "bincode", - "bitflags 1.3.2", - "byteorder", - "id-arena", - "lazy_static", - "lmdb-rkv", - "log", - "ordered-float", - "paste", - "serde", - "serde_derive", - "thiserror", - "url", - "uuid", -] - [[package]] name = "rusqlite" version = "0.29.0" @@ -1808,21 +1709,6 @@ dependencies = [ "syn 2.0.16", ] -[[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 = "tokio" version = "1.28.1" @@ -1961,27 +1847,12 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - [[package]] name = "unicode-ident" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" -[[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-segmentation" version = "1.10.1" @@ -1994,29 +1865,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -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 = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index 1e37f59..e9d6d24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,6 @@ paste = "1.0.12" path-clean = "1.0.1" pretty-bytes = "0.2.2" regex = "1.8.2" -rkv = "0.17" # 0.18 removes lmdb backend rusqlite = {version = "0.29.0", features = ["vtab", "bundled"]} schemars = {version = "0.8.12", features = ["preserve_order"]} serde = {version = "1.0.163", features = ["derive"]}