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

How to make cabal build to ignore ~/.cache/cabal #9884

Closed
yaitskov opened this issue Apr 11, 2024 · 3 comments
Closed

How to make cabal build to ignore ~/.cache/cabal #9884

yaitskov opened this issue Apr 11, 2024 · 3 comments

Comments

@yaitskov
Copy link

Hi,

I noticed that some packages from ~/.cache/cabal can contaminate cabal build.

cabal build is executed inside nix-shell which provides dependencies
and doesn't keep packages in ~/.cache/cabal,
but if somehow a package shows up in ~/.cache/cabal it overrides dependency from nixs-store.

Current workaround is just remove ~/.cache/cabal from time to time, but I would like to have an command line option or an environment variable to disable cache.

cabal --global --package-db= still looks at the cache folder.

@yaitskov
Copy link
Author

cabal-install version 3.10.2.1
compiled using version 3.10.2.1 of the Cabal library

uname -a
Linux diehard 5.13.11 #1 SMP Sun Aug 15 11:46:11 EDT 2021 x86_64 GNU/Linux

    "nixpkgs": {
        "branch": "master",
        "description": "Nix Packages collection",
        "homepage": "",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "5154a46001b1c012f63fa078a741449593545eec",
        "sha256": "136v59r9lsli97nzy26p1j1cqz7xcgrwdjvb8ndwhladzv7ih660",
        "type": "tarball",
        "url": "https://github.com/NixOS/nixpkgs/archive/5154a46001b1c012f63fa078a741449593545eec.tar.gz",
        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
    },

@yaitskov
Copy link
Author

Update:

building cabal project with explicit even empty config files solves the issue.

cabal --config-file=foo build

@gbaz
Copy link
Collaborator

gbaz commented Apr 11, 2024

Note you can also override the cabal-dir using an environment variable (either xdg or cabal_dir specifically): #7386

@gbaz gbaz closed this as completed Apr 11, 2024
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

2 participants