nandi/jolt-nativepublic Fork 0
726f7c6204744da1ec206370a11b6c8d5e00c669
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 · 32 lines · 1.3 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#
Cross-compile for Android, with an NDK nobody has to install 14a30c0 nandi 19d ago9# $1 is the directory the tarball unpacked into and $2 the sysroot to use;
10# buck passes both because neither is knowable from inside the script. The
11# sysroot is a separate argument rather than something built from a triple
12# here: cross-compiling needs two libstds stitched into one directory, and
13# that stitching is an artifact of its own (toolchains//dist:android-sysroot).
Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago14set -e
15dist=$1
Cross-compile for Android, with an NDK nobody has to install 14a30c0 nandi 19d ago16sysroot=$2
Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago17shift 2
18
19# The dist tarball keeps its components in sibling directories, so the
20# compiler's own default sysroot (rustc/) holds no libstd — it lives under
Cross-compile for Android, with an NDK nobody has to install 14a30c0 nandi 19d ago21# rust-std-<triple>/, which is what buck names above. The codegen libraries are
22# found by rpath relative to the binary, so only the sysroot has to be named.
Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago23#
24# Callers that set their own win: buck's rustc_cfg action passes an empty
25# --sysroot, and rustc refuses the option twice.
26for arg do
27 case $arg in
28 --sysroot|--sysroot=*) exec "$dist/rustc/bin/rustc" "$@" ;;
29 esac
30done
31
Cross-compile for Android, with an NDK nobody has to install 14a30c0 nandi 19d ago32exec "$dist/rustc/bin/rustc" --sysroot "$sysroot" "$@"