Skip to content

Comments

Remove bug-avoiding StoreConfig * casts for settings#6258

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:gcc-bug-ergonomics
Oct 31, 2023
Merged

Remove bug-avoiding StoreConfig * casts for settings#6258
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:gcc-bug-ergonomics

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Mar 14, 2022

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80431 has been fixed, the default GCC in Nixpkgs is now new enough, and the fix is trivial to backport for older GCCs too (I did it in NixOS/nixpkgs#210816).

@edolstra
Copy link
Member

Not opposed in theory but it's a huge diff for little gain... I've never really had a problem with this being a pointer so I'm not sure it really makes Config easier to use.

@Ericson2314
Copy link
Member Author

@edolstra Sure. So I was flailing around with the GCC bug and trying various things, and made this. The pointer vs ref thing is not very import, agreed. The function, however, is useful if due to that bug need to change what base class we are casting "from".

At this point, I am considering instead backporting patch to earlier GCCs (it is very small!), documenting the restriction in the read-me, and just deleting the workarounds. It is a frustrating bug.

How does that sound to you?

@edolstra
Copy link
Member

Hm, requiring GCC 12 or a patched GCC might be pretty inconvenient to downstream packages, so we probably shouldn't do that (yet).

@Ericson2314
Copy link
Member Author

Ericson2314 commented Mar 16, 2022

Well, GCC 12, 5 line patched GCC, or any version of Clang. I do feel like requiring bug-free implementations is "morally" different from requiring the latest features, but yes they are harder to distinguish as a practical matter.

@fricklerhandwerk fricklerhandwerk added the contributor-experience Developer experience for Nix contributors label Sep 9, 2022
@Ericson2314 Ericson2314 marked this pull request as draft February 22, 2023 15:59
@github-actions github-actions bot added the store Issues and pull requests concerning the Nix store label Oct 31, 2023
@Ericson2314 Ericson2314 changed the title Try to make Config a bit easier to use Remove bug-avoiding StoreConfig * casts for settings Oct 31, 2023
@Ericson2314
Copy link
Member Author

This PR was completely redone: rather than working around in a different way, we simply don't need to work around at all any more!

The only churn that is left is getting rid of hacks :).

@Ericson2314 Ericson2314 marked this pull request as ready for review October 31, 2023 16:07
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80431

(test is adapted from issue, test does not test for GCC-specific
behavior but rather absence of bug, so test is good with other compilers
too.)
@Ericson2314 Ericson2314 enabled auto-merge October 31, 2023 16:13
@Ericson2314 Ericson2314 merged commit e3febfc into NixOS:master Oct 31, 2023
@Ericson2314 Ericson2314 deleted the gcc-bug-ergonomics branch October 31, 2023 16:48
tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
Remove bug-avoiding `StoreConfig *` casts for settings

(cherry picked from commit e3febfc)
Change-Id: Ifeae276582fdbc781a38581df9de3da67a7e7bf9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor-experience Developer experience for Nix contributors store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants