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

Support empty extra_flags_per_feature #576

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion toolchains/cc/cc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _nixpkgs_cc_toolchain_config_impl(repository_ctx):
"%{coverage_compile_flags}": get_starlark_list(info.coverage_compile_flags),
"%{coverage_link_flags}": get_starlark_list(info.coverage_link_flags),
"%{supports_start_end_lib}": repr(info.supports_start_end_lib),
"%{extra_flags_per_feature}": repr(info.extra_flags_per_feature),
"%{extra_flags_per_feature}": repr(dict(info.extra_flags_per_feature)),
Copy link
Member

Choose a reason for hiding this comment

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

dict() expects an iterable of pairs as its first argument. info.extra_flags_per_feature is a list of strings. This will only work out if this list is empty. So, this is a bit complicated way of always writing out {}.

Is there a way forward for the EXTRA_FLAGS_PER_FEATURE in cc.nix to be useful? Otherwise I'd rather remove it until there is a use case for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would you suggest we simply do

Suggested change
"%{extra_flags_per_feature}": repr(dict(info.extra_flags_per_feature)),
"%{extra_flags_per_feature}": repr({}),

and remove the rest until there is a concrete usecase?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, even just using "{}" would do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"%{conly_flags}": get_starlark_list(info.conly_flags),
},
)
Expand Down