rules_apple icon indicating copy to clipboard operation
rules_apple copied to clipboard

bazel builds failed and reports an error with rules_apple version 2.4.1 and version 2.4.0

Open uiChuanqi opened this issue 2 years ago • 3 comments

Hi, guys,

I found the rules_apple version has upgrade to 2.4.1 this morning, so i changed the version in my WORKSPACE from 2.1.0 to 2.4.1, however when i execute "bazel build //SampleApp:SampleApp" as usual, it reports an error as below,

2 4 1

then i degrade the version to 2.4.0, it also gives this error:

2 4 0_2023-07-14 11 46 48

but when i changed the version to 2.3.0, this error disappears, and it also works well when i change it to version 2.2.0, 2 3 0_2023-07-14 11 48 04

I don't know what happened, so i remain my rules_apple at version 2.3.0.

Maybe you'd better check the the release message and compare the codes of version 2.4.0 to get some clues, Regards.

uiChuanqi avatar Jul 14 '23 04:07 uiChuanqi

Can you share the SampleApp?

thii avatar Jul 14 '23 06:07 thii

Can you share the SampleApp?

OK, here is the project SampleApp

uiChuanqi avatar Jul 17 '23 10:07 uiChuanqi

For your example, I'd suggest using swiftc_inputs instead of data if you want to include additional files in compile actions. Try this:

diff --git c/SampleApp/BUILD i/SampleApp/BUILD
index 3136ddc..2fac22a 100644
--- c/SampleApp/BUILD
+++ i/SampleApp/BUILD
@@ -22,8 +22,7 @@ swift_library(
         "-import-objc-header",
         "$(location :OCClasses/BridgeHeader.h)",
     ],
-    swiftc_inputs = [":OCClasses/BridgeHeader.h"],
-    data = glob(["OCClasses/*.h"]) ,
+    swiftc_inputs = glob(["OCClasses/*.h"]),
     visibility = ["//visibility:public"],
 )
 

thii avatar Jul 19 '23 14:07 thii