ill-inc / biomes-game

Biomes is an open source sandbox MMORPG built for the web using web technologies such as Next.js, Typescript, React and WebAssembly.
https://www.biomes.gg
MIT License
2.53k stars 301 forks source link

bazel compile fatal failed: System headers not found #77

Closed snowyu closed 1 year ago

snowyu commented 1 year ago

Relevant system information

What you did

following the https://docs.biomes.gg/docs/basics/running-locally. All is ok, until:

./b data-snapshot run
bazel run --config=release --show_result=0 --ui_event_filters=-INFO --color=yes --curses=yes //src:deploy_all_ts_deps -- ./biomes-game/src/gen
Generating TypeScript dependencies (release)...
Starting local Bazel server and connecting to it...
ERROR: ~/.cache/bazel/_bazel_riceball/397f6ead471743135a6ba8d0c332fb01/external/glslang/BUILD.bazel:93:11: Compiling glslang/GenericCodeGen/Link.cpp [for tool] failed: (Exit 1): clang failed: error executing command (from target @glslang//:glslang) /usr/lib/llvm-17/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 ... (remaining 41 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/glslang/glslang/GenericCodeGen/Link.cpp:39:
external/glslang/glslang/GenericCodeGen/../Include/Common.h:40:10: fatal error: 'algorithm' file not found
   40 | #include <algorithm>
      |          ^~~~~~~~~~~
1 error generated.
ERROR: ~/.cache/bazel/_bazel_riceball/397f6ead471743135a6ba8d0c332fb01/external/glslang/BUILD.bazel:93:11: Compiling glslang/MachineIndependent/InfoSink.cpp [for tool] failed: (Exit 1): clang failed: error executing command (from target @glslang//:glslang) /usr/lib/llvm-17/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 ... (remaining 41 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/glslang/glslang/MachineIndependent/InfoSink.cpp:35:
In file included from external/glslang/glslang/MachineIndependent/../Include/InfoSink.h:38:
external/glslang/glslang/MachineIndependent/../Include/../Include/Common.h:40:10: fatal error: 'algorithm' file not found
   40 | #include <algorithm>
      |          ^~~~~~~~~~~
1 error generated.
ERROR: ~/.cache/bazel/_bazel_riceball/397f6ead471743135a6ba8d0c332fb01/external/glslang/BUILD.bazel:177:11: Compiling SPIRV/InReadableOrder.cpp [for tool] failed: (Exit 1): clang failed: error executing command (from target @glslang//:SPIRV) /usr/lib/llvm-17/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 ... (remaining 53 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/glslang/SPIRV/InReadableOrder.cpp:51:
external/glslang/SPIRV/spvIR.h:52:10: fatal error: 'algorithm' file not found
   52 | #include <algorithm>
      |          ^~~~~~~~~~~
1 error generated.
ERROR: ~/.cache/bazel/_bazel_riceball/397f6ead471743135a6ba8d0c332fb01/external/glslang/BUILD.bazel:177:11: Compiling SPIRV/disassemble.cpp [for tool] failed: (Exit 1): clang failed: error executing command (from target @glslang//:SPIRV) /usr/lib/llvm-17/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 ... (remaining 53 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/glslang/SPIRV/disassemble.cpp:39:10: fatal error: 'cstdlib' file not found
   39 | #include <cstdlib>
      |          ^~~~~~~~~
1 error generated.
ERROR: ~/.cache/bazel/_bazel_riceball/397f6ead471743135a6ba8d0c332fb01/external/glslang/BUILD.bazel:177:11: Compiling SPIRV/SPVRemapper.cpp [for tool] failed: (Exit 1): clang failed: error executing command (from target @glslang//:SPIRV) /usr/lib/llvm-17/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 ... (remaining 53 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/glslang/SPIRV/SPVRemapper.cpp:36:
external/glslang/SPIRV/SPVRemapper.h:39:10: fatal error: 'string' file not found
   39 | #include <string>
      |          ^~~~~~~~
1 error generated.
FAILED: Build did NOT complete successfully
ERROR: Build failed. Not running target
Error: There was an error while generating the TypeScript dependencies.
DevinLeamy commented 1 year ago

Hi @snowyu. Checkout https://stackoverflow.com/a/74759390. "Clang doesn't have it's own header libraries for C++" so it's getting them from GCC. It might be targeting a GCC version that isn't installed, so you may have to install it.

snowyu commented 1 year ago

Thanks. It's ok after sudo apt install g++-12.