Hannes Siebenhandl pushed to branch wip/fendor/dep-json-link-nodes at Glasgow Haskell Compiler / GHC
Commits:
-
175beaef
by fendor at 2026-10-22T09:55:26+02:00
24 changed files:
- + changelog.d/make-depends-link-nodes
- compiler/GHC/Driver/MakeFile.hs
- docs/users_guide/make-depends-json-schema-1_0.json
- testsuite/tests/driver/mkdepend/all.T
- + testsuite/tests/driver/mkdepend/mhu04/app/Main.hs
- + testsuite/tests/driver/mkdepend/mhu04/app/Utils.hs
- + testsuite/tests/driver/mkdepend/mhu04/lib/Lib.hs
- + testsuite/tests/driver/mkdepend/mhu04/lib/Lib/Internal.hs
- + testsuite/tests/driver/mkdepend/mhu04/unitApp
- + testsuite/tests/driver/mkdepend/mhu04/unitLib
- + testsuite/tests/driver/mkdepend/mhu05/app/Main.hs
- + testsuite/tests/driver/mkdepend/mhu05/lib/Lib.hs
- + testsuite/tests/driver/mkdepend/mhu05/lib/Lib/Internal.hs
- + testsuite/tests/driver/mkdepend/mhu05/test/Spec.hs
- + testsuite/tests/driver/mkdepend/mhu05/unitApp
- + testsuite/tests/driver/mkdepend/mhu05/unitLib
- + testsuite/tests/driver/mkdepend/mhu05/unitTest
- + testsuite/tests/driver/mkdepend/mkdepend02.dep-json
- + testsuite/tests/driver/mkdepend/mkdepend02/Main.hs
- + testsuite/tests/driver/mkdepend/mkdepend_bkp_01/bkp01.bkp
- + testsuite/tests/driver/mkdepend/mkdepend_mhu04.dep-json
- + testsuite/tests/driver/mkdepend/mkdepend_mhu04.dep-makefile
- + testsuite/tests/driver/mkdepend/mkdepend_mhu05.dep-json
- + testsuite/tests/driver/mkdepend/mkdepend_mhu05.dep-makefile
Changes:
| 1 | +section: compiler
|
|
| 2 | +synopsis: Expose link nodes in `ghc -M -dep-json` output
|
|
| 3 | +issues: #24384
|
|
| 4 | +mrs: !16717
|
|
| 5 | +description: {
|
|
| 6 | + Adds the option to output the dependency information of `ghc -M` in
|
|
| 7 | + JSON Lines format via the new flag `-dep-json <FILE>`.
|
|
| 8 | + |
|
| 9 | + The output is richer than the `Makefile`, since it can encode additional information
|
|
| 10 | + such as `quote` and `splice` imports (see `-XExplicitLevelImports`).
|
|
| 11 | + By using JSON Lines, the output of `-dep-json` can be streamed efficiently.
|
|
| 12 | +} |
| ... | ... | @@ -77,6 +77,7 @@ import System.IO |
| 77 | 77 | import System.IO.Error (isEOFError)
|
| 78 | 78 | import System.OsPath as OsPath
|
| 79 | 79 | import System.OsString qualified as OsString
|
| 80 | +import qualified GHC.Unit.Env as UnitEnv
|
|
| 80 | 81 | |
| 81 | 82 | -----------------------------------------------------------------
|
| 82 | 83 | --
|
| ... | ... | @@ -216,6 +217,19 @@ data Dep |
| 216 | 217 | { dep_path :: OsPath
|
| 217 | 218 | }
|
| 218 | 219 | |
| 220 | +data DepLink
|
|
| 221 | + = DepLink
|
|
| 222 | + { link_output :: !UnitId
|
|
| 223 | + , link_nodes :: ![DepLinkNode]
|
|
| 224 | + , link_type :: GhcLink
|
|
| 225 | + }
|
|
| 226 | + |
|
| 227 | +data DepLinkNode
|
|
| 228 | + = DepLink_Unit !UnitId
|
|
| 229 | + | DepLink_Module !ModuleNameWithIsBoot !UnitId
|
|
| 230 | + | DepLink_HomeUnit {-# UNPACK #-} !UnitId
|
|
| 231 | + | DepLink_ExtUnit {-# UNPACK #-} !UnitId
|
|
| 232 | + |
|
| 219 | 233 | data DependencyWriter = DependencyWriter
|
| 220 | 234 | { dw_beginWriter :: IO DepSink
|
| 221 | 235 | , dw_endWriter :: IO ()
|
| ... | ... | @@ -223,6 +237,7 @@ data DependencyWriter = DependencyWriter |
| 223 | 237 | |
| 224 | 238 | data DepSink = DepSink
|
| 225 | 239 | { ds_writeDependency :: DepNode -> [Dep] -> IO ()
|
| 240 | + , ds_writeLinkDependency :: DepLink -> IO ()
|
|
| 226 | 241 | }
|
| 227 | 242 | |
| 228 | 243 | -----------------------------------------------------------------
|
| ... | ... | @@ -261,7 +276,22 @@ processDeps hsc_env _ _ (AcyclicSCC (InstantiationNode _uid node)) |
| 261 | 276 | mkPlainErrorMsgEnvelope noSrcSpan $
|
| 262 | 277 | GhcDriverMessage $ DriverInstantiationNodeInDependencyGeneration node
|
| 263 | 278 | |
| 264 | -processDeps _ _ _ (AcyclicSCC (LinkNode {})) = return ()
|
|
| 279 | +processDeps hsc_env _ sinks (AcyclicSCC (LinkNode keys unitId)) = do
|
|
| 280 | + let
|
|
| 281 | + toLinkNodeDep = \ case
|
|
| 282 | + NodeKey_Unit iu -> DepLink_Unit $ virtualUnitId iu
|
|
| 283 | + NodeKey_Module node -> DepLink_Module (mnkModuleName node) (mnkUnitId node)
|
|
| 284 | + NodeKey_Link uid -> DepLink_HomeUnit uid
|
|
| 285 | + NodeKey_ExternalUnit uid -> DepLink_ExtUnit uid
|
|
| 286 | + |
|
| 287 | + linkNode = DepLink
|
|
| 288 | + { link_nodes = map toLinkNodeDep keys
|
|
| 289 | + , link_output = unitId
|
|
| 290 | + , link_type = ghcLink $ UnitEnv.ue_unitFlags unitId (hsc_unit_env hsc_env)
|
|
| 291 | + }
|
|
| 292 | + |
|
| 293 | + traverse_ (\ sink -> ds_writeLinkDependency sink linkNode) sinks
|
|
| 294 | + |
|
| 265 | 295 | processDeps _ _ _ (AcyclicSCC (UnitNode {})) = return ()
|
| 266 | 296 | processDeps _ _ _ (AcyclicSCC (ModuleNode _ (ModuleNodeFixed {})))
|
| 267 | 297 | -- No dependencies needed for fixed modules (already compiled)
|
| ... | ... | @@ -385,8 +415,13 @@ initFileDepWriter logger root tmpfs dflags makefile = do |
| 385 | 415 | files <- beginMkDependHS logger tmpfs dflags makefile
|
| 386 | 416 | pure DependencyWriter
|
| 387 | 417 | { dw_beginWriter = do
|
| 388 | - pure $ DepSink $ \ node deps -> do
|
|
| 389 | - writeDependencies root (mkd_tmp_hdl files) suffixes node deps
|
|
| 418 | + pure DepSink
|
|
| 419 | + { ds_writeDependency = \ node deps -> do
|
|
| 420 | + writeDependencies root (mkd_tmp_hdl files) suffixes node deps
|
|
| 421 | + , ds_writeLinkDependency = \ _linkNode -> do
|
|
| 422 | + -- Link nodes are not supported
|
|
| 423 | + pure ()
|
|
| 424 | + }
|
|
| 390 | 425 | , dw_endWriter = endMkDependHS logger files
|
| 391 | 426 | }
|
| 392 | 427 | where
|
| ... | ... | @@ -559,8 +594,13 @@ initJsonDepWriter logger tmpfs dflags output = do |
| 559 | 594 | json_var <- mkJsonOutput logger tmpfs dflags output initDepJson
|
| 560 | 595 | pure DependencyWriter
|
| 561 | 596 | { dw_beginWriter =
|
| 562 | - pure $ DepSink $ \ node deps ->
|
|
| 563 | - writeHomeUnitDeps json_var node deps
|
|
| 597 | + pure DepSink
|
|
| 598 | + { ds_writeDependency = \ node deps ->
|
|
| 599 | + writeHomeUnitDeps json_var node deps
|
|
| 600 | + , ds_writeLinkDependency = \ link ->
|
|
| 601 | + -- Link nodes are not supported
|
|
| 602 | + writeLinkNode json_var link
|
|
| 603 | + }
|
|
| 564 | 604 | , dw_endWriter = do
|
| 565 | 605 | writeJsonOutput logger json_var
|
| 566 | 606 | }
|
| ... | ... | @@ -629,8 +669,12 @@ writeJsonOutput logger JsonOutput {json_path, json_tmp_file, json_tmp_hdl} = do |
| 629 | 669 | -- Output helpers
|
| 630 | 670 | |
| 631 | 671 | writeJsonl :: ToJson a => JsonOutput -> a -> IO ()
|
| 632 | -writeJsonl JsonOutput {json_tmp_hdl} output = do
|
|
| 633 | - hPutStrLn json_tmp_hdl (showSDocUnsafe $ renderJSON $ json output)
|
|
| 672 | +writeJsonl deps_json output = do
|
|
| 673 | + writeJsonl' deps_json (json output)
|
|
| 674 | + |
|
| 675 | +writeJsonl' :: JsonOutput -> JsonDoc -> IO ()
|
|
| 676 | +writeJsonl' JsonOutput {json_tmp_hdl} output = do
|
|
| 677 | + hPutStrLn json_tmp_hdl (showSDocUnsafe $ renderJSON output)
|
|
| 634 | 678 | |
| 635 | 679 | --------------------------------------------------------------------------------
|
| 636 | 680 | -- Payload for -dep-json
|
| ... | ... | @@ -849,6 +893,65 @@ writeHomeUnitDeps deps_json DepNode {..} deps = do |
| 849 | 893 | DepCpp {dep_path} ->
|
| 850 | 894 | (extDeps, addCpp dep_path node_data)
|
| 851 | 895 | |
| 896 | +writeLinkNode :: JsonOutput -> DepLink -> IO ()
|
|
| 897 | +writeLinkNode dep_json (DepLink uid deps linkType) = do
|
|
| 898 | + writeJsonl' dep_json $
|
|
| 899 | + JSObject
|
|
| 900 | + [ ("unit-id", JSString $ unitIdString uid)
|
|
| 901 | + , ("link-type", linkTypeJson linkType)
|
|
| 902 | + , ("deps", JSArray $ concat
|
|
| 903 | + [ map renderMods (Map.toList allMods)
|
|
| 904 | + , map (JSString . unitIdString) (Set.toList units)
|
|
| 905 | + , map (JSString . unitIdString) (Set.toList homeUids)
|
|
| 906 | + , map (JSString . unitIdString) (Set.toList extUids)
|
|
| 907 | + ])
|
|
| 908 | + ]
|
|
| 909 | + where
|
|
| 910 | + (extUids, homeUids, units, allMods) = foldl' go (Set.empty, Set.empty, Set.empty, Map.empty) deps
|
|
| 911 | + |
|
| 912 | + renderMods (u, ms) =
|
|
| 913 | + JSObject
|
|
| 914 | + [ ("unit-id", JSString $ unitIdString u)
|
|
| 915 | + , ("modules", JSArray $ map moduleKey (Set.toList ms))
|
|
| 916 | + ]
|
|
| 917 | + |
|
| 918 | + |
|
| 919 | + go (ext, homeUid, unit, mods) = \ case
|
|
| 920 | + DepLink_Module modName u ->
|
|
| 921 | + let
|
|
| 922 | + newMods = Map.insertWith (Set.union) u (Set.singleton modName) mods
|
|
| 923 | + in
|
|
| 924 | + (ext, homeUid, unit, newMods)
|
|
| 925 | + DepLink_Unit uid ->
|
|
| 926 | + (ext, homeUid, Set.insert uid unit, mods)
|
|
| 927 | + DepLink_HomeUnit uid ->
|
|
| 928 | + (ext, Set.insert uid homeUid, unit, mods)
|
|
| 929 | + DepLink_ExtUnit uid ->
|
|
| 930 | + (Set.insert uid ext, homeUid, unit, mods)
|
|
| 931 | + |
|
| 932 | + moduleNameJson m = JSString $ moduleNameString m
|
|
| 933 | + |
|
| 934 | + moduleKey :: ModuleNameWithIsBoot -> JsonDoc
|
|
| 935 | + moduleKey t =
|
|
| 936 | + case gwib_isBoot t of
|
|
| 937 | + NotBoot -> moduleNameJson (gwib_mod t)
|
|
| 938 | + IsBoot -> JSObject
|
|
| 939 | + [ ("module", moduleNameJson (gwib_mod t))
|
|
| 940 | + -- Redundant check, but the compiler will fix it and
|
|
| 941 | + -- this feels like it might avoid bugs in the future.
|
|
| 942 | + , ("boot", JSBool $ gwib_isBoot t == IsBoot)
|
|
| 943 | + ]
|
|
| 944 | + |
|
| 945 | + linkTypeJson :: GhcLink -> JsonDoc
|
|
| 946 | + linkTypeJson = JSString . \ case
|
|
| 947 | + NoLink{} -> panic ""
|
|
| 948 | + LinkExecutable{} -> "executable"
|
|
| 949 | + LinkInMemory{} -> "in-memory"
|
|
| 950 | + LinkDynLib{} -> "dynamic-library"
|
|
| 951 | + LinkBytecodeLib{} -> "bytecode-library"
|
|
| 952 | + LinkStaticLib{} -> "static-library"
|
|
| 953 | + LinkMergedObj{} -> "merged-object"
|
|
| 954 | + |
|
| 852 | 955 | -----------------------------------------------------------------
|
| 853 | 956 | -- Module cycles
|
| 854 | 957 | -----------------------------------------------------------------
|
| ... | ... | @@ -3,14 +3,15 @@ |
| 3 | 3 | "title": "GHC dependencies",
|
| 4 | 4 | "description": "The dependency graph of a Haskell program.",
|
| 5 | 5 | "oneOf": [
|
| 6 | - { "$ref": "#/definitions/home-module" },
|
|
| 7 | - { "$ref": "#/definitions/external-unit" }
|
|
| 6 | + { "$ref": "#/definitions/external-unit" },
|
|
| 7 | + { "$ref": "#/definitions/module" },
|
|
| 8 | + { "$ref": "#/definitions/link" }
|
|
| 8 | 9 | ],
|
| 9 | 10 | "definitions": {
|
| 10 | 11 | "external-unit": {
|
| 11 | 12 | "type": "object",
|
| 12 | 13 | "properties": {
|
| 13 | - "unit-id": { "$ref": "#/definitions/unit-name" },
|
|
| 14 | + "unit-id": { "$ref": "#/definitions/unit-id" },
|
|
| 14 | 15 | "package-name": { "$ref": "#/definitions/package-name" },
|
| 15 | 16 | "package-id": { "$ref": "#/definitions/package-id" }
|
| 16 | 17 | },
|
| ... | ... | @@ -29,17 +30,17 @@ |
| 29 | 30 | "module-name": {
|
| 30 | 31 | "type": "string"
|
| 31 | 32 | },
|
| 32 | - "home-module": {
|
|
| 33 | + "module": {
|
|
| 33 | 34 | "type": "object",
|
| 34 | 35 | "properties": {
|
| 35 | 36 | "module": { "$ref": "#/definitions/module-name" },
|
| 36 | 37 | "unit-id": { "$ref": "#/definitions/unit-id" },
|
| 37 | 38 | "package-name": { "$ref": "#/definitions/package-name" },
|
| 38 | - "source": { "$ref": "#/definitions/home-module-source" },
|
|
| 39 | - "boot": { "type": "boolean" },
|
|
| 39 | + "source": { "$ref": "#/definitions/module-source" },
|
|
| 40 | + "boot": { "$ref": "#/definitions/boot" },
|
|
| 40 | 41 | "includes": {
|
| 41 | 42 | "type": "array",
|
| 42 | - "items": { "$ref": "#/definitions/home-module-include" }
|
|
| 43 | + "items": { "$ref": "#/definitions/module-include" }
|
|
| 43 | 44 | },
|
| 44 | 45 | "imports": {
|
| 45 | 46 | "type": "object",
|
| ... | ... | @@ -48,18 +49,18 @@ |
| 48 | 49 | "items": { "$ref": "#/definitions/import" }
|
| 49 | 50 | }
|
| 50 | 51 | },
|
| 51 | - "preprocessor": { "$ref": "#/definitions/home-module-preprocessor" }
|
|
| 52 | + "preprocessor": { "$ref": "#/definitions/module-preprocessor" }
|
|
| 52 | 53 | },
|
| 53 | 54 | "required": ["module", "unit-id", "source"],
|
| 54 | 55 | "unevaluatedProperties": false
|
| 55 | 56 | },
|
| 56 | - "home-module-source": {
|
|
| 57 | + "module-source": {
|
|
| 57 | 58 | "type": "string"
|
| 58 | 59 | },
|
| 59 | - "home-module-include": {
|
|
| 60 | + "module-include": {
|
|
| 60 | 61 | "type": "string"
|
| 61 | 62 | },
|
| 62 | - "home-module-preprocessor": {
|
|
| 63 | + "module-preprocessor": {
|
|
| 63 | 64 | "type": "string"
|
| 64 | 65 | },
|
| 65 | 66 | "import": {
|
| ... | ... | @@ -70,17 +71,66 @@ |
| 70 | 71 | "properties": {
|
| 71 | 72 | "module": { "$ref": "#/definitions/module-name" },
|
| 72 | 73 | "level": { "$ref": "#/definitions/import-level" },
|
| 73 | - "boot": { "type": "boolean" }
|
|
| 74 | + "boot": { "$ref": "#/definitions/boot" }
|
|
| 74 | 75 | },
|
| 75 | 76 | "required": ["module"],
|
| 76 | 77 | "unevaluatedProperties": false
|
| 77 | 78 | }
|
| 78 | 79 | ]
|
| 79 | 80 | },
|
| 81 | + "boot": {
|
|
| 82 | + "type": "boolean",
|
|
| 83 | + "default": false
|
|
| 84 | + },
|
|
| 80 | 85 | "import-level": {
|
| 81 | 86 | "type": "string",
|
| 82 | 87 | "enum": ["normal", "quote", "splice"],
|
| 83 | 88 | "default": "normal"
|
| 89 | + },
|
|
| 90 | + "link": {
|
|
| 91 | + "type": "object",
|
|
| 92 | + "link-type": { "$ref": "#/definitions/link-type" },
|
|
| 93 | + "properties": {
|
|
| 94 | + "links": {
|
|
| 95 | + "type": "array",
|
|
| 96 | + "items": { "$ref": "#/definitions/link-unit" }
|
|
| 97 | + }
|
|
| 98 | + }
|
|
| 99 | + },
|
|
| 100 | + "link-type": {
|
|
| 101 | + "type": "string",
|
|
| 102 | + "enum": [
|
|
| 103 | + "executable",
|
|
| 104 | + "in-memory",
|
|
| 105 | + "dynamic-library",
|
|
| 106 | + "bytecode-library",
|
|
| 107 | + "static-library",
|
|
| 108 | + "merged-object"
|
|
| 109 | + ]
|
|
| 110 | + },
|
|
| 111 | + "link-unit": {
|
|
| 112 | + "type": "object",
|
|
| 113 | + "properties": {
|
|
| 114 | + "unit-id": { "$ref": "#/definitions/unit-id" },
|
|
| 115 | + "modules": {
|
|
| 116 | + "type": "array",
|
|
| 117 | + "items": { "$ref": "#/definitions/link-module" }
|
|
| 118 | + }
|
|
| 119 | + },
|
|
| 120 | + "required": ["unit-id"]
|
|
| 121 | + },
|
|
| 122 | + "link-module": {
|
|
| 123 | + "oneOf": [
|
|
| 124 | + { "$ref": "#/definitions/module-name" },
|
|
| 125 | + {
|
|
| 126 | + "type": "object",
|
|
| 127 | + "properties": {
|
|
| 128 | + "module": { "$ref": "#/definitions/module-name" },
|
|
| 129 | + "boot": { "$ref": "#/definitions/boot" }
|
|
| 130 | + },
|
|
| 131 | + "required": ["module"]
|
|
| 132 | + }
|
|
| 133 | + ]
|
|
| 84 | 134 | }
|
| 85 | 135 | }
|
| 86 | 136 | } |
| ... | ... | @@ -30,9 +30,23 @@ test('mkdepend_mhu03', |
| 30 | 30 | , when(opsys('mingw32'), skip) # shell script preprocessor
|
| 31 | 31 | ],
|
| 32 | 32 | make_depend_multiunit, [['mhu03/unitA'], ''])
|
| 33 | +# Link nodes
|
|
| 34 | +test('mkdepend_mhu04',
|
|
| 35 | + [ extra_files(['mhu04/']), dep_makefile, dep_json ],
|
|
| 36 | + make_depend_multiunit, [['mhu04/unitLib', 'mhu04/unitApp'], ''])
|
|
| 37 | +test('mkdepend_mhu05',
|
|
| 38 | + [ extra_files(['mhu05/']), dep_makefile, dep_json ],
|
|
| 39 | + make_depend_multiunit, [['mhu05/unitLib', 'mhu05/unitApp', 'mhu05/unitTest'], ''])
|
|
| 33 | 40 | |
| 34 | 41 | # Honour -F
|
| 35 | 42 | test('mkdepend01',
|
| 36 | 43 | [ extra_files(['mkdepend01/']), dep_makefile, dep_json ],
|
| 37 | 44 | make_depend, [['mkdepend01/A.hs'], '-pgmF pp'])
|
| 38 | - |
|
| 45 | +# Link nodes
|
|
| 46 | +test('mkdepend02',
|
|
| 47 | + [ extra_files(['mkdepend02/']), dep_json ],
|
|
| 48 | + make_depend, [['mkdepend02/Main.hs'], ''])
|
|
| 49 | +# Backpack
|
|
| 50 | +test('mkdepend_bkp_01',
|
|
| 51 | + [ extra_files(['mkdepend_bkp_01/']), dep_json, expect_fail ],
|
|
| 52 | + make_depend, [['mkdepend_bkp_01/bkp01.bkp'], '']) |
| 1 | +module Main (main) where
|
|
| 2 | + |
|
| 3 | +import Lib (greeting)
|
|
| 4 | +import Utils (shout)
|
|
| 5 | + |
|
| 6 | +main :: IO ()
|
|
| 7 | +main = putStrLn (shout greeting) |
| 1 | +module Utils (shout) where
|
|
| 2 | + |
|
| 3 | +import Data.Char (toUpper)
|
|
| 4 | + |
|
| 5 | +shout :: String -> String
|
|
| 6 | +shout = map toUpper |
| 1 | +module Lib (greeting) where
|
|
| 2 | + |
|
| 3 | +import Lib.Internal (name)
|
|
| 4 | + |
|
| 5 | +greeting :: String
|
|
| 6 | +greeting = "Hello, " ++ name |
| 1 | +module Lib.Internal (name) where
|
|
| 2 | + |
|
| 3 | +name :: String
|
|
| 4 | +name = "world" |
| 1 | +-i -i. -working-dir=mhu04/app -this-unit-id app -this-package-name app -package-id lib -o app Main |
| 1 | +-i -i. -working-dir=mhu04/lib -this-unit-id lib -this-package-name lib Lib Lib.Internal |
| 1 | +module Main (main) where
|
|
| 2 | + |
|
| 3 | +import Lib (greeting)
|
|
| 4 | + |
|
| 5 | +main :: IO ()
|
|
| 6 | +main = putStrLn greeting |
| 1 | +module Lib (greeting) where
|
|
| 2 | + |
|
| 3 | +import Lib.Internal (name)
|
|
| 4 | + |
|
| 5 | +greeting :: String
|
|
| 6 | +greeting = "Hello, " ++ name |
| 1 | +module Lib.Internal (name) where
|
|
| 2 | + |
|
| 3 | +name :: String
|
|
| 4 | +name = "world" |
| 1 | +module Spec (main) where
|
|
| 2 | + |
|
| 3 | +import Lib (greeting)
|
|
| 4 | +import Lib.Internal (name)
|
|
| 5 | + |
|
| 6 | +main :: IO ()
|
|
| 7 | +main
|
|
| 8 | + | greeting == "Hello, " ++ name = putStrLn "OK"
|
|
| 9 | + | otherwise = error "unexpected greeting" |
| 1 | +-i -i. -working-dir=mhu05/app -this-unit-id app -this-package-name app -package-id lib -o app Main |
| 1 | +-i -i. -working-dir=mhu05/lib -this-unit-id lib -this-package-name lib -staticlib Lib Lib.Internal |
| 1 | +-i -i. -working-dir=mhu05/test -this-unit-id test -this-package-name test -package-id lib -main-is Spec -o test Spec |
| 1 | +{"module":"Main","unit-id":"main","imports":{},"source":"mkdepend02/Main.hs"}
|
|
| 2 | +{"unit-id":"main","link-type":"executable","deps":[{"unit-id":"main","modules":["Main"]}]} |
| 1 | +module Main where
|
|
| 2 | + |
|
| 3 | +main = putStrLn "Hello, World" |
| 1 | +unit p where
|
|
| 2 | + signature H where
|
|
| 3 | + data T
|
|
| 4 | + x :: Bool
|
|
| 5 | + module A where
|
|
| 6 | + import H
|
|
| 7 | + data A = MkA T
|
|
| 8 | + y = x
|
|
| 9 | + |
|
| 10 | +unit q where
|
|
| 11 | + dependency p[H=<H>]
|
|
| 12 | + |
|
| 13 | +unit h where
|
|
| 14 | + module H where
|
|
| 15 | + data T = T
|
|
| 16 | + x = True
|
|
| 17 | + |
|
| 18 | +unit r where
|
|
| 19 | + dependency h
|
|
| 20 | + dependency q[H=h:H] |
| 1 | +{"module":"Lib.Internal","unit-id":"lib","imports":{},"package-name":"lib","source":"mhu04/lib/Lib/Internal.hs"}
|
|
| 2 | +{"module":"Lib","unit-id":"lib","imports":{"lib":["Lib.Internal"]},"package-name":"lib","source":"mhu04/lib/Lib.hs"}
|
|
| 3 | +{"module":"Utils","unit-id":"app","imports":{},"package-name":"app","source":"mhu04/app/Utils.hs"}
|
|
| 4 | +{"module":"Main","unit-id":"app","imports":{"app":["Utils"],"lib":["Lib"]},"package-name":"app","source":"mhu04/app/Main.hs"}
|
|
| 5 | +{"unit-id":"app","link-type":"executable","deps":[{"unit-id":"app","modules":["Main","Utils"]}]} |
| 1 | +# DO NOT DELETE: Beginning of Haskell dependencies
|
|
| 2 | +mhu04/lib/Lib/Internal.o : mhu04/lib/Lib/Internal.hs
|
|
| 3 | +mhu04/lib/Lib.o : mhu04/lib/Lib.hs
|
|
| 4 | +mhu04/lib/Lib.o : mhu04/lib/Lib/Internal.hi
|
|
| 5 | +mhu04/app/Utils.o : mhu04/app/Utils.hs
|
|
| 6 | +mhu04/app/Main.o : mhu04/app/Main.hs
|
|
| 7 | +mhu04/app/Main.o : mhu04/app/Utils.hi
|
|
| 8 | +mhu04/app/Main.o : mhu04/lib/Lib.hi
|
|
| 9 | +# DO NOT DELETE: End of Haskell dependencies |
| 1 | +{"module":"Lib.Internal","unit-id":"lib","imports":{},"package-name":"lib","source":"mhu05/lib/Lib/Internal.hs"}
|
|
| 2 | +{"module":"Lib","unit-id":"lib","imports":{"lib":["Lib.Internal"]},"package-name":"lib","source":"mhu05/lib/Lib.hs"}
|
|
| 3 | +{"unit-id":"lib","link-type":"static-library","deps":[{"unit-id":"lib","modules":["Lib","Lib.Internal"]}]}
|
|
| 4 | +{"module":"Main","unit-id":"app","imports":{"lib":["Lib"]},"package-name":"app","source":"mhu05/app/Main.hs"}
|
|
| 5 | +{"unit-id":"app","link-type":"executable","deps":[{"unit-id":"app","modules":["Main"]}]}
|
|
| 6 | +{"module":"Spec","unit-id":"test","imports":{"lib":["Lib","Lib.Internal"]},"package-name":"test","source":"mhu05/test/Spec.hs"}
|
|
| 7 | +{"unit-id":"test","link-type":"executable","deps":[{"unit-id":"test","modules":["Spec"]}]} |
| 1 | +# DO NOT DELETE: Beginning of Haskell dependencies
|
|
| 2 | +mhu05/lib/Lib/Internal.o : mhu05/lib/Lib/Internal.hs
|
|
| 3 | +mhu05/lib/Lib.o : mhu05/lib/Lib.hs
|
|
| 4 | +mhu05/lib/Lib.o : mhu05/lib/Lib/Internal.hi
|
|
| 5 | +mhu05/app/Main.o : mhu05/app/Main.hs
|
|
| 6 | +mhu05/app/Main.o : mhu05/lib/Lib.hi
|
|
| 7 | +mhu05/test/Spec.o : mhu05/test/Spec.hs
|
|
| 8 | +mhu05/test/Spec.o : mhu05/lib/Lib/Internal.hi
|
|
| 9 | +mhu05/test/Spec.o : mhu05/lib/Lib.hi
|
|
| 10 | +# DO NOT DELETE: End of Haskell dependencies |