Workaround for using shell on arm64 Darwin causes issues with process substitution
This workaround causes an issue on Mac when labgrid uses rules_python version 1.6.3 and higher.
# A workaround for invoking APE binaries on Apple Silicon # https://github.com/jart/cosmopolitan?tab=readme-ov-file#shells if machine() == "arm64" and system() == "Darwin": cmd = (which("sh"), *cmd)
A bit elusive as it shows up as a syntax error issue. Errors can look like:
ERROR: test/plans/mvp/BUILD.bazel:76:9: LabGridRunBinary test/plans/mvp/MVP_SCENARIO_3_LOCALHOST-process-results.xml failed: (Exit 2): executor failed: error executing LabGridRunBinary command (from target //test/plans/mvp:MVP_SCENARIO_3_LOCALHOST-process)
(cd /private/var/tmp/_bazel_petmoo01/9dfdab82187c0fa05e6c92640e63d57a/sandbox/darwin-sandbox/38/execroot/_main && \
exec env - \
ARTIFACTORY_API_KEY='' \
ARTIFACTORY_USER_EMAIL='' \
MONGO_TLS_CA_FILE=/usr/local/share/ca-certificates/global-bundle.crt \
PATH=/bin:/usr/bin:/usr/local/bin \
PYTHONUNBUFFERED=1 \
bazel-out/darwin_arm64-opt-exec-ST-4b216e2ffc40/bin/external/rules_labgrid+/labgrid/executor/executor -- bazel-out/darwin_arm64-opt-exec-ST-4b216e2ffc40/bin/system_tests/main-process --test-cases system_tests.implementations.test_cases.mvp.mvp.MvpTestCase --result-format junit --result-file bazel-out/darwin_arm64-fastbuild-ST-65718626ef9b/bin/test/plans/mvp/MVP_SCENARIO_3_LOCALHOST-process-results.xml --output-workspace bazel-out/darwin_arm64-fastbuild-ST-65718626ef9b/bin/test/plans/mvp/MVP_SCENARIO_3_LOCALHOST-process-workspace --no-bad-exit --testcase-parameters bazel-out/darwin_arm64-fastbuild-ST-65718626ef9b/bin/test/plans/mvp/MVP_SCENARIO_3_LOCALHOST-process-testcase_parameters.json --platform-parameters bazel-out/darwin_arm64-fastbuild-ST-65718626ef9b/bin/test/plans/mvp/MVP_SCENARIO_3_LOCALHOST-process-platform_parameters.json --downloads bazel-out/darwin_arm64-fastbuild-ST-65718626ef9b/bin/test/plans/mvp/MVP_SCENARIO_3_LOCALHOST-process-downloads.json --console-logging-level debug --input-workspace bazel-out/darwin_arm64-fastbuild-ST-65718626ef9b/bin/test/plans/mvp/MVP_SCENARIO_3_LOCALHOST-preprocess-workspace process)
# Configuration: b3c6dafd3caeb7270b7aa43bacc373e8ddada2c0f038303f7894a3055e922c77
# Execution platform: @@platforms//host:host
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
bazel-out/darwin_arm64-opt-exec-ST-4b216e2ffc40/bin/system_tests/main-process: line 213: syntax error near unexpected token `<'
Target //test/plans/mvp:MVP_SCENARIO_3_LOCALHOST failed to build
Edited by Alex Tercete