diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 2152051e09..ccab0f179c 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -61,7 +61,7 @@ jobs: - name: Setup apt run: apt update -y && apt upgrade -y - name: Install dependencies - run: apt install -y git clang libcurl4-openssl-dev clang-tidy + run: apt install -y git clang libcurl4-openssl-dev clang-tidy libtinfo5 - name: Install bazel run: bash tools/buildutils/installbazel.sh - name: Build cvd diff --git a/base/cvd/.bazelrc b/base/cvd/.bazelrc index f358a21df8..5bdec15328 100644 --- a/base/cvd/.bazelrc +++ b/base/cvd/.bazelrc @@ -1,6 +1,6 @@ build --copt=-fdiagnostics-color=always -build --repo_env=CC=clang build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect build:clang-tidy --output_groups=report build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config +build:clang-tidy --@bazel_clang_tidy//:clang_tidy_executable=@llvm_toolchain//:clang-tidy diff --git a/base/cvd/MODULE.bazel b/base/cvd/MODULE.bazel index ab8643794b..94f641c197 100644 --- a/base/cvd/MODULE.bazel +++ b/base/cvd/MODULE.bazel @@ -33,3 +33,15 @@ git_override( commit = "f23d924918c581c68cd5cda5f12b4f8198ac0c35", remote = "https://github.com/erenon/bazel_clang_tidy.git", ) + +bazel_dep(name = "toolchains_llvm", version = "1.2.0") + +# Configure and register the toolchain. +llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm") +llvm.toolchain( + llvm_version = "16.0.4", +) + +use_repo(llvm, "llvm_toolchain") + +register_toolchains("@llvm_toolchain//:all") diff --git a/base/cvd/MODULE.bazel.lock b/base/cvd/MODULE.bazel.lock index b6d0110e57..8a315c8cc3 100644 --- a/base/cvd/MODULE.bazel.lock +++ b/base/cvd/MODULE.bazel.lock @@ -148,6 +148,8 @@ "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", "https://bcr.bazel.build/modules/tinyxml2/10.0.0/MODULE.bazel": "7c2c2fd7f9bd767e5c98eeb46385dba08c81be321d885ed077da9383e85aebc7", "https://bcr.bazel.build/modules/tinyxml2/10.0.0/source.json": "e6f10ec3ed2d93b165a6556ec0cca75f3f1f1b508494c618ed398d38919947a0", + "https://bcr.bazel.build/modules/toolchains_llvm/1.2.0/MODULE.bazel": "7b271b71e50de47fa47159a7f58165e80fcebe1196c014a14af0a08a867d1635", + "https://bcr.bazel.build/modules/toolchains_llvm/1.2.0/source.json": "0328cfc67075d6a016980be4011bbc1dcfba933e357568002542dff22abdd3a1", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", @@ -288,6 +290,81 @@ ] ] } + }, + "@@toolchains_llvm+//toolchain/extensions:llvm.bzl%llvm": { + "general": { + "bzlTransitiveDigest": "2UD8x0LHy2fgOvBmCL8R0HPa9/omkySg1/dsFBzYcH8=", + "usagesDigest": "Z0KCJxBQ4esw5YdZk0qufBrIAPg0mAUyKkS+m6KZHG8=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "llvm_toolchain_llvm": { + "repoRuleId": "@@toolchains_llvm+//toolchain:rules.bzl%llvm", + "attributes": { + "alternative_llvm_sources": [], + "auth_patterns": {}, + "distribution": "auto", + "exec_arch": "", + "exec_os": "", + "llvm_mirror": "", + "llvm_version": "16.0.4", + "llvm_versions": {}, + "netrc": "", + "sha256": {}, + "strip_prefix": {}, + "urls": {} + } + }, + "llvm_toolchain": { + "repoRuleId": "@@toolchains_llvm+//toolchain:rules.bzl%toolchain", + "attributes": { + "absolute_paths": false, + "archive_flags": {}, + "compile_flags": {}, + "coverage_compile_flags": {}, + "coverage_link_flags": {}, + "cxx_builtin_include_directories": {}, + "cxx_flags": {}, + "cxx_standard": {}, + "dbg_compile_flags": {}, + "exec_arch": "", + "exec_os": "", + "extra_exec_compatible_with": {}, + "extra_target_compatible_with": {}, + "link_flags": {}, + "link_libs": {}, + "llvm_versions": { + "": "16.0.4" + }, + "opt_compile_flags": {}, + "opt_link_flags": {}, + "stdlib": {}, + "target_settings": {}, + "unfiltered_compile_flags": {}, + "toolchain_roots": {}, + "sysroot": {} + } + } + }, + "recordedRepoMappingEntries": [ + [ + "toolchains_llvm+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "toolchains_llvm+", + "bazel_tools", + "bazel_tools" + ], + [ + "toolchains_llvm+", + "toolchains_llvm", + "toolchains_llvm+" + ] + ] + } } } } diff --git a/base/debian/control b/base/debian/control index 8ae61fb7e0..1e29a1ef60 100644 --- a/base/debian/control +++ b/base/debian/control @@ -2,26 +2,27 @@ Source: cuttlefish-common Maintainer: Cuttlefish Team Section: misc Priority: optional -Build-Depends: config-package-dev, - debhelper-compat (= 12), +Build-Depends: bazel [amd64], clang, - pkg-config, + config-package-dev, + debhelper-compat (= 12), + git, + libcurl4-openssl-dev, libfmt-dev, libgflags-dev, - libjsoncpp-dev, - libcurl4-openssl-dev, libgoogle-glog-dev, libgtest-dev, + libjsoncpp-dev, + libtinfo5, + libprotobuf-c-dev, + libprotobuf-dev, libssl-dev, libxml2-dev, - uuid-dev, - libprotobuf-dev, - libprotobuf-c-dev, - protobuf-compiler, libz3-dev, + pkg-config, + protobuf-compiler, sed, - git, - bazel [amd64] + uuid-dev Standards-Version: 4.5.0 Package: cuttlefish-base