Skip to content

Fix ex-WINE compiler ordering to appear at end of compiler lists#2

Draft
Copilot wants to merge 2 commits intoWINE-compilers-order-fixfrom
copilot/fix-cd001718-308f-48c4-be61-6d0c6d90e754
Draft

Fix ex-WINE compiler ordering to appear at end of compiler lists#2
Copilot wants to merge 2 commits intoWINE-compilers-order-fixfrom
copilot/fix-cd001718-308f-48c4-be61-6d0c6d90e754

Conversation

Copy link

Copilot AI commented Aug 28, 2025

Fixes compiler-explorer#8006 where ex-WINE compilers were appearing incorrectly at the beginning of compiler lists instead of at the end.

Problem

Ex-WINE compilers (legacy MSVC compilers with "(ex-WINE)" suffix) were being sorted to the beginning of compiler lists due to basic alphabetical string comparison. This resulted in an incorrect ordering like:

x64 msvc v19.0 (ex-WINE)
x64 msvc v19.10 (ex-WINE)
x64 msvc v19.14 (ex-WINE)
x64 msvc v19.latest
x64 msvc v19.43 VS17.13
x64 msvc v19.42 VS17.12
...

When the expected order should place regular compilers first and ex-WINE compilers at the end:

x64 msvc v19.latest
x64 msvc v19.43 VS17.13
x64 msvc v19.42 VS17.12
...
x64 msvc v19.14 (ex-WINE)
x64 msvc v19.10 (ex-WINE)
x64 msvc v19.0 (ex-WINE)

Solution

Replaced the basic alphabetical sort in CompilerFinder.find() with a custom sorting function that:

  1. Prioritizes non-ex-WINE compilers: Regular compilers appear first in the list
  2. Groups ex-WINE compilers at the end: All compilers with "(ex-WINE)" suffix are moved to the end
  3. Maintains alphabetical order within groups: Both regular and ex-WINE compilers are still sorted alphabetically within their respective groups

The implementation uses a simple two-phase comparison:

  • If one compiler is ex-WINE and the other isn't, the non-ex-WINE compiler comes first
  • If both are the same type (both ex-WINE or both regular), fall back to standard alphabetical sorting

Changes

  • lib/compiler-finder.ts: Added customCompilerSort() method and replaced the basic sort call
  • test/compiler-finder-tests.ts: Added test case to verify ex-WINE compilers are sorted to the end

Testing

  • All existing tests continue to pass
  • New test specifically validates that ex-WINE compilers appear at the end of sorted compiler lists
  • Manual verification shows correct ordering for MSVC compiler groups

This is a minimal, targeted fix that only affects compiler list ordering without impacting any other functionality.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.cypress.io
    • Triggering command: node index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: jacobpanov <84049465+jacobpanov@users.noreply.github.com>
Copilot AI changed the title [WIP] Based on the problem explained in the compiler-explorer problem: Ex-WINE compilers appear in an unusual order #8006, (ex-WINE) compilers are ordered incorrectly in the list of compilers for a few different sections of compilers. Currently the list is a... Fix ex-WINE compiler ordering to appear at end of compiler lists Aug 28, 2025
Copilot AI requested a review from jacobpanov August 28, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants