Skip to content

Commit

Permalink
make index store output uncacheable
Browse files Browse the repository at this point in the history
Summary: We can see that index store output contains absolute paths, and so is not possible to build remotely or cache. Mark the actions accordingly.

Reviewed By: chatura-atapattu

Differential Revision: D65344579

fbshipit-source-id: aa1e3837c58686acb42283d9ce1898a5b6deb7cc
  • Loading branch information
rmaz authored and facebook-github-bot committed Nov 4, 2024
1 parent 4ce179f commit 2c6788d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apple/apple_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def _compile_index_store(ctx: AnalysisContext, src_compile_cmd: CxxSrcCompileCom
cmd,
category = category,
identifier = identifier,
allow_cache_upload = True,
allow_cache_upload = False,
local_only = True,
)

return index_store
Expand Down
6 changes: 4 additions & 2 deletions apple/swift/swift_compilation.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ def _compile_index_store(
additional_flags,
toolchain,
module_name,
cacheable = False,
)

return index_store_output
Expand All @@ -545,7 +546,8 @@ def _compile_with_argsfile(
additional_flags: cmd_args,
toolchain: SwiftToolchainInfo,
identifier: str | None = None,
num_threads: int = 1) -> CompileArgsfiles:
num_threads: int = 1,
cacheable: bool = True) -> CompileArgsfiles:
shell_quoted_args = cmd_args(shared_flags, quote = "shell")
argsfile, _ = ctx.actions.write(extension + "_compile_argsfile", shell_quoted_args, allow_args = True)
input_args = [shared_flags]
Expand All @@ -568,7 +570,7 @@ def _compile_with_argsfile(
# because there's no shared module cache across different libraries.
prefer_local = not explicit_modules_enabled

if build_swift_incrementally and not toolchain.supports_relative_resource_dir:
if (not cacheable) or (build_swift_incrementally and not toolchain.supports_relative_resource_dir):
# When Swift code is built incrementally, the swift-driver embeds
# absolute paths into the artifacts without relative resource dir
# support. In this case we can only build locally.
Expand Down

0 comments on commit 2c6788d

Please sign in to comment.