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

Cabal 2.0 operations fail without an internet connection with default settings. #4821

Closed
dalaing opened this issue Oct 12, 2017 · 2 comments
Closed

Comments

@dalaing
Copy link
Collaborator

dalaing commented Oct 12, 2017

I updated my NixOS VM last night, which bumped my cabal versions to:

> cabal --version
cabal-install version 2.0.0.0
compiled using version 2.0.0.2 of the Cabal library

and then tried to do some development on my train trip into work:

> cabal build
Warning: Caught exception during _mirrors lookup:dieVerbatim: user error
(cabal: '/run/current-system/sw/bin/nslookup' exited with an error:
)
Warning: No mirrors found for http://hackage.haskell.org/
dieVerbatim: user error (cabal: '/run/current-system/sw/bin/curl' exited with an error:
curl: (6) Could not resolve host: hackage.haskell.org

I can comment out the repository information in ~/.cabal/config as a temporary workaround, but it seems like a bad user experience that could be fixed.

@23Skidoo 23Skidoo added this to the 2.0.2 milestone Oct 14, 2017
@23Skidoo 23Skidoo modified the milestones: 2.0.2, 2.4 Aug 29, 2018
@23Skidoo 23Skidoo modified the milestones: 2.4, 2.4.1 Sep 17, 2018
@23Skidoo 23Skidoo modified the milestones: 2.4.1.0, 2.4.2.0 Apr 26, 2019
@phadej phadej modified the milestones: 2.4.2.0, 3.4 Nov 27, 2019
@schmittlauch
Copy link

schmittlauch commented Jul 13, 2020

I, another Nix user, am affected by this as well. Particularly I have set up an isolated nixos container with an environment of all required Haskell dependencies already fetched at container-build time, thanks to cabal2nix. At runtime, cabal run is invoked only within that nix-shell environment with all dependencies being locally available. The container has no internet access and thus cannot reach the hackage indexing servers.

Emptying the cabal config is a workaround, but please keep this use case in mind.

@phadej
Copy link
Collaborator

phadej commented Jul 14, 2020

Use active-repositories: :none in cabal.project (with cabal-install: 3.4).

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

4 participants