public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: James Le Cuirot <chewi@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 1/3] cargo.eclass: Add cargo_env helper and use it in compile, test, install
Date: Thu, 25 Jul 2024 09:06:54 +0100	[thread overview]
Message-ID: <d59d1d667715be238e146e450bb69aa25974a92b.camel@gentoo.org> (raw)
In-Reply-To: <0f37e9b8-4005-40ed-97db-ea3f2dc43585@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

On Wed, 2024-07-24 at 18:14 -0400, Eli Schwartz wrote:
> On 7/24/24 6:07 PM, James Le Cuirot wrote:
> > Rust packages have a tendency to rebuild parts during test and install.
> > It is not clear whether this can be addressed. We were therefore relying
> > on some environment variables set during the compile phase for
> > cross-compiling to work in the later phases. This is not ideal,
> > especially if you need to build for multiple targets.
> 
> 
> Oof, yeah, as I mentioned on Monday in -dev, I have a package that
> actually produces meaningfully different programs if you rebuild it
> during test.
> 
> dev-util/ruff will, when built with FEATURES=test, not show color when
> you run it. Don't know why, feel a bit too freaked out about rebuilding
> for tests *at all* to even think about fixing this in a "src_test
> compatible way".
> 
> So I wonder if maybe we can somehow switch to e.g. doing the test phase
> in a different directory such that it doesn't modify the artifacts we
> actually want to install.

It can happen due to files or environment variables changing. It sounds like
the tests inadvertently cause that in this case. You could copy the
$(cargo_target_dir) to $(cargo_target_dir)-test and then set CARGO_TARGET_DIR
to the latter before running the tests.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 858 bytes --]

      reply	other threads:[~2024-07-25  8:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 22:07 [gentoo-dev] [PATCH 1/3] cargo.eclass: Add cargo_env helper and use it in compile, test, install James Le Cuirot
2024-07-24 22:07 ` [gentoo-dev] [PATCH 2/3] cargo.eclass: Handle LDFLAGS and RUSTFLAGS better James Le Cuirot
2024-07-24 22:07 ` [gentoo-dev] [PATCH 3/3] cargo.eclass: Explicitly tell rustc not to strip binaries James Le Cuirot
2024-07-24 22:14 ` [gentoo-dev] [PATCH 1/3] cargo.eclass: Add cargo_env helper and use it in compile, test, install Eli Schwartz
2024-07-25  8:06   ` James Le Cuirot [this message]

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=d59d1d667715be238e146e450bb69aa25974a92b.camel@gentoo.org \
    --to=chewi@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