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
gcc10: use gcc 9 patch of mcfgthread.patch to fix MinGW build #107918
Conversation
Result of |
@@ -62,7 +62,7 @@ let majorVersion = "10"; | |||
++ optional langFortran ../gfortran-driving.patch | |||
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch | |||
++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch { | |||
url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch"; | |||
url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-9-branch-Added-mcf-thread-model-support-from-mcfgthread.patch"; |
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.
Since there's a sha256 below, we should not import mfcgthreads-patches-repo.nix at all IMO - the outputHash always takes precedence over url in Nix.
Here's the "official" url for the patch from @lhmouse: It is in fact the same thing as 9000-gcc-9-branch-Added-mcf-thread-model-support-from-mcfgthread.patch though :-). |
Here's a commit removing mfcgthreads-patches-repo.nix that I can push if @Ericson2314 is okay with it: |
Thanks, @matthewbauer! Yeah, that's probably a better way of handling it. |
While I'm decently ambivalent, if we remove that file they will certainly drift out of sync. Also, I think we can go back to using Certainly switching repos and getting new patches is good, though. |
I'll close this then in favour of @matthewbauer's fix. @Ericson2314 Wouldn't it also be easy to forget to update the hash when updating |
I am afraid the links with commit SHA-1 values will expire sooner or later, as the master branch is constantly rebased on upstream and force-pushed. You may fork the repo and maintain a permanent link yourself, or maintain a local copy of it. The patch itself is less likely to result in conflicts nowadays (it used to cause some back in GCC 7 or 8 days). |
@lhmouse Thank you! GitHub should always keep around the old commits, even if they were never merged. (for example youtube-dl on the dcma repo), but yeah we probably shouldn't rely on it, and I think it would be better to maintain a local copy. |
They drift out of sync anyway since the sha256 is cached in cache.nixos.org. You have to update both URL & sha256 to change the contents. Since Nix looks up the cache first, it's bad practice to concat paths in this way, since it's providing more confusion than abstraction. |
Motivation for this change
Fixes #107886.
@Ericson2314 The patch files are no longer available from https://github.com/lhmouse/MINGW-packages. The GCC 9 patch applies fine for GCC 10, but should we keep trying to maintain this in the future?
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)@Ericson2314 @Synthetica9