-
Notifications
You must be signed in to change notification settings - Fork 722
Use text package to decode UTF-8 instead of doing it ourselves #11462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
52b3ba5 to
550ea8f
Compare
|
In principle, this looks like the right direction of travel. But I'm wary of the CPP and dependence on an internal text module. |
|
CPP can be avoided if everyone is happy to require |
|
With all the stuff we already need for bootstrapping, and 9.2.8 being disrecommended due to bugs, I think we should go ahead and bump it if it avoids CPP. |
This currently requires CPP for text<2, required for Cabal bootstrap plan on GHC 9.2. Hopefully we will be able to get rid of it in a not so distant future: `text-2.0` itself is buildable with GHC >= 8.0 and shipped as a boot package starting from GHC 9.4.
|
One does not simply update a bootstrap plan. Raised #11464 to discuss. |
|
And for what it's worth, I don't see any other |
|
Since it's a change to the library, not the tool, I'd be more careful. In particular, I'd only require text>=2.0 after the last GHC shipping text<2.0 falls out of our support window. Thoughts @Mikolaj @mpickering @ffaf1? |
Could you elaborate why? What's the relationship? |
|
All I can think of is someone building such an older ghc from source, since that would require the newer |
If they are building an old GHC from source, surely they are building an old (For the record, not a hill I'm going to die on; I'm genuinely curious) |
We can drop the plan for GHC 9.2.8, even because we already have more plans than we normally offer. Re requiring new text vs CPP, that's a tough one, in particular, because CPP (and non-strict deps) make it much harder to test all paths in CI. Text 2.0 is 4 years old, so maybe it's time to switch? That obviously needs a major version, asking major lib users ahead of time (especially @mpilgrem and the illustrious distro maintainers) and I may still be missing some old promise or custom around this that @ulysses4ever remembers. |
|
I don't have any reasoning, just things I came to believe over time, overhearing various talks and reading various ancient threads on this bug tracker (no links, sorry). I'd ask Oleg hadn't he explicitly asked not to ping him on ongoing cabal matters. For distributors, apart from Mike, I think it'd be prudent to ping @juhp for feedback. Maybe @maralorn could also opine. (Apologies in advance for a rather vague ping.) The question is whether you guys see any issue in Cabal-the-library requiring text>=2. |
Stack already requires
|
|
Yeah, I this would be no problem on Nixos. |
|
@ulysses4ever @Mikolaj @geekosaur is this enough of assurances to go ahead with this or do you have further reservations? |
|
With respect to text 2, yes, thank you! Is there no way to avoid depending on an internal module? |
| bs1 | ||
| ((acc `shiftL` 6) .|. fromIntegral cn .&. 0x3F) | ||
| | otherwise -> (replacementChar, f bs1) | ||
| go decoderResult bs = case decoderResult of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we're using the same replacementChar, couldn't we just use Data.Text.Encoding.decodeUtf8Lenient? (It's also in 2.0, if you're worried about that.)
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significantin the changelog file.