[all-commits] [llvm/llvm-project] f72601: [Bazel] Use `LLVM_VERSION` from `llvm/CMakeLists.txt`

NAKAMURA Takumi via All-commits all-commits at lists.llvm.org
Fri Jan 13 17:26:38 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f72601a89f30b066e9c572d3d81bebe6435deae8
      https://github.com/llvm/llvm-project/commit/f72601a89f30b066e9c572d3d81bebe6435deae8
  Author: NAKAMURA Takumi <geek4civic at gmail.com>
  Date:   2023-01-14 (Sat, 14 Jan 2023)

  Changed paths:
    M llvm/utils/release/bump-version.py
    M utils/bazel/configure.bzl
    M utils/bazel/llvm-project-overlay/clang/BUILD.bazel
    M utils/bazel/llvm-project-overlay/lld/BUILD.bazel
    M utils/bazel/llvm-project-overlay/llvm/config.bzl
    M utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h

  Log Message:
  -----------
  [Bazel] Use `LLVM_VERSION` from `llvm/CMakeLists.txt`

* Generate `//:vars.bzl` from `llvm/CMakeLists.txt`

`_extract_cmake_settings()` generates `//:vars.bzl` in `llvm_configure()`.
It would be easier to use external commands like sed(1) and python.
For portability, I think the parser should run on Starlark.

`@llvm-project//:vars.bzl` may be loaded from both WORKSPACE and BUILD.
At the moment, `vars.bzl` provides some values as string.

- CMAKE_CXX_STANDARD = "17"
- LLVM_VERSION_MAJOR = "16"
- LLVM_VERSION_MINOR = "0"
- LLVM_VERSION_PATCH = "0"
- LLVM_VERSION = "16.0.0"
- llvm_vars = (dict of these values)

`CMAKE_CXX_STANDARD` may be used to configure toolchain.

* Use `//vars.bzl` for each BUILD files

It would be smarter if the BUILD phase could generate `llvm-config.h`.
Since I am afraid of the discussion in D126581, I just remove
LLVM_VERSION stuff out of the static `llvm-config.h`.

* Eliminate Bazel stuff in 'bump-version.py'

Current version of `bump-version.py` tries to substitute CLANG_VERSION.
It is the reason why I modify bump-version in this change rather than
incoming patch.

Differential Revision: https://reviews.llvm.org/D136392




More information about the All-commits mailing list