Skip to content

Possible solution for train date and version #18

@RivenSkaye

Description

@RivenSkaye

This comment mentions parsing the static manifests page for acquiring an exact release date. While feasible, that resource seems to always be a week behind compared to the actual releases.

Parsing it is still possible though, and I do have something that mostly works hidden beneath

There are two dates that are relatively easy to acquire from there

  1. The date assigned to the channel release, in ISO-8601 format (YYYY-MM-DD, currently 2023-06-26)
  2. The date inside the manifest TOML, which lists when the last contributing commit was made as well as a version number (`version = "0.72.0-beta.4 (cfd3bbd8f 2023-06-08)"`, which seems to follow some semver logic wrt beta numbering being 0.x.y)

Assuming 1, it's as simple as

tmpvar=$(curl -s https://static.rust-lang.org/manifests.txt | grep -i beta | tail -1)
beta_date=${tmpvar:26:10}

2 becomes slightly more complex, since it requires grabbing whatever the last beta release is

tomlurl=$(curl -s https://static.rust-lang.org/manifests.txt | grep -i beta | tail -1)
versionline=$(curl -s $tomlurl | grep -i version | sed -n '2p')  # I tried grabbing both in one line, but something's tripping up curl
commit_date=$([[ $versionline =~ ([0-9][0-9]+\-[0-9]+\-[0-9+][^\)]) ]] ; echo ${BASH_REMATCH[1]})  # 2023-06-08
version=$([[ $versionline =~ ([0-9]+\.[0-9]+\.[0-9]+\-beta\.[0-9]+) ]] ; echo ${BASH_REMATCH[1]})  # 0.72.0-beta.4

Of course, whatever components aren't necessary can be stripped off before use, e.g.

relver=${version:2}
cat <<EOS > beta
[toolchain]
channel = "1.${relver%.*}"
EOS

That said, the current beta version reports as being 72.0-beta.4 (cfd3bbd8f 2023-06-08), but upon installing it rustup reports rustc 1.71.0-beta.4 (dbf31f17d 2023-06-24). The static list also doesn't list any nightly builds after 2023-07-02, which seems to imply
  • it's always a full week behind
  • beta version numbers are incremented sooner than stable (maybe @ breakage freeze?)
  • beta versions start with a different major version identifier

So perhaps it's best to abandon this idea? Does make me wonder where rustup gets its manifest information from though

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions