diff --git a/libraries/ghc-boot/GHC/PackageDb.hs b/libraries/ghc-boot/GHC/PackageDb.hs index c7984d0edb27bf3cfdcfd300701075b2cdb7fe0a..31073711d4908b9609a1c54b31b6b175ce1ddb52 100644 --- a/libraries/ghc-boot/GHC/PackageDb.hs +++ b/libraries/ghc-boot/GHC/PackageDb.hs @@ -387,6 +387,8 @@ decodeFromFile :: FilePath -> DbOpenMode mode t -> Get pkgs -> IO (pkgs, DbOpenMode mode PackageDbLock) decodeFromFile file mode decoder = case mode of DbOpenReadOnly -> do + -- Note [Locking package database on Windows] + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- When we open the package db in read only mode, there is no need to acquire -- shared lock on non-Windows platform because we update the database with an -- atomic rename, so readers will always see the database in a consistent diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T index 75b1635dd0201f865ff0039df69eb7c43cbf78c2..46ba064c1726158de77f9981b2255e59866f3364 100644 --- a/testsuite/tests/ghci/linking/dyn/all.T +++ b/testsuite/tests/ghci/linking/dyn/all.T @@ -45,5 +45,11 @@ test('big-obj', [extra_files(['big-obj-c.c', 'big-obj.hs']), unless(doing_ghci, skip), unless(opsys('mingw32'), skip)], makefile_test, ['big-obj']) -test('T3372', [unless(doing_ghci, skip), extra_run_opts('"' + config.libdir + '"')], +test('T3372', + [unless(doing_ghci, skip), + extra_run_opts('"' + config.libdir + '"'), + # Concurrent GHC sessions is fragile on Windows since we must lock the + # package database even for read-only access. + # See Note [Locking package database on Windows] in GHC.PackageDb + when(opsys('mingw32'), fragile(16773))], compile_and_run, ['-package ghc'])