Skip to content

Add recommendations for distro usage #2917

Description

@workingjubilee

While talking to Gentoo's people about possible issues that might be affecting how Gentoo's rustc is compiling things, it came up that we, The Rust Project™, don't really document what are basically the "minimum viable build settings" for important components of rustc, such as LLVM, or anything else we would appreciate. We do, of course, have the dist profile via bootstrap.dist.toml which encodes many of those, but there's more than just that.

For instance, bootstrap sets LLVM_UNREACHABLE_OPTIMIZE="OFF" for the CMake build, but we also support usage of a system or external LLVM. That system LLVM support came first, and we don't want to break it, but we also would really like all LLVMs that are used with rustc to have the same setting, which means we have to coordinate this setting across LLVMs that aren't built via bootstrap. This coordination might be optimistic but the benefit of stopping execution immediately, even if it's only on a gradually-decreasing percent of LLVM-related bugs, is huge, as it means we're only a few line-tables away from getting a function name that is the culprit and don't have a mysterious miscompilation instead. The mysterious miscompilations that can't be stopped by simple means are quite enough work for us to handle.

We could of course just expect folks to stare into random segments of bootstrap's Rust code and duplicate the build configurations we have buried in there but... that seems like a bit of a non-starter.

Anyways, the idea here is to try to document at least a few of these things. The big one to document our expectations on for LLVM is https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html since that is apparently often referenced by distros, or at least Gentoo, for answers about things that need such work, like LLVM compatibility.

I can open a PR addressing the first rec but I'm wondering now if we should have more of a full-on page for this, or something like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-buildArea: building the compilerneeds-triageThis issue needs triage to classify its nature and status

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions