crosvm/infra/cipd/package_rustup-init.sh
Dennis Kempin 323d267a8c infra: Add build_windows recipe
Refactors the crosvm recipe API a little to provide 3 different
environments for builds: Just the source, building with containers
and building on the host.

For building on the host, we will install rustup-init via CIPD and
then use rustup to install the required rust version.

BUG=b:233914170
TEST=./recipes.py run build_windows

Change-Id: I12ef22f286af584edeb02beed4d231565b698099
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3718900
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-01 20:11:59 +00:00

27 lines
835 B
Bash
Executable file

#!/usr/bin/env bash
# Copyright 2022 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -ex
BUILD_DIR=$(mktemp -d)
cd "$BUILD_DIR" || exit 1
CIPD_ARGS=(
-pkg-var "description:rustup-init to set up rustup.rs"
-install-mode copy
-ref latest
)
RUSTUP_WIN="https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe"
RUSTUP_LINUX="https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init"
cd $(mktemp -d)
wget "$RUSTUP_WIN" -O "rustup-init.exe"
cipd create -in "." -name "crosvm/rustup-init/windows-amd64" "${CIPD_ARGS[@]}"
cd $(mktemp -d)
wget "$RUSTUP_LINUX" -O "rustup-init"
chmod +x "rustup-init"
cipd create -in "." -name "crosvm/rustup-init/linux-amd64" "${CIPD_ARGS[@]}"