Skip to content

[native_assets_cli] BuildOutput behaves like a sink, should it behave like a bag? #1167

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

Closed
Tracked by #995
dcharkes opened this issue May 22, 2024 · 1 comment
Closed
Tracked by #995

Comments

@dcharkes
Copy link
Collaborator

Currently, our BuildOutput behaves like a Sink. One calls add methods on it and never inspects it. This is how the build method is set up as well. It constructs one sink at the start and all builders stream assets and dependencies to it. It was modeled this way because the Rust build system streams lines to stdout. (Which inherently works like a sink.)

An alternative design would be to have it behave like a bag (or collection). In this case instead of passing in a BuildOutput to builders, they should return a BuildOutput. And then BuildOutput should have a + operator that takes another BuildOutput to combine two build outputs.

@dcharkes
Copy link
Collaborator Author

Some more discussion with @mosuem:

We should keep it a sink. Reasoning, the constructors of the Builders can take a parameter, and they should decide if an asset is sent for linking for example. If we start allowing arbitrary modification of build outputs and link outputs its very easy to do things that are not supported by that specific builder. By adding a parameter to the builder constructor instead, that parameter can indicate that that builder supports such things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant