-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
pkgsCross.mingwW64.windows.mcfgthreads: add gcc13 compatible version #236598
Conversation
Upstream `gcc-13` merged `mcfgthreads` support with a caveat: it's headers interface is not compatible with the patch `nixpkgs` was carrying in `gcc-12` and before. To keep both new (`gcc13`) and old (`_pre_gcc13`) version I held back previous `windows.mcfgthreads` attribute as `windows.mcfgthreads_pre_gcc_13`. It is used for `gcc` before 13. The change fixes the build of `pkgsCross.mingwW64.stdenv` itself and example program: $ nix build --impure --expr 'with import ./. {}; pkgsCross.mingwW64.re2c.override { stdenv = pkgsCross.mingwW64.gcc11Stdenv; }'
Required per NixOS/nixpkgs#236598.
threadsCross_pre_gcc_13 = if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false) | ||
then { | ||
# other possible values: win32 or posix | ||
model = "mcf"; | ||
# For win32 or posix set this to null | ||
package = targetPackages.windows.mcfgthreads_pre_gcc_13 or windows.mcfgthreads_pre_gcc_13; | ||
} else { }; |
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.
Please stop copy-pasting code like this. Please.
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.
Feel free to revert. Thanks.
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.
I'm not asking for permission to revert this, I'm asking you to stop doing it.
When you duplicate code like this, eventually either:
- Somebody will change one copy and forget to change the other.
- Somebody will deliberately change only one, but leave no explanation of why they didn't change the other.
Either way, if the duplication hasn't been noticed before one of these happens, we don't know which of them happened.
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.
I consider a bit if I should stop contributing at all. Thanks.
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.
Removed myself from the org.
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.
@trofi please reconsider your decision, I don't think @amjoseph-nixpkgs has any ill intentions.
I know that it can be frustrating when higher standards for code are asked.
We all struggle between perfect and shipping, but let's leave the room for discussions.
Upstream
gcc-13
mergedmcfgthreads
support with a caveat: it's headers interface is not compatible with the patchnixpkgs
was carrying ingcc-12
and before.To keep both new (
gcc13
) and old (_pre_gcc13
) version I held back previouswindows.mcfgthreads
attribute aswindows.mcfgthreads_pre_gcc_13
. It is used forgcc
before 13.The change fixes the build of
pkgsCross.mingwW64.stdenv
itself and example program:Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)