cabal icon indicating copy to clipboard operation
cabal copied to clipboard

`--offline` does not stop Cabal from attempting to access the network

Open 9999years opened this issue 1 year ago • 5 comments

Describe the bug

Cabal attempts to access the network, even if --offline is given.

To Reproduce

$ rm -rf dist-newstyle/ ~/.cabal/packages && cabal exec -v --offline -- ghc --print-libdir
...
Trying to locate mirrors via DNS for initial bootstrap of secure repository
'http://hackage.haskell.org/' ...
located 2 mirrors for http://hackage.haskell.org/ :
- http://hackage.fpcomplete.com/
- http://objects-us-east-1.dream.io/hackage-mirror/
Selected mirror http://hackage.haskell.org/
Downloading root
Including the following directories in PATH:
- /Users/wiggles/.cabal/bin
Running: /nix/store/c8zjxnirrs9w62rh5mnzd54rx9w31zai-curl-8.9.0-bin/bin/curl 'http://hackage.haskell.org/root.json' --output /tmp/nix-shell.HDXhum/transportAdapterGet36559-3 --location --write-out '%{http_code}' --user-agent 'cabal-install/3.12.1.0 (osx; aarch64)' --silent --show-error --dump-header /tmp/nix-shell.HDXhum/curl-headers36559-4.txt
...

Expected behavior

If --offline is set, Cabal should not attempt to access the network.

System information

Operating system: macOS Sonoma 14.6.1 (23G93)

$ cabal --version
cabal-install version 3.12.1.0
compiled using version 3.12.1.0 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.6.3

9999years avatar Aug 27 '24 18:08 9999years