Ensure proper case-less handling of FlagName#5082
Ensure proper case-less handling of FlagName#5082peti wants to merge 2 commits intohaskell:masterfrom peti:master
Conversation
|
There are some legit CI failures: it fails to build on older GHCs and AppVeyor found this: |
| let fa' = nub [ map toLower (unFlagName n) | (n,_) <- fa ] | ||
| duplicates = findDuplicateFlagAssignments (mkFlagAssignment fa) | ||
| in | ||
| length duplicates == length fa - length fa' |
There was a problem hiding this comment.
use === (triple equals) to print LHS and RHS in case of failure
|
@23Skidoo, yes, of course! That failure documents the fact that our current API does not ensure that flag name are treated in a case-insensitive way. We apply |
|
Do you want to mark it as expected failure (to be fixed later) and merge as is, or do you plan to fix the underlying issue as part of the same PR? |
|
@23Skidoo, I would like to fix the issue in this PR. The obvious solution would be to move the conversion to all lower-case into the |
|
Noted. |
|
OK, I fixed the underlying issue and moved the There are still CI failures in Travis et al, but these failures seem to be unrelated to my changes. |
|
All CI tests on travis are green. I think this PR is ready to be merged. |
|
There are some failing tests in downstream CI builds. |
This commit adds new unit tests to the Cabal test suite to verify that 'findDuplicateFlagAssignments' recognizes properly cases in which a 'FlagAssignment' was constructed from a list that contains flag names "foo" and "FOO" -- which ought to be a duplicate. Related to #5043.
|
I don't know what is causing these CI test failures in appveyor. I have run the cabal test suite locally and it succeeds just fine on my machine. |
|
Well, there's still the issue that this PR introduces a technical debt we'll have to revert when cleaning up the semantics as e.g. suggested in #5043 (comment), as then we can't just normalise in |
|
Well, there is also the issue that |
|
So ... I trust this all means that this PR will be lying here forever and that I might just as well close it? |
This patch moves the conversion to all-lower-case out of the
FlagNameparser instances and into themkFlagNameconstructor function.Fixes #5043.
Please include the following checklist in your PR:
[ci skip]is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!