Skip to content

Commit

Permalink
build helper: update build helper to work with 1.15
Browse files Browse the repository at this point in the history
With rust 1.15, a few artifacts moved around and there were some
bad assumptions with how we did things previously which ended up
causing problems.  This commits eliminates enough assumptions about
how things are structured to get things working again.

Signed-off-by: Paul Osborne <osbpau@gmail.com>
  • Loading branch information
posborne committed Feb 3, 2017
1 parent db5891d commit e3b2fe6
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions build-new-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if [ -z "$TARGET_VERSION" ]; then
exit 1
fi

CHANNEL_FILE="channel-rust-${TARGET_VERSION}.toml"

TMPDIR=`mktemp -p $PWD -d`
cd "$TMPDIR"

Expand Down Expand Up @@ -63,18 +65,29 @@ get_rust_sha256sum() {
get_sha256sum ${component}-${TARGET_VERSION}-${triple}.tar.gz
}

cargo_url() {
local triple="$1"
grep -A 3 "pkg.cargo.target.${triple}" ${CHANNEL_FILE} | \
grep '^url =' | \
cut -d '=' -f2 | \
tr -d '"'
}

cargo_version() {
cargo_url x86_64-unknown-linux-gnu | rev | cut -d'/' -f2 | rev | tr -d '-'
}

cargo_filename() {
local triple="$1"
cargo_url $triple | rev | cut -d'/' -f1 | rev
}

download_files() {
# channel file
local channel_file="channel-rust-${TARGET_VERSION}.toml"
wget https://static.rust-lang.org/dist/${channel_file}
wget https://static.rust-lang.org/dist/${CHANNEL_FILE}

# cargo for each supported host triple
for triple in $RUSTC_TRIPLES; do
url=$(grep -A 3 "pkg.cargo.target.${triple}" ${channel_file} | \
grep '^url =' | \
cut -d '=' -f2 | \
tr -d '"')
wget ${url}
wget $(cargo_url $triple)
done

# rustc
Expand All @@ -88,22 +101,6 @@ download_files() {
done
}

cargo_version() {
grep -A 3 "pkg.cargo.target.x86_64-unknown-linux-gnu" "channel-rust-${TARGET_VERSION}.toml" | \
grep '^url =' | \
cut -d'=' -f2 | \
tr -d '"' | \
rev | \
cut -d'/' -f2 | \
rev | \
tr -d '-'
}

cargo_filename() {
triple="$1"
echo "cargo-nightly-${triple}.tar.gz"
}

write_get_hash() {
cat <<EOF >>${RUST_BIN_RECIPE}
def get_hash(hashes, triple):
Expand Down

0 comments on commit e3b2fe6

Please sign in to comment.