Repository navigation
Public transitive headermap rule first pass - #26
Merged
Merged
Conversation
Collaborator
Author
|
No need to review this one yet. The plan for this is to implement it in Unless there is a clear path to merge bazelbuild/bazel#3712 into master, this will replace the PR for most of my use cases. |
jerrymarino
force-pushed
the
jmarino_prototype_headermap_rule
branch
from
October 1, 2019 19:59
76e87b5 to
1744ba7
Compare
Collaborator
Author
|
It looks like |
jerrymarino
force-pushed
the
jmarino_prototype_headermap_rule
branch
4 times, most recently
from
October 3, 2019 01:07
3aca0de to
c4d13e3
Compare
This patch prototypes a headermap rule in skylark!
It works quite well, and sacrifices usability, since it isn't implicitly
created.
Public transitive `objc_library` header usage:
- `deps` go into `deps`
- `hdrs` into `hdrs` wrapped in a filegroup
- the actual header map goes into `hdrs` for public usage
Other consumers of the rules can wrap `objc_library` in a macro, which
both instantiate and consume this rule.
It works by transitively merging public headermaps. This works
effortlessly, since headermaps are propagated transitively along with the
headers.
Usage:
Create a basic headermap ( for the pod PINOperation )
headermap(
name = "PINOperation_hmap",
namespace = "PINOperation",
# File group to headers
hdrs = [
"PINOperation_hdrs"
],
deps = []
)
It supports transitive propagation via the `deps` rule,
which are currently objc providers only, we can expand this to multiple
types once swift support is added.
headermap(
name = "PINCache_hmap",
namespace = "PINCache",
hdrs = [
"PINCache_hdrs"
],
deps = [ "//Vendor/PINOperation:PINOperation" ]
)
Compilation flags:
Explicitly set this in copts, the compiler shoulnd't have O(N) hmaps.
Other considerations and TODOs:
- Be smarter about headers that actually exist. This needs more thought.
If the input pruning and dot d pruning work is useable from skylark,
it'd be great to leverage that.
- Add better documentation
jerrymarino
force-pushed
the
jmarino_prototype_headermap_rule
branch
from
October 3, 2019 01:23
c4d13e3 to
6178db8
Compare
Collaborator
Author
|
This one should be ready to merge, and get us to parity of how headers were treated. We should improve upon that:
|
Collaborator
Author
|
This needs a few things before we enable it by default including:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch prototypes a headermap rule in skylark!
It works quite well, and sacrifices usability, since it isn't implicitly
created.
Public transitive
objc_libraryheader usage:depsgo intohdr_providershdrsintohdrswrapped in a filegrouphdrsfor public usageOther consumers of the rules can wrap
objc_libraryin a macro, whichboth instantiate and consume this rule.
It works by transitively merging public headermaps. This works
effortlessly, since headermaps are propagated transitively along with the
headers.
Usage:
Create a basic headermap ( for the pod PINOperation )
It supports transitive propagation via the
hdr_providersrule,which are currently objc providers only, we can expand this to multiple
types once swift support is added.
Compilation flags:
.hmaps will need to be explicitly added to the command line. Likely,
this will be achieved with
coptsin PodToBUILD. I'm not sure if thebehavior of replacing
GENFILESwith the correct directory isavailable in Bazel, so that may rely on a custom toolchain or simply use
the
includeattribute.Other considerations:
Be smarter about headers that actually exist. This needs more thought.
If the input pruning and dot d pruning work is useable from skylark,
it'd be great to leverage that.