nandi/jolt-nativepublic Fork 0
a7f62025fc9a5a5db4edb9a6ba6808dc31f7596b
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.

zcc.sh · 30 lines · 938 BBash Blame HistoryRaw
Make the C toolchain a dependency too, so zig travels with the action 6391496 nandi 19d ago1#!/bin/sh
2# zig, as the C toolchain, out of the tarball buck fetched.
3#
4# The buck-side twin of scripts/zcc, and the same argument rewriting: cc-rs
5# builds a `--target=` from the Rust triple, which carries a vendor field —
6# `x86_64-unknown-linux-gnu`. zig's own triples have no vendor, and it refuses
7# the whole query rather than ignoring the part it does not want, reporting
8# "unable to parse target query: UnknownOperatingSystem" as though Linux were
9# the problem.
10#
11# $1 is the directory the tarball unpacked into and $2 the zig subcommand — cc,
12# c++, ar or ranlib. buck passes both; nothing here can work them out.
13set -e
14zig=$1/zig
15mode=$2
16shift 2
17
18for arg do
19 case $arg in
20 --target=*-unknown-linux-*)
21 set -- "$@" "$(printf '%s' "$arg" | sed 's/-unknown-linux-/-linux-/')"
22 shift
23 continue
24 ;;
25 esac
26 set -- "$@" "$arg"
27 shift
28done
29
30exec "$zig" "$mode" "$@"