Skip to content

Add embeds, file sets#116

Merged
mwoehlke merged 1 commit into
cps-org:masterfrom
mwoehlke:filesets-and-embed
Jun 26, 2026
Merged

Add embeds, file sets#116
mwoehlke merged 1 commit into
cps-org:masterfrom
mwoehlke:filesets-and-embed

Conversation

@mwoehlke

@mwoehlke mwoehlke commented Jun 8, 2026

Copy link
Copy Markdown
Member

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").

@nickelpro

Copy link
Copy Markdown
Collaborator

cc @dcbaker @grafikrobot @cfrankmiller

embeds I think should be fine, it's a direct analogy for includes for the new feature, mapping to the --embed-dir flag instead of -I.

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.

@mwoehlke

mwoehlke commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

Yeah, reasoning behind embeds was 1) trying to be proactive rather than reactive for a change, 2) consistency with embeds as a file set type, since we know we want it, and 3) the embeds attribute is a clearer candidate for a version bump, and doing them together means not worrying what sort of version bump file_sets on its own warrants, or likewise if embeds as a file set type was added later.

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 file_sets, but that's something we can add later if it becomes necessary.

@dcbaker dcbaker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 cfrankmiller left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread schema.rst Outdated
@nickelpro

nickelpro commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Consensus for root, on the basis we've avoided "directory" so far, and "location" isn't clear enough about the purpose of the path.

Wide agreement the answer didn't matter too much. Bikeshed painted.

@mwoehlke mwoehlke force-pushed the filesets-and-embed branch from 72b9a68 to f679e5b Compare June 26, 2026 18:31
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").
@mwoehlke mwoehlke force-pushed the filesets-and-embed branch from f679e5b to 1787956 Compare June 26, 2026 18:35
@mwoehlke mwoehlke merged commit 485d717 into cps-org:master Jun 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants