Matthew Pickering pushed to branch wip/bytecode-library at Glasgow Haskell Compiler / GHC Commits: dbc55a0f by Matthew Pickering at 2025-10-07T11:28:32+01:00 Normalise testsuite output for package tests - - - - - 4421c478 by Matthew Pickering at 2025-10-07T14:21:38+01:00 Use LinkingHomePackage, for now, this is broken but only for bytecode libraries - - - - - 2cbf543c by Matthew Pickering at 2025-10-07T14:30:53+01:00 Accept new output for T9930fail - - - - - 7 changed files: - compiler/GHC/Linker/Loader.hs - testsuite/tests/cabal/all.T - testsuite/tests/cabal/pkg_bytecode.stderr - testsuite/tests/cabal/pkg_bytecode.stdout - testsuite/tests/cabal/pkg_bytecode_foreign.stderr - testsuite/tests/cabal/pkg_bytecode_foreign.stdout - testsuite/tests/ghc-e/should_fail/T9930fail.stderr Changes: ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -931,7 +931,8 @@ dynLoadObjs interp hsc_env pls@LoaderState{..} objs = do -- Loading bytecode for mypkg --- -l mypkg -- This thinks we are creating shared library for main but we actually are for mypkg - linkDynLib LinkingForInterpreter logger tmpfs dflags2 unit_env objs (pprTraceIt "test" (map loaded_pkg_uid $ eltsUDFM pkgs_loaded)) + -- MP: LinkingForInterpreter is broken here for tests, recompPluginPackage + linkDynLib LinkingHomePackage logger tmpfs dflags2 unit_env objs (map loaded_pkg_uid $ eltsUDFM pkgs_loaded) -- if we got this far, extend the lifetime of the library file changeTempFilesLifetime tmpfs TFL_GhcSession [soFile] ===================================== testsuite/tests/cabal/all.T ===================================== @@ -35,9 +35,13 @@ test('ghcpkg06', [extra_files(['test.pkg', 'testdup.pkg'])], makefile_test, []) test('ghcpkg07', [extra_files(['test.pkg', 'test7a.pkg', 'test7b.pkg'])], makefile_test, []) -test('pkg_bytecode', [extra_files(['bytecode.pkg', 'Bytecode.hs', "bytecode.script"]), copy_files], makefile_test, []) +test('pkg_bytecode', [extra_files(['bytecode.pkg', 'Bytecode.hs', "bytecode.script"]) + , normalise_errmsg_fun(normaliseDynlibNames, ignore_warnings) + , copy_files], makefile_test, []) -test('pkg_bytecode_foreign', [extra_files(['bytecode_foreign.pkg', "BytecodeForeign.hs", "BytecodeForeign.c", "bytecode_foreign.script"]), copy_files], makefile_test, []) +test('pkg_bytecode_foreign', [extra_files(['bytecode_foreign.pkg', "BytecodeForeign.hs", "BytecodeForeign.c", "bytecode_foreign.script"]) + , normalise_errmsg_fun(normaliseDynlibNames, ignore_warnings) + , copy_files], makefile_test, []) # Test that we *can* compile a module that also belongs to a package # (this was disallowed in GHC 6.4 and earlier) ===================================== testsuite/tests/cabal/pkg_bytecode.stderr ===================================== @@ -1,9 +1 @@ -testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX_p.a","libtestpkg-1.2.3.4-XXX-ghc9.15.20250811.so","libtestpkg-1.2.3.4-XXX_p-ghc9.15.20250811.so","libtestpkg-1.2.3.4-XXX-ghc9.15.20250811.dylib","libtestpkg-1.2.3.4-XXX_p-ghc9.15.20250811.dylib","testpkg-1.2.3.4-XXX-ghc9.15.20250811.dll","testpkg-1.2.3.4-XXX_p-ghc9.15.20250811.dll"] on library path (ignoring) -hs_classifieds - [BytecodeLibrary ./outdir/testpkg-1.2.3.4-XXX.bytecode] -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSghc-internal-9.1500.0-inplace-ghc9.15.20250811.so] -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSghc-prim-0.13.1-inplace-ghc9.15.20250811.so] -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSbase-4.22.0.0-inplace-ghc9.15.20250811.so] +testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX_p.a","libtestpkg-1.2.3.4-XXX-ghc9.15.20251003.so","libtestpkg-1.2.3.4-XXX_p-ghc9.15.20251003.so","libtestpkg-1.2.3.4-XXX-ghc9.15.20251003.dylib","libtestpkg-1.2.3.4-XXX_p-ghc9.15.20251003.dylib","testpkg-1.2.3.4-XXX-ghc9.15.20251003.dll","testpkg-1.2.3.4-XXX_p-ghc9.15.20251003.dll"] on library path (ignoring) ===================================== testsuite/tests/cabal/pkg_bytecode.stdout ===================================== @@ -1,6 +1,4 @@ -[1 of 2] Compiling Bytecode ( Bytecode.hs, interpreted ) +[1 of 2] Compiling Bytecode ( Bytecode.hs, Bytecode.gbc ) [2 of 2] Linking testpkg-1.2.3.4-XXX.bytecode Reading package info from "bytecode.pkg" ... done. -GHCi, version 9.15.20250811: https://www.haskell.org/ghc/ :? for help -ghci> ghci> "bytecode from a package" -ghci> Leaving GHCi. +"bytecode from a package" ===================================== testsuite/tests/cabal/pkg_bytecode_foreign.stderr ===================================== @@ -1,15 +1 @@ -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSghc-internal-9.1500.0-inplace-ghc9.15.20250811.so] -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSghc-prim-0.13.1-inplace-ghc9.15.20250811.so] -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSbase-4.22.0.0-inplace-ghc9.15.20250811.so] -testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX_p.a","libtestpkg-1.2.3.4-XXX-ghc9.15.20250811.so","libtestpkg-1.2.3.4-XXX_p-ghc9.15.20250811.so","libtestpkg-1.2.3.4-XXX-ghc9.15.20250811.dylib","libtestpkg-1.2.3.4-XXX_p-ghc9.15.20250811.dylib","testpkg-1.2.3.4-XXX-ghc9.15.20250811.dll","testpkg-1.2.3.4-XXX_p-ghc9.15.20250811.dll"] on library path (ignoring) -hs_classifieds - [BytecodeLibrary ./outdir/testpkg-1.2.3.4-XXX.bytecode] -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSghc-internal-9.1500.0-inplace-ghc9.15.20250811.so] -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSghc-prim-0.13.1-inplace-ghc9.15.20250811.so] -hs_classifieds - [DLLPath /home/matt/ghc-bytecode/_build/stage1/lib/../lib/x86_64-linux-ghc-9.15.20250811/libHSbase-4.22.0.0-inplace-ghc9.15.20250811.so] +testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX_p.a","libtestpkg-1.2.3.4-XXX-ghc9.15.20251003.so","libtestpkg-1.2.3.4-XXX_p-ghc9.15.20251003.so","libtestpkg-1.2.3.4-XXX-ghc9.15.20251003.dylib","libtestpkg-1.2.3.4-XXX_p-ghc9.15.20251003.dylib","testpkg-1.2.3.4-XXX-ghc9.15.20251003.dll","testpkg-1.2.3.4-XXX_p-ghc9.15.20251003.dll"] on library path (ignoring) ===================================== testsuite/tests/cabal/pkg_bytecode_foreign.stdout ===================================== @@ -1,7 +1,5 @@ -[1 of 2] Compiling BytecodeForeign ( BytecodeForeign.hs, interpreted ) +[1 of 2] Compiling BytecodeForeign ( BytecodeForeign.hs, BytecodeForeign.gbc ) [2 of 2] Linking testpkg-1.2.3.4-XXX.bytecode Reading package info from "bytecode_foreign.pkg" ... done. -GHCi, version 9.15.20250811: https://www.haskell.org/ghc/ :? for help -ghci> ghci> 8 +8 42 -ghci> Leaving GHCi. ===================================== testsuite/tests/ghc-e/should_fail/T9930fail.stderr ===================================== @@ -1,11 +1,4 @@ -ghc: Uncaught exception ghc-9.13-inplace:GHC.Utils.Panic.GhcException: - -default output name would overwrite the input file; must specify -o explicitly +<no location info>: error: + default output name would overwrite the input file; must specify -o explicitly Usage: For basic information, try the `--help' option. -While handling default output name would overwrite the input file; must specify -o explicitly - | Usage: For basic information, try the `--help' option. - -HasCallStack backtrace: - bracket, called at compiler/GHC/Driver/MakeAction.hs:2955:3 in ghc-9.13-inplace:GHC.Driver.MakeAction - View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b186de5fcc0d8da289a05d4e2870d83... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b186de5fcc0d8da289a05d4e2870d83... You're receiving this email because of your account on gitlab.haskell.org.