gcc: deduplicate version expressions#249707
Conversation
|
Rebased. The last merge of Since this is strictly cleanup (no change after eval), in order to prevent that from happening again I am going to merge this to both |
This commit lifts the default gcc version to a top-level attribute so it can be overridden.
Found here: |
Found here: |
|
The last merge of Since this is strictly cleanup (no change after eval), in order to prevent that from happening again I am merging this to both |
This PR sorts the huge pile of patches and deduplicates it. Unlike its predecessors #249707 and #250489 this commit *does* affect eval. Patches below are organized into three general categories: 1. Patches relevant to gcc>=12 on every platform 2. Patches relevant to gcc>=12 on specific platforms 3. Patches relevant only to gcc<12, sorted by the newest version to which they might be relevant
This PR sorts the huge pile of patches and deduplicates it. Unlike its predecessors NixOS/nixpkgs#249707 and NixOS/nixpkgs#250489 this commit *does* affect eval. Patches below are organized into three general categories: 1. Patches relevant to gcc>=12 on every platform 2. Patches relevant to gcc>=12 on specific platforms 3. Patches relevant only to gcc<12, sorted by the newest version to which they might be relevant
This commit simplifies our gcc expression by applying various workarounds unconditionally, rather than only to exactly the versions which applied them prior to the deduplication cleanup. Unlike its predecessors NixOS/nixpkgs#249707 and NixOS/nixpkgs#250489 this commit *does* affect eval.
Description of changes
This PR combines our 10 copy-pasted-but-slightly-different gcc expressions into a single Nix expression which uses conditionals where necessary. It reduces the size of our GCC expression by 64% -- from over 5,000 lines of Nix code to under 2,000.
Prior to this PR, making any kind of change uniformly across all versions of GCC was either impossible or extremely error-prone.
This (mostly) completes the work begun in #243607
This PR causes no change in eval -- all
gccpackages have the samedrvPathafter it as they did before:The
patches/default.nixexpression is more complicated than necessary because it preserves the order of the patches exactly. A follow-up PR will greatly simplify that file, but that follow-up PR won't preservedrvPaths like this one does. Likewise, thefixing the GLIBC_DYNAMIC_LINKER...part ofpostPatchwill be made massively simpler by not worrying about keeping all the whitespace exactly the same.Things done