Skip to content

Don't promote binaries between stages #11145

Closed
@brson

Description

@brson

The way the build currently works makes a distinction between the 'host' binaries, which are used only to run the toolchain, and the 'target' binaries, which are targeted by the toolchain. There are separate locations on disk for each. As the build progresses between stages, binaries are promoted from the target directories to the host directories, then the host bins used to build the target bins within the next stage.

This has a few problems:

  • It doesn't make sense for cross compiles in general, since non-build-triple hosts don't need to bootstrap. This works in our only working multi-host cross-compile currently because we're just doing x86->x86_64.
  • It means that programs compiled by rustc cannot (reliably) be used as plugins to rustc itself since they are linking to different versions of libsyntax/librustc. This would make procedural macros pretty difficult.

My preference is to not intermix binaries from different stages, not have the host libraries at all, link rustc to the same target libraries as others in the same stage, use previous stages to build the entirety of the next stage.

This would have it's own bootstrapping issues, and the last time I made this change we decided not to do it because of some new difficulty to the snapshotting/bootstrapping process that I don't recall. But any build arrangement for a self-bootstrapping compiler is going to have difficulties and I think this would be the least surprising way to do the build in general.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions