1
hermetic_cc_toolchain/build-and-file

14 lines
374 B
Bash
Executable File

#!/bin/bash
# 'bazel' binary is stored in $HOME in builds.sr.ht.
export PATH=$PATH:$HOME
# -o pipefail fails `bazel aquery ...`: it errs if it can't output to stdout.
set -xeu
bazel build "$@"
execpath=$(bazel aquery "$@" 2>/dev/null | \
awk "/action 'GoLink/{f=1};/Outputs: / &&f{print;exit}" | \
awk -F'\\[|\\]' '{print $2}')
file "$execpath" | tee /dev/stderr