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

chore: refactor ZigModuleInfo #233

Merged
merged 7 commits into from
Feb 21, 2024
Merged

chore: refactor ZigModuleInfo #233

merged 7 commits into from
Feb 21, 2024

Conversation

aherrmann
Copy link
Owner

Zig's module system is changing drastically between releases. However, the direction seems to be a system where each module is represented on the command-line by a either multiple arguments in a specific order (0.12.0) or a single flag with a complex structure (0.11.0). Neither of those lends itself to tracking parts of the command-line separately in depset values to later on pass to args.add_all.

Instead, we track modules in a depset of struct that carries all relevant information for each module, and later apply args.add_all using the map_each parameter to render the flags for each module.

  • zig_module_info constructor function
  • Use zig_module_info
  • Remove unused ZigModuleInfo fields
  • pkg --> mod in module info test
  • Store structured module arguments
  • Factor out dependency name rendering
  • Change ZigModuleInfo field names

Zig's module system is changing drastically between releases. However,
the direction seems to be a system where each module is represented on
the command-line by a either multiple arguments in a specific order
(0.12.0) or a single flag with a complex structure (0.11.0). Neither of
those lends itself to tracking parts of the command-line separately in
`depset` values to later on pass to `args.add_all`.

Instead, we track modules in a `depset` of `struct` that carries all
relevant information for each module, and later apply `args.add_all`
using the `map_each` parameter to render the flags for each module.
@aherrmann aherrmann enabled auto-merge February 21, 2024 07:51
@aherrmann aherrmann merged commit 1fe88a2 into main Feb 21, 2024
21 checks passed
@aherrmann aherrmann deleted the zig-mod branch February 21, 2024 08:04
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.

1 participant