JavaScript Backend: Fix trusted modules
Description
The JavaScript backend currently provides incorrect error messages for modules that have failed to be trusted:
--- "/tmp/ghctest-64akgqpm/test spaces/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.run/ImpSafeOnly08.stderr.normalised" 2022-10-11 21:47:08.798828765 +0200
+++ "/tmp/ghctest-64akgqpm/test spaces/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.run/ImpSafeOnly08.comp.stderr.normalised" 2022-10-11 21:47:08.798828765 +0200
@@ -1,6 +1,2 @@
-
-<no location info>: [GHC-08674]
- The package (base-<VERSION>) is required to be trusted but it isn't!
-
-<no location info>: [GHC-08674]
- The package (bytestring-<VERSION>) is required to be trusted but it isn't!
+<command line>: cannot satisfy -trust safePkg01
+ (use -v for more information)
Sometimes this comes in the form of missing modules:
--- "/tmp/ghctest-64akgqpm/test spaces/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly03.run/ImpSafeOnly03.stderr.normalised" 2022-10-11 21:47:09.125495421 +0200
+++ "/tmp/ghctest-64akgqpm/test spaces/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly03.run/ImpSafeOnly03.comp.stderr.normalised" 2022-10-11 21:47:09.125495421 +0200
@@ -1,4 +1,4 @@
-ImpSafeOnly03.hs:5:1: [GHC-75165]
- M_SafePkg3: Can't be safely imported!
- The package (safePkg01-1.0) the module resides in isn't trusted.
+ImpSafeOnly03.hs:5:1:
+ Could not find module ‘M_SafePkg3’
+ Use -v (or `:set -v` in ghci) to see a list of the files searched for.
Some trusted module tests are expected to compile but don’t:
Compile failed (exit code 1) errors were:
ImpSafeOnly01.hs:5:1: error:
Could not find module ‘M_SafePkg’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
*** unexpected failure for ImpSafeOnly01(normal)
Tests affected by this issue
The following tests are temporarily skipped for the JavaScript backend by this issue:
ImpSafeOnly01
ImpSafeOnly02
ImpSafeOnly03
ImpSafeOnly04
ImpSafeOnly05
ImpSafeOnly06
ImpSafeOnly07
ImpSafeOnly08
ImpSafeOnly09
ImpSafeOnly10