[all-commits] [llvm/llvm-project] c5f6a2: [bazel] Repair clang_headers_gen when run on macOS.

James Y Knight via All-commits all-commits at lists.llvm.org
Mon Jun 12 13:31:38 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c5f6a287499a816cba5585708999e2c8b134290f
      https://github.com/llvm/llvm-project/commit/c5f6a287499a816cba5585708999e2c8b134290f
  Author: James Knight <jyknight at google.com>
  Date:   2023-06-12 (Mon, 12 Jun 2023)

  Changed paths:
    M utils/bazel/llvm-project-overlay/clang/BUILD.bazel

  Log Message:
  -----------
  [bazel] Repair clang_headers_gen when run on macOS.

The antique version of bash (3.2.57, from 2007) which is available on
macOS cannot deal with quoted slashes in a `${x/...}`
substitution. Since only prefix-removal is required here, switch to a
`${x#...}` substitution instead.

(E.g. `src="foo/bar/baz.h"; echo ${src/"foo/bar"}` echos `bar/bar/baz.h`
instead of `/baz.h` on old bash versions).

Originally broken by 459420c33a2c80525bc73ad1ff89fdf4dd079d6c.
Fixes #63222




More information about the All-commits mailing list