{"id":17537599,"url":"https://github.com/peterbecich/cabal-resolver-issue","last_synced_at":"2025-07-03T13:05:52.068Z","repository":{"id":41905818,"uuid":"382750924","full_name":"peterbecich/cabal-resolver-issue","owner":"peterbecich","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-17T21:43:08.000Z","size":686,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T03:46:05.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterbecich.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-04T03:05:50.000Z","updated_at":"2023-02-18T17:31:06.000Z","dependencies_parsed_at":"2023-01-18T12:15:58.940Z","dependency_job_id":null,"html_url":"https://github.com/peterbecich/cabal-resolver-issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterbecich/cabal-resolver-issue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbecich%2Fcabal-resolver-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbecich%2Fcabal-resolver-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbecich%2Fcabal-resolver-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbecich%2Fcabal-resolver-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterbecich","download_url":"https://codeload.github.com/peterbecich/cabal-resolver-issue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbecich%2Fcabal-resolver-issue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263331769,"owners_count":23450155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-20T20:42:16.534Z","updated_at":"2025-07-03T13:05:52.047Z","avatar_url":"https://github.com/peterbecich.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://github.com/peterbecich/cabal-resolver-issue/actions/workflows/ci.yml/badge.svg)](https://github.com/peterbecich/cabal-resolver-issue/actions/workflows/ci.yml)\n\n[![Build status](https://github.com/peterbecich/cabal-resolver-issue/actions/workflows/nix-cabal.yml/badge.svg)](https://github.com/peterbecich/cabal-resolver-issue/actions/workflows/nix-cabal.yml)\n\n[![Build status](https://github.com/peterbecich/cabal-resolver-issue/actions/workflows/nix-stack.yml/badge.svg)](https://github.com/peterbecich/cabal-resolver-issue/actions/workflows/nix-stack.yml)\n\nAttempt to replicate issue https://github.com/haskell/cabal/issues/7466.\n\nThis is a Cabal project with an intricate dependency tree, but no source code. It was obfuscated using `obfuscate.hs`.\n\nRun `cabal clean` followed by `cabal build all --dry-run`. The latter takes about 40 seconds locally to run, but is\nfaster on subsequent runs. Switching between `--enable-tests` and `--disable-test` incurs this 40-second cost again.\n\n## `cabal configure`\n\n```\n% cabal clean\n% cabal update\n% time cabal configure\nResolving dependencies...\nBuild profile: -w ghc-8.10.4 -O1\n...\ncabal configure  43.40s user 9.81s system 52% cpu 1:42.08 total\n% time cabal configure\n'cabal.project.local' already exists, backing it up to 'cabal.project.local~'.\nBuild profile: -w ghc-8.10.4 -O1\n...\ncabal configure  7.67s user 2.02s system 54% cpu 17.941 total\n```\n\n## `cabal build all --dry-run`\n\n```\n% cabal clean\n% cabal update\n% time cabal build all --dry-run\nResolving dependencies...\nBuild profile: -w ghc-8.10.4 -O1\n...\ncabal build all --dry-run  44.71s user 9.52s system 45% cpu 1:59.77 total\n% time cabal build all --dry-run\nBuild profile: -w ghc-8.10.4 -O1\n...\ncabal build all --dry-run  8.51s user 2.14s system 56% cpu 18.757 total\n```\n\n## Other considerations\n\n- Deleting `cabal.project.freeze` and compare with that\n- Use the `master` branch of the Cabal project\n\n## Package versions\n\n- Cabal 3.4.0.0 (via ghcup)\n- GHC 8.10.4 (via ghcup)\n\n## Workflow\n\nIn https://github.com/haskell/cabal,\n\n```\ncabal install cabal-install --overwrite-policy=always\n```\n\nThe bug is reproduced by switching between `enable-tests` and `disable-tests`.\nIn this repo, try\n\n```\ntime ~/.cabal/bin/cabal build all --disable-tests --dry-run \u003e disabled.log\n```\nand\n```\ntime ~/.cabal/bin/cabal build all --enable-tests --dry-run \u003e enabled.log\n```\n, then `diff disabled.log enabled.log`.\n\nAlso, try `--verbose:`\n```\ntime ~/.cabal/bin/cabal build all --disable-tests --dry-run --verbose \u003e disabled.log\ntime ~/.cabal/bin/cabal build all --enable-tests --dry-run --verbose \u003e enabled.log\n```\n\nPrint statements placed here\nhttps://github.com/haskell/cabal/blob/ec3cf26ae6021b7ca9f496a39efbcba50e459015/cabal-install/src/Distribution/Client/ProjectPlanning.hs#L413-L416\nindicate that the `improved-plan`\nhttps://github.com/haskell/cabal/blob/ec3cf26ae6021b7ca9f496a39efbcba50e459015/doc/nix-local-build.rst#caching\nchanges, triggering the 30~40 second resolver.\n\n### My results using Cabal 3.4\n\nFrom disabled tests to enabled tests\n```\ncabal build all --disable-tests --dry-run \u003e disabled.log\n1.50s user 0.15s system 99% cpu 1.655 total\n\ncabal build all --enable-tests --dry-run \u003e enabled.log \n30.89s user 0.79s system 99% cpu 31.790 total\n```\nSee `disabled_to_enabled.diff`.\n\nFrom enabled tests to disabled tests\n```\ncabal build all --enable-tests --dry-run \u003e enabled.log  \n1.90s user 0.20s system 100% cpu 2.108 total\n\ncabal build all --disable-tests --dry-run \u003e disabled.log  \n29.72s user 0.85s system 99% cpu 30.668 total\n```\nSee `enabled_to_disabled.diff`.\n\nThe message \"cannot read state cache\" is of interest. The message is defined here:\nhttps://github.com/haskell/cabal/blob/ec3cf26ae6021b7ca9f496a39efbcba50e459015/cabal-install/src/Distribution/Client/ProjectOrchestration.hs#L954-L955\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterbecich%2Fcabal-resolver-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterbecich%2Fcabal-resolver-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterbecich%2Fcabal-resolver-issue/lists"}