Skip to content

gcc: rename enablePlugin to enablePlugins#217978

Closed
ghost wants to merge 2 commits intostagingfrom
unknown repository
Closed

gcc: rename enablePlugin to enablePlugins#217978
ghost wants to merge 2 commits intostagingfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@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
else ["--disable-multilib"])
++ lib.optional (!enableShared) "--disable-shared"
++ lib.singleton (lib.enableFeature enablePlugin "plugin")
++ lib.singleton (lib.enableFeature enablePlugins "plugin")
Copy link
Copy Markdown
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
Copy Markdown
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 on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 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 on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant