From cd52eadfff6aefef4aafa2607437e07105ea2ca5 Mon Sep 17 00:00:00 2001 From: maxgio92 Date: Thu, 12 Dec 2024 19:44:26 +0100 Subject: [PATCH] feat(pipelines/cargo): add support for rustflags (#1698) Signed-off-by: Massimiliano Giovagnoli --- pkg/build/pipelines/cargo/build.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/build/pipelines/cargo/build.yaml b/pkg/build/pipelines/cargo/build.yaml index 3b5244b6a..0fa8fb3a2 100644 --- a/pkg/build/pipelines/cargo/build.yaml +++ b/pkg/build/pipelines/cargo/build.yaml @@ -26,6 +26,14 @@ inputs: Before building, the cargo pipeline wil cd into this directory. Defaults to current working directory + rustflags: + default: "" + required: false + description: | + Rustc flags to be passed to pass to all compiler invocations that Cargo performs. + In contrast with cargo rustc, this is useful for passing a flag to all compiler instances. + This string is split by whitespace. + prefix: default: usr description: | @@ -51,7 +59,7 @@ pipeline: cd "${{inputs.modroot}}" # Build and install package(s) - cargo auditable build --target-dir target ${{inputs.opts}} + RUSTFLAGS="${{inputs.rustflags}}" cargo auditable build --target-dir target ${{inputs.opts}} if [[ ! -z "${{inputs.output}}" ]]; then install -Dm755 "${OUTPUT_PATH}/${{inputs.output}}" "${INSTALL_PATH}/${{inputs.output}}" else