
I am having a rather unexpected difficulty building older versions of cabal-install. The invariably run into conflicts between "Cabal" and "Cabal-syntax". The latter shows up as a dependency of "Cabal" on hackage, but not in the upstream Git repo. Is there is there some sort of problem with the hackage metadata for Cabal 3.0, 3.2, 3.4, ... It is odd for these to have "Cabal-syntax 3.10.*" as a dependency, with conflicting definitions. -- Viktor.

On Sat, Nov 25, 2023 at 01:07:37AM -0500, Viktor Dukhovni wrote:
I am having a rather unexpected difficulty building older versions of cabal-install. The invariably run into conflicts between "Cabal" and "Cabal-syntax".
The latter shows up as a dependency of "Cabal" on hackage, but not in the upstream Git repo. Is there is there some sort of problem with the hackage metadata for Cabal 3.0, 3.2, 3.4, ...
It is odd for these to have "Cabal-syntax 3.10.*" as a dependency, with conflicting definitions.
I was able to build 'cabal-3.4' from git, after running "cabal freeze" and editing the freeze file to clear the "+cabal-syntax" flag that for some reason was getting set for "hackage-security" (seems to the source of problem) and removing the "3.10" pin for "Cabal-syntax". -- Viktor.

Viktor Dukhovni
I am having a rather unexpected difficulty building older versions of cabal-install. The invariably run into conflicts between "Cabal" and "Cabal-syntax".
The latter shows up as a dependency of "Cabal" on hackage, but not in the upstream Git repo. Is there is there some sort of problem with the hackage metadata for Cabal 3.0, 3.2, 3.4, ...
It is odd for these to have "Cabal-syntax 3.10.*" as a dependency, with conflicting definitions.
I believe it is expected that `Cabal-syntax` should appear in the dependency set of `Cabal`. I had no trouble building `cabal-install` from upstream `master` (4f53a2feeb17bd54b609ee7cfba3c25348aca997) with GHC 9.6.3. Perhaps you could describe more precisely what you are doing? Cheers, - Ben

On Sat, Nov 25, 2023 at 04:52:04PM -0500, Ben Gamari wrote:
The latter shows up as a dependency of "Cabal" on hackage, but not in the upstream Git repo. Is there is there some sort of problem with the hackage metadata for Cabal 3.0, 3.2, 3.4, ...
It is odd for these to have "Cabal-syntax 3.10.*" as a dependency, with conflicting definitions.
I believe it is expected that `Cabal-syntax` should appear in the dependency set of `Cabal`. I had no trouble building `cabal-install` from upstream `master` (4f53a2feeb17bd54b609ee7cfba3c25348aca997) with GHC 9.6.3.
Perhaps you could describe more precisely what you are doing?
Just, for example: $ cabal install --constraint "cabal-install ^>= 3.4" cabal-install This fails due to a conflict between Cabal-3.4 and Cabal-syntax-3.10, (which is not the right choice of dependency for Cabal 3.4). The hackage dependency data looks wrong, the "cabal-syntax" flag in "hackage-security" should not default to "on", and then an older version of "Cabal-syntax" would be chosen. -- Viktor.

Viktor Dukhovni
Just, for example:
$ cabal install --constraint "cabal-install ^>= 3.4" cabal-install
This fails due to a conflict between Cabal-3.4 and Cabal-syntax-3.10, (which is not the right choice of dependency for Cabal 3.4).
The hackage dependency data looks wrong, the "cabal-syntax" flag in "hackage-security" should not default to "on", and then an older version of "Cabal-syntax" would be chosen.
Which GHC version are you attempting to build with? My guess is that `cabal-install-3.4` excludes your GHC's `base` via its version constraints. Cheers, - Ben

On Sat, Nov 25, 2023 at 05:09:59PM -0500, Ben Gamari wrote:
Viktor Dukhovni
writes: Just, for example:
$ cabal install --constraint "cabal-install ^>= 3.4" cabal-install
This fails due to a conflict between Cabal-3.4 and Cabal-syntax-3.10, (which is not the right choice of dependency for Cabal 3.4).
The hackage dependency data looks wrong, the "cabal-syntax" flag in "hackage-security" should not default to "on", and then an older version of "Cabal-syntax" would be chosen.
Which GHC version are you attempting to build with? My guess is that `cabal-install-3.4` excludes your GHC's `base` via its version constraints.
No, I'm specifically using GHC 8.10, which actually comes with the Cabal 3.4 library. Also tried 8.8 with same results. -- Viktor.

On Sat, Nov 25, 2023 at 05:23:33PM -0500, Viktor Dukhovni wrote:
Which GHC version are you attempting to build with? My guess is that `cabal-install-3.4` excludes your GHC's `base` via its version constraints.
No, I'm specifically using GHC 8.10, which actually comes with the Cabal 3.4 library. Also tried 8.8 with same results.
Here's the build output: $ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.8.4 $ cabal --version cabal-install version 3.0.1.0 compiled using version 3.0.1.0 of the Cabal library $ cabal install --constraint 'cabal-install ^>=3.4' cabal-install Resolving dependencies... Build profile: -w ghc-8.8.4 -O1 In order, the following will be built (use -v for more details): - Cabal-3.4.1.0 (lib) (requires build) - Cabal-syntax-3.10.2.0 (lib) (requires build) ... - hackage-security-0.6.2.3 (lib) (requires build) ... - cabal-install-3.4.1.0 (exe:cabal) (requires build) ... Installing Cabal-syntax-3.10.2.0 (lib) Completed Cabal-syntax-3.10.2.0 (lib) Starting hackage-security-0.6.2.3 (lib) Building hackage-security-0.6.2.3 (lib) Installing hackage-security-0.6.2.3 (lib) Completed hackage-security-0.6.2.3 (lib) Installing Cabal-3.4.1.0 (lib) Completed Cabal-3.4.1.0 (lib) Starting cabal-install-3.4.1.0 (exe:cabal) Building cabal-install-3.4.1.0 (exe:cabal) Failed to build exe:cabal from cabal-install-3.4.1.0. Build log ( /home/viktor/.cabal/logs/ghc-8.8.4/cabal-install-3.4.1.0-0f55dc0aa499748357ddf42c4e32b1e210d53da7ef90484735d9a77309f7612d.log ): Configuring executable 'cabal' for cabal-install-3.4.1.0.. Preprocessing executable 'cabal' for cabal-install-3.4.1.0.. Building executable 'cabal' for cabal-install-3.4.1.0.. [ 1 of 180] Compiling Distribution.Client.Compat.Directory ( Distribution/Client/Compat/Directory.hs, dist/build/cabal/cabal-tmp/Distribution/Client/Compat/Directory.o ) [ 2 of 180] Compiling Distribution.Client.Compat.ExecutablePath ( Distribution/Client/Compat/ExecutablePath.hs, dist/build/cabal/cabal-tmp/Distribution/Client/Compat/ExecutablePath.o ) ... [128 of 180] Compiling Distribution.Client.FetchUtils ( Distribution/Client/FetchUtils.hs, dist/build/cabal/cabal-tmp/Distribution/Client/FetchUtils.o ) Distribution/Client/FetchUtils.hs:195:36: error: • Couldn't match type ‘Distribution.Types.PackageId.PackageIdentifier’ with ‘Cabal-syntax-3.10.2.0:Distribution.Types.PackageId.PackageIdentifier’ NB: ‘Cabal-syntax-3.10.2.0:Distribution.Types.PackageId.PackageIdentifier’ is defined in ‘Distribution.Types.PackageId’ in package ‘Cabal-syntax-3.10.2.0’ ‘Distribution.Types.PackageId.PackageIdentifier’ is defined in ‘Distribution.Types.PackageId’ in package ‘Cabal-3.4.1.0’ Expected type: Cabal-syntax-3.10.2.0:Distribution.Types.PackageId.PackageIdentifier Actual type: PackageId • In the second argument of ‘Sec.downloadPackage'’, namely ‘pkgid’ In a stmt of a 'do' block: Sec.downloadPackage' rep pkgid path In the second argument of ‘($)’, namely ‘do info verbosity ("Writing " ++ path) Sec.downloadPackage' rep pkgid path’ | 195 | Sec.downloadPackage' rep pkgid path | ^^^^^ cabal: Failed to build exe:cabal from cabal-install-3.4.1.0. See the build log above for details. -- Viktor.
participants (2)
-
Ben Gamari
-
Viktor Dukhovni