Skip to content

Fail more gracefully if swiftc is not found #16

Closed
@allevato

Description

@allevato

If swiftc is not found on the system path, the build will fail with the following terrible diagnostic:

ERROR: /<REDACTED>/examples/xplatform/hello_world/BUILD:5:1: every rule of type swift_binary implicitly depends upon the target '@build_bazel_rules_swift_local_config//:toolchain', but this target could not be found because of: no such package '@build_bazel_rules_swift_local_config//': Traceback (most recent call last):
	File "/<REDACTED>/external/build_bazel_rules_swift/swift/repositories.bzl", line 75
		_create_linux_toolchain(repository_ctx)
	File "/<REDACTED>/external/build_bazel_rules_swift/swift/repositories.bzl", line 24, in _create_linux_toolchain
		path_to_swiftc.dirname
object of type 'NoneType' has no field 'dirname'

We should print something more useful for the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We should fix this this quartertype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions