Repository navigation
Add support for Cabal-syntax - #254
Conversation
adc9b5d to
ea3baba
Compare
| if flag(use-cabal-syntax) | ||
| build-depends: Cabal-syntax >= 3.7 && < 3.8 | ||
| else | ||
| build-depends: Cabal >= 1.12 |
There was a problem hiding this comment.
this should have also && <3.7 to make the flag selection options mutually exclusive
| else | ||
| build-depends: Cabal >= 1.14 && < 1.26 | ||
| || >= 2.0 && < 2.6 | ||
| || >= 3.0 && < 3.4 |
There was a problem hiding this comment.
Not intentional, just naively cut-pasted from the existing constraints, updated now.
ea3baba to
83aba08
Compare
|
@Mikolaj would it make sense to commit recent revisions (https://hackage.haskell.org/package/hackage-security-0.6.0.1/revisions/) into the repository? |
Absolutely. If nobody does it, I will do this before a release (probably early next week?). |
Mikolaj
left a comment
There was a problem hiding this comment.
As far as I understand the context, LGTM.
| build-depends: network >= 2.5 && < 2.6 | ||
|
|
||
| if flag(use-cabal-syntax) | ||
| build-depends: Cabal-syntax >= 3.7 && < 3.8 |
There was a problem hiding this comment.
Sorry I overlooked this: it's better to leave the bound <3.9 (here and elsewhere), so we don't need to do revisions right after the Cabal(-syntax)-3.8 is released.
83aba08 to
b1a28ee
Compare
| else | ||
| build-depends: Cabal >= 1.14 && < 1.26 | ||
| || >= 2.0 && < 2.6 | ||
| || >= 3.0 && < 3.7 |
| else | ||
| build-depends: Cabal >= 1.14 && < 1.26 | ||
| || >= 2.0 && < 2.6 | ||
| || >= 3.0 && < 3.7 |
There was a problem hiding this comment.
This logic is trying to handle the split, so for:
< 3.7, use Cabal>= 3.7, use Cabal-syntax
Is that the wrong version to split on?
There was a problem hiding this comment.
Is that the wrong version to split on?
Not really. It's a bit unfortunate as the sections are not mutually exclusive. There could be install-plan with Cabal-syntax-3.7 and Cabal-3.5, so the flag value selection is arbitrary.
This could be problematic, e.g. something which uses old Cabal version still, then the solver will pick the Cabal-syntax-3.7 dependency for hackage-security. And then weird things might happen as e.g. download has PackageIdentifier in its type. Downstream would expect one from Cabal-3.5, but hackage-security would have Cabal-syntax-3.7 one.
A solution to this is to release a dummy Cabal-syntax-3.6 which would depend on Cabal <3.7 and use its version to get mutual exclusive branches. The similar example is https://hackage.haskell.org/package/network-uri-2.5.0.0 but I think it's wrong as network-uri-2.5.0.0 doesn't depend on network we have to write:
if flag(network-uri)
build-depends: network-uri >= 2.6, network >= 2.6
else
build-depends: network-uri < 2.6, network < 2.6
but we would like (in our case) to be able to omit the "network" from the newer branch:
if flag(network-uri)
build-depends: network-uri >= 2.6
else
build-depends: network-uri < 2.6, network < 2.6
I.e. we would write
if flag(Cabal-syntax)
build-depends: Cabal-syntax >= 3.7 && < 3.9
else
build-depends: Cabal-syntax <3.7, Cabal >= 1.12 ...
I'm very tired now, please check that I didn't any mistake in my reasoning.
There was a problem hiding this comment.
... and I would rename the flag to just Cabal-syntax. It's common to just use the package name.
There was a problem hiding this comment.
If I understand flags correctly, assuming we have some package foo that depends on Cabal-3.5 and the updated hackage-security, then the solver will return Cabal-3.5 and Cabal-syntax-3.7. And the maintainer of foo would need to work around that?
Perhaps it would be more user friendly to flip the default so that hackage-security will use Cabal < 3.7 and the dummy Cabal-syntax-3.6 unless newer versions are specifically requested (Cabal >= 3.7 or Cabal-syntax >= 3.7)?
In either case, what's the preferred path for generating the dummy cabal-syntax?
There was a problem hiding this comment.
If nobody objects, I will help to set that in motion.
|
|
||
| flag use-cabal-syntax | ||
| description: Are we using Cabal-syntax? | ||
| manual: False |
There was a problem hiding this comment.
Please specify the default. I never remember which one is a default.
| if flag(use-cabal-syntax) | ||
| build-depends: Cabal-syntax >= 3.7 && < 3.9 | ||
| else | ||
| build-depends: Cabal >= 1.12 && < 3.7 |
There was a problem hiding this comment.
I probably got confused because this section doesn't look like all others.
But this is just an example, so no need to change
| else | ||
| build-depends: Cabal >= 1.14 && < 1.26 | ||
| || >= 2.0 && < 2.6 | ||
| || >= 3.0 && < 3.7 |
|
I will wait for a fixed point or a cyclic alternation and then merge. :) |
|
I guess we reached the fixed point. @patrickdoc: what would we start with? Could we spell out the plan so that @phadej may correct us? |
|
The plan is that I merge soon and release new hackage-security. Bound should guarantee that it won't break 3.6.* nor any earlier cabals when it releases. Changes in cabal will follow. #256 Edit: and I will commit recent revisions (https://hackage.haskell.org/package/hackage-security-0.6.0.1/revisions/) into the repository first. Edit2: and, as @fendor pointed out, we probably need to release the dummy Cabal-syntax package first (it turns out not to be released) --- do we get this right or has the plan changed? |
|
@patrickdoc: re "I update the hackage-security pr to fix the bounds in the flag" from Matrix/IRC, I thought they are already correct in the PR? |
c7333a1 to
8b2087a
Compare
8b2087a to
c717313
Compare
Add support for new Cabal-syntax library: haskell/cabal#7620
The only reference to Cabal I didn't know how to remove was the CPP here: https://github.com/haskell/hackage-security/blob/master/hackage-security/tests/TestSuite.hs#L18