Open PaoloMattachini opened 7 months ago
What are your configurations (bazel build --config=clang_config
)?
What is the Bazel version you're using? Bazel 7 uses toolchain resolution by default so --cpu=cortex-m4
might not work anymore.
Can you provide logs with --verbose_failures
(and without --sandbox_debug
).
clang_config
and clang_config_linux
are defined in .bazelrc file which looks as follow:
build:clang_config --crosstool_top=@tiarm-compiler//ti-cgt-armllvm_2.1.1.LTS-windows:ticlang_suite build:clang_config_linux --crosstool_top=@tiarm-compiler-linux//ti-cgt-armllvm_3.2.1.LTS-linux:ticlang_suite build:clang_config build:clang_config_linux build:clang_config --host_crosstool_top=@bazel_tools//tools/cpp:toolchain/ti-cgt-armllvm_2.1.1.LTS-windows build:clang_config_linux --host_crosstool_top=@bazel_tools//tools/cpp:toolchain/ti-cgt-armllvm_3.2.1.LTS-linux
Output of bazel version
is:
Build label: 6.4.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Oct 19 17:07:43 2023 (1697735263)
Build timestamp: 1697735263
Build timestamp as int: 1697735263
Following logs as requested bazel build --config=clang_config_linux --cpu=cortex-m4 --verbose_failures :osal
Extracting Bazel installation... Starting local Bazel server and connecting to it... INFO: Analyzed target //atacama/platform/osal/src:osal (38 packages loaded, 160 targets configured). INFO: Found 1 target... ERROR: /home/paolo/Documents/Projects/atacama/source/atacama/platform/osal/src/BUILD.bazel:5:11: Compiling atacama/platform/osal/src/osal.c failed: (Exit 1): tiarmclang failed: error executing command (from target //atacama/platform/osal/src:osal) (cd /home/paolo/.cache/bazel/_bazel_paolo/1ef341b3783b27f51df4fb6dfd82d4a9/sandbox/linux-sandbox/1/execroot/Atacama && \ exec env - \ PATH=/home/paolo/.local/bin:/home/paolo/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/Parasoft/cpptest:/snap/bin \ PWD=/proc/self/cwd \ external/tiarm-compiler-linux/ti-cgt-armllvm_3.2.1.LTS-linux/bin/tiarmclang -MD -MF bazel-out/cortex-m4-fastbuild/bin/atacama/platform/osal/src/_objs/osal/osal.d '-frandom-seed=bazel-out/cortex-m4-fastbuild/bin/atacama/platform/osal/src/_objs/osal/osal.o' '-DBAZEL_CURRENT_REPOSITORY=""' -iquote . -iquote bazel-out/cortex-m4-fastbuild/bin '-mcpu=cortex-m4' '-mfloat-abi=hard' -mlittle-endian -mthumb -DSOC_AM64X '-DDEBUG=1' -g -Wall -Wno-gnu-variable-sized-type-not-at-end -Wno-unused-function -MMD -MP -Iextern/os -c atacama/platform/osal/src/osal.c -o bazel-out/cortex-m4-fastbuild/bin/atacama/platform/osal/src/_objs/osal/osal.o)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging src/main/tools/linux-sandbox-pid1.cc:518: "execvp(external/tiarm-compiler-linux/ti-cgt-armllvm_3.2.1.LTS-linux/bin/tiarmclang, 0x11da130)": No such file or directory Target //atacama/platform/osal/src:osal failed to build INFO: Elapsed time: 45.141s, Critical Path: 0.05s INFO: 2 processes: 2 internal. FAILED: Build did NOT complete successfully
Hello, any update on this?
I suspect that the external compiler files are not being placed into the sandbox. Based on the log:
src/main/tools/linux-sandbox-pid1.cc:518: "execvp(external/tiarm-compiler/ti-cgt-armllvm_3.2.1.LTS-windows/bin/tiarmclang, 0xb70150)": No such file or directory
Could you please check if the file external/tiarm-compiler/ti-cgt-armllvm_3.2.1.LTS-windows/bin/tiarmclang
exists in your bazel-<your workspace name>
folder?
Thank you!
Page link:
https://bazel.build/help
Problem description (include actual vs expected text, if applicable):
Hello, I am working on an embedded project developing both on windows 11 and ubuntu 20.04 machines. I set up custom toolchains for both machines, the compiler being tiarmclang.
When I try to build my project on a windows machine with
bazel build --config=clang_config --cpu=cortex-m4 :osal
everything works fine and the project is correctly build.When I try to build it on the linux machine with
bazel build --config=clang_config_linux --cpu=cortex-m4 :osal
I get the following error:ERROR: /home/paolo/Documents/Projects/atacama/source/atacama/platform/osal/src/BUILD.bazel:5:11: Compiling atacama/platform/osal/src/osal.c failed: (Exit 1): linux-sandbox failed: error executing command (cd /home/paolo/.cache/bazel/_bazel_paolo/1ef341b3783b27f51df4fb6dfd82d4a9/sandbox/linux-sandbox/2/execroot/Atacama && \ exec env - \ PATH=/home/paolo/.local/bin:/home/paolo/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/Parasoft/cpptest:/snap/bin \ PWD=/proc/self/cwd \ TMPDIR=/tmp \ /home/paolo/.cache/bazel/_bazel_paolo/install/117cee491f5c7d83be6e3c6d6b5b8ca4/linux-sandbox -t 15 -w /home/paolo/.cache/bazel/_bazel_paolo/1ef341b3783b27f51df4fb6dfd82d4a9/sandbox/linux-sandbox/2/execroot/Atacama -w /tmp -w /dev/shm -S /home/paolo/.cache/bazel/_bazel_paolo/1ef341b3783b27f51df4fb6dfd82d4a9/sandbox/linux-sandbox/2/stats.out -D -- external/tiarm-compiler/ti-cgt-armllvm_2.1.1.LTS-windows/bin/tiarmclang -MD -MF bazel-out/cortex-m4-fastbuild/bin/atacama/platform/osal/src/_objs/osal/osal.d '-frandom-seed=bazel-out/cortex-m4-fastbuild/bin/atacama/platform/osal/src/_objs/osal/osal.o' '-DBAZEL_CURRENT_REPOSITORY=""' -iquote . -iquote bazel-out/cortex-m4-fastbuild/bin '-mcpu=cortex-m4' '-mfloat-abi=hard' -mlittle-endian -mthumb -DSOC_AM64X '-DDEBUG=1' -g -Wall -Wno-gnu-variable-sized-type-not-at-end -Wno-unused-function -MMD -MP -Iextern/os -c atacama/platform/osal/src/osal.c -o bazel-out/cortex-m4-fastbuild/bin/atacama/platform/osal/src/_objs/osal/osal.o) 1705920468.107149918: src/main/tools/linux-sandbox.cc:152: calling pipe(2)... 1705920468.107197408: src/main/tools/linux-sandbox.cc:171: calling clone(2)... 1705920468.107486322: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 5402 1705920468.107517102: src/main/tools/linux-sandbox-pid1.cc:681: Pid1Main started 1705920468.107606060: src/main/tools/linux-sandbox.cc:197: done manipulating pipes 1705920468.107752566: src/main/tools/linux-sandbox-pid1.cc:285: working dir: /home/paolo/.cache/bazel/_bazel_paolo/1ef341b3783b27f51df4fb6dfd82d4a9/sandbox/linux-sandbox/2/execroot/Atacama 1705920468.107775889: src/main/tools/linux-sandbox-pid1.cc:320: writable: /home/paolo/.cache/bazel/_bazel_paolo/1ef341b3783b27f51df4fb6dfd82d4a9/sandbox/linux-sandbox/2/execroot/Atacama 1705920468.107787613: src/main/tools/linux-sandbox-pid1.cc:320: writable: /tmp 1705920468.107795929: src/main/tools/linux-sandbox-pid1.cc:320: writable: /dev/shm 1705920468.107856580: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: / 1705920468.107866366: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev 1705920468.107872455: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/pts 1705920468.107878286: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm 1705920468.107883531: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/hugepages 1705920468.107889400: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/mqueue 1705920468.107895382: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run 1705920468.107900659: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/lock 1705920468.107906551: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/credentials/systemd-sysusers.service 1705920468.107912898: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/rpc_pipefs 1705920468.107918420: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/snapd/ns 1705920468.107924795: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/1000 1705920468.107956594: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/1000/gvfs 1705920468.107963752: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/1000/doc 1705920468.107969789: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys 1705920468.107974717: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/security 1705920468.107983213: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup 1705920468.107989578: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/pstore 1705920468.107995530: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/firmware/efi/efivars 1705920468.108002755: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/bpf 1705920468.108008995: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/debug 1705920468.108015171: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/tracing 1705920468.108020955: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/fuse/connections 1705920468.108027632: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/config 1705920468.108036489: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc 1705920468.108045035: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc 1705920468.108056232: src/main/tools/linux-sandbox-pid1.cc:422: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored 1705920468.108084270: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc 1705920468.108091603: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/fs/nfsd 1705920468.108098347: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/bare/5 1705920468.108104119: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/code/148 1705920468.108109741: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1974 1705920468.108115043: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/2105 1705920468.108119964: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core22/1033 1705920468.108136688: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core22/858 1705920468.108144403: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/firefox/2987 1705920468.108152162: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/gnome-3-38-2004/143 1705920468.108159359: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/gnome-42-2204/120 1705920468.108190716: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/gnome-42-2204/141 1705920468.108200541: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/gtk-common-themes/1535 1705920468.108208724: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snap-store/959 1705920468.108216694: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/20290 1705920468.108224762: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/20671 1705920468.108233737: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /var/snap/firefox/common/host-hunspell 1705920468.108243124: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd-desktop-integration/83 1705920468.108252265: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /boot/efi 1705920468.108261936: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /home/paolo/.cache/bazel/_bazel_paolo/1ef341b3783b27f51df4fb6dfd82d4a9/sandbox/linux-sandbox/2/execroot/Atacama 1705920468.108279343: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /home/paolo/.cache/bazel/_bazel_paolo/1ef341b3783b27f51df4fb6dfd82d4a9/sandbox/linux-sandbox/2/execroot/Atacama 1705920468.108290299: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /tmp 1705920468.108298796: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm 1705920468.108354184: src/main/tools/linux-sandbox-pid1.cc:491: calling fork... 1705920468.108560365: src/main/tools/linux-sandbox-pid1.cc:521: child started with PID 2 src/main/tools/linux-sandbox-pid1.cc:518: "execvp(external/tiarm-compiler/ti-cgt-armllvm_3.2.1.LTS-windows/bin/tiarmclang, 0xb70150)": No such file or directory 1705920468.109168437: src/main/tools/linux-sandbox-pid1.cc:538: wait returned pid=2, status=0x100 1705920468.109178225: src/main/tools/linux-sandbox-pid1.cc:556: child exited normally with code 1 1705920468.109613936: src/main/tools/linux-sandbox.cc:233: child exited normally with code 1 Target //atacama/platform/osal/src:osal failed to build Use --verbose_failures to see the command lines of failed build steps.
I tried as a test to copy the folder 'external' and all of its content inside the sandbox and now bazel can find the compiler. Why is this happening?
Where do you see this issue? (include link to specific section of the page, if applicable)
No response
Any other information you'd like to share?
Output of bazel version:
Build label: 6.4.0 Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Thu Oct 19 17:07:43 2023 (1697735263) Build timestamp: 1697735263 Build timestamp as int: 1697735263