mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:00:13 +01:00
This required a minor change to patch 0009, and allows us to drop patch 0010.
147 lines
5.6 KiB
Python
147 lines
5.6 KiB
Python
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
"""Bazel modules.
|
|
|
|
`MODULE.bazel.lock` may change locally when `bazel` is executed. This means one
|
|
of:
|
|
|
|
1. An input is changing, typically `MODULE.bazel` or `.bazelversion`.
|
|
- Running `bazel mod deps` provides a canonical update to
|
|
`MODULE.bazel.lock`; include the changes.
|
|
- GitHub test actions may also identify platform-specific lockfile
|
|
updates.
|
|
2. The host platform hasn't yet been added to the lock file.
|
|
- Platforms tested with GitHub actions are kept up-to-date. Other
|
|
platforms may fall out of sync due to `bazel` or dependency changes,
|
|
and should be updated with a PR the same way a platform is added.
|
|
- Running `bazel mod deps` provides a canonical update to
|
|
`MODULE.bazel.lock`; create a PR with those changes in order to include
|
|
the host platform.
|
|
|
|
For updates, run `scripts/query_module_versions.py` to list the latest package
|
|
versions.
|
|
"""
|
|
|
|
module(name = "carbon")
|
|
|
|
bazel_dep(name = "abseil-cpp", version = "20260107.1")
|
|
bazel_dep(name = "bazel_skylib", version = "1.9.0")
|
|
bazel_dep(name = "boost.unordered", version = "1.90.0.bcr.1")
|
|
bazel_dep(name = "google_benchmark", version = "1.9.5")
|
|
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
|
|
bazel_dep(name = "libpfm", version = "4.13.0")
|
|
bazel_dep(name = "re2", version = "2025-11-05.bcr.1")
|
|
bazel_dep(name = "rules_cc", version = "0.2.18")
|
|
bazel_dep(name = "rules_pkg", version = "1.2.0")
|
|
bazel_dep(name = "rules_shell", version = "0.8.0")
|
|
bazel_dep(name = "tcmalloc", version = "0.0.0-20250927-12f2552")
|
|
bazel_dep(name = "tree-sitter-bazel", version = "0.26.5")
|
|
|
|
bazel_dep(name = "wolfd_bazel_compile_commands", version = "0.5.2", dev_dependency = True)
|
|
git_override(
|
|
module_name = "wolfd_bazel_compile_commands",
|
|
# This is https://github.com/wolfd/bazel-compile-commands/pull/3 which is
|
|
# needed to correctly select target configurations in our compile commands.
|
|
commit = "7c673ac868cd237f262bb37a7819b1a279566a66",
|
|
remote = "https://github.com/chandlerc/bazel-compile-commands.git",
|
|
)
|
|
|
|
bazel_dep(name = "bazel_clang_tidy", dev_dependency = True)
|
|
git_override(
|
|
module_name = "bazel_clang_tidy",
|
|
# HEAD as of 2026-01-28.
|
|
commit = "c4d35e0d0b838309358e57a2efed831780f85cd0",
|
|
remote = "https://github.com/erenon/bazel_clang_tidy.git",
|
|
)
|
|
|
|
bazel_cc_toolchain = use_extension(
|
|
"//bazel/cc_toolchains:clang_configuration.bzl",
|
|
"clang_toolchain_extension",
|
|
)
|
|
use_repo(bazel_cc_toolchain, "bazel_cc_toolchain")
|
|
|
|
register_toolchains("@bazel_cc_toolchain//:all")
|
|
|
|
register_toolchains("//toolchain/install:all")
|
|
|
|
# Required for llvm-project.
|
|
bazel_dep(name = "platforms", version = "1.0.0")
|
|
bazel_dep(name = "protobuf", version = "34.0.bcr.1", repo_name = "com_google_protobuf")
|
|
bazel_dep(name = "zlib-ng", version = "2.3.3", repo_name = "llvm_zlib")
|
|
bazel_dep(name = "zstd", version = "1.5.7.bcr.1", repo_name = "llvm_zstd")
|
|
|
|
###############################################################################
|
|
# llvm-project
|
|
###############################################################################
|
|
|
|
# Load a repository for the raw llvm-project, pre-overlay.
|
|
bazel_dep(name = "llvm-raw")
|
|
git_override(
|
|
module_name = "llvm-raw",
|
|
build_file_content = "# empty",
|
|
# We pin to specific upstream commits and try to track top-of-tree
|
|
# reasonably closely rather than pinning to a specific release.
|
|
# HEAD as of 2026-06-23.
|
|
commit = "bab165ecb0d64686849dfa14d1798589eee7b66e",
|
|
patch_cmds = ["echo \"module(name='llvm-raw')\" > MODULE.bazel"],
|
|
patch_strip = 1,
|
|
patches = [
|
|
"//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch",
|
|
"//bazel/llvm_project:0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch",
|
|
"//bazel/llvm_project:0004_Introduce_basic_sources_exporting_for_libunwind.patch",
|
|
"//bazel/llvm_project:0005_Introduce_basic_sources_exporting_for_libcxx_and_libcxxabi.patch",
|
|
"//bazel/llvm_project:0009_Introduce_starlark_exporting_compiler-rt_build_information.patch",
|
|
],
|
|
remote = "https://github.com/llvm/llvm-project.git",
|
|
)
|
|
|
|
# Apply the overlay to produce llvm-project.
|
|
llvm_project = use_extension(
|
|
"//bazel/llvm_project:llvm_project.bzl",
|
|
"llvm_project",
|
|
)
|
|
use_repo(llvm_project, "llvm-project")
|
|
|
|
###############################################################################
|
|
# Python
|
|
###############################################################################
|
|
|
|
bazel_dep(name = "rules_python", version = "1.9.0")
|
|
|
|
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
|
|
python.toolchain(
|
|
python_version = "3.12",
|
|
)
|
|
use_repo(python, "python_versions")
|
|
|
|
###############################################################################
|
|
# Bazel integration testing
|
|
###############################################################################
|
|
|
|
bazel_dep(
|
|
name = "rules_bazel_integration_test",
|
|
version = "0.37.1",
|
|
dev_dependency = True,
|
|
)
|
|
|
|
# We test against our current Bazel version, the latest release, and the latest
|
|
# release candidate.
|
|
bazel_binaries = use_extension(
|
|
"@rules_bazel_integration_test//:extensions.bzl",
|
|
"bazel_binaries",
|
|
dev_dependency = True,
|
|
)
|
|
bazel_binaries.download(version_file = "//:.bazelversion")
|
|
bazel_binaries.download(version = "latest")
|
|
bazel_binaries.download(version = "last_rc")
|
|
use_repo(
|
|
bazel_binaries,
|
|
"bazel_binaries",
|
|
"bazel_binaries_bazelisk",
|
|
"build_bazel_bazel_.bazelversion",
|
|
"build_bazel_bazel_last_rc",
|
|
"build_bazel_bazel_latest",
|
|
)
|