Channel should not default to dev when built from a tarball

685f565
Opened by Brian Anderson at 2024-10-13 23:32:54

Today whenever Rust is built without a .git directory (approximately meaning "when it's built from a tarball") the configure script overrides the release channel to "stable", per this PR and this issue. Unfortunately, as I realized after a recent bug in which nightly distcheck thought it was a stable compiler this is not correct. Today, if somebody downloads a nightly tarball and builds it, they will receive a compiler that claims to be a stable release. This is just not true.

I'm not sure how best to fix this. The configure script is the source of truth for the release channel, and the configure script is not telling the truth.

Here's one thing we could do: the build process that produces the tarball also dumps a version file into the source tree, and the release channel can be derived from that file. So when the configure script sees that it is not in a git repo it opens that file and looks for "-nightly", "-beta", or "-dev" and sets the release channel as appropriate. If it sees none of those it sets the channel to "stable". If the version file does not exist it sets the channel to "dev".

cc @alexcrichton

  1. Agreed that a nightly tarball should produce a nightly compiler (as should a beta tarball produce a beta compiler).

    Also agree that we're gonna have to dump a version file in the source tree, and absence means "dev". I think we can emit it during the packaging steps, so shouldn't be too hard? Basically whenever we copy the license we can also copy a version file.

    Alex Crichton at 2016-09-26 22:42:15

  2. That file exists today as src/ci/version. ./configure is no longer hard-coding stable; instead it doesn't configure the channel, so bootstrap uses the default of dev. Unfortunately that channel file also exists in the normal source tree, so using it unconditionally in bootstrap doesn't seem right. Maybe we can use it only for ./configure, though?

    jyn at 2023-02-03 08:44:10