From 844f67383a9d481d818ca4b6c80981ef79a3c9b7 Mon Sep 17 00:00:00 2001 From: Andrew Lilley Brinker Date: Thu, 7 Nov 2024 21:47:37 -0800 Subject: [PATCH] chore: Preparing to use 'dist' for more releases. This relies on the upgrade to the latest version of 'dist'. Since we now have plugins that we want to produce pre-built binaries for, this updates our build configuration to support that. It'll need to be tested. Signed-off-by: Andrew Lilley Brinker --- .github/workflows/release-dry-run.yml | 46 --------------------------- .github/workflows/release.yml | 4 +-- Cargo.toml | 38 +++------------------- dist-workspace.toml | 35 ++++++++++++++++++++ hipcheck/Cargo.toml | 12 +++---- hipcheck/dist.toml | 15 +++++++++ plugins/activity/Cargo.toml | 1 + plugins/activity/dist.toml | 14 ++++++++ plugins/activity/plugin.kdl | 12 ++++--- plugins/affiliation/Cargo.toml | 5 +-- plugins/affiliation/dist.toml | 14 ++++++++ plugins/affiliation/plugin.kdl | 9 +++--- plugins/binary/Cargo.toml | 5 ++- plugins/binary/dist.toml | 14 ++++++++ plugins/binary/plugin.kdl | 9 +++--- plugins/churn/Cargo.toml | 5 ++- plugins/churn/dist.toml | 14 ++++++++ plugins/churn/plugin.kdl | 9 +++--- plugins/entropy/Cargo.toml | 5 ++- plugins/entropy/dist.toml | 14 ++++++++ plugins/entropy/plugin.kdl | 14 ++++---- plugins/fuzz/Cargo.toml | 5 ++- plugins/fuzz/dist.toml | 14 ++++++++ plugins/fuzz/plugin.kdl | 12 ++++--- plugins/git/Cargo.toml | 3 +- plugins/git/dist.toml | 14 ++++++++ plugins/git/plugin.kdl | 9 +++--- plugins/github/Cargo.toml | 5 ++- plugins/github/dist.toml | 14 ++++++++ plugins/github/plugin.kdl | 9 +++--- plugins/identity/Cargo.toml | 5 ++- plugins/identity/dist.toml | 14 ++++++++ plugins/identity/plugin.kdl | 10 +++--- plugins/linguist/Cargo.toml | 5 ++- plugins/linguist/dist.toml | 14 ++++++++ plugins/linguist/plugin.kdl | 11 +++++++ plugins/linguist/src/main.rs | 4 +-- plugins/npm/Cargo.toml | 3 +- plugins/npm/dist.toml | 14 ++++++++ plugins/npm/plugin.kdl | 9 +++--- plugins/review/Cargo.toml | 1 + plugins/review/dist.toml | 14 ++++++++ plugins/review/plugin.kdl | 9 +++--- plugins/typo/Cargo.toml | 1 + plugins/typo/dist.toml | 14 ++++++++ plugins/typo/plugin.kdl | 12 ++++--- xtask/Cargo.toml | 3 ++ 47 files changed, 367 insertions(+), 155 deletions(-) delete mode 100644 .github/workflows/release-dry-run.yml create mode 100644 dist-workspace.toml create mode 100644 hipcheck/dist.toml create mode 100644 plugins/activity/dist.toml create mode 100644 plugins/affiliation/dist.toml create mode 100644 plugins/binary/dist.toml create mode 100644 plugins/churn/dist.toml create mode 100644 plugins/entropy/dist.toml create mode 100644 plugins/fuzz/dist.toml create mode 100644 plugins/git/dist.toml create mode 100644 plugins/github/dist.toml create mode 100644 plugins/identity/dist.toml create mode 100644 plugins/linguist/dist.toml create mode 100644 plugins/linguist/plugin.kdl create mode 100644 plugins/npm/dist.toml create mode 100644 plugins/review/dist.toml create mode 100644 plugins/typo/dist.toml diff --git a/.github/workflows/release-dry-run.yml b/.github/workflows/release-dry-run.yml deleted file mode 100644 index 033cd605..00000000 --- a/.github/workflows/release-dry-run.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Release Dry Run - -# Run once a week on Monday at midnight. -on: - schedule: - - cron: "0 0 * * 1" - -permissions: - contents: read - -env: - RUSTFLAGS: -Dwarnings - CARGO_TERM_COLOR: always - -jobs: - test: - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - name: "Test (${{ matrix.os }})" - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - steps: - # Get the repo, get Rust, get `cargo-nextest`, setup caching. - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: taiki-e/install-action@nextest - - uses: swatinem/rust-cache@v2 - with: - key: ${{ matrix.os }} - - # Install the protobuf compiler - - if: runner.os == 'Linux' - run: sudo apt-get install -y protobuf-compiler - - if: runner.os == 'macOS' - run: brew install protobuf - - if: runner.os == 'Windows' - run: choco install protoc - - # Print dependency info (useful for debugging) - - name: Dependency Tree - run: cargo tree - - # Try building as-if for publishing a new version. - - name: Publish - run: cargo publish --dry-run --allow-dirty --verbose -p hipcheck diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e9bca83..f70df1be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,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.25.1/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.25.2-prerelease.1/cargo-dist-installer.sh | sh" - name: Cache dist uses: actions/upload-artifact@v4 with: @@ -118,7 +118,7 @@ jobs: with: submodules: recursive - name: Install dist - run: ${{ matrix.install_dist }} + run: ${{ matrix.install_dist.run }} # Get the dist-manifest - name: Fetch local artifacts uses: actions/download-artifact@v4 diff --git a/Cargo.toml b/Cargo.toml index f70f0af5..ff713530 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,8 @@ members = [ "plugins/identity", "plugins/linguist", "plugins/review", - "plugins/typo"] + "plugins/typo", +] # Make sure Hipcheck is run with `cargo run`. # @@ -39,44 +40,13 @@ members = [ # See `.cargo/config.toml` for how this is done. default-members = ["hipcheck"] -# Config for 'dist' -[workspace.metadata.dist] -# The preferred dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.25.1" -# CI backends to support -ci = "github" -# The installers to generate for each app -installers = ["shell", "powershell"] -# Target platforms to build apps for (Rust target-triple syntax) -targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"] -# Which actions to run on pull requests -pr-run-mode = "plan" -# Whether to install an updater program -install-updater = true -# Extra static files to include in each App (path relative to this Cargo.toml's dir) -include = ["config/"] -# Path that installers should place binaries in -install-path = "CARGO_HOME" - -# Ubuntu build dependencies for `cargo-dist` -[workspace.metadata.dist.dependencies.apt] -protobuf-compiler = "*" - -# macOS build dependencies for 'cargo-dist' -[workspace.metadata.dist.dependencies.homebrew] -protobuf = "*" - -# Windows build dependencies for `cargo-dist` -[workspace.metadata.dist.dependencies.chocolatey] -protoc = "*" - # The profile that 'cargo dist' will build with -[profile.dist] - +# # For now this is just the release profile, but with "thin" Link-Time # Optimization enabled. This performs _some_ LTO and tries to hit the # right trade-off between the runtime performance improvements of more # LTO and the compile time cost of doing LTO. +[profile.dist] inherits = "release" lto = "thin" diff --git a/dist-workspace.toml b/dist-workspace.toml new file mode 100644 index 00000000..74c89ead --- /dev/null +++ b/dist-workspace.toml @@ -0,0 +1,35 @@ +[workspace] + +# All the packages which 'cargo-dist' is responsible for. +# This is _only_ the binary packages in the overall project, so it excludes +# libraries including any SDKs and our supporting libraries. +members = ["cargo:."] + +# Config for 'dist' +[dist] +# The preferred dist version to use in CI (Cargo.toml SemVer syntax) +cargo-dist-version = "0.25.2-prerelease.1" +# CI backends to support +ci = "github" +# Which actions to run on pull requests +pr-run-mode = "plan" +# Path that installers should place binaries in +install-path = ["~/.local/bin", "~/.hipcheck/bin"] +# Target platforms to build apps for (Rust target-triple syntax) +targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"] +# The installers to generate for each app +installers = ["shell", "powershell"] +# Whether to install an updater program +install-updater = true + +# Make sure that both Hipcheck and all the plugins are built with the protobuf +# compiler present on their platform. + +[dist.dependencies.apt] +protobuf-compiler = "*" + +[dist.dependencies.homebrew] +protobuf = "*" + +[dist.dependencies.chocolatey] +protoc = "*" diff --git a/hipcheck/Cargo.toml b/hipcheck/Cargo.toml index 1444f8f1..0d56d160 100644 --- a/hipcheck/Cargo.toml +++ b/hipcheck/Cargo.toml @@ -100,7 +100,12 @@ rustls = { version = "0.23.10", default-features = false, features = [ ] } rustls-native-certs = "0.8.0" salsa = "0.16.1" -schemars = { version = "0.8.21", default-features = false, features = ["derive", "preserve_order", "chrono", "url"] } +schemars = { version = "0.8.21", default-features = false, features = [ + "derive", + "preserve_order", + "chrono", + "url", +] } semver = "1.0.9" serde = { version = "1.0.214", features = ["derive", "rc"] } serde_derive = "1.0.137" @@ -151,8 +156,3 @@ which = { version = "7.0.0", default-features = false } dirs = "5.0.1" tempfile = "3.13.0" test-log = "0.2.16" - -[package.metadata.dist] - -# Make sure that `cargo-dist` can find this binary. -dist = true diff --git a/hipcheck/dist.toml b/hipcheck/dist.toml new file mode 100644 index 00000000..b5198f21 --- /dev/null +++ b/hipcheck/dist.toml @@ -0,0 +1,15 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# For now we'll only use these installers. In the future we might add others. +installers = ["shell", "powershell"] + +# Yes we want the updater. +install-updater = true + +# Make sure to include the configuration. +include = ["../config/"] diff --git a/plugins/activity/Cargo.toml b/plugins/activity/Cargo.toml index cb800b43..98b9940b 100644 --- a/plugins/activity/Cargo.toml +++ b/plugins/activity/Cargo.toml @@ -3,6 +3,7 @@ name = "activity" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] diff --git a/plugins/activity/dist.toml b/plugins/activity/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/activity/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/activity/plugin.kdl b/plugins/activity/plugin.kdl index 20a2fa56..979f14e1 100644 --- a/plugins/activity/plugin.kdl +++ b/plugins/activity/plugin.kdl @@ -2,12 +2,14 @@ publisher "mitre" name "activity" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/activity" - on arch="x86_64-apple-darwin" "./target/debug/activity" - on arch="x86_64-unknown-linux-gnu" "./target/debug/activity" - on arch="x86_64-pc-windows-msvc" "./target/debug/activity.exe" + on arch="aarch64-apple-darwin" "activity" + on arch="x86_64-apple-darwin" "activity" + on arch="x86_64-unknown-linux-gnu" "activity" + on arch="x86_64-pc-windows-msvc" "activity.exe" } + dependencies { - plugin "mitre/git" version="0.1.0" manifest="./plugins/git/plugin.kdl" + plugin "mitre/git" version="0.1.0" manifest="./plugins/git/plugin.kdl" } diff --git a/plugins/affiliation/Cargo.toml b/plugins/affiliation/Cargo.toml index 00c5551e..67057311 100644 --- a/plugins/affiliation/Cargo.toml +++ b/plugins/affiliation/Cargo.toml @@ -3,12 +3,13 @@ name = "affiliation" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] anyhow = "1.0.91" clap = { version = "4.5.18", features = ["derive"] } -hipcheck-sdk = { path = "../../sdk/rust", features = ["macros"]} +hipcheck-sdk = { path = "../../sdk/rust", features = ["macros"] } kdl = "4.6.0" log = "0.4.22" pathbuf = "1.0.0" @@ -19,4 +20,4 @@ strum = { version = "0.26.3", features = ["derive"] } tokio = { version = "1.40.0", features = ["rt"] } [dev-dependencies] -hipcheck-sdk = { path = "../../sdk/rust", features = ["macros", "mock_engine"]} +hipcheck-sdk = { path = "../../sdk/rust", features = ["macros", "mock_engine"] } diff --git a/plugins/affiliation/dist.toml b/plugins/affiliation/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/affiliation/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/affiliation/plugin.kdl b/plugins/affiliation/plugin.kdl index a42687ce..2af35355 100644 --- a/plugins/affiliation/plugin.kdl +++ b/plugins/affiliation/plugin.kdl @@ -2,11 +2,12 @@ publisher "mitre" name "affiliation" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/affiliation" - on arch="x86_64-apple-darwin" "./target/debug/affiliation" - on arch="x86_64-unknown-linux-gnu" "./target/debug/affiliation" - on arch="x86_64-pc-windows-msvc" "./target/debug/affiliation.exe" + on arch="aarch64-apple-darwin" "affiliation" + on arch="x86_64-apple-darwin" "affiliation" + on arch="x86_64-unknown-linux-gnu" "affiliation" + on arch="x86_64-pc-windows-msvc" "affiliation.exe" } dependencies { diff --git a/plugins/binary/Cargo.toml b/plugins/binary/Cargo.toml index 06b75854..d30aa087 100644 --- a/plugins/binary/Cargo.toml +++ b/plugins/binary/Cargo.toml @@ -3,12 +3,15 @@ name = "binary" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] clap = { version = "4.5.20", features = ["derive"] } content_inspector = "0.2.4" -hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = ["macros"] } +hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = [ + "macros", +] } log = "0.4.22" pathbuf = "1.0.0" schemars = "0.8.21" diff --git a/plugins/binary/dist.toml b/plugins/binary/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/binary/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/binary/plugin.kdl b/plugins/binary/plugin.kdl index 782ba240..8627a32d 100644 --- a/plugins/binary/plugin.kdl +++ b/plugins/binary/plugin.kdl @@ -2,9 +2,10 @@ publisher "mitre" name "binary" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/binary" - on arch="x86_64-apple-darwin" "./target/debug/binary" - on arch="x86_64-unknown-linux-gnu" "./target/debug/binary" - on arch="x86_64-pc-windows-msvc" "./target/debug/binary.exe" + on arch="aarch64-apple-darwin" "binary" + on arch="x86_64-apple-darwin" "binary" + on arch="x86_64-unknown-linux-gnu" "binary" + on arch="x86_64-pc-windows-msvc" "binary.exe" } diff --git a/plugins/churn/Cargo.toml b/plugins/churn/Cargo.toml index 8bd8f0b0..3e6d8891 100644 --- a/plugins/churn/Cargo.toml +++ b/plugins/churn/Cargo.toml @@ -3,11 +3,14 @@ name = "churn" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] clap = { version = "4.5.20", features = ["derive"] } -hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = ["macros"] } +hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = [ + "macros", +] } log = "0.4.22" salsa = "0.16.1" schemars = "0.8.21" diff --git a/plugins/churn/dist.toml b/plugins/churn/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/churn/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/churn/plugin.kdl b/plugins/churn/plugin.kdl index 5173bd80..7ad139b6 100644 --- a/plugins/churn/plugin.kdl +++ b/plugins/churn/plugin.kdl @@ -2,11 +2,12 @@ publisher "mitre" name "churn" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/churn" - on arch="x86_64-apple-darwin" "./target/debug/churn" - on arch="x86_64-unknown-linux-gnu" "./target/debug/churn" - on arch="x86_64-pc-windows-msvc" "./target/debug/churn.exe" + on arch="aarch64-apple-darwin" "churn" + on arch="x86_64-apple-darwin" "churn" + on arch="x86_64-unknown-linux-gnu" "churn" + on arch="x86_64-pc-windows-msvc" "churn.exe" } dependencies { diff --git a/plugins/entropy/Cargo.toml b/plugins/entropy/Cargo.toml index c0dc69a9..ab796b04 100644 --- a/plugins/entropy/Cargo.toml +++ b/plugins/entropy/Cargo.toml @@ -3,6 +3,7 @@ name = "entropy" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] @@ -11,7 +12,9 @@ clap = { version = "4.5.20", features = ["derive"] } dashmap = { version = "6.1.0", features = ["inline", "rayon"] } finl_unicode = { version = "1.2.0", features = ["grapheme_clusters"] } futures = "0.3.31" -hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = ["macros"] } +hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = [ + "macros", +] } ordered-float = { version = "4.4.0", features = ["serde"] } pathbuf = "1.0.0" rayon = "1.10.0" diff --git a/plugins/entropy/dist.toml b/plugins/entropy/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/entropy/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/entropy/plugin.kdl b/plugins/entropy/plugin.kdl index 9b60617d..3e5ccf45 100644 --- a/plugins/entropy/plugin.kdl +++ b/plugins/entropy/plugin.kdl @@ -2,12 +2,14 @@ publisher "mitre" name "entropy" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/entropy" - on arch="x86_64-apple-darwin" "./target/debug/entropy" - on arch="x86_64-unknown-linux-gnu" "./target/debug/entropy" - on arch="x86_64-pc-windows-msvc" "./target/debug/entropy.exe" + on arch="aarch64-apple-darwin" "entropy" + on arch="x86_64-apple-darwin" "entropy" + on arch="x86_64-unknown-linux-gnu" "entropy" + on arch="x86_64-pc-windows-msvc" "entropy.exe" } + dependencies { - plugin "mitre/git" version="0.1.0" manifest="./plugins/git/plugin.kdl" -} \ No newline at end of file + plugin "mitre/git" version="0.1.0" manifest="./plugins/git/plugin.kdl" +} diff --git a/plugins/fuzz/Cargo.toml b/plugins/fuzz/Cargo.toml index a649534f..6a43c995 100644 --- a/plugins/fuzz/Cargo.toml +++ b/plugins/fuzz/Cargo.toml @@ -3,11 +3,14 @@ name = "fuzz" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] clap = { version = "4.5.20", features = ["derive"] } -hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = ["macros"] } +hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = [ + "macros", +] } serde = { version = "1.0.214", features = ["derive"] } serde_json = "1.0.128" tokio = { version = "1.40.0", features = ["rt"] } diff --git a/plugins/fuzz/dist.toml b/plugins/fuzz/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/fuzz/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/fuzz/plugin.kdl b/plugins/fuzz/plugin.kdl index 648988fb..86e8f3d7 100644 --- a/plugins/fuzz/plugin.kdl +++ b/plugins/fuzz/plugin.kdl @@ -2,12 +2,14 @@ publisher "mitre" name "fuzz" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/fuzz" - on arch="x86_64-apple-darwin" "./target/debug/fuzz" - on arch="x86_64-unknown-linux-gnu" "./target/debug/fuzz" - on arch="x86_64-pc-windows-msvc" "./target/debug/fuzz.exe" + on arch="aarch64-apple-darwin" "fuzz" + on arch="x86_64-apple-darwin" "fuzz" + on arch="x86_64-unknown-linux-gnu" "fuzz" + on arch="x86_64-pc-windows-msvc" "fuzz.exe" } + dependencies { - plugin "mitre/github" version="0.1.0" manifest="./plugins/github/plugin.kdl" + plugin "mitre/github" version="0.1.0" manifest="./plugins/github/plugin.kdl" } diff --git a/plugins/git/Cargo.toml b/plugins/git/Cargo.toml index d35e62b8..f047798e 100644 --- a/plugins/git/Cargo.toml +++ b/plugins/git/Cargo.toml @@ -3,12 +3,13 @@ name = "git" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] anyhow = "1.0.91" clap = { version = "4.5.18", features = ["derive"] } -hipcheck-sdk = { path = "../../sdk/rust", features = ["macros"]} +hipcheck-sdk = { path = "../../sdk/rust", features = ["macros"] } jiff = { version = "0.1.13", features = ["serde"] } log = "0.4.22" nom = "7.1.3" diff --git a/plugins/git/dist.toml b/plugins/git/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/git/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/git/plugin.kdl b/plugins/git/plugin.kdl index 5719b047..15f00552 100644 --- a/plugins/git/plugin.kdl +++ b/plugins/git/plugin.kdl @@ -2,9 +2,10 @@ publisher "mitre" name "git" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/git" - on arch="x86_64-apple-darwin" "./target/debug/git" - on arch="x86_64-unknown-linux-gnu" "./target/debug/git" - on arch="x86_64-pc-windows-msvc" "./target/debug/git.exe" + on arch="aarch64-apple-darwin" "git" + on arch="x86_64-apple-darwin" "git" + on arch="x86_64-unknown-linux-gnu" "git" + on arch="x86_64-pc-windows-msvc" "git.exe" } diff --git a/plugins/github/Cargo.toml b/plugins/github/Cargo.toml index ead2462c..2dfb0384 100644 --- a/plugins/github/Cargo.toml +++ b/plugins/github/Cargo.toml @@ -3,13 +3,16 @@ name = "github" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] anyhow = "1.0.91" clap = { version = "4.5.19", features = ["derive"] } graphql_client = "0.14.0" -hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = ["macros"] } +hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = [ + "macros", +] } log = "0.4.22" # Exactly matching the version of rustls used by ureq # Get rid of default features since we don't use the AWS backed crypto diff --git a/plugins/github/dist.toml b/plugins/github/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/github/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/github/plugin.kdl b/plugins/github/plugin.kdl index b27bc737..7370726d 100644 --- a/plugins/github/plugin.kdl +++ b/plugins/github/plugin.kdl @@ -2,9 +2,10 @@ publisher "mitre" name "github" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/github" - on arch="x86_64-apple-darwin" "./target/debug/github" - on arch="x86_64-unknown-linux-gnu" "./target/debug/github" - on arch="x86_64-pc-windows-msvc" "./target/debug/github.exe" + on arch="aarch64-apple-darwin" "github" + on arch="x86_64-apple-darwin" "github" + on arch="x86_64-unknown-linux-gnu" "github" + on arch="x86_64-pc-windows-msvc" "github.exe" } diff --git a/plugins/identity/Cargo.toml b/plugins/identity/Cargo.toml index 578c37d3..fb033ef1 100644 --- a/plugins/identity/Cargo.toml +++ b/plugins/identity/Cargo.toml @@ -3,11 +3,14 @@ name = "identity" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] clap = { version = "4.5.20", features = ["derive"] } -hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = ["macros"] } +hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = [ + "macros", +] } log = "0.4.22" schemars = "0.8.21" serde = "1.0.214" diff --git a/plugins/identity/dist.toml b/plugins/identity/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/identity/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/identity/plugin.kdl b/plugins/identity/plugin.kdl index bf7e7b28..999ab6fb 100644 --- a/plugins/identity/plugin.kdl +++ b/plugins/identity/plugin.kdl @@ -2,12 +2,14 @@ publisher "mitre" name "identity" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/identity" - on arch="x86_64-apple-darwin" "./target/debug/identity" - on arch="x86_64-unknown-linux-gnu" "./target/debug/identity" - on arch="x86_64-pc-windows-msvc" "./target/debug/identity.exe" + on arch="aarch64-apple-darwin" "identity" + on arch="x86_64-apple-darwin" "identity" + on arch="x86_64-unknown-linux-gnu" "identity" + on arch="x86_64-pc-windows-msvc" "identity.exe" } + dependencies { plugin "mitre/git" version="0.1.0" manifest="./plugins/git/plugin.kdl" } diff --git a/plugins/linguist/Cargo.toml b/plugins/linguist/Cargo.toml index 0f3b502a..5cacf352 100644 --- a/plugins/linguist/Cargo.toml +++ b/plugins/linguist/Cargo.toml @@ -3,12 +3,15 @@ name = "linguist" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] anyhow = "1.0.91" clap = { version = "4.5.20", features = ["derive"] } -hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = ["macros"] } +hipcheck-sdk = { version = "0.1.0", path = "../../sdk/rust", features = [ + "macros", +] } log = "0.4.22" pathbuf = "1.0.0" serde = { version = "1.0.214", features = ["derive"] } diff --git a/plugins/linguist/dist.toml b/plugins/linguist/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/linguist/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/linguist/plugin.kdl b/plugins/linguist/plugin.kdl new file mode 100644 index 00000000..1edff627 --- /dev/null +++ b/plugins/linguist/plugin.kdl @@ -0,0 +1,11 @@ +publisher "mitre" +name "linguist" +version "0.1.0" +license "Apache-2.0" + +entrypoint { + on arch="aarch64-apple-darwin" "linguist" + on arch="x86_64-apple-darwin" "linguist" + on arch="x86_64-unknown-linux-gnu" "linguist" + on arch="x86_64-pc-windows-msvc" "linguist.exe" +} diff --git a/plugins/linguist/src/main.rs b/plugins/linguist/src/main.rs index 564b66a8..d14af1a2 100644 --- a/plugins/linguist/src/main.rs +++ b/plugins/linguist/src/main.rs @@ -5,12 +5,10 @@ mod fs; mod linguist; -use linguist::SourceFileDetector; - use clap::Parser; use hipcheck_sdk::prelude::*; +use linguist::SourceFileDetector; use serde::Deserialize; - use std::{path::PathBuf, result::Result as StdResult, sync::OnceLock}; #[derive(Deserialize)] diff --git a/plugins/npm/Cargo.toml b/plugins/npm/Cargo.toml index 254f6c42..6bd4ac01 100644 --- a/plugins/npm/Cargo.toml +++ b/plugins/npm/Cargo.toml @@ -3,12 +3,13 @@ name = "npm" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] anyhow = "1.0.91" clap = { version = "4.5.18", features = ["derive"] } -hipcheck-sdk = { path = "../../sdk/rust", features = ["macros"]} +hipcheck-sdk = { path = "../../sdk/rust", features = ["macros"] } log = "0.4.22" pathbuf = "1.0.0" regex = "1.11.1" diff --git a/plugins/npm/dist.toml b/plugins/npm/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/npm/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/npm/plugin.kdl b/plugins/npm/plugin.kdl index 46d77fe3..5cf7f1fa 100644 --- a/plugins/npm/plugin.kdl +++ b/plugins/npm/plugin.kdl @@ -2,9 +2,10 @@ publisher "mitre" name "npm" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/npm" - on arch="x86_64-apple-darwin" "./target/debug/npm" - on arch="x86_64-unknown-linux-gnu" "./target/debug/npm" - on arch="x86_64-pc-windows-msvc" "./target/debug/npm.exe" + on arch="aarch64-apple-darwin" "npm" + on arch="x86_64-apple-darwin" "npm" + on arch="x86_64-unknown-linux-gnu" "npm" + on arch="x86_64-pc-windows-msvc" "npm.exe" } diff --git a/plugins/review/Cargo.toml b/plugins/review/Cargo.toml index 188783fc..c1df4445 100644 --- a/plugins/review/Cargo.toml +++ b/plugins/review/Cargo.toml @@ -3,6 +3,7 @@ name = "review" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] diff --git a/plugins/review/dist.toml b/plugins/review/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/review/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/review/plugin.kdl b/plugins/review/plugin.kdl index 65bfcd76..09e8222d 100644 --- a/plugins/review/plugin.kdl +++ b/plugins/review/plugin.kdl @@ -2,11 +2,12 @@ publisher "mitre" name "review" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/review" - on arch="x86_64-apple-darwin" "./target/debug/review" - on arch="x86_64-unknown-linux-gnu" "./target/debug/review" - on arch="x86_64-pc-windows-msvc" "./target/debug/review.exe" + on arch="aarch64-apple-darwin" "review" + on arch="x86_64-apple-darwin" "review" + on arch="x86_64-unknown-linux-gnu" "review" + on arch="x86_64-pc-windows-msvc" "review.exe" } dependencies { diff --git a/plugins/typo/Cargo.toml b/plugins/typo/Cargo.toml index 7ba9363f..84c2fdd3 100644 --- a/plugins/typo/Cargo.toml +++ b/plugins/typo/Cargo.toml @@ -3,6 +3,7 @@ name = "typo" version = "0.1.0" license = "Apache-2.0" edition = "2021" +repository = "https://github.com/mitre/hipcheck" publish = false [dependencies] diff --git a/plugins/typo/dist.toml b/plugins/typo/dist.toml new file mode 100644 index 00000000..9f320923 --- /dev/null +++ b/plugins/typo/dist.toml @@ -0,0 +1,14 @@ + +[dist] + +# Make sure that 'dist' will handle releases for this. Otherwise, since +# the crate is set to 'publish = false', 'dist' would ignore it by default. +dist = true + +# We explicitly *don't* want 'dist' to produce installers; just to prebuild +# the binaries for us and bundle everything together. Hipcheck itself will +# handle people getting the prebuilt binaries based on the download manifest. +installers = [] + +# Make sure to include the plugin manifest. +include = ["plugin.kdl"] diff --git a/plugins/typo/plugin.kdl b/plugins/typo/plugin.kdl index 038b5f8d..bb46f0a9 100644 --- a/plugins/typo/plugin.kdl +++ b/plugins/typo/plugin.kdl @@ -2,12 +2,14 @@ publisher "mitre" name "typo" version "0.1.0" license "Apache-2.0" + entrypoint { - on arch="aarch64-apple-darwin" "./target/debug/typo" - on arch="x86_64-apple-darwin" "./target/debug/typo" - on arch="x86_64-unknown-linux-gnu" "./target/debug/typo" - on arch="x86_64-pc-windows-msvc" "./target/debug/typo.exe" + on arch="aarch64-apple-darwin" "typo" + on arch="x86_64-apple-darwin" "typo" + on arch="x86_64-unknown-linux-gnu" "typo" + on arch="x86_64-pc-windows-msvc" "typo.exe" } + dependencies { - plugin "mitre/npm" version="0.1.0" manifest="./plugins/npm/plugin.kdl" + plugin "mitre/npm" version="0.1.0" manifest="./plugins/npm/plugin.kdl" } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 670e42c2..af9c72fc 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -4,6 +4,9 @@ description = "Hipcheck development task runner." version = "0.1.0" license = "Apache-2.0" edition = "2021" +# This ensures we do not publish this to Crates.io, and that +# 'dist' doesn't try to create any releases of this, since it's just +# internal tooling. publish = false [dependencies]