summaryrefslogtreecommitdiff
path: root/lang/rust/update.sh
blob: 64ac7180b0b77f19deb358264dabcdd96cab0115 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# Requires: pkg install portfmt yq
# Run in lang/rust
set -eu

fetch -qo /tmp/channel-rust-stable.toml https://dev-static.rust-lang.org/dist/channel-rust-stable.toml
version=$(</tmp/channel-rust-stable.toml tomlq -r '.pkg.rustc.version | split(" ")[0]')
new_commit=$(</tmp/channel-rust-stable.toml tomlq -r '.pkg.rustc.git_commit_hash')
rm /tmp/channel-rust-stable.toml

fetch -qo - https://raw.githubusercontent.com/rust-lang/rust/${new_commit}/src/stage0.json | jq -r '
	"BOOTSTRAPS_DATE=\(.compiler.date)",
	"RUST_BOOTSTRAP_VERSION=\(.compiler.version)"
' | portedit merge -i .

sed -i '' -E -e "s,(\\$\\{RUST_DEFAULT\\}>=).*(:lang/\\$\\{RUST_DEFAULT\\}),\\1${version}\\2," \
	../../Mk/Uses/cargo.mk ../../Mk/bsd.gecko.mk

portedit set-version -i "${version}" .
portedit set-version -i "${version}" ../rust-bootstrap

make makesum
make -C ../rust-bootstrap makesum

echo "lang/rust: Update to ${version}

https://blog.rust-lang.org/FIXME/Rust-${version}.html

PR:		FIXME
Exp-run by:	antoine
Differential Revision:	FIXME" >rust.msg