-
Notifications
You must be signed in to change notification settings - Fork 691
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
--offline
does not stop Cabal from attempting to access the network
#10288
Comments
@ulysses4ever No, |
Oh, good catch! Then it's a new revelation, and we need to fix it! I can't reproduce your issue neither with exec nor with build though. What context are you calling cabal from? Any project files involved? Here's what I see with a clean package: ❯ cabal init -nm --lib
...
❯ rm -rf dist-newstyle/ ~/.cabal/packages && cabal-3.12.1.0 exec -v --offline -- ghc --print-libdir
Project settings changed, reconfiguring...
creating /home/artem/Dev/tmp/dist-newstyle
creating /home/artem/Dev/tmp/dist-newstyle/cache
Compiler settings changed, reconfiguring...
Running: /run/current-system/sw/bin/ghc --numeric-version
looking for tool ghc-pkg near compiler in /run/current-system/sw/bin
found ghc-pkg in
/nix/store/j7pf2p2dpyi7psvmgm6aqyqm7iqwbfz8-ghc-9.6.5/bin/ghc-pkg-9.6.5
Running: /nix/store/j7pf2p2dpyi7psvmgm6aqyqm7iqwbfz8-ghc-9.6.5/bin/ghc-pkg-9.6.5 --version
Running: /run/current-system/sw/bin/ghc --supported-languages
Running: /run/current-system/sw/bin/ghc --info
Running: /run/current-system/sw/bin/ghc --print-global-package-db
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent cabal update
index-state(hackage.haskell.org) = 2024-08-27T15:07:51Z
Failed to query pkg-config, Cabal will continue without solving for pkg-config
constraints: Cannot find pkg-config program
Resolving dependencies...
Component graph for tmp-0.1.0.0: component lib
component tmp-0.1.0.0-inplace include base-4.18.2.1
unit tmp-0.1.0.0-inplace
include base-4.18.2.1
MyLib=tmp-0.1.0.0-inplace:MyLib
creating /home/artem/Dev/tmp/dist-newstyle/tmp
Running: /run/current-system/sw/bin/ghc --print-libdir
/nix/store/j7pf2p2dpyi7psvmgm6aqyqm7iqwbfz8-ghc-9.6.5/lib/ghc-9.6.5/lib Without any package available, it just errors citing no package (which may be not the best idea but that's another issue):
|
Where is your
On both my Linux and macOS machines those commands error in the |
Ah, sorry about that: it's the XDG stuff. https://cabal.readthedocs.io/en/stable/config.html#directories |
Describe the bug
Cabal attempts to access the network, even if
--offline
is given.To Reproduce
Expected behavior
If
--offline
is set, Cabal should not attempt to access the network.System information
Operating system: macOS Sonoma 14.6.1 (23G93)
The text was updated successfully, but these errors were encountered: