-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BinaryPlatforms] Change "shortest match" algorithm to "best match"
My assertion in the previous attempt to fix this issue was incorrect: > We define a simpler match as one that has fewer tags overall. > As these candidate matches have already been filtered to match the > given platform, the only other tags that exist are ones that are in > addition to the tags declared by the platform. Hence, selecting the > minimum in number of tags is equivalent to selecting the closest match. This is demonstrably false, by my own test case: ``` platforms = Dict( Platform("x86_64", "linux") => "bad", Platform("x86_64", "linux"; sanitize="memory") => "good", ) select_platform(platforms, Platform("x86_64", "linux"; sanitize="memory")) == "good" ``` In this case, because there exists a candidate that is _more general_ than the provided platform type, the shortest match is no longer the best match. This PR performs a more rigorous matching that works more reliably in all cases.
- Loading branch information
1 parent
3db036e
commit e1de57f
Showing
2 changed files
with
36 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters