Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repro problem with absolute paths in dot-d files breaking inclusion validation in bazel5 #366

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions tests/ios/InclusionProblemRepro/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
load("//rules:library.bzl", "apple_library")
load("//rules:hmap.bzl", "headermap")

apple_library(
name = "LibraryA",
srcs = glob([
"Classes/HeaderB.h",
"Classes/HeaderC.h",
"Classes/Extensions/D.h",
"Classes/Extensions/D.m",
]),
platforms = {"ios": "8.0"},
public_headers = [
"Classes/HeaderB.h",
"Classes/HeaderC.h",
"Classes/Extensions/D.h",
],
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"],
)
1 change: 1 addition & 0 deletions tests/ios/InclusionProblemRepro/Classes/Extensions/D.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import "HeaderC.h"
1 change: 1 addition & 0 deletions tests/ios/InclusionProblemRepro/Classes/Extensions/D.m
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import "D.h"
Empty file.
1 change: 1 addition & 0 deletions tests/ios/InclusionProblemRepro/Classes/HeaderC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import "HeaderB.h"