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

confusion to use Local no-index repositories. parse error when copying from doc. #8425

Closed
andrewufrank opened this issue Aug 23, 2022 · 2 comments

Comments

@andrewufrank
Copy link

andrewufrank commented Aug 23, 2022

Describe the bug
I try to use 'Local no-index repositories' as described in the documentation for cabal 3.8 under point 5.1.3.2
and understood that the additional local repository url is to be introduced int he .cabal/config file: I tried

repository hackage.haskell.org
  url: http://hackage.haskell.org/
repository my-local-repository
  url: file+noindex:///home/frank/Workspace11/uBase/uniform-algebras/dist-newstyle/sdist
            uniform-algebras-0.1.3.tar.gz
  -- secure: True
  -- root-keys:....

and get the error

cabal v2-build
Error: cabal: Error parsing config file /home/frank/.cabal/config:19:
Parse of field 'url' failed.

I seem not to understand how to construct such a local repository, which would be very useful to avoid repeated recompilation of local packages which are not changing, because I do not understand

An external package is any package which is not listed in the packages field. The source code for external packages is usually retrieved from Hackage.
How could an external package listed, if not in one of the fields packages, optional-packages or extra-packages?

Thank you for clarify the documentation!

To Reproduce
Steps to reproduce the behavior:

$ cabal v2-build ...

Please use version-prefixed commands (e.g. v2-build or v1-build) to avoid ambiguity.

Expected behavior
A clear and concise description of what you expected to happen.

System information

frank@santafe:~/Workspace11/u2giscore/uniform-field$ cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library 
frank@santafe:~/Workspace11/u2giscore/uniform-field$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.0.2
frank@santafe:~/Workspace11/u2giscore/uniform-field$ 
  • Operating system debian bullseye updated
  • cabal, ghc versions

Additional context
Add any other context about the problem here.

@fgaz
Copy link
Member

fgaz commented Aug 24, 2022

https://cabal.readthedocs.io/en/stable/config.html#local-no-index-repositories

It’s possible to use a directory of .tar.gz package files as a local package repository.

(emphasis mine)

so it should be

repository my-local-repository
  url: file+noindex:///home/frank/Workspace11/uBase/uniform-algebras/dist-newstyle/sdist

@ulysses4ever
Copy link
Collaborator

I propose we close this issue as handled by the very helpful answer from fgaz.

@fgaz fgaz closed this as completed Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants