-
Notifications
You must be signed in to change notification settings - Fork 80
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
Conversation
I tried to use this (as I was still getting an error after PR #575:
It's correct that my extra flags get gen'd as:
Previously they were:
It seems to be expecting something of shape |
Interesting, the template built into Bazel includes this
other fields that should be set via
FWIW, Bazel itself also uses |
Without this PR, I get the same error as reported by @jtszalay
I will try to fully reproduce and test with a local_override but might only get to to next week. |
Yes, but In Bazel, the So, the |
Thank you @avdv, good catch!
Yes, that's an easy quick fix.
This may be a good motivation to finally replace the |
52f9694
to
e35d136
Compare
toolchains/cc/cc.bzl
Outdated
@@ -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)), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
"%{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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @hofbi , LGTM!
@Mergifyio update |
❌ Mergify doesn't have permission to updateFor security reasons, Mergify can't update this pull request. Try updating locally. |
Used the wrong serialization in #575. Since this is not really used yet, we set always set an empty dict for now.
Closes #578