pre-push check fails on macOS trying to use a Linux jq binary
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 437
Description
*Title*: pre-push check fails on macOS trying to use a Linux jq binary
*Description*:
The `./ci/do_ci.sh check_proto_format` script on macOS is attempting to use a Linux `jq` which fails for obvious reasons.
*Repro steps*:
- Fresh clone of `envoyproxy/envoy` on a macOS Apple Silicon host
- Setup git hooks as documented via `./support/bootstrap`
- Create a branch and push a dummy commit
*Logs*:
```
akamath@macbook-pro envoy % ./ci/do_ci.sh check_proto_format
ENVOY_SRCDIR=/Users/akamath/Documents/dev/envoy
ENVOY_BUILD_TARGET=//source/exe:envoy-static
ENVOY_BUILD_ARCH=arm64
BUILD_DIR not set - defaulting to ~/.cache/envoy-bazel
Setting test_tmpdir to /Users/akamath/.cache/envoy-bazel/tmp.
building for arm64
clang toolchain configured: clang
Check proto format ...
INFO: Analyzed target //tools/proto_format:proto_sync (847 packages loaded, 19110 targets configured).
ERROR: /Users/akamath/Documents/dev/envoy/tools/proto_format/BUILD:44:3: Jq tools/proto_format/proto_targets.json [for tool] failed: (Exit 126): bash failed: error executing Jq command (from target //tools/proto_format:proto_targets)
(cd /Users/akamath/.cache/envoy-bazel/bazel_root/base/sandbox/darwin-sandbox/8/execroot/envoy && \
exec env - \
/bin/bash -c 'external/jq_linux_arm64/jq -sR '\''
split("
") | map(select(length>0))
'\'' '\''bazel-out/darwin_arm64-opt-exec-ST-c559125b5957/bin/tools/proto_format/active_proto_targets_txt.json'\'' '\''bazel-out/darwin_arm64-opt-exec-ST-c559125b5957/bin/tools/proto_format/frozen_proto_targets_txt.json'\'' > bazel-out/darwin_arm64-opt-exec-ST-c559125b5957/bin/tools/proto_format/proto_targets.json')
# Configuration: f3a171bc8331aee48b7d20e4e861346c252fd6f55138fdbb3d96cca93b1894da
# Execution platform: //bazel/platforms/rbe:linux_arm64
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/bin/bash: external/jq_linux_arm64/jq: cannot execute binary file
Target //tools/proto_format:proto_sync failed to build
INFO: Elapsed time: 0.965s, Critical Path: 0.45s
INFO: 28 processes: 482 action cache hit, 25 internal, 3 darwin-sandbox.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
akamath@macbook-pro envoy %
```
Contributor guide
Research direction
Start with ci/do_ci.sh check_proto_format and tools/proto_format/BUILD, then inspect how the jq tool is selected during the macOS Apple Silicon build. Reproduce the failure with ./ci/do_ci.sh check_proto_format after ./support/bootstrap; done means the check completes successfully on that host without attempting to execute an incompatible Linux jq binary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, shell
- Domain
- build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100