2021-06-19 16:45:33 +03:00
|
|
|
#!/bin/bash
|
|
|
|
# 'bazel' binary is stored in $HOME in builds.sr.ht.
|
|
|
|
export PATH=$PATH:$HOME
|
|
|
|
|
2021-06-19 16:48:26 +03:00
|
|
|
set -xeuo pipefail
|
2021-06-19 16:45:33 +03:00
|
|
|
|
2021-06-19 16:48:26 +03:00
|
|
|
bazel build "$@"
|
2021-06-19 16:45:33 +03:00
|
|
|
execpath=$(bazel aquery "$@" 2>/dev/null | \
|
|
|
|
awk "/action 'GoLink/{f=1};/Outputs: / &&f{print;exit}" | \
|
|
|
|
awk -F'\\[|\\]' '{print $2}')
|
|
|
|
|
|
|
|
file "$execpath" | tee /dev/stderr
|