Skip to content

Commit b77ad81

Browse files
committed
Add compiler-abi-tag to path command
1 parent a90f33c commit b77ad81

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

cabal-install/src/Distribution/Client/CmdPath.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ data PathOutputs = PathOutputs
324324
data PathCompilerInfo = PathCompilerInfo
325325
{ pathCompilerInfoFlavour :: CompilerFlavor
326326
, pathCompilerInfoId :: CompilerId
327+
, pathCompilerInfoAbiTag :: String
327328
, pathCompilerInfoPath :: FilePath
328329
, pathCompilerInfoStorePath :: FilePath
329330
}
@@ -334,6 +335,7 @@ mkCompilerInfo compilerProgram compiler storeLayout =
334335
PathCompilerInfo
335336
{ pathCompilerInfoFlavour = compilerFlavor compiler
336337
, pathCompilerInfoId = compilerId compiler
338+
, pathCompilerInfoAbiTag = showCompilerIdWithAbi compiler
337339
, pathCompilerInfoPath = programPath compilerProgram
338340
, pathCompilerInfoStorePath = storeDirectory storeLayout compiler
339341
}
@@ -380,6 +382,7 @@ compilerInfoToJson pci =
380382
.= Json.object
381383
[ "flavour" .= jdisplay (pathCompilerInfoFlavour pci)
382384
, "id" .= jdisplay (pathCompilerInfoId pci)
385+
, "abi-tag" .= Json.String (pathCompilerInfoAbiTag pci)
383386
, "path" .= Json.String (pathCompilerInfoPath pci)
384387
, "store-path" .= Json.String (pathCompilerInfoStorePath pci)
385388
]
@@ -410,6 +413,7 @@ compilerInfoToKeyValue :: PathCompilerInfo -> [(String, String)]
410413
compilerInfoToKeyValue pci =
411414
[ ("compiler-flavour", prettyShow $ pathCompilerInfoFlavour pci)
412415
, ("compiler-id", prettyShow $ pathCompilerInfoId pci)
416+
, ("compiler-abi-tag", pathCompilerInfoAbiTag pci)
413417
, ("compiler-path", pathCompilerInfoPath pci)
414418
, ("compiler-store-path", pathCompilerInfoStorePath pci)
415419
]

cabal-testsuite/PackageTests/Path/All/cabal.out

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# cabal path
2-
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"},"logs-dir":"<ROOT>/cabal.dist/home/.cabal/logs","installdir":"<ROOT>/cabal.dist/home/.cabal/bin"}
2+
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","abi-tag":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"},"logs-dir":"<ROOT>/cabal.dist/home/.cabal/logs","installdir":"<ROOT>/cabal.dist/home/.cabal/bin"}
33
# cabal path
4-
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"},"store-dir":"<ROOT>/cabal.dist/home/.cabal/store","config-file":"<ROOT>/cabal.dist/home/.cabal/config"}
4+
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","abi-tag":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"},"store-dir":"<ROOT>/cabal.dist/home/.cabal/store","config-file":"<ROOT>/cabal.dist/home/.cabal/config"}
55
# cabal path
6-
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"},"remote-repo-cache":"<ROOT>/cabal.dist/home/.cabal/packages"}
6+
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","abi-tag":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"},"remote-repo-cache":"<ROOT>/cabal.dist/home/.cabal/packages"}
77
# cabal path
8-
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"},"cache-home":"<ROOT>/cabal.dist/home/.cabal","remote-repo-cache":"<ROOT>/cabal.dist/home/.cabal/packages","logs-dir":"<ROOT>/cabal.dist/home/.cabal/logs","store-dir":"<ROOT>/cabal.dist/home/.cabal/store","config-file":"<ROOT>/cabal.dist/home/.cabal/config","installdir":"<ROOT>/cabal.dist/home/.cabal/bin"}
8+
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","abi-tag":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"},"cache-home":"<ROOT>/cabal.dist/home/.cabal","remote-repo-cache":"<ROOT>/cabal.dist/home/.cabal/packages","logs-dir":"<ROOT>/cabal.dist/home/.cabal/logs","store-dir":"<ROOT>/cabal.dist/home/.cabal/store","config-file":"<ROOT>/cabal.dist/home/.cabal/config","installdir":"<ROOT>/cabal.dist/home/.cabal/bin"}
99
# cabal path
1010
{"cabal-version":"<CABAL_INSTALL_VER>","cache-home":"<ROOT>/cabal.dist/home/.cabal"}
1111
# cabal path
@@ -21,26 +21,30 @@
2121
# cabal path
2222
compiler-flavour: ghc
2323
compiler-id: ghc-<GHCVER>
24+
compiler-abi-tag: ghc-<GHCVER>
2425
compiler-path: <GHCPATH>
2526
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
2627
logs-dir: <ROOT>/cabal.dist/home/.cabal/logs
2728
installdir: <ROOT>/cabal.dist/home/.cabal/bin
2829
# cabal path
2930
compiler-flavour: ghc
3031
compiler-id: ghc-<GHCVER>
32+
compiler-abi-tag: ghc-<GHCVER>
3133
compiler-path: <GHCPATH>
3234
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
3335
store-dir: <ROOT>/cabal.dist/home/.cabal/store
3436
config-file: <ROOT>/cabal.dist/home/.cabal/config
3537
# cabal path
3638
compiler-flavour: ghc
3739
compiler-id: ghc-<GHCVER>
40+
compiler-abi-tag: ghc-<GHCVER>
3841
compiler-path: <GHCPATH>
3942
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
4043
remote-repo-cache: <ROOT>/cabal.dist/home/.cabal/packages
4144
# cabal path
4245
compiler-flavour: ghc
4346
compiler-id: ghc-<GHCVER>
47+
compiler-abi-tag: ghc-<GHCVER>
4448
compiler-path: <GHCPATH>
4549
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
4650
cache-home: <ROOT>/cabal.dist/home/.cabal
@@ -64,26 +68,30 @@ installdir: <ROOT>/cabal.dist/home/.cabal/bin
6468
# cabal path
6569
compiler-flavour: ghc
6670
compiler-id: ghc-<GHCVER>
71+
compiler-abi-tag: ghc-<GHCVER>
6772
compiler-path: <GHCPATH>
6873
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
6974
logs-dir: <ROOT>/cabal.dist/home/.cabal/logs
7075
installdir: <ROOT>/cabal.dist/home/.cabal/bin
7176
# cabal path
7277
compiler-flavour: ghc
7378
compiler-id: ghc-<GHCVER>
79+
compiler-abi-tag: ghc-<GHCVER>
7480
compiler-path: <GHCPATH>
7581
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
7682
store-dir: <ROOT>/cabal.dist/home/.cabal/store
7783
config-file: <ROOT>/cabal.dist/home/.cabal/config
7884
# cabal path
7985
compiler-flavour: ghc
8086
compiler-id: ghc-<GHCVER>
87+
compiler-abi-tag: ghc-<GHCVER>
8188
compiler-path: <GHCPATH>
8289
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
8390
remote-repo-cache: <ROOT>/cabal.dist/home/.cabal/packages
8491
# cabal path
8592
compiler-flavour: ghc
8693
compiler-id: ghc-<GHCVER>
94+
compiler-abi-tag: ghc-<GHCVER>
8795
compiler-path: <GHCPATH>
8896
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
8997
cache-home: <ROOT>/cabal.dist/home/.cabal
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# cabal path
22
compiler-flavour: ghc
33
compiler-id: ghc-<GHCVER>
4+
compiler-abi-tag: ghc-<GHCVER>
45
compiler-path: <GHCPATH>
56
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
67
# cabal path
7-
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"}}
8+
{"cabal-version":"<CABAL_INSTALL_VER>","compiler":{"flavour":"ghc","id":"ghc-<GHCVER>","abi-tag":"ghc-<GHCVER>","path":"<GHCPATH>","store-path":"<ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>"}}
89
# cabal path
910
compiler-flavour: ghc
1011
compiler-id: ghc-<GHCVER>
12+
compiler-abi-tag: ghc-<GHCVER>
1113
compiler-path: <GHCPATH>
1214
compiler-store-path: <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>
1315
# cabal path
1416
compiler-flavour: ghc
1517
compiler-id: ghc-<GHCVER>
18+
compiler-abi-tag: ghc-<GHCVER>
1619
compiler-path: <GHCPATH>
1720
compiler-store-path: fake-dir/ghc-<GHCVER>

0 commit comments

Comments
 (0)