google-deepmind / code_contests

Apache License 2.0
2.1k stars 207 forks source link

Can't compile with clang 14 and gcc 12 #29

Open TheExGenesis opened 1 year ago

TheExGenesis commented 1 year ago

On Ubuntu 20.04.5 LTS. clang and gcc versions:

(base) root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# clang --version
Ubuntu clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
(base) root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# gcc --version
gcc (GCC) 12.2.1 20230316
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling with --sandbox-debug throws the following:

INFO: Analyzed target //:print_names_and_sources (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
INFO: From Compiling uncompr.c [for tool]:
1678978886.148520003: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1678978886.148547135: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1678978886.148751419: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 1198220
1678978886.150589322: src/main/tools/linux-sandbox-pid1.cc:681: Pid1Main started
1678978886.150708683: src/main/tools/linux-sandbox-pid1.cc:285: working dir: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/13/execroot/__main__
1678978886.150719944: src/main/tools/linux-sandbox-pid1.cc:320: writable: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/13/execroot/__main__
1678978886.150725004: src/main/tools/linux-sandbox-pid1.cc:320: writable: /tmp
1678978886.150729413: src/main/tools/linux-sandbox-pid1.cc:320: writable: /dev/shm
1678978886.150772556: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /
1678978886.150777365: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev
1678978886.150781042: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/pts
1678978886.150784710: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.150788196: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/hugepages
1678978886.150791843: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/mqueue
1678978886.150795510: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run
1678978886.150798876: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/lock
1678978886.150802673: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/snapd/ns
1678978886.150806702: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/0
1678978886.150810940: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys
1678978886.150814096: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/security
1678978886.150818915: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup
1678978886.150822712: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/unified
1678978886.150850987: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/systemd
1678978886.150854844: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/perf_event
1678978886.150858461: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/memory
1678978886.150862329: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/net_cls,net_prio
1678978886.150866036: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/hugetlb
1678978886.150869443: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/blkio
1678978886.150873039: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/rdma
1678978886.150876867: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpu,cpuacct
1678978886.150880293: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpuset
1678978886.150883811: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/devices
1678978886.150887207: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/freezer
1678978886.150890754: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/pids
1678978886.150894380: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/pstore
1678978886.150917565: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/bpf
1678978886.150921433: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/debug
1678978886.150925461: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/tracing
1678978886.150929308: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/config
1678978886.150933275: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/fuse/connections
1678978886.150937874: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc
1678978886.150941742: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.150948445: src/main/tools/linux-sandbox-pid1.cc:422: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored
1678978886.150964867: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.150969054: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/17950
1678978886.150972571: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1822
1678978886.150976539: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /boot/efi
1678978886.150980387: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/22753
1678978886.150983723: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1828
1678978886.150986699: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/18357
1678978886.150995996: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/24061
1678978886.150999293: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core18/2714
1678978886.151002930: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/google-cloud-cli/115
1678978886.151006817: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/13/execroot/__main__
1678978886.151010474: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/13/execroot/__main__
1678978886.151013780: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /tmp
1678978886.151017098: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.151034200: src/main/tools/linux-sandbox-pid1.cc:491: calling fork...
1678978886.151122981: src/main/tools/linux-sandbox-pid1.cc:521: child started with PID 2
1678978886.151283460: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
1678978886.194077801: src/main/tools/linux-sandbox-pid1.cc:538: wait returned pid=2, status=0x00
1678978886.194090306: src/main/tools/linux-sandbox-pid1.cc:556: child exited normally with code 0
1678978886.215912775: src/main/tools/linux-sandbox.cc:233: child exited normally with code 0
INFO: From Executing genrule @com_google_protobuf//:protos_python_genrule:
1678978886.165345861: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1678978886.165386129: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1678978886.165609529: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 1198227
1678978886.179718849: src/main/tools/linux-sandbox-pid1.cc:681: Pid1Main started
1678978886.179803333: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
1678978886.179886242: src/main/tools/linux-sandbox-pid1.cc:285: working dir: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/15/execroot/__main__
1678978886.179905720: src/main/tools/linux-sandbox-pid1.cc:320: writable: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/15/execroot/__main__
1678978886.179910709: src/main/tools/linux-sandbox-pid1.cc:320: writable: /tmp
1678978886.179915017: src/main/tools/linux-sandbox-pid1.cc:320: writable: /dev/shm
1678978886.179970775: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /
1678978886.179975705: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev
1678978886.179979492: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/pts
1678978886.179983179: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.179986596: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/hugepages
1678978886.179990273: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/mqueue
1678978886.179994091: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run
1678978886.179997307: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/lock
1678978886.180000934: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/snapd/ns
1678978886.180004921: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/0
1678978886.180008979: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys
1678978886.180012276: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/security
1678978886.180017706: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup
1678978886.180021944: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/unified
1678978886.180052012: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/systemd
1678978886.180056210: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/perf_event
1678978886.180059967: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/memory
1678978886.180064235: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/net_cls,net_prio
1678978886.180068083: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/hugetlb
1678978886.180071770: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/blkio
1678978886.180075357: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/rdma
1678978886.180079044: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpu,cpuacct
1678978886.180082601: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpuset
1678978886.180086157: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/devices
1678978886.180089685: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/freezer
1678978886.180093182: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/pids
1678978886.180096828: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/pstore
1678978886.180122948: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/bpf
1678978886.180127448: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/debug
1678978886.180131485: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/tracing
1678978886.180135453: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/config
1678978886.180139280: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/fuse/connections
1678978886.180144189: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc
1678978886.180148098: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.180165029: src/main/tools/linux-sandbox-pid1.cc:422: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored
1678978886.180172164: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.180176312: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/17950
1678978886.180179978: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1822
1678978886.180183926: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /boot/efi
1678978886.180187814: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/22753
1678978886.180191180: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1828
1678978886.180194246: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/18357
1678978886.180204455: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/24061
1678978886.180208023: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core18/2714
1678978886.180211730: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/google-cloud-cli/115
1678978886.180215427: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/15/execroot/__main__
1678978886.180219064: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/15/execroot/__main__
1678978886.180222240: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /tmp
1678978886.180225306: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.180242158: src/main/tools/linux-sandbox-pid1.cc:491: calling fork...
1678978886.180365196: src/main/tools/linux-sandbox-pid1.cc:521: child started with PID 2
1678978886.213271193: src/main/tools/linux-sandbox-pid1.cc:538: wait returned pid=2, status=0x00
1678978886.213283807: src/main/tools/linux-sandbox-pid1.cc:556: child exited normally with code 0
1678978886.247837291: src/main/tools/linux-sandbox.cc:233: child exited normally with code 0
ERROR: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/external/com_google_protobuf/BUILD:513:10: Compiling src/google/protobuf/compiler/main.cc [for tool] failed: (Exit 1): linux-sandbox failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__ && \
  exec env - \
    LD_LIBRARY_PATH=/root/install/gcc-12/lib/../lib64: \
    PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-6.1.1-linux-x86_64/bin:~/install/gcc-12/bin/gcc:/root/install/gcc-12/bin:/usr/local/cuda/bin:/root/.vscode-server/bin/e2816fe719a4026ffa1ee0189dc89bdfdbafb164/bin/remote-cli:/root/anaconda3/bin:/root/anaconda3/condabin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /root/.cache/bazel/_bazel_root/install/e63ada1a9406bff70c6efc9d97c3aeba/linux-sandbox -t 15 -w /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__ -w /tmp -w /dev/shm -S /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/stats.out -D -- /usr/lib/llvm-14/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protoc/main.d '-frandom-seed=bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protoc/main.o' '-DBAZEL_CURRENT_REPOSITORY="com_google_protobuf"' -iquote external/com_google_protobuf -iquote bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf -iquote external/zlib -iquote bazel-out/k8-opt-exec-2B5CBBC6/bin/external/zlib -iquote external/bazel_tools -iquote bazel-out/k8-opt-exec-2B5CBBC6/bin/external/bazel_tools -isystem external/com_google_protobuf/src -isystem bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src -isystem external/zlib -isystem bazel-out/k8-opt-exec-2B5CBBC6/bin/external/zlib -g0 -g0 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/compiler/main.cc -o bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protoc/main.o)
1678978886.142680495: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1678978886.142709432: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1678978886.142941359: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 1198218
1678978886.151704492: src/main/tools/linux-sandbox-pid1.cc:681: Pid1Main started
1678978886.151750582: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
1678978886.151853319: src/main/tools/linux-sandbox-pid1.cc:285: working dir: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__
1678978886.151862386: src/main/tools/linux-sandbox-pid1.cc:320: writable: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__
1678978886.151867036: src/main/tools/linux-sandbox-pid1.cc:320: writable: /tmp
1678978886.151870613: src/main/tools/linux-sandbox-pid1.cc:320: writable: /dev/shm
1678978886.151898045: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /
1678978886.151902944: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev
1678978886.151906723: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/pts
1678978886.151910179: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.151913305: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/hugepages
1678978886.151917212: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/mqueue
1678978886.151920849: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run
1678978886.151924106: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/lock
1678978886.151927613: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/snapd/ns
1678978886.151931219: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/0
1678978886.151934906: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys
1678978886.151937972: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/security
1678978886.151942271: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup
1678978886.151946148: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/unified
1678978886.151961027: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/systemd
1678978886.151964915: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/perf_event
1678978886.151968572: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/memory
1678978886.151972409: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/net_cls,net_prio
1678978886.151976066: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/hugetlb
1678978886.151979592: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/blkio
1678978886.151983030: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/rdma
1678978886.151986616: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpu,cpuacct
1678978886.151990093: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpuset
1678978886.151993519: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/devices
1678978886.151996936: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/freezer
1678978886.152000493: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/pids
1678978886.152004170: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/pstore
1678978886.152018337: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/bpf
1678978886.152021915: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/debug
1678978886.152025501: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/tracing
1678978886.152029008: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/config
1678978886.152032454: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/fuse/connections
1678978886.152036412: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc
1678978886.152040290: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.152048335: src/main/tools/linux-sandbox-pid1.cc:422: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored
1678978886.152056531: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.152060389: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/17950
1678978886.152063605: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1822
1678978886.152067262: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /boot/efi
1678978886.152070758: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/22753
1678978886.152073744: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1828
1678978886.152076710: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/18357
1678978886.152085337: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/24061
1678978886.152088493: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core18/2714
1678978886.152091729: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/google-cloud-cli/115
1678978886.152095235: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__
1678978886.152098743: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__
1678978886.152102169: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /tmp
1678978886.152105485: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.152118250: src/main/tools/linux-sandbox-pid1.cc:491: calling fork...
1678978886.152215568: src/main/tools/linux-sandbox-pid1.cc:521: child started with PID 2
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:31:
external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h:40:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
1 error generated.
1678978886.234147709: src/main/tools/linux-sandbox-pid1.cc:538: wait returned pid=2, status=0x100
1678978886.234162178: src/main/tools/linux-sandbox-pid1.cc:556: child exited normally with code 1
1678978886.263911448: src/main/tools/linux-sandbox.cc:233: child exited normally with code 1
Target //:print_names_and_sources failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.377s, Critical Path: 0.16s
INFO: 7 processes: 5 internal, 2 linux-sandbox.
FAILED: Build did NOT complete successfully
TheExGenesis commented 1 year ago

Managed to compile after doing the following:

apt-get install libc++-dev
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" | sudo tee -a /etc/apt/sources.list
apt-get update
apt-get install libc++-14-dev libc++abi-14-dev
export BAZEL_CXXOPTS="-stdlib=libc++:-I/usr/include/c++/v1/"
export BAZEL_LINKOPTS="-stdlib=libc++:-lc++abi"