-
Notifications
You must be signed in to change notification settings - Fork 710
plan.json
doesn't include compiler id.
#10726
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
Comments
In general it doesn't seem correct to assume that a package in the build plan comes from the store. It may also come from a package database given by Perhaps it would be better in future to store the For now I will just expose the store-dir from the plan.json. |
The plan.json file was missing crucial information needed to locate packages in the store directory structure. When cabal-install stores packages, it uses a full compiler identifier including an ABI tag (e.g., "ghc-9.10.1-69c3") but plan.json only included the basic compiler ID ("ghc-9.10.1"). This made it impossible for external tools like cabal-plan to correctly locate packages and their files in the store. This commit adds: 1. A new "compiler-abi" field with the ABI tag string 2. A "store-dir" section containing: - The complete store directory path (with full compiler ID) - The store package database path - The store incoming directory path These additions allow tools to accurately locate packages in the store without having to guess or reconstruct the paths themselves. The StoreDirLayout is now passed to the JSON encoder, making all store-related paths available in plan.json. The issue reported in the original ticket seems to be about the location of LICENSE files, but the plan.json may still lack sufficient information to locate all license files since the packages may not be located in the store, but in different package databases given by the --package-db flag. This will do for now. Fixes #10726
@mpickering i think it does, but I also think it does too much as I told in private. |
plan.json specifies when package in the plan comes from global db.
Please no,
Store directory is not plan. It also is directly in conflict with any effort making store relocatable. |
I think you are referring to the assumption that the global db (and any package databases specified with --package-db) are immutable. That isn't kept track of very well at the moment but perhaps you could record a hash of each package database you are using rather than just the path to it. If you start mutating the global package database then yes you will corrupt the store. For now I will expose the "abi" field of the compiler into the plan.json and not address this other issue with attempting to recreate store paths from the |
The plan.json file was missing crucial information needed to locate packages in the store directory structure. When cabal-install stores packages, it uses a full compiler identifier including an ABI tag (e.g., "ghc-9.10.1-69c3") but plan.json only included the basic compiler ID ("ghc-9.10.1"). This made it impossible for external tools like cabal-plan to correctly locate packages and their files in the store. This commit adds a new "compiler-abi" field with the ABI tag string The issue reported in the original ticket seems to be about the location of LICENSE files, but the plan.json may still lack sufficient information to locate all license files since the packages may not be located in the store, but in different package databases given by the --package-db flag. This will do for now. Fixes #10726
Since some version of
cabal-install
, the locations of ghc-specific store take "project unit id" (e.g.,("Project Unit Id","ghc-9.10.1-69c3")
) into account. So it's notstore/ghc-9.10.1
butstore/ghc-9.10.1-69c3
). However this information is absent fromplan.json
.plan.json
contains just a version ascompiler-id
:Therefore tools (e.g.
cabal-plan
) which traverse theplan.json
but also information in the store (e.g. license files), cannot do this anymore without also somehow finding the corresponding GHC (which can be anywhere, that's the point of an additional few bits - to disambiguate different GHC builds even with the same main version).The text was updated successfully, but these errors were encountered: