Ubuntu 22.04 で Sorbet をビルドする

Ubuntu 22.04 の環境で Sorbet のビルドをしたらエラーが発生しました。 単純な問題ですが一応書き残しておきます。

README にあるように ./bazel build //main:sorbet --config=dbg を実行したら以下のエラーが発生しました。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ ./bazel build //main:sorbet --config=dbg
WARNING: Download from https://mirror.bazel.build/www.colm.net/files/ragel/ragel-6.10.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/github.com/jmillikin/rules_m4/releases/download/v0.1/m4-gnulib-788db09a9f88abbef73c97e8d7291c40455336d8.tar.xz failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/ftp.gnu.org/gnu/bison/bison-3.3.2.tar.xz failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/github.com/jmillikin/rules_bison/releases/download/v0.1/bison-gnulib-788db09a9f88abbef73c97e8d7291c40455336d8.tar.xz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Analyzed target //main:sorbet (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/mihyaeru/.cache/bazel/_bazel_mihyaeru/a74a2d0f7000d949282952fb8eb1689b/external/com_google_absl/absl/strings/BUILD.bazel:500:11: Compiling absl/strings/internal/cordz_functions.cc [for host] failed: (Exit 127): clang failed: error executing command /home/mihyaeru/.cache/bazel/_bazel_mihyaeru/a74a2d0f7000d949282952fb8eb1689b/external/llvm_toolchain_12_0_0/bin/clang -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 71 arguments skipped)
/home/mihyaeru/.cache/bazel/_bazel_mihyaeru/a74a2d0f7000d949282952fb8eb1689b/external/llvm_toolchain_12_0_0/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
ERROR: /home/mihyaeru/ghq/github.com/mihyaeru21/sorbet/common/concurrency/BUILD:1:11: Compiling common/concurrency/WorkerPoolImpl.cc [for host] failed: (Exit 127): clang failed: error executing command /home/mihyaeru/.cache/bazel/_bazel_mihyaeru/a74a2d0f7000d949282952fb8eb1689b/external/llvm_toolchain_12_0_0/bin/clang -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 54 arguments skipped)
/home/mihyaeru/.cache/bazel/_bazel_mihyaeru/a74a2d0f7000d949282952fb8eb1689b/external/llvm_toolchain_12_0_0/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Target //main:sorbet failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.243s, Critical Path: 0.03s
INFO: 24 processes: 24 internal.
FAILED: Build did NOT complete successfully

libtinfo.so.5 が入っていないようです。 以下で入れてあげたら通るようになりました。

1
sudo apt install libtinfo5