Skip to content

Commit

Permalink
Warn instead of fail when swiftc not found on Linux (#1433)
Browse files Browse the repository at this point in the history
Signed-off-by: Brentley Jones <github@brentleyjones.com>
(cherry picked from commit a8d7635)
  • Loading branch information
brentleyjones committed Oct 22, 2024
1 parent e30a8aa commit bd0e6e0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions swift/internal/swift_autoconfiguration.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,18 @@ def _create_linux_toolchain(repository_ctx):
"""
path_to_swiftc = repository_ctx.which("swiftc")
if not path_to_swiftc:
fail("No 'swiftc' executable found in $PATH")
print("""\
No 'swiftc' executable found in $PATH. Not auto-generating a Linux Swift \
toolchain.
""") # buildifier: disable=print
repository_ctx.file(
"BUILD",
"""\
# No 'swiftc' executable found in $PATH. Not auto-generating a Linux Swift \
toolchain.
""",
)
return

root = path_to_swiftc.dirname.dirname
feature_values = _compute_feature_values(repository_ctx, path_to_swiftc)
Expand All @@ -223,7 +234,7 @@ def _create_linux_toolchain(repository_ctx):

repository_ctx.file(
"BUILD",
"""
"""\
load(
"@build_bazel_rules_swift//swift/toolchains:swift_toolchain.bzl",
"swift_toolchain",
Expand Down

0 comments on commit bd0e6e0

Please # to comment.