Open essandess opened 5 months ago
~You probably also need to pass --libsubdir
on the command line?~
This looks to me a lot like a cabal v1 workflow (cabal [v2-]configure
edits cabal.project.local
, it does not configure a build). It probably wants to become a runghc Setup.hs
workflow these days.
If there's a bug, it's that cabal 3.10.3 might have allowed (and possibly done unexpected things with) v1-build
parameters given to v2-build
.
I thought these were the correct v2 calls.
What’s the correct call to bootstrap cabal
from source?
If you have an existing cabal
binary, you don't need to do anything special; just cabal-boot build cabal
and cp $(cabal-boot list-bin cabal) targetDir
, since there are no data files associated with it. Our bootstrap procedure is for when you don't have an existing cabal
binary, and you need to work from a checkout of the source tree so you have the bootstrap
directory, which isn't distributed.
cabal configure
in cabal-install v2 is used to edit cabal.project.local
. It has nothing to do directly with building a package, it just edits local project settings. The things it used to do in cabal v1 are now done by cabal build
or cabal run
as appropriate.
While cabal run
in v2
commands (which have been the default since cabal-install 3.0.0.0) accepts the options you gave it, most of them either do nothing or affect paths in cabal's store (see https://cabal.readthedocs.io/en/3.10/nix-local-build-overview.html) and may therefore cause breakage if they're set wrong; that they point into the store is why they're supposed to be relative (to the package's directory in the store), and that older cabal-install accepted them was a bug. (We know the help lists them; there's a ticket about it incorrectly showing both v1 and v2 options.) Additionally, cabal install
by default installs to the store and then makes a symlink to the final install location, and any data files etc. are within the store, not installed to the system.
The intended workflow for system packagers is to use the runghc Setup.hs
interface, which still requires a separate configure
, and most of your prefix options should be passed to that instead of build
.
Thanks for comment @geekosaur .
But please note this is a build for a package manager that itself downloads a specific source code version, and builds and distributes that specific version of cabal
. None of these instructions in your comment appear to provide version control.
How does one build cabal
from downloaded source at https://downloads.haskell.org/~cabal/cabal-install-3.12.1.0/ (latest version 3.12.1.0
, but in general), using the prebuilt binary https://downloads.haskell.org/~cabal/cabal-install-3.12.1.0/cabal-install-3.12.1.0-aarch64-darwin.tar.xz ?
What are the commands to build a cabal
package version 2 from a specific source code downloads? MacPorts has been using this general build approach for all cabal
-based builds, and everything has worked prior to cabal
version 3.12.1.0
:
@geekosaur This diagnosis doesn't appear to be correct. cabal-boot build cabal
still throws the error:
Installation directories are not prefix_relative:
This issue is pretty simple: The source code for cabal
3.12.1.0 is here. The binary for cabal
3.12.1.0 is here.
What are the commands to build a cabal
binary (or any cabal-based binary in general) from source? The command cabal-boot build cabal
throws an error. It did not throw an error in previous versions of cabal
.
If you have an existing
cabal
binary, you don't need to do anything special; justcabal-boot build cabal
andcp $(cabal-boot list-bin cabal) targetDir
, …
The intended workflow for system packagers is to use the
runghc Setup.hs
interface, which still requires a separateconfigure
, and most of your prefix options should be passed to that instead ofbuild
.
I've been trying to follow the instructions at https://github.com/haskell/cabal/blob/master/doc/setup-commands.rst#creating-a-binary-package. But there are 74 files named Setup.hs
in the cabal
source file tree. Which specific runhaskell
command should be used?
If I try the one in ./cabal-install
or ./cabal-install-solver
with the command
runhaskell Setup.hs configure --prefix=/opt/local
(note: after running cabal update
) I get the error:
Encountered missing or private dependencies:
Details:
:debug:configure system -W /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-3.12.1.0/cabal-install-solver: env CABAL_CONFIG=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/config GHC=/opt/local/bin/ghc /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/bin/runhaskell Setup.hs configure --prefix=/opt/local :info:configure Configuring cabal-install-solver-3.12.1.0... :info:configure Error: Setup.hs: Encountered missing or private dependencies: :info:configure Cabal >=3.12.1.0 && <3.13, :info:configure Cabal-syntax >=3.12.1.0 && <3.13, :info:configure edit-distance >=0.2.2 && <0.3, :info:configure network-uri >=2.6.0.2 && <2.7 :info:configure Command failed: env CABAL_CONFIG=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/config GHC=/opt/local/bin/ghc /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/bin/runhaskell Setup.hs configure --prefix=/opt/local
Describe the bug
I'm the maintainer for MacPorts
cabal
, and am trying to update to version 3.12.1.0, which is bootstrapped from source using the prebuilt binary at https://downloads.haskell.org/~cabal/cabal-install-latest/.Source builds using either
--project-file=cabal.bootstrap.project
or--project-file=cabal.release.project
fail to build with the multiple errors of the form:This error is new in version 3.12.1.0. Version 3.10.3.0 bootstraps as expected.
See:
https://github.com/haskell/cabal/blob/7cbc45ede7545a39003d6fb56b5a9d2d7d505176/Cabal/src/Distribution/Simple/Errors.hs#L633
To Reproduce Steps to reproduce the behavior:
Expected behavior
A successful bootstrap.
System information
cabal
3.12.1.0,ghc
9.6.4Additional context
Automated builds of
cabal
3.10.3.0 across multiple macOS versions: https://ports.macports.org/port/cabal/details/