bazelbuild / rules_swift

Bazel rules to build Swift on Apple and Linux platforms
Apache License 2.0
309 stars 133 forks source link

Enable `swift.add_target_name_to_output` by default #1215

Closed brentleyjones closed 2 months ago

brentleyjones commented 2 months ago

Since we are releasing 2.0 with breaking changes, we should enable this by default now, and then in 3.0 we can remove the feature.

keith commented 2 months ago

Even though we can flip this I don't think this ends up being the right default for folks. It would definitely be nice to remove the implementation complexity but I don't think it's worth deviating from the standard output layout. Especially since this is fixing for something that doesn't appear to be the common case

brentleyjones commented 2 months ago

but I don't think it's worth deviating from the standard output layout

Most rules are written such that the target name is part of the outputs, to prevent this from being an issue. I think the new way is correct while the old way is incorrect.

brentleyjones commented 2 months ago
examples/apple/objc_interop/main.m:20:9: fatal error: 'examples/apple/objc_interop/generated_header/Printer-Swift.h' file not found
#import "examples/apple/objc_interop/generated_header/Printer-Swift.h"

Yuck. Not flipping.