Skip to content
  • Herbert Valerio Riedel's avatar
    Add more fields to plan.json schema · d2f7845d
    Herbert Valerio Riedel authored
    This adds the following new fields:
    
     - `.compiler-id`
     - `.os`
     - `.arch`
     - `.install-plan[].pkg-name`
     - `.install-plan[].pkg-version`
     - `.install-plan[].pkg-src-sha256`
    
    Having separate "pkg-{name,version}" fields is desirable because the "id"-field
    is actually a UnitId which is supposed to be an opaque id which may not
    always be easily convertible into a PackageId via string operations.
    
    The "pkg-src-sha256" is generally useful to uniquely identify a
    source-tarball (when the package-id is not exact enough).
    
    Finally, the compiler-id/os/arch information is needed to determine the
    values of the respective impl()/os()/arch() predicates used in
    conditionals in .cabal files.
    
    Here's an example demonstrating the new fields:
    
        {
          "cabal-version": "1.25.0.0",
          "cabal-lib-version": "1.25.0.0",
          "compiler-id": "ghc-8.0.1",
          "os": "linux",
          "arch": "x86_64",
          "install-plan": [
    	{
    	  "type": "configured",
    	  "id": "StateVar-1.1.0.4-048d5d25d5813f17f152f9e766fe3ea0ef6f5317439aa115f3fc24e53a0e3c17",
    	  "pkg-name": "StateVar",
    	  "pkg-version": "1.1.0.4",
    	  "flags": {},
    	  "style": "global",
    	  "pkg-src-sha256": "7ad68decb5c9a76f83c95ece5fa13d1b053e4fb1079bd2d3538f6b05014dffb7",
    	  "depends": [
    	    "base-4.9.0.0",
    	    "stm-2.4.4.1-2c7789312d2396a91db173e1ae8cf3a9af3dd18de42bb1021c4978fbab49c191",
    	    "transformers-0.5.2.0"
    	  ],
    	  "exe-depends": [],
    	  "component-name": "lib"
    	},
            {
              "type": "pre-existing",
              "id": "rts",
              "pkg-name": "rts",
              "pkg-version": "1.0",
              "depends": []
            },
    	{
    	  "type": "configured",
    	  "id": "hackage-matrix-builder3-0.3-inplace-matrix-lib",
    	  "pkg-name": "hackage-matrix-builder3",
    	  "pkg-version": "0.3",
    	  "component-name": "lib:matrix-lib"
    	  ...
    	}
    	...
        }
    d2f7845d