From 4060c7882fff1eaf18e79240021347a738889009 Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Thu, 1 Aug 2024 12:55:36 -0400 Subject: [PATCH 1/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f602a1f..7541021 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ $ ulimit -n 2048 before running `piscem`. +- **The pre-compiled executables (including those installed via bioconda)** require that the underlying processor support [the BMI2 instruction set](https://en.wikipedia.org/wiki/X86_Bit_manipulation_instruction_set). If you are running on a CPU from ~2012 or earlier, these instructions may not be available and the pre-compiled executable may not work. In that case, you should compile from source using the `NO_BMI2` environement variable (i.e. `NO_BMI2=TRUE cargo build --release`). Building ======== From 821dceb3983f7e2bca654eb9e1af73c2696f3615 Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 29 Oct 2024 17:26:08 -0400 Subject: [PATCH 2/6] update build.rs --- Cargo.lock | 2 +- build.rs | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8e4d93..33d9455 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -405,7 +405,7 @@ checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "piscem" -version = "0.10.3" +version = "0.10.4" dependencies = [ "anyhow", "clap", diff --git a/build.rs b/build.rs index 15f3b17..fcc8752 100644 --- a/build.rs +++ b/build.rs @@ -87,11 +87,36 @@ fn main() { dst_piscem_cpp.join("lib64").display() ); + let profile = std::env::var("PROFILE").unwrap(); + match profile.as_str() { + "debug" => { + println!( + "cargo:rustc-link-search=native={}", + dst_piscem_cpp.join("Debug").join("lib64").display() + ); + println!( + "cargo:rustc-link-search=native={}", + dst_piscem_cpp.join("Debug").join("lib").display() + ); + } + "release" => { + println!( + "cargo:rustc-link-search=native={}", + dst_piscem_cpp.join("Release").join("lib64").display() + ); + println!( + "cargo:rustc-link-search=native={}", + dst_piscem_cpp.join("Release").join("lib").display() + ); + } + _ => (), + } + println!("cargo:rustc-link-lib=static=kmc_core"); //println!("cargo:rustc-link-lib=static=pesc_static"); //println!("cargo:rustc-link-lib=static=build_static"); println!("cargo:rustc-link-lib=static=sshash_static"); - println!("cargo:rustc-link-lib=static=z"); + println!("cargo:rustc-link-lib=static=zcf"); println!("cargo:rustc-link-lib=static=bz2"); #[cfg(target_os = "linux")] From 0ca7c18fb10887271cc268005a586c914450f867 Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 29 Oct 2024 20:57:48 -0400 Subject: [PATCH 3/6] update cargo dist --- .github/workflows/release.yml | 4 +++- Cargo.toml | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a41298a..314331e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,5 @@ +# This file was autogenerated by cargo-dist: https://opensource.axo.dev/cargo-dist/ +# # Copyright 2022-2024, axodotdev # SPDX-License-Identifier: MIT or Apache-2.0 # @@ -61,7 +63,7 @@ jobs: # we specify bash to get pipefail; it guards against the `curl` command # failing. otherwise `sh` won't catch that `curl` returned non-0 shell: bash - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.18.0/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.1/cargo-dist-installer.sh | sh" - name: Cache cargo-dist uses: actions/upload-artifact@v4 with: diff --git a/Cargo.toml b/Cargo.toml index 957c4a5..bb7204f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ inherits = "release" # Config for 'cargo dist' [workspace.metadata.dist] # The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.18.0" +cargo-dist-version = "0.21.1" # The installers to generate for each app installers = ["shell"] # Target platforms to build apps for (Rust target-triple syntax) @@ -49,12 +49,14 @@ targets = [ unix-archive = ".tar.gz" # CI backends to support ci = "github" -# Publish jobs to run in CI +# Which actions to run on pull requests pr-run-mode = "plan" # Whether to install an updater program install-updater = true # Generate and dist a source tarball source-tarball = false +# Path that installers should place binaries in +install-path = "CARGO_HOME" ## since this is cross-language and ## we are not including C++ debug ## symbols, this currently doesn't work From 5501277927ac8e3d2fcc0f067044fc556af584af Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 29 Oct 2024 21:17:21 -0400 Subject: [PATCH 4/6] add permissions --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 314331e..99d011a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -202,6 +202,7 @@ jobs: ${{ env.BUILD_MANIFEST_NAME }} # Determines if we should publish/announce host: + permissions: write-all needs: - plan - build-local-artifacts From fafe3adfbdf11ade66dce4c57d9311701141cae6 Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 29 Oct 2024 21:19:40 -0400 Subject: [PATCH 5/6] add permissions --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99d011a..c56ece0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,8 @@ name: Release permissions: "contents": "write" + "pull-requests": "write" + "repository-projects": "write" # This task will run whenever you push a git tag that looks like a version # like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc. @@ -202,7 +204,6 @@ jobs: ${{ env.BUILD_MANIFEST_NAME }} # Determines if we should publish/announce host: - permissions: write-all needs: - plan - build-local-artifacts From 6c9b4df923071bf9ad30fc62e403f770b03c968b Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 29 Oct 2024 21:24:57 -0400 Subject: [PATCH 6/6] permission --- .github/workflows/release.yml | 50 +++++++++++++++++------------------ Cargo.toml | 12 +++------ 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c56ece0..f6b098f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -# This file was autogenerated by cargo-dist: https://opensource.axo.dev/cargo-dist/ +# This file was autogenerated by dist: https://opensource.axo.dev/cargo-dist/ # # Copyright 2022-2024, axodotdev # SPDX-License-Identifier: MIT or Apache-2.0 @@ -6,7 +6,7 @@ # CI that: # # * checks for a Git Tag that looks like a release -# * builds artifacts with cargo-dist (archives, installers, hashes) +# * builds artifacts with dist (archives, installers, hashes) # * uploads those artifacts to temporary workflow zip # * on success, uploads the artifacts to a GitHub Release # @@ -16,8 +16,6 @@ name: Release permissions: "contents": "write" - "pull-requests": "write" - "repository-projects": "write" # This task will run whenever you push a git tag that looks like a version # like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc. @@ -26,10 +24,10 @@ permissions: # must be a Cargo-style SemVer Version (must have at least major.minor.patch). # # If PACKAGE_NAME is specified, then the announcement will be for that -# package (erroring out if it doesn't have the given version or isn't cargo-dist-able). +# package (erroring out if it doesn't have the given version or isn't dist-able). # # If PACKAGE_NAME isn't specified, then the announcement will be for all -# (cargo-dist-able) packages in the workspace with that version (this mode is +# (dist-able) packages in the workspace with that version (this mode is # intended for workspaces with only one dist-able package, or with all dist-able # packages versioned/released in lockstep). # @@ -47,7 +45,7 @@ on: - '**[0-9]+.[0-9]+.[0-9]+*' jobs: - # Run 'cargo dist plan' (or host) to determine what tasks we need to do + # Run 'dist plan' (or host) to determine what tasks we need to do plan: runs-on: "ubuntu-20.04" outputs: @@ -61,16 +59,16 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install cargo-dist + - name: Install dist # we specify bash to get pipefail; it guards against the `curl` command # failing. otherwise `sh` won't catch that `curl` returned non-0 shell: bash - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.1/cargo-dist-installer.sh | sh" - - name: Cache cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.24.1/cargo-dist-installer.sh | sh" + - name: Cache dist uses: actions/upload-artifact@v4 with: name: cargo-dist-cache - path: ~/.cargo/bin/cargo-dist + path: ~/.cargo/bin/dist # sure would be cool if github gave us proper conditionals... # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible # functionality based on whether this is a pull_request, and whether it's from a fork. @@ -78,8 +76,8 @@ jobs: # but also really annoying to build CI around when it needs secrets to work right.) - id: plan run: | - cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json - echo "cargo dist ran successfully" + dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json + echo "dist ran successfully" cat plan-dist-manifest.json echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT" - name: "Upload dist-manifest.json" @@ -97,12 +95,12 @@ jobs: if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }} strategy: fail-fast: false - # Target platforms/runners are computed by cargo-dist in create-release. + # Target platforms/runners are computed by dist in create-release. # Each member of the matrix has the following arguments: # # - runner: the github runner - # - dist-args: cli flags to pass to cargo dist - # - install-dist: expression to run to install cargo-dist on the runner + # - dist-args: cli flags to pass to dist + # - install-dist: expression to run to install dist on the runner # # Typically there will be: # - 1 "global" task that builds universal installers @@ -119,7 +117,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install cargo-dist + - name: Install dist run: ${{ matrix.install_dist }} # Get the dist-manifest - name: Fetch local artifacts @@ -134,8 +132,8 @@ jobs: - name: Build artifacts run: | # Actually do builds and make zips and whatnot - cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json - echo "cargo dist ran successfully" + dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json + echo "dist ran successfully" - id: cargo-dist name: Post-build # We force bash here just because github makes it really hard to get values up @@ -170,12 +168,12 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install cached cargo-dist + - name: Install cached dist uses: actions/download-artifact@v4 with: name: cargo-dist-cache path: ~/.cargo/bin/ - - run: chmod +x ~/.cargo/bin/cargo-dist + - run: chmod +x ~/.cargo/bin/dist # Get all the local artifacts for the global tasks to use (for e.g. checksums) - name: Fetch local artifacts uses: actions/download-artifact@v4 @@ -186,8 +184,8 @@ jobs: - id: cargo-dist shell: bash run: | - cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json - echo "cargo dist ran successfully" + dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json + echo "dist ran successfully" # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" @@ -219,12 +217,12 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install cached cargo-dist + - name: Install cached dist uses: actions/download-artifact@v4 with: name: cargo-dist-cache path: ~/.cargo/bin/ - - run: chmod +x ~/.cargo/bin/cargo-dist + - run: chmod +x ~/.cargo/bin/dist # Fetch artifacts from scratch-storage - name: Fetch artifacts uses: actions/download-artifact@v4 @@ -235,7 +233,7 @@ jobs: - id: host shell: bash run: | - cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json + dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json echo "artifacts uploaded and released successfully" cat dist-manifest.json echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" diff --git a/Cargo.toml b/Cargo.toml index bb7204f..e512cbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,18 +33,14 @@ opt-level = 3 [profile.dist] inherits = "release" -# Config for 'cargo dist' +# Config for 'dist' [workspace.metadata.dist] -# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.21.1" +# The preferred dist version to use in CI (Cargo.toml SemVer syntax) +cargo-dist-version = "0.24.1" # The installers to generate for each app installers = ["shell"] # Target platforms to build apps for (Rust target-triple syntax) -targets = [ - "aarch64-apple-darwin", - "x86_64-apple-darwin", - "x86_64-unknown-linux-gnu", -] +targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"] # The archive format to use for non-windows builds (defaults .tar.xz) unix-archive = ".tar.gz" # CI backends to support