Add embeds, file sets#116
Conversation
Add attributes to support the C/C++ `#embed` directive which was
recently standardized. Introduce a 'file set' object to the schema, with
corresponding `file_sets` attribute. These are being combined mostly for
the sake of the corresponding schema version bump, but 'embeds' are one
of the supported file set types.
For now, file sets are primarily informative, offering a way for certain
tools to match `#include`/`#embed` directives in consumer's sources to
specific components, which is useful for various sorts of correctness
validation ("linting").
b23f883 to
72b9a68
Compare
|
cc @dcbaker @grafikrobot @cfrankmiller
Personally I'm fine with filesets going in. No one had strong objections to purely informative file sets. To be clear, this is in support of tools like link-what-you-include, which want to be able to map specific headers to specific components. It's not a build-correctness feature at the moment, for emission or consumption. I'll hold off on approval in case anyone wants to raise strong objections. |
|
Yeah, reasoning behind I was also planning to give this a week or so to "marinate", so we're on the same page there. 🙂 For now, I'm hoping to avoid allowing per-configuration |
There was a problem hiding this comment.
This all looks good to me.
@nickelpro thanks for mentioning that filesets are for external tools ATM, I've had a string of conflicts with the call for the last couple of months and am a bit out of the loop.
cfrankmiller
left a comment
There was a problem hiding this comment.
This looks good from my perspective. I have one slight concern about overloading the name "prefix" that I made a comment on. I think this is clear enough as is but thought I would point it out for discussion. I apologize for bikeshedding.
| Specifies the base path of files in the file set. | ||
| For :string:`"embeds"` and :string:`"includes"` |fileset|\ s, | ||
| this path should match one of the paths specified in the component's | ||
| :attribute:`embeds` or :attribute:`includes` attributes, |
There was a problem hiding this comment.
The overloaded prefix name makes for some slight weirdness here because this fileset.prefix attribute can contain the @prefix@ string which refers to the package.prefix.
fileset {
type: "includes",
prefix: "@prefix@/include",
files: [ "some_header.h", "some_other_header.h" ]
}
Should we consider renaming this attribute to something like base_dir to avoid any confusion or do you think this clear enough?
There was a problem hiding this comment.
I share the concern about prefix. Would it be safe, from a semantic pov, to call it dir (or directory) instead?
There was a problem hiding this comment.
Now that it's been pointed out, I'm a third on this. Rename to anything else reasonable to avoid the semantic collision of prefix/@prefix (no opinion on what, dir/base_dir/directory all work for me).
Add attributes to support the C/C++
#embeddirective which was recently standardized. Introduce a 'file set' object to the schema, with correspondingfile_setsattribute. These are being combined mostly for the sake of the corresponding schema version bump, but 'embeds' are one of the supported file set types.For now, file sets are primarily informative, offering a way for certain tools to match
#include/#embeddirectives in consumer's sources to specific components, which is useful for various sorts of correctness validation ("linting").