From fc319c9bec5afed7546bae7cc4171a767710061c Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Sep 26 2023 14:20:04 +0000 Subject: add symlink from target/rpm to target/release for compatibility --- diff --git a/macros.d/macros.cargo b/macros.d/macros.cargo index 318698f..ca1eea3 100644 --- a/macros.d/macros.cargo +++ b/macros.d/macros.cargo @@ -129,13 +129,17 @@ EOF}}\ # cargo_build: builds the crate with cargo with the specified feature flags %cargo_build(naf:)\ +(\ +set -euo pipefail\ %{shrink: \ %{__cargo} build \ %{__cargo_common_opts} \ --profile rpm \ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ %* \ -} +}\ +%{__ln} -s rpm target/release\ +) # cargo_test: runs the test suite with cargo with the specified feature flags # diff --git a/tests/test_macros_cargo.py b/tests/test_macros_cargo.py index fa84918..b18f296 100644 --- a/tests/test_macros_cargo.py +++ b/tests/test_macros_cargo.py @@ -246,8 +246,15 @@ def test_cargo_generate_buildrequires(evaluater, flags: str, expected: str): def test_cargo_build(evaluater): cargo = evaluater("%__cargo")[0] cargo_common_opts = evaluater("%__cargo_common_opts")[0] + ln = evaluater("%__ln")[0] - assert evaluater("%cargo_build")[0] == f"{cargo} build {cargo_common_opts} --profile rpm" + assert [line.rstrip() for line in evaluater("%cargo_build")[0].splitlines()] == [ + f"(", + f"set -euo pipefail", + f"{cargo} build {cargo_common_opts} --profile rpm", + f"{ln} -s rpm target/release", + f")", + ] def test_cargo_test(evaluater):