Skip to content

Commit

Permalink
Narrow down the repro case. It looks like the problem happens when bo…
Browse files Browse the repository at this point in the history
…th modules are enabled and we are using header maps
  • Loading branch information
amberdixon committed Nov 30, 2021
1 parent 33ef929 commit ad1037a
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions tests/ios/InclusionProblemRepro/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("//rules:library.bzl", "apple_library")
load("//rules:hmap.bzl", "headermap")

apple_library(
name = "LibraryA",
Expand All @@ -16,3 +17,65 @@ apple_library(
],
visibility = ["//visibility:public"],
)


headermap(
name="LibraryTest_private_hmap",
hdrs=glob([
"Classes/HeaderB.h",
"Classes/HeaderC.h",
"Classes/Extensions/D.h",
]),
)

# it looks like the use of header maps combined with -fmodules is waht causes the problem to happen.
objc_library(
name = "LibraryNoWorky_objc",
srcs = glob([
"Classes/HeaderB.h",
"Classes/HeaderC.h",
"Classes/Extensions/D.h",
"Classes/Extensions/D.m",
]),
deps = ["LibraryTest_private_hmap"],
copts = [
"-fmodules",
"-fmodule-name=LibraryNoWorky",
"-iquote$(execpath :LibraryTest_private_hmap)",
"-I."
],
visibility = ["//visibility:public"],
)


objc_library(
name = "LibraryWorky_objc",
srcs = glob([
"Classes/HeaderB.h",
"Classes/HeaderC.h",
"Classes/Extensions/D.h",
"Classes/Extensions/D.m",
]),
copts = [
"-fmodules",
"-fmodule-name=LibraryWorky",
"-iquotetests/ios/InclusionProblemRepro/Classes",
],
visibility = ["//visibility:public"],
)

objc_library(
name = "LibraryWorkyToo_objc",
srcs = glob([
"Classes/HeaderB.h",
"Classes/HeaderC.h",
"Classes/Extensions/D.h",
"Classes/Extensions/D.m",
]),
deps = ["LibraryTest_private_hmap"],
copts = [
"-iquote$(execpath :LibraryTest_private_hmap)",
"-I."
],
visibility = ["//visibility:public"],
)

0 comments on commit ad1037a

Please sign in to comment.