gcc: rename enablePlugin to enablePlugins#217978
Closed
Conversation
added 2 commits
February 23, 2023 22:54
In 6812dd9 I mistakenly had the implication order reversed. This commit corrects that mistake. The original assertion (which is correct) was the following, which asserts that if you enable the GDB plugin, you must enable plugins generally (there is shared infrastructure): ``` assert enableGdbPlugin -> enablePlugin; ``` When the option name was changed to `disableGdbPlugin`, I incorrectly wrote: ``` assert disableGdbPlugin -> enablePlugin; ``` And then again incorrectly wrote: ``` assert disableGdbPlugin -> !enablePlugin; ``` This commit uses the correct equivalent for the first statement, which is the contrapositive: ``` assert !enablePlugin -> disableGdbPlugin; ```
This commit implements @SuperSandro2000's suggestion that `enablePlugins` is a better name for this option: #216237 (comment) This makes a lot of sense. The option does not enable one specific plugin, and in fact does not necessarily enable *all* plugins either. Rather, it enables the general infrastructure for gcc plugins. For example, you can combine `--enable-plugins` with `--disable-libcc1` (which is the GDB plugin).
4 tasks
trofi
reviewed
Feb 24, 2023
| else ["--disable-multilib"]) | ||
| ++ lib.optional (!enableShared) "--disable-shared" | ||
| ++ lib.singleton (lib.enableFeature enablePlugin "plugin") | ||
| ++ lib.singleton (lib.enableFeature enablePlugins "plugin") |
Contributor
There was a problem hiding this comment.
While gcc/gcc has only --enable-plugin m4 code contains both flags:
$ git grep plugin |& fgrep AC_ARG
config/gcc-plugin.m4: AC_ARG_ENABLE(plugin,
config/plugins.m4: AC_ARG_ENABLE([plugins],
It is really scary that enablePlugins enable not the one you expect from the name.
I find enablePlugin and enablePlugins equally non-descriptive for what it does. But at least enablePlugin matches the configure option. There are at least 3 things I know of that gcc has to do with plugins:
liblto_plugin.so:binutilslinker plugin- plugin API
libcc1plugin.so
I suggest picking something more distinctive across the 3. Maybe enablePluginApi? Or not do the rename at all.
Author
There was a problem hiding this comment.
Yikes, I didn't know that there was an --enable-plugin in there.
12 tasks
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Includes (to prevent merge conflicts):
Description of changes
This commit implements @SuperSandro2000's suggestion that
enablePluginsis a better name for this option:#216237 (comment)
This makes a lot of sense. The option does not enable one specific plugin, and in fact does not necessarily enable all plugins either. Rather, it enables the general infrastructure for gcc plugins.
For example, you can combine
--enable-pluginswith--disable-libcc1(which is the GDB plugin).Cc: @trofi @SuperSandro2000
Things done
nix-instantiate -A stdenv)