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

gcc: rename enablePlugin to enablePlugins #217978

Closed
wants to merge 2 commits into from
Closed

gcc: rename enablePlugin to enablePlugins #217978

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 24, 2023

Includes (to prevent merge conflicts):

Description of changes

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).

Cc: @trofi @SuperSandro2000

Things done
  • Built on platform(s)
    • no eval change (nix-instantiate -A stdenv)

Adam Joseph 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).
@ghost ghost requested a review from matthewbauer as a code owner February 24, 2023 07:08
@ghost ghost mentioned this pull request Feb 24, 2023
4 tasks
@@ -174,7 +174,7 @@ let
then ["--enable-multilib" "--disable-libquadmath"]
else ["--disable-multilib"])
++ lib.optional (!enableShared) "--disable-shared"
++ lib.singleton (lib.enableFeature enablePlugin "plugin")
++ lib.singleton (lib.enableFeature enablePlugins "plugin")
Copy link
Contributor

Choose a reason for hiding this comment

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

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: binutils linker plugin
  • plugin API
  • libcc1plugin.so

I suggest picking something more distinctive across the 3. Maybe enablePluginApi? Or not do the rename at all.

Copy link
Author

Choose a reason for hiding this comment

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

Yikes, I didn't know that there was an --enable-plugin in there.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Feb 24, 2023
@ghost ghost closed this Feb 24, 2023
@ghost ghost changed the title gcc: rename enablePlugin to enablePlugins ignore this Feb 24, 2023
@ghost ghost changed the title ignore this gcc: rename enablePlugin to enablePlugins Feb 24, 2023
@ghost ghost deleted the pr/gcc/rename-enablePlugin branch January 23, 2024 06:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant