Skip to content

Commit

Permalink
Build incremental swift locally
Browse files Browse the repository at this point in the history
Summary: For incremental swift to benefit from swiftdep files, it must be built locally where the swiftdep files are present.

Reviewed By: rmaz

Differential Revision: D66471469

fbshipit-source-id: 9857568c2e0f2d3cab3eb4c7116dda313d0039f3
  • Loading branch information
chatura-atapattu authored and facebook-github-bot committed Nov 26, 2024
1 parent dd7c0f7 commit df8017c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions prelude/apple/swift/swift_compilation.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -621,12 +621,15 @@ def _compile_with_argsfile(
prefer_local = not explicit_modules_enabled

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.
# 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.
allow_cache_upload = False
local_only = True
prefer_local = False
elif build_swift_incrementally:
# Swift incremental compilation requires the swiftdep files which are only present when
# compiling locally. Prefer local unless otherwise overridden.
prefer_local = True

# Make it easier to debug whether Swift actions get compiled with explicit modules or not
category = category_prefix + ("_with_explicit_mods" if explicit_modules_enabled else "")
Expand Down

0 comments on commit df8017c

Please sign in to comment.