Skip to content
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

Prepare for change of Data.Text.Array to type synonym (Support text-2.1) #1055

Closed
wants to merge 2 commits into from

Conversation

TeofilC
Copy link
Contributor

@TeofilC TeofilC commented Jul 31, 2023

In an upcoming version of text, Array will become a type synonym for Data.Array.Byte.ByteArray, which means that importing its constructors will no longer bring the ByteArray constructor into scope.

This change gives a backwards compatible way to avoid the build failing when that change happens.

In an upcoming version of text, Array will become a type synonym for Data.Array.Byte.ByteArray, which means that importing its constructors will no longer bring the ByteArray constructor into scope.
@Bodigrim
Copy link
Contributor

text-2.1 is out now: https://hackage.haskell.org/package/text-2.1/docs/Data-Text-Array.html

@TeofilC TeofilC changed the title Prepare for change of Data.Text.Array to type synonym Prepare for change of Data.Text.Array to type synonym (Support text-2.1) Aug 29, 2023
@TeofilC
Copy link
Contributor Author

TeofilC commented Aug 29, 2023

I've added a commit to relax the text bounds to allow 2.1

@andreasabel
Copy link
Member

I reported the CI timeout here:

@andreasabel
Copy link
Member

@phadej : Would it be possible to release this patch now?

That would help me testing text-2.1 using a Haskell CI constraint set, in projects that also use aeson.
I tried this:

constraint-set text-2.1
  ghc: >= 8.2
  constraints: text ^>= 2.1
  tests: True
  run-tests: True

raw-project
  allow-newer: text

But it fails because allow-newer: aeson:text is causing a build failure of aeson: https://github.com/haskell-hvr/microaeson/actions/runs/6034329194/job/16372500106?pr=14

@phadej
Copy link
Collaborator

phadej commented Sep 1, 2023

@phadej : Would it be possible to release this patch now?

I don't see any urgency. GHC-9.8 will come soon (this month, i.e. September) with plenty of major version bumps, also there's tasty-1.5 coming, and maybe something else (I haven't checked if GHC-9.8 changes will cause cascade effect somewhere, as GHC-9.6 did with bifunctors e.g.). I have no time too spend too early on that kind of work.

AFAICT, text-2.1 becomes relevant only when GHC-9.8 is released, so I'll wait until then.

Yes, there are alpha releases so we can test stuff before actual release, but the latest GHC-9.8.1-alpha3 doesn't even have text-2.1 in it, nor bytestring-0.12 (will it even be included?), also Cabal is still at development 3.11 version. So these alpha-previews feel to be quite far away from release-quality, so I don't spend time on testing with them too much. (I would if they included some new feature I'm interested in, but these are not relevant for aeson)

@TeofilC
Copy link
Contributor Author

TeofilC commented Sep 1, 2023

Another alternative for testing things before 9.8 is released should be head.hackage. This patch should also be there. Not sure if haskell-ci supports that though

@phadej
Copy link
Collaborator

phadej commented Sep 1, 2023

Another alternative for testing things before 9.8 is released should be head.hackage. This patch should also be there. Not sure if haskell-ci supports that though

It does.

@Bodigrim
Copy link
Contributor

Bodigrim commented Sep 1, 2023

(AFAICT GHC 9.8 will ship with bytestring-0.11, and an upgrade to bytestring-0.12 is postponed until GHC 9.10)

@phadej
Copy link
Collaborator

phadej commented Sep 1, 2023

(AFAICT GHC 9.8 will ship with bytestring-0.11, and an upgrade to bytestring-0.12 is postponed until GHC 9.10)

That's silly. The most visible breaking change in bytestring-0.12 and text-2.1 are the same one: Data.Array.Byte stuff.

@Bodigrim
Copy link
Contributor

Bodigrim commented Sep 2, 2023

@phadej not me calling the shots on this.

@phadej
Copy link
Collaborator

phadej commented Sep 2, 2023

I opened a GHC issue https://gitlab.haskell.org/ghc/ghc/-/issues/23926

@phadej
Copy link
Collaborator

phadej commented Sep 2, 2023

@phadej not me calling the shots on this.

@Bodigrim, you say you don't, but you do: haskell/text#532 (comment)

@Bodigrim
Copy link
Contributor

Bodigrim commented Sep 3, 2023

@phadej not me calling the shots on this.

@Bodigrim, you say you don't, but you do: haskell/text#532 (comment)

If GHC developers prefer to stick to an older release for whatever reason, it's entirely up to them. Equally, it's entirely up to me whether to spend my unpaid time on backports and/or get grumpy about unplanned work.

@andreasabel
Copy link
Member

@phadej: With the GHC 9.8.1 RC1 out, may I renew my request to release this patch please?

This would make it so much easier to test text-2.1 on various GHCs, see e.g. my recent breakage of a constraint-set at https://github.com/haskell-hvr/http-io-streams/actions/runs/6352652447/job/17255929726 .

New facts are: GHC 9.8 will be released both with bytestring-0.12 and text-2.1, see https://downloads.haskell.org/ghc/9.8.1-alpha4/docs/users_guide/9.8.1-notes.html#included-libraries.

andreasabel added a commit to haskell-hvr/http-io-streams that referenced this pull request Sep 30, 2023
@phadej phadej self-assigned this Oct 3, 2023
@phadej phadej mentioned this pull request Oct 4, 2023
@phadej phadej closed this in #1073 Oct 4, 2023
@TeofilC
Copy link
Contributor Author

TeofilC commented Oct 4, 2023

Thanks!

@phadej
Copy link
Collaborator

phadej commented Oct 4, 2023

https://hackage.haskell.org/package/aeson-2.2.1.0 is on Hackage

@andreasabel
Copy link
Member

Great thanks!

Would be excellent if you could you also release attoparsec-aeson-2.2.1.0 to address the issue there:

Building library for attoparsec-aeson-2.2.0.0...
...
[2 of 5] Compiling Data.Aeson.Internal.Text ( src/Data/Aeson/Internal/Text.hs, dist/build/Data/Aeson/Internal/Text.o, dist/build/Data/Aeson/Internal/Text.dyn_o )

src/Data/Aeson/Internal/Text.hs:30:50: error: [GHC-88464]
    Data constructor not in scope:
      ByteArray :: ghc-prim-0.11.0:GHC.Prim.ByteArray# -> Array
    Suggested fix:
      Add ‘ByteArray’ to the import list in the import of
      ‘Data.Text.Array’ (at src/Data/Aeson/Internal/Text.hs:11:1-60).
   |
30 |   let !(SBS.SBS arr) = SBS.toShort bs in T.Text (ByteArray arr) 0 len
   |                                  

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.

None yet

4 participants