Skip to content

Conversation

thesayyn
Copy link

#378 introduced this setting to allow users to disable libtool all together even on macOS, however this flag was not made public for toolchain implementors to condition on.

I have two different tool_maps that overrides the ar binary but it was conditioned on @platforms//os:macos like rules_cc was, but with the change @keith made, it changed the flags leading to broken ar action

# use libtool
cc_tool_map(
    name = "libtool_tools",
    tools = {
        "@rules_cc//cc/toolchains/actions:ar_actions": ":llvm-libtool-darwin",
    },
)

# use llvm-ar
cc_tool_map(
    name = "default_tools",
    tools =  {
        "@rules_cc//cc/toolchains/actions:ar_actions": ":llvm-ar",
    },
)

alias(
 name = "tools",
 actual = select({
      "@rules_cc//cc/toolchains/args/archiver_flags:use_libtool_on_macos_setting": "libtool_tools",
      "//conditions:default": "default_tools",
  })
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant