-
Notifications
You must be signed in to change notification settings - Fork 704
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
Bootstrap of version 3.8.1.0 fails on macOS #8360
Comments
That you for the report. The bounds on |
You shouldn't need to regenerate the bootstrap files, I believe we check that the linux bootstrap files are good for bootstrapping macOS in CI. Instead, you should be able to bootstrap using the normal bootstrapping command,
|
Oh, I didn't think about that. @essandess: please let us know if that works in your case. @robx: I don't remember if I asked you and I can't find you on IRC/Matrix: would you like to drop in sometimes into the fortnightly cabal dev's chats (starts in 40min)? |
Thanks for the suggestions. Unfortunately, swapping in ghc-pkg: cannot find package base-4.16.2.0 We have explicitly not updated Is there an alternate approach by simply ripping out the version requirements in cabal-bootstrap-gen.cabal? Any suggestion on which requirements to relax, or simply remove all of them? |
That apparently doesn't work either. Simply removing all the requirements from cabal-bootstrap-gen.cabal yields the error: > :info:build src/Main.hs:39:11: error:
> :info:build • Couldn't match expected type: Map.Map C.PackageName I.PackageI
nfo
> :info:build with actual type: (FilePath, Map.Map C.PackageName
I.PackageInfo)
> :info:build • In the first argument of ‘main2’, namely ‘meta’
> :info:build In a stmt of a 'do' block: main2 meta plan
> :info:build In the expression:
> :info:build do meta <- I.cachedHackageMetadata
> :info:build plan <- P.decodePlanJson planPath
> :info:build main2 meta plan
> :info:build |
> :info:build 39 | main2 meta plan
> :info:build | ^^^^ |
I think just add base-4.16 and actually all other |
BTW, I think there is a linux-9.2.1.json somewhere in the repo history, half a year ago perhaps. |
Thanks, but no such luck: git log --all --full-history -- "*linux-9.2.1.json*" I'll try setting the version on |
I've updated to Using linux-9.2.3.json: :debug:build system -W /opt/local/var/macports/build/_opt_local_ports_lang_cabal
/cabal/work/cabal-install-3.8.1.0: ./bootstrap/bootstrap.py -d ./bootstrap/darwi
n-9.4.1.json -w /opt/local/bin/ghc
:info:build ghc-pkg-9.4.1: cannot find package ghc-prim-0.8.0 Trying to build :debug:build system -W /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-install-3.8.1.0: /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/bin/cabal v2-build --with-compiler=/opt/local/bin/ghc --dry-run cabal-install:exe:cabal
:info:build Resolving dependencies...
:info:build Error: cabal: Could not resolve dependencies:
:info:build [__0] trying: Cabal-3.8.1.0 (user goal)
:info:build [__1] trying: base-4.17.0.0/installed-4.17.0.0 (dependency of Cabal)
:info:build [__2] trying: Cabal-described-3.8.1.0 (user goal)
:info:build [__3] next goal: rere (dependency of Cabal-described)
:info:build [__3] rejecting: rere-0.2 (conflict: base==4.17.0.0/installed-4.17.0.0, rere
:info:build => base>=4.3.0.0 && <4.17)
:info:build [__3] skipping: rere-0.1 (has the same characteristics that caused the
:info:build previous version to fail: excludes 'base' version 4.17.0.0) |
Yes, linux-9.2.3.json has no chance to work with GHC 9.4. I wonder, perhaps spin a Linux VM, generate |
BTW, I forgot the backlog, but don't you have any old |
I downloaded the |
And the binary works for you? Forgive my clueless questions, I'm trying to understand the "what for" to be able to help with "how". |
I’m the maintainer of the Bootstrapping |
Thank you for the explanation. So you'd like to bootstrap cabal using ghc binary, but not cabal binary? Why not bootstrap GHC without using ghc binary? Why not bootstrap cabal using ghc and cabal binary?
It always worked only for a selection of GHC version. I hope the selection we have now works. I'm sorry that's not enough for your use case. We might accept a PR that makes more GHC versions available to boostrap with. |
I’m simply following the bootstrap instructions provided in this repo. If there are other methods that work that would be great. Would you please post
|
I think the best way to bootstrap new cabal using a ghc and an old cabal is via |
Here's the error message for sudo -u macports bash -c 'export CABAL_CONFIG=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/config ; \
cd /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-install-3.8.1.0/ ; \
/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/bin/cabal update ; \
/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/bin/cabal install cabal-install'
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org has been updated.
The index-state is set to 2022-08-18T15:48:58Z.
Error: cabal: Could not resolve dependencies:
[__0] trying: Cabal-3.8.1.0 (user goal)
[__1] trying: base-4.17.0.0/installed-4.17.0.0 (dependency of Cabal)
[__2] trying: Cabal-described-3.8.1.0 (user goal)
[__3] next goal: rere (dependency of Cabal-described)
[__3] rejecting: rere-0.2 (conflict: base==4.17.0.0/installed-4.17.0.0, rere
=> base>=4.3.0.0 && <4.17)
[__3] skipping: rere-0.1 (has the same characteristics that caused the
previous version to fail: excludes 'base' version 4.17.0.0)
[__3] fail (backjumping, conflict set: Cabal-described, base, rere)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, Cabal, rere, Cabal-described
Try running with --minimize-conflict-set to improve the error message.
|
Is it advisable to use |
Indeed, cabal-install, or rather its dependencies, don't yet build with GHC 9.4. I'd suggest either using GHC 9.2 or, if you feel adventurous, running with
Depends on how reliable you need it. If very much so, it's probably worth the effort to use Stackage LTS. The newest GHC it lets you use at this time is GHC 9.0.2, which is understandable, given the focus on testing, reproducibility and the need to coordinate a lot of package updates. Also, usually only point version 2 or 3 of GHC is stable enough, so 9.4.1 is not the best bet, though GHC 9.2.5 should probably be and 9.2.2 is probably good enough if it supports your architecture. |
Thanks for the advice. I’ll refactor to use |
Good luck. Out of curiosity, is your stack package bootstrapped from ghc alone? |
I've set things up so that each Haskell thing bootstraps itself: Thinking on this, the real reason I'm pushing ahead with the latest I'd be willing to try a few more wacky things the get |
@essandess this does not look right, why is |
This works for me:
|
Thanks. I see these issues running with the targets $ sudo -u macports bash -c 'export CABAL_CONFIG=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/config ; cd /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-install-3.8.1.0/ ; /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/bin/cabal install cabal-install-3.8.1.0 -w ghc-9.4.1 --allow-newer="cabal-install:time,cabal-install:base,lukko:base,cabal-install:text,hackage-security:base,hackage-security:template-haskell,cabal-install-solver:base"'
Error: cabal: No targets given and there is no package in the current
directory. Use the target 'all' for all packages in the project or specify
packages or components by name or location. See 'cabal build --help' for more
details on target options. sudo -u macports bash -c 'export CABAL_CONFIG=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/config ; cd /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-install-3.8.1.0/ ; /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/bin/cabal install all -w ghc-9.4.1 --allow-newer'
…
Wrote tarball sdist to
/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/dist-newstyle/sdist/cabal-benchmarks-3.tar.gz
Resolving dependencies...
Error: cabal: Cannot build the executables in the package Cabal because it
does not contain any executables. Check the .cabal file for the package and
make sure that it properly declares the components that you expect.
Cannot build the executables in the package Cabal-QuickCheck because it does
not contain any executables. Check the .cabal file for the package and make
sure that it properly declares the components that you expect.
Cannot build the executables in the package Cabal-described because it does
not contain any executables. Check the .cabal file for the package and make
sure that it properly declares the components that you expect.
Cannot build the executables in the package Cabal-syntax because it does not
contain any executables. Check the .cabal file for the package and make sure
that it properly declares the components that you expect.
Cannot build the executables in the package Cabal-tree-diff because it does
not contain any executables. Check the .cabal file for the package and make
sure that it properly declares the components that you expect.
Cannot build the executables in the package cabal-install-solver because it
does not contain any executables. Check the .cabal file for the package and
make sure that it properly declares the components that you expect.
This is what happens when I do that. Also, I don't see how this could bootstrap sudo -u macports bash -c 'export CABAL_CONFIG=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/config ; cd /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/tmp ; /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/bin/cabal update ; /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/bin/cabal install cabal-install-3.8.1.0'
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2022-08-19T00:37:09Z.
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: cabal-install-3.8.1.0 (user goal)
[__1] next goal: base (dependency of cabal-install)
[__1] rejecting: base-4.17.0.0/installed-4.17.0.0 (conflict: cabal-install =>
base>=4.10 && <4.17)
[__1] skipping: base-4.17.0.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '>=4.10 && <4.17' from
'cabal-install')
[__1] rejecting: base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0,
base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0, base-4.14.1.0,
base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0,
base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0,
base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0,
base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0,
base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1,
base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1
(constraint from non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: base, cabal-install)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cabal-install, base |
Retry the last one with the whole |
This PR might help here in the future: |
Great thank you! 🇺🇦 I'm getting very close. I'm able to build with But there's a How to I tell cd "/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-install-3.8.1.0" && \
/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal \
--store-dir=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/store \
--logs-dir=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/.home/.cabal/logs new-install cabal-install-3.8.1.0 \
--prefix=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-install-3.8.1.0/_build \
--with-compiler=/opt/local/bin/ghc \
--allow-newer
…
:info:build Completed cabal-install-3.8.1.0 (lib)
:info:build Starting cabal-install-3.8.1.0 (exe:cabal)
:info:build Building cabal-install-3.8.1.0 (exe:cabal)
:info:build Installing cabal-install-3.8.1.0 (exe:cabal)
:info:build Completed cabal-install-3.8.1.0 (exe:cabal)
:info:build Copying 'cabal' to '/opt/local/bin/cabal'
/opt/local/bin: copyFile:atomicCopyFileContents:withReplacementFile:openBinaryTempFile: permission denied (Operation not permitted) |
|
|
Thanks. I patched the source per #8403, but still see this issue running the first bootstrap command in the instructions: :debug:build system -W /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-install-3.8.1.0: /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/bin/cabal v2-build --with-compiler=/opt/local/bin/ghc --dry-run cabal-install:exe:cabal
:info:build Resolving dependencies...
:info:build Error: cabal: Could not resolve dependencies:
:info:build [__0] trying: Cabal-3.8.1.0 (user goal)
:info:build [__1] trying: base-4.17.0.0/installed-4.17.0.0 (dependency of Cabal)
:info:build [__2] trying: Cabal-described-3.8.1.0 (user goal)
:info:build [__3] next goal: rere (dependency of Cabal-described)
:info:build [__3] rejecting: rere-0.2 (conflict: base==4.17.0.0/installed-4.17.0.0, rere
:info:build => base>=4.3.0.0 && <4.17)
:info:build [__3] skipping: rere-0.1 (has the same characteristics that caused the
:info:build previous version to fail: excludes 'base' version 4.17.0.0)
:info:build [__3] fail (backjumping, conflict set: Cabal-described, base, rere)
:info:build After searching the rest of the dependency tree exhaustively, these were the
:info:build goals I've had most trouble fulfilling: base, Cabal, rere, Cabal-described |
What you describe suggests you run from the cloned repo. If so, https://github.com/haskell/cabal/blob/master/README.md suggests, for your use case, to do |
The instructions at https://github.com/haskell/cabal/blob/master/bootstrap/README.md say to run the command: ./bootstrap/bootstrap.py -d ./bootstrap/darwin-9.4.1.json -w /opt/local/bin/ghc-9.4.1 That's what I'm doing. I included the flag Unfortunately, the :info:build [1 of 2] Compiling Main ( Setup.hs, /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/dists/cabal-install-solver-3.8.1.0/setup/Main.o )
:info:build [2 of 2] Linking /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/dists/cabal-install-solver-3.8.1.0/setup/Setup
:info:build Configuring cabal-install-solver-3.8.1.0...
:info:build Error: Setup: Encountered missing or private dependencies:
:info:build base >=4.10 && <4.17
…
info:build bootstrap: running cwd=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/cabal-install-solver /opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/dists/cabal-install-solver-3.8.1.0/setup/Setup configure --builddir=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/dists/cabal-install-solver-3.8.1.0 --package-db=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/packages.conf --prefix=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/pseudostore --bindir=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/bin --with-compiler=/opt/local/bin/ghc --with-hc-pkg=/opt/local/bin/ghc-pkg --with-hsc2hs=/opt/local/bin/hsc2hs --flags=-debug-conflict-sets -debug-expensive-assertions -debug-tracetree
:info:build Traceback (most recent call last):
:info:build File "/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/./bootstrap/bootstrap.py", line 399, in <module>
:info:build main()
:info:build File "/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/./bootstrap/bootstrap.py", line 367, in main
:info:build bootstrap(info, ghc)
:info:build File "/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/./bootstrap/bootstrap.py", line 262, in bootstrap
:info:build install_dep(dep, ghc)
:info:build File "/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/./bootstrap/bootstrap.py", line 205, in install_dep
:info:build install_sdist(dist_dir, sdist_dir, ghc, dep.flags)
:info:build File "/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/./bootstrap/bootstrap.py", line 235, in install_sdist
:info:build check_call([setup, 'configure'] + configure_args)
:info:build File "/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/./bootstrap/bootstrap.py", line 228, in check_call
:info:build subprocess_run(args, cwd=sdist_dir, check=True)
:info:build File "/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/./bootstrap/bootstrap.py", line 396, in subprocess_run
:info:build return subprocess.run(args, **kwargs)
:info:build File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 524, in run
:info:build raise CalledProcessError(retcode, process.args,
:info:build subprocess.CalledProcessError: Command '[PosixPath('/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/dists/cabal-install-solver-3.8.1.0/setup/Setup'), 'configure', '--builddir=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/dists/cabal-install-solver-3.8.1.0', '--package-db=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/packages.conf', '--prefix=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/pseudostore', '--bindir=/opt/local/var/macports/build/_opt_local_ports_lang_cabal/cabal/work/cabal-Cabal-v3.8.1.0/_build/bin', '--with-compiler=/opt/local/bin/ghc', '--with-hc-pkg=/opt/local/bin/ghc-pkg', '--with-hsc2hs=/opt/local/bin/hsc2hs', '--flags=-debug-conflict-sets -debug-expensive-assertions -debug-tracetree']' returned non-zero exit status 1.
:info:build Command failed: ./bootstrap/bootstrap.py -d ./bootstrap/darwin-9.4.1.json -w /opt/local/bin/ghc
:info:build Exit code: 1
:error:build Failed to build cabal: command execution failed |
This is indeed present in cabal-install-solver.cabal and it rules out GHC 9.4. We'd need to either modify this in all 4 packages or tell Setup (in bootstrap.py) to allow-newer, but I don't know if the latter is even possible. The ability to run bootstrap generation on GHC 9.4 doesn't yet enable you to compile cabal for GHC 9.4, unfortunately. For this we'd need another PR, which is blocked on the ability to set up GHC 9.4 CI for cabal, attempted in #8264. |
Based on the feedback in this thread, I have a I'm confused by the status of bootstrapping cabal install --project-file=cabal.project.release cabal-install -w ghc-9.4.1 --allow-newer What's the Python script even for if the above command works? |
@essandess "bootstrapping" is the case when you don't have another version of
which indicates that you have a previous version of But it's good that it works for you. This thread shows how important it is to understand constraints of your environment! |
Thanks for the explanation. But we need an exisiting |
With the trick that worked for you ( |
Congrats. Do you run it at tag cabal-install-v3.8.1.0? I still think taking the source package from Hackage is more obvious (and even more secure cryptographically, because the repo can be tampered with more easily), but you need to make sure you are not installing it when in the repo checkout directory, because then the local |
I'd like to implement the install using this approach but am still stuck because I would like to be able to run
then copy the binaries and documentation produced by these commands to DESTDIR, and have the package manager take over from there. But running the first command What are the correct |
Did my idea to use
That would probably be what you listed (without the |
This idea works, thank you. But the command
Is there a comparable |
Oh, I missed this. Does any of
|
Sorry, none of these options get around the error:
|
My bad, I mixed up which variant we are currently discussing. The variant with BTW, do you package just the executable or the library as well? If only executable, what are the haddocks for? Would not the user manual be a better option? If the library, |
To be specific, it should build haddocks for the Cabal library, if that's what you are after, and many more. Executables don't have any substantial haddocks as a rule (no library API in their case). |
Thanks. Yes, we would prefer just the binary and the user manual. The command cabal install cabal-install-3.8.1.0 --installdir=./bin --docdir=./doc --htmldir=./html … creates the binary in |
@essandess as described in doc/README.md:
|
Let me think what kinds of users manuals we have. The main one seems to be https://cabal.readthedocs.io/en/3.8. A minor one is the automatically generated man page from |
is this an action item for cabal to fix or just at this point a user question? |
The recently released haskell tar-0.6 introduces some breaking changes that prevent Cabal from building on MacPorts because of its previous use of `--allow-newer` in `build.target`. This line was deliberately added (haskell/cabal#8360 (comment)), but it's causes persistent build failure.
The recently released haskell tar-0.6 introduces some breaking changes that prevent Cabal from building on MacPorts because of its previous use of `--allow-newer` in `build.target`. This line was deliberately added (haskell/cabal#8360 (comment)), but it's causes persistent build failure.
Describe the bug
I'm the maintainer for the MacPorts
cabal
port and am trying to update to version 3.8.1.0.I'm following the revised bootstrap instructions on https://github.com/haskell/cabal/blob/master/bootstrap/README.md#bootstrapping-cabal-install and am hitting this issue. The
cabal
binary is downloaded from https://downloads.haskell.org/~cabal/cabal-install-3.8.1.0/.The
cabal
error prior to thetee
output is:Expected behavior
I expect the file
darwin-9.2.1.json
to be created to be able to bootstrapcabal
on macOS.System information
macOS 12.5 21G72 x86_64
Xcode 13.4.1 13F100
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 9.2.1
The text was updated successfully, but these errors were encountered: