这是indexloc提供的服务,不要输入任何密码
Skip to content

Non-hermeticity with link_osize_opt #371

@jpsim

Description

@jpsim

Hi folks, I noticed some non-hermeticity introduced in 1.18.0 and bisected to identify #348 as the cause. This manifested itself in my project by making all uses of Swift macros non-hermetic, causing many cache misses. I wasn't able to find how to disable the feature specifically (build --features=-link_osize_opt didn't have any effect), but patching apple_support to set enabled = False explicitly worked.

Here's the patch in case others want to try it themselves and report if they see a similar impact:

diff --git a/crosstool/cc_toolchain_config.bzl b/crosstool/cc_toolchain_config.bzl
index d27ae52..6334384 100644
--- a/crosstool/cc_toolchain_config.bzl
+++ b/crosstool/cc_toolchain_config.bzl
@@ -1126,7 +1126,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
 
     link_osize_opt_feature = feature(
         name = "link_osize_opt",
-        enabled = True,
+        enabled = False,
         flag_sets = [
             flag_set(
                 actions = _DYNAMIC_LINK_ACTIONS,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions