nandi/jolt-nativepublic Fork 0
8cf1b3347ef6fa83297b6866dfd47d2728d4e339
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

rustc.sh · 29 lines · 1.1 KBBash Blame HistoryRaw
Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago1#!/bin/sh
2# rustc out of the dist tarball buck fetched, with the sysroot stitched on.
3#
4# The same job scripts/rustc does, said in a way buck can ship: the wrapper and
5# the tarball are both inputs to every action that runs it, so the compiler's
6# identity is part of the action's cache digest and a remote worker can be
7# handed the whole thing.
8#
9# $1 is the directory the tarball unpacked into, $2 the target triple; buck
10# passes both because neither is knowable from inside the script.
11set -e
12dist=$1
13triple=$2
14shift 2
15
16# The dist tarball keeps its components in sibling directories, so the
17# compiler's own default sysroot (rustc/) holds no libstd — it lives under
18# rust-std-<triple>/. The codegen libraries are found by rpath relative to the
19# binary, so only the sysroot has to be named.
20#
21# Callers that set their own win: buck's rustc_cfg action passes an empty
22# --sysroot, and rustc refuses the option twice.
23for arg do
24 case $arg in
25 --sysroot|--sysroot=*) exec "$dist/rustc/bin/rustc" "$@" ;;
26 esac
27done
28
29exec "$dist/rustc/bin/rustc" --sysroot "$dist/rust-std-$triple" "$@"