Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a helper script to find rustc archives #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nalysius
Copy link

The script looks for rustc archives on the server.

When it finds an archive, it downloads it in /tmp/build-rust-archives/, prints the Rust version contained inside and the URL to use in "distfiles_rustc_base" to build this version.

Example: listing the beta archives published between the 1st and the end of March 2024.

$ ./find-rustc-archives.sh 3 2024 1 beta
Downloading https://static.rust-lang.org/dist/2024-03-02/rustc-beta-src.tar.gz at /tmp/build-rust-archives/2024-03-02/rustc-beta-src.tar.gz...
Extracting version file from rustc-beta-src.tar.gz...
1.77.0-beta.6 (2c9c76411 2024-03-01), https://static.rust-lang.org/dist/2024-03-02

Downloading https://static.rust-lang.org/dist/2024-03-07/rustc-beta-src.tar.gz at /tmp/build-rust-archives/2024-03-07/rustc-beta-src.tar.gz...
Extracting version file from rustc-beta-src.tar.gz...
1.77.0-beta.7 (339fb6965 2024-03-06), https://static.rust-lang.org/dist/2024-03-07

Downloading https://static.rust-lang.org/dist/2024-03-16/rustc-beta-src.tar.gz at /tmp/build-rust-archives/2024-03-16/rustc-beta-src.tar.gz...
Extracting version file from rustc-beta-src.tar.gz...
1.77.0-beta.8 (2bcca41ad 2024-03-15), https://static.rust-lang.org/dist/2024-03-16

Downloading https://static.rust-lang.org/dist/2024-03-17/rustc-beta-src.tar.gz at /tmp/build-rust-archives/2024-03-17/rustc-beta-src.tar.gz...
Extracting version file from rustc-beta-src.tar.gz...
1.77.0-beta.9 (28fd269a5 2024-03-16), https://static.rust-lang.org/dist/2024-03-17

Downloading https://static.rust-lang.org/dist/2024-03-19/rustc-beta-src.tar.gz at /tmp/build-rust-archives/2024-03-19/rustc-beta-src.tar.gz...
Extracting version file from rustc-beta-src.tar.gz...
1.78.0-beta.1 (efd9d2df1 2024-03-18), https://static.rust-lang.org/dist/2024-03-19

Downloading https://static.rust-lang.org/dist/2024-03-24/rustc-beta-src.tar.gz at /tmp/build-rust-archives/2024-03-24/rustc-beta-src.tar.gz...
Extracting version file from rustc-beta-src.tar.gz...
1.78.0-beta.2 (277d06bc9 2024-03-23), https://static.rust-lang.org/dist/2024-03-24

It doesn't re-download archives. A second call only prints the versions.

$ ./find-rustc-archives.sh 3 2024 1 beta
1.77.0-beta.6 (2c9c76411 2024-03-01), https://static.rust-lang.org/dist/2024-03-02

1.77.0-beta.7 (339fb6965 2024-03-06), https://static.rust-lang.org/dist/2024-03-07

1.77.0-beta.8 (2bcca41ad 2024-03-15), https://static.rust-lang.org/dist/2024-03-16

1.77.0-beta.9 (28fd269a5 2024-03-16), https://static.rust-lang.org/dist/2024-03-17

1.78.0-beta.1 (efd9d2df1 2024-03-18), https://static.rust-lang.org/dist/2024-03-19

1.78.0-beta.2 (277d06bc9 2024-03-23), https://static.rust-lang.org/dist/2024-03-24

The script looks for rustc archives on the server. Archives are sorted
by dates, so the script iterates over days in a month to find them.

When it finds an archive, it downloads it in /tmp, prints the Rust
version contained inside and the URL to use in "distfiles_rustc_base"
to build this version.
@nalysius nalysius marked this pull request as draft March 28, 2024 08:21
The script used to depend on non-zero return code to detect
incomplete archive, but it prevented to use the -e ksh flag.

Now the size of the archive is compared to the one coming from
the HTTP response, and the script doesnt' depend on errors anymore.
@nalysius nalysius marked this pull request as ready for review March 28, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant