This is an archive of the discontinued LLVM Phabricator instance.

[bazel][NFC] Replace @bazel_tools//src/conditions with equivalent @platforms rules
ClosedPublic

Authored by rupprecht on Apr 10 2023, 9:03 AM.

Details

Summary

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.

Diff Detail

Event Timeline

rupprecht created this revision.Apr 10 2023, 9:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2023, 9:03 AM
rupprecht requested review of this revision.Apr 10 2023, 9:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2023, 9:03 AM
rupprecht edited the summary of this revision. (Show Details)Apr 10 2023, 9:53 AM
GMNGeoffrey accepted this revision.Apr 10 2023, 11:12 AM
This revision is now accepted and ready to land.Apr 10 2023, 11:12 AM