Rodrigo Mesquita pushed to branch wip/romes/T25897 at Glasgow Haskell Compiler / GHC
Commits:
-
6a35cfdf
by Rodrigo Mesquita at 2025-07-21T14:41:45+01:00
15 changed files:
- compiler/GHC/HsToCore/Docs.hs
- + testsuite/tests/determinism/T25897d/A.hs
- + testsuite/tests/determinism/T25897d/B.hs
- + testsuite/tests/determinism/T25897d/C.hs
- + testsuite/tests/determinism/T25897d/Makefile
- + testsuite/tests/determinism/T25897d/T25897d.stdout
- + testsuite/tests/determinism/T25897d/T25897e.stdout
- + testsuite/tests/determinism/T25897d/all.T
- testsuite/tests/showIface/HaddockIssue849.stdout
- testsuite/tests/showIface/Makefile
- + testsuite/tests/showIface/T25897.hs
- + testsuite/tests/showIface/T25897.stdout
- + testsuite/tests/showIface/T25897b.hs
- + testsuite/tests/showIface/T25897c.hs
- testsuite/tests/showIface/all.T
Changes:
| ... | ... | @@ -173,7 +173,9 @@ mkDocStructureFromExportList mdl import_avails export_list = |
| 173 | 173 | -> Avails
|
| 174 | 174 | -> DocStructureItem
|
| 175 | 175 | moduleExport alias avails =
|
| 176 | - DsiModExport (nubSortNE orig_names) (sortAvails (nubAvails avails))
|
|
| 176 | + {- For module re-exports, use the original order (which is already deterministic) -}
|
|
| 177 | + DsiModExport (nubSortNE orig_names)
|
|
| 178 | + (DefinitelyDeterministicAvails (nubAvails avails))
|
|
| 177 | 179 | where
|
| 178 | 180 | orig_names = M.findWithDefault aliasErr alias aliasMap
|
| 179 | 181 | aliasErr = error $ "mkDocStructureFromExportList: "
|
| 1 | +module A
|
|
| 2 | + ( b, a, c
|
|
| 3 | + ) where
|
|
| 4 | + |
|
| 5 | +a :: ()
|
|
| 6 | +a = ()
|
|
| 7 | + |
|
| 8 | +b :: ()
|
|
| 9 | +b = ()
|
|
| 10 | + |
|
| 11 | +c :: ()
|
|
| 12 | +c = () |
| 1 | +module B
|
|
| 2 | + ( module A
|
|
| 3 | + ) where
|
|
| 4 | + |
|
| 5 | +import A (a)
|
|
| 6 | +import A (b)
|
|
| 7 | +import A (c)
|
|
| 8 | + |
| 1 | +module B
|
|
| 2 | + ( module A
|
|
| 3 | + ) where
|
|
| 4 | + |
|
| 5 | +-- The order of the imports is the order in the module re-exports
|
|
| 6 | +import A (a)
|
|
| 7 | +import A (c)
|
|
| 8 | +import A (b)
|
|
| 9 | + |
| 1 | +TOP=../../..
|
|
| 2 | +include $(TOP)/mk/boilerplate.mk
|
|
| 3 | +include $(TOP)/mk/test.mk
|
|
| 4 | + |
|
| 5 | +T25897d:
|
|
| 6 | + $(RM) A.hi A.o B.hi B.o
|
|
| 7 | + # Use -haddock to get docs: output in the interface file
|
|
| 8 | + '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -haddock B.hs
|
|
| 9 | + '$(TEST_HC)' --show-iface A.hi > A_clean_iface
|
|
| 10 | + '$(TEST_HC)' --show-iface B.hi > B_clean_iface
|
|
| 11 | + '$(TEST_HC)' $(TEST_HC_OPTS) -dinitial-unique=16777215 -dunique-increment=-1 -v0 -haddock A.hs B.hs -fforce-recomp
|
|
| 12 | + '$(TEST_HC)' --show-iface A.hi > A_dirty_iface
|
|
| 13 | + '$(TEST_HC)' --show-iface B.hi > B_dirty_iface
|
|
| 14 | + diff A_clean_iface A_dirty_iface
|
|
| 15 | + diff B_clean_iface B_dirty_iface
|
|
| 16 | + cat B_clean_iface | grep -A7 "documentation structure"
|
|
| 17 | + cat B_dirty_iface | grep -A7 "documentation structure"
|
|
| 18 | + |
|
| 19 | +T25897e:
|
|
| 20 | + $(RM) A.hi A.o C.hi C.o
|
|
| 21 | + # Use -haddock to get docs: output in the interface file
|
|
| 22 | + '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -haddock C.hs
|
|
| 23 | + '$(TEST_HC)' --show-iface A.hi > A_clean_iface
|
|
| 24 | + '$(TEST_HC)' --show-iface C.hi > C_clean_iface
|
|
| 25 | + '$(TEST_HC)' $(TEST_HC_OPTS) -dinitial-unique=16777215 -dunique-increment=-1 -v0 -haddock A.hs C.hs -fforce-recomp
|
|
| 26 | + '$(TEST_HC)' --show-iface A.hi > A_dirty_iface
|
|
| 27 | + '$(TEST_HC)' --show-iface C.hi > C_dirty_iface
|
|
| 28 | + diff A_clean_iface A_dirty_iface
|
|
| 29 | + diff C_clean_iface C_dirty_iface
|
|
| 30 | + cat C_clean_iface | grep -A7 "documentation structure"
|
|
| 31 | + cat C_dirty_iface | grep -A7 "documentation structure" |
| 1 | + documentation structure:
|
|
| 2 | + re-exported module(s): [A]
|
|
| 3 | + [A.a, A.b, A.c]
|
|
| 4 | + named chunks:
|
|
| 5 | + haddock options:
|
|
| 6 | + language:
|
|
| 7 | + Nothing
|
|
| 8 | + language extensions:
|
|
| 9 | + documentation structure:
|
|
| 10 | + re-exported module(s): [A]
|
|
| 11 | + [A.a, A.b, A.c]
|
|
| 12 | + named chunks:
|
|
| 13 | + haddock options:
|
|
| 14 | + language:
|
|
| 15 | + Nothing
|
|
| 16 | + language extensions: |
| 1 | + documentation structure:
|
|
| 2 | + re-exported module(s): [A]
|
|
| 3 | + [A.a, A.c, A.b]
|
|
| 4 | + named chunks:
|
|
| 5 | + haddock options:
|
|
| 6 | + language:
|
|
| 7 | + Nothing
|
|
| 8 | + language extensions:
|
|
| 9 | + documentation structure:
|
|
| 10 | + re-exported module(s): [A]
|
|
| 11 | + [A.a, A.c, A.b]
|
|
| 12 | + named chunks:
|
|
| 13 | + haddock options:
|
|
| 14 | + language:
|
|
| 15 | + Nothing
|
|
| 16 | + language extensions: |
| 1 | +test('T25897d', [extra_files(['A.hs', 'B.hs'])], makefile_test, ['T25897d'])
|
|
| 2 | +test('T25897e', [extra_files(['A.hs', 'C.hs'])], makefile_test, ['T25897e']) |
| ... | ... | @@ -11,12 +11,12 @@ docs: |
| 11 | 11 | re-exported module(s): [Data.Functor.Identity]
|
| 12 | 12 | []
|
| 13 | 13 | re-exported module(s): [Data.Maybe]
|
| 14 | - [GHC.Internal.Data.Maybe.maybe,
|
|
| 15 | - GHC.Internal.Maybe.Maybe{GHC.Internal.Maybe.Maybe,
|
|
| 16 | - GHC.Internal.Maybe.Just, GHC.Internal.Maybe.Nothing}]
|
|
| 14 | + [GHC.Internal.Maybe.Maybe{GHC.Internal.Maybe.Maybe,
|
|
| 15 | + GHC.Internal.Maybe.Nothing, GHC.Internal.Maybe.Just},
|
|
| 16 | + GHC.Internal.Data.Maybe.maybe]
|
|
| 17 | 17 | re-exported module(s): [Data.Tuple]
|
| 18 | - [GHC.Internal.Data.Tuple.curry, GHC.Internal.Data.Tuple.fst,
|
|
| 19 | - GHC.Internal.Data.Tuple.snd, GHC.Internal.Data.Tuple.swap,
|
|
| 18 | + [GHC.Internal.Data.Tuple.swap, GHC.Internal.Data.Tuple.curry,
|
|
| 19 | + GHC.Internal.Data.Tuple.fst, GHC.Internal.Data.Tuple.snd,
|
|
| 20 | 20 | GHC.Internal.Data.Tuple.uncurry]
|
| 21 | 21 | named chunks:
|
| 22 | 22 | haddock options:
|
| ... | ... | @@ -49,3 +49,7 @@ HaddockSpanIssueT24378: |
| 49 | 49 | MagicHashInHaddocks:
|
| 50 | 50 | '$(TEST_HC)' $(TEST_HC_OPTS) -c -haddock MagicHashInHaddocks.hs
|
| 51 | 51 | '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface MagicHashInHaddocks.hi | grep -A 200 'docs:'
|
| 52 | + |
|
| 53 | +T25897:
|
|
| 54 | + '$(TEST_HC)' $(TEST_HC_OPTS) -haddock -v0 T25897.hs T25897b.hs T25897c.hs
|
|
| 55 | + '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T25897.hi | grep -A 4 'documentation structure:' |
| 1 | +-- | Re-exports should display `b` first and `a` second, as per the explicit
|
|
| 2 | +-- exports of that module.
|
|
| 3 | +module T25897
|
|
| 4 | + ( module T25897c
|
|
| 5 | + , module T25897b
|
|
| 6 | + ) where
|
|
| 7 | + |
|
| 8 | +import T25897b
|
|
| 9 | +import T25897c |
| 1 | + documentation structure:
|
|
| 2 | + re-exported module(s): [T25897c]
|
|
| 3 | + [T25897c.d, T25897c.c]
|
|
| 4 | + re-exported module(s): [T25897b]
|
|
| 5 | + [T25897b.b, T25897b.a] |
| 1 | +-- #hide
|
|
| 2 | +module T25897b
|
|
| 3 | + ( b
|
|
| 4 | + , a
|
|
| 5 | + )
|
|
| 6 | + where
|
|
| 7 | + |
|
| 8 | +-- | This should appear in second, as per the explicit export list
|
|
| 9 | +a :: ()
|
|
| 10 | +a = ()
|
|
| 11 | + |
|
| 12 | +-- | This should appear in first, as per the explicit export list
|
|
| 13 | +b :: ()
|
|
| 14 | +b = () |
| 1 | +-- #hide
|
|
| 2 | +module T25897c
|
|
| 3 | + ( d
|
|
| 4 | + , c
|
|
| 5 | + )
|
|
| 6 | + where
|
|
| 7 | + |
|
| 8 | +-- | This should appear in second, as per the explicit export list
|
|
| 9 | +c :: ()
|
|
| 10 | +c = ()
|
|
| 11 | + |
|
| 12 | +-- | This should appear in first, as per the explicit export list
|
|
| 13 | +d :: ()
|
|
| 14 | +d = () |
| ... | ... | @@ -13,3 +13,4 @@ test('ReExports', extra_files(['Inner0.hs', 'Inner1.hs', 'Inner2.hs', 'Inner3.hs |
| 13 | 13 | test('HaddockIssue849', normal, makefile_test, [])
|
| 14 | 14 | test('HaddockSpanIssueT24378', normal, makefile_test, [])
|
| 15 | 15 | test('MagicHashInHaddocks', normal, makefile_test, [])
|
| 16 | +test('T25897', extra_files(['T25897b.hs', 'T25897c.hs']), makefile_test, []) |