julia
e1de57fb - [BinaryPlatforms] Change "shortest match" algorithm to "best match"

Commit
3 years ago
[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.
Author
Committer
Parents
Loading