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] [RFC] Dealing with default upstream Rust flags (?)
Date: Sat, 09 Nov 2024 23:28:10 +0000	[thread overview]
Message-ID: <60cfeed31956ac629faaca329ea2b94003ccfe78.camel@gentoo.org> (raw)
In-Reply-To: <70781f1308cd370f762732053220083c8f734431.camel@gentoo.org>

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

On Sat, 2024-11-09 at 17:45 +0100, Michał Górny wrote:
> Hi,
> 
> Long story short, a lot of Rust upstreams are ricing in their
> Cargo.toml: enabling LTO, adjusting LTO jobs to exactly 1, and even
> weirder stuff.  With C, we generally have clear policies to override
> this and respect user flags.  With Rust, things aren't that clear.
> 
> Say, let's look at fractal:
> 
>   [profile.release]
>   debug = true
>   lto = "thin"
>   codegen-units = 1
> 
> Upstream is enabling LTO with 1 job (i.e. single threaded) to squeeze
> as much as they can from it.  Also, they are enabling debug symbols for
> some reason.  As a result, the build takes 45 minutes, if it doesn't OOM
> first.
> 
> How much of that stuff should we respect?  Or should we perhaps override
> it all?  Should we do some special magic via eclass, or perhaps expect
> users to set specific RUSTFLAGS for that?  Perhaps set default RUSTFLAGS
> in the profiles?

This stuff is unbelievably messy. Read the comments in cargo.eclass regarding
RUSTFLAGS. As things stand, user RUSTFLAGS are respected, as are some
project-specific flags but not all.

When I worked on this, I didn't look into these profile-related settings. Do
these actually have anything to do with RUSTFLAGS? I'm not sure. gyakovlev
experimented with a "gentoo" (as opposed to "release") profile a while back,
but that effort stalled.

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

      reply	other threads:[~2024-11-09 23:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-09 16:45 [gentoo-dev] [RFC] Dealing with default upstream Rust flags (?) Michał Górny
2024-11-09 23:28 ` 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=60cfeed31956ac629faaca329ea2b94003ccfe78.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