[Git][ghc/ghc][wip/davide/rts-public_baseline] DO NOT MERGE add per CI job golden test for rts DSO symbols
David Eichmann pushed to branch wip/davide/rts-public_baseline at Glasgow Haskell Compiler / GHC Commits: c13de886 by David Eichmann at 2026-11-02T14:56:56+00:00 DO NOT MERGE add per CI job golden test for rts DSO symbols A full dump of global symbols is made for all RTS DSOs over all CI jobs. This does not use an ignore list like the curent rts-check-symbols test. - - - - - 4 changed files: - testsuite/tests/rts/symbols/Main.hs - testsuite/tests/rts/symbols/all.T - + testsuite/tests/rts/symbols/expected/.gitkeep - testsuite/tests/rts/symbols/rts-check-symbols.sh Changes: ===================================== testsuite/tests/rts/symbols/Main.hs ===================================== @@ -3,6 +3,8 @@ import qualified Data.Set as S import Data.List (isSuffixOf, stripPrefix) import Data.Maybe (mapMaybe) import System.Environment (getArgs) +import System.FilePath +import System.Directory -- Symbols to be ignored. These are symbols that are gated on CPP ant not correctly -- specified in RtsSymbols.c. This means the symbol will sometimes appear in the @@ -154,6 +156,12 @@ main = do -- writeFile "<ghc root>/testsuite/tests/rts/symbols/rts-check-symbols.stdout" putStrLn diffStr + -- Formats all symbols from readelf output + ["full-dump", observedSymbolsFile] -> do + observedSymbolsStr <- readFile observedSymbolsFile + let observedSymbols = parseReadelf observedSymbolsStr + putStrLn $ unlines [symbol ++ " " ++ show codeOrData | (symbol, codeOrData) <- M.toList observedSymbols] + _ -> fail ("Unexpected arguments: " ++ show args) foreign import ccall "dumpDeclaredSymbols" ===================================== testsuite/tests/rts/symbols/all.T ===================================== @@ -10,7 +10,8 @@ test('rts-check-symbols', [ extra_files([ 'dumpDeclaredSymbols.c', 'Main.hs', - 'rts-check-symbols.sh' + 'rts-check-symbols.sh', + 'expected/' ])], makefile_test, [] ===================================== testsuite/tests/rts/symbols/expected/.gitkeep ===================================== ===================================== testsuite/tests/rts/symbols/rts-check-symbols.sh ===================================== @@ -2,6 +2,8 @@ $TEST_HC $TEST_HC_OPTS \ -package containers \ + -package directory \ + -package filepath \ -dynamic \ dumpDeclaredSymbols.c \ -I$TOP/../rts \ @@ -37,3 +39,19 @@ RTS_DYLIB_PATH=$(ldd ./Main | awk '/^[[:space:]]*libHSrts-.* => .+$/ { readelf -W --dyn-syms "$RTS_DYLIB_PATH" > $OBSERVED_SYMBOLS ./Main diff $DECLARED_SYMBOLS $OBSERVED_SYMBOLS + + +# +# Full dump/diff +# + +DUMP=$CI_JOB_NAME-$(basename $RTS_DYLIB_PATH).dump +./Main full-dump $OBSERVED_SYMBOLS > $DUMP +if [ -f "expected/$DUMP" ]; then + diff "$DUMP" "expected/$DUMP" +else + echo "# No expected dump file: expected/$DUMP" + echo "" + cat "$DUMP" +fi + View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c13de88693687deb594650b910844ab7... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c13de88693687deb594650b910844ab7... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
David Eichmann (@DavidEichmann)