[all-commits] [llvm/llvm-project] 5e57f1: [bazel][NFC] Replace @bazel_tools//src/conditions ...

Jordan Rupprecht via All-commits all-commits at lists.llvm.org
Mon Apr 10 11:43:13 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5e57f1bf52834cd5133011624c9bbc8cbf58c272
      https://github.com/llvm/llvm-project/commit/5e57f1bf52834cd5133011624c9bbc8cbf58c272
  Author: Jordan Rupprecht <rupprecht at google.com>
  Date:   2023-04-10 (Mon, 10 Apr 2023)

  Changed paths:
    M utils/bazel/llvm-project-overlay/clang/BUILD.bazel
    M utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
    M utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
    M utils/bazel/llvm-project-overlay/llvm/cc_plugin_library.bzl
    M utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel
    M utils/bazel/vulkan_sdk.bzl

  Log Message:
  -----------
  [bazel][NFC] Replace @bazel_tools//src/conditions with equivalent @platforms rules

Followup to D147354. Using src/conditions is discouraged in favor of using rules from the `@platforms` repository directly.

This replaces three conditions:
* `@bazel_tools//src/conditions:windows` -> `@platforms//os:windows`
* `@bazel_tools//src/conditions:darwin` -> `@platforms//os:macos`
* `@bazel_tools//src/conditions:freebsd` -> `@platforms//os:freebsd`

`llvm/config.bzl` has a non-trivial OS+CPU selection config, so that is omitted from this patch. There is intentionally no equivalent for that in `@platforms` because every project will have their own opinions about what a platform is, and it is not feasible for the bazel selection list to include every possible combination. The recommended idiom there is for projects to define their own supported platforms list, e.g. in a separate BUILD file or platform mapping.

Reviewed By: GMNGeoffrey

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




More information about the All-commits mailing list