public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Lucio Sauer" <watermanpaint@posteo.net>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:master commit in: dev-util/rust-script/files/, dev-util/rust-script/
Date: Sat, 10 Aug 2024 15:41:56 +0000 (UTC)	[thread overview]
Message-ID: <1723261029.45bce1db40d7bf62bb59f250982b346f87b16e97.watermanpaint@gentoo> (raw)

commit:     45bce1db40d7bf62bb59f250982b346f87b16e97
Author:     Takuya Wakazono <pastalian46 <AT> gmail <DOT> com>
AuthorDate: Sat Aug 10 03:32:05 2024 +0000
Commit:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
CommitDate: Sat Aug 10 03:37:09 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=45bce1db

dev-util/rust-script: fix tests with new cargo.eclass

Signed-off-by: Takuya Wakazono <pastalian46 <AT> gmail.com>

 .../files/rust-script-0.34.0-fix-test.patch          | 20 ++++++++++++++++++++
 dev-util/rust-script/rust-script-0.34.0.ebuild       | 13 ++++++-------
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/dev-util/rust-script/files/rust-script-0.34.0-fix-test.patch b/dev-util/rust-script/files/rust-script-0.34.0-fix-test.patch
new file mode 100644
index 000000000..b7a68add0
--- /dev/null
+++ b/dev-util/rust-script/files/rust-script-0.34.0-fix-test.patch
@@ -0,0 +1,20 @@
+- cargo_target_dir helper contains {debug,release}
+- tests does not work with CARGO_BUILD_TARGET defined
+https://github.com/fornwall/rust-script/issues/85
+--- a/tests/util/mod.rs
++++ b/tests/util/mod.rs
+@@ -15,12 +15,13 @@ macro_rules! rust_script {
+             let out = {
+                 let target_dir = ::std::env::var("CARGO_TARGET_DIR")
+                     .unwrap_or_else(|_| String::from("target"));
+-                let mut cmd = Command::new(format!("{}/debug/rust-script", target_dir));
++                let mut cmd = Command::new(format!("{}/rust-script", target_dir));
+                 $(
+                     cmd.arg($args);
+                 )*
+ 
+                 cmd.env_remove("CARGO_TARGET_DIR");
++                cmd.env_remove("CARGO_BUILD_TARGET");
+                 $(cmd.env(stringify!($env_k), $env_v);)*
+ 
+                 cmd_str = format!("{:?}", cmd);

diff --git a/dev-util/rust-script/rust-script-0.34.0.ebuild b/dev-util/rust-script/rust-script-0.34.0.ebuild
index f668ea5bd..82bd8e756 100644
--- a/dev-util/rust-script/rust-script-0.34.0.ebuild
+++ b/dev-util/rust-script/rust-script-0.34.0.ebuild
@@ -116,13 +116,12 @@ KEYWORDS="~amd64"
 
 QA_FLAGS_IGNORED="usr/bin/.*"
 
+PATCHES=(
+	# tests does not work with CARGO_BUILD_TARGET defined
+	"${FILESDIR}/${P}-fix-test.patch"
+)
+
 src_prepare() {
 	default
-
-	use debug || sed -i "s|/debug/|/release/|" tests/util/mod.rs || die
-
-	# cargo.eclass uses the old config and deprecation warning breaks the test.
-	if [[ ! -e "${ECARGO_HOME}/config.toml" ]]; then
-		ln -s "${ECARGO_HOME}/config" "${ECARGO_HOME}/config.toml" || die
-	fi
+	sed -i "s|\"target\"|\"$(cargo_target_dir)\"|" tests/util/mod.rs || die
 }


                 reply	other threads:[~2024-08-10 15:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1723261029.45bce1db40d7bf62bb59f250982b346f87b16e97.watermanpaint@gentoo \
    --to=watermanpaint@posteo.net \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox