From d45f06f1c6837cbee0e3399bd84e350b8ce9265d Mon Sep 17 00:00:00 2001 From: Alejandro Pedraza Date: Fri, 1 Dec 2023 17:30:18 -0500 Subject: [PATCH] Moved ./validator/.justfile to ./justfile-rust --- justfile | 3 ++- validator/.justfile => justfile-rust | 33 +++++++++++++++------------- 2 files changed, 20 insertions(+), 16 deletions(-) rename validator/.justfile => justfile-rust (56%) diff --git a/justfile b/justfile index 4d14a3d3..d659b731 100644 --- a/justfile +++ b/justfile @@ -71,7 +71,8 @@ rs-check-dir dir *flags: ## validator *args: - {{ just_executable() }} --justfile=validator/.justfile {{ args }} + TARGETCRATE=linkerd-network-validator \ + {{ just_executable() }} --justfile=justfile-rust {{ args }} ## ## cni-plugin diff --git a/validator/.justfile b/justfile-rust similarity index 56% rename from validator/.justfile rename to justfile-rust index d4d6e8e0..21de077b 100644 --- a/validator/.justfile +++ b/justfile-rust @@ -1,12 +1,15 @@ -# This justfile includes recipes for building and packaging the validator for -# release. This file is separated so that we can invoke cargo, etc when building -# defaults. If this logic were in the top-level justfile, then these tools would -# be invoked (possibly updating Rust, etc), for unrelated targets. +# This justfile includes recipes for building and packaging the validator and +# reinitialize-pods crates for release. This file is separated so that we can +# invoke cargo, etc when building defaults. If this logic were in the main +# justfile, then these tools would be invoked (possibly updating Rust, etc), +# for unrelated targets. # -# Users are expected to interact with this via the top-level Justfile. +# Users are expected to interact with this via the main Justfile. + +crate := env_var('TARGETCRATE') # The version name to use for packages. -version := `just-cargo crate-version linkerd-network-validator` +version := `just-cargo crate-version $TARGETCRATE` profile := 'debug' @@ -25,13 +28,13 @@ _cargo-target := if arch == "amd64" { `rustup show | sed -n 's/^Default host: \(.*\)/\1/p'` } -_target-dir := "../target" / _cargo-target / profile -_target-bin := _target-dir / "linkerd-network-validator" +_target-dir := "target" / _cargo-target / profile +_target-bin := _target-dir / crate -_package-name := "linkerd-network-validator-" + version + "-" + arch -_package-tgz := "../target/package" / _package-name + ".tgz" -_package-dir := "../target/package" / _package-name -_package-bin := _package-dir / "linkerd-network-validator" +_package-name := crate + "-" + version + "-" + arch +_package-tgz := "target/package" / _package-name + ".tgz" +_package-dir := "target/package" / _package-name +_package-bin := _package-dir / crate _package-dbg := _package-bin + ".dbg" _cargo := 'just-cargo profile=' + profile + ' target=' + _cargo-target @@ -43,10 +46,10 @@ package: build {{ _objcopy }} --only-keep-debug {{ _target-bin }} {{ _package-bin }}.dbg {{ _objcopy }} --strip-unneeded {{ _target-bin }} {{ _package-bin }} {{ _objcopy }} --add-gnu-debuglink={{ _package-dbg }} {{ _package-bin }} - tar -C ../target/package -czf {{ _package-tgz }} {{ _package-name }} - (cd ../target/package && {{ _shasum }} {{ _package-name }}.tgz > {{ _package-name }}.txt) + tar -C target/package -czf {{ _package-tgz }} {{ _package-name }} + (cd target/package && {{ _shasum }} {{ _package-name }}.tgz > {{ _package-name }}.txt) @rm -rf {{ _package-dir }} build *flags: {{ _cargo }} fetch --locked - {{ _cargo }} build --workspace -p linkerd-network-validator {{ flags }} + {{ _cargo }} build --workspace -p {{ crate }} {{ flags }}