Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"MulipleResultsBug" #6046

Closed
jgm opened this issue Jan 29, 2023 · 6 comments
Closed

"MulipleResultsBug" #6046

jgm opened this issue Jan 29, 2023 · 6 comments

Comments

@jgm
Copy link

jgm commented Jan 29, 2023

General summary/comments (optional)

I'm getting a MulipleResultsBug (sic) on stack builds in CI for pandoc.

Steps to reproduce

See https://github.com/jgm/pandoc/actions/runs/4038196626/jobs/6942025643 or any of the recent pandoc CI builds.

Expected

Expected project to build normally.

Actual

MulipleResultsBug
  (PackageName "z-pandoc-z-xml-light")
  [ DumpPackage
      { dpGhcPkgId = "pandoc-3.0.1-77ZLKePxhTaCRRSLZRG4Rc-xml-light"
      , dpPackageIdent =
          PackageIdentifier
            { pkgName = PackageName "z-pandoc-z-xml-light"
            , pkgVersion = mkVersion [ 3 , 0 , 1 ]
            }
      , dpParentLibIdent =
          Just
            PackageIdentifier
              { pkgName = PackageName "pandoc"
              , pkgVersion = mkVersion [ 3 , 0 , 1 ]
              }
      , dpLicense = Just (GPL (Just (mkVersion [ 2 , 0 ])))
      , dpLibDirs =
          [ "D:\\a\\pandoc\\pandoc\\.stack-work\\install\\8b79c707\\lib\\x86_64-windows-ghc-9.2.5\\pandoc-3.0.1-77ZLKePxhTaCRRSLZRG4Rc-xml-light"
          , "C:\\Users\\runneradmin\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20221216\\mingw64\\lib"
          , "C:\\Users\\runneradmin\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20221216\\mingw64\\bin"
          ]
      , dpLibraries =
          [ "HSpandoc-3.0.1-77ZLKePxhTaCRRSLZRG4Rc-xml-light" ]
      , dpHasExposedModules = True
      , dpExposedModules =
          fromList
            [ ModuleName "Text.Pandoc.XML.Light"
            , ModuleName "Text.Pandoc.XML.Light.Output"
            , ModuleName "Text.Pandoc.XML.Light.Proc"
            , ModuleName "Text.Pandoc.XML.Light.Types"
            ]
      , dpDepends =
          [ "base-4.16.4.0"
          , "containers-0.6.5.1"
          , "text-1.2.5.0"
          , "xml-1.3.14-KiW89sjmbIPAlN8B4nqhKb"
          , "xml-conduit-1.9.1.1-2pcaBXY4SmGGVoz4CdA3uA"
          , "xml-types-0.3.8-LZyzf9bLT8K9kdiyyQ9IUF"
          ]
      , dpHaddockInterfaces =
          [ "D:\\a\\pandoc\\pandoc\\.stack-work\\install\\8b79c707\\doc\\pandoc-3.0.1\\pandoc.haddock"
          ]
      , dpHaddockHtml =
          Just
            "D:\\a\\pandoc\\pandoc\\.stack-work\\install\\8b79c707\\doc\\pandoc-3.0.1"
      , dpIsExposed = False
      }
  , DumpPackage
      { dpGhcPkgId = "pandoc-3.0-HOHiVyu81CU8bKnUqaz1c5-xml-light"
      , dpPackageIdent =
          PackageIdentifier
            { pkgName = PackageName "z-pandoc-z-xml-light"
            , pkgVersion = mkVersion [ 3 , 0 ]
            }
      , dpParentLibIdent =
          Just
            PackageIdentifier
              { pkgName = PackageName "pandoc"
              , pkgVersion = mkVersion [ 3 , 0 ]
              }
      , dpLicense = Just (GPL (Just (mkVersion [ 2 , 0 ])))
      , dpLibDirs =
          [ "D:\\a\\pandoc\\pandoc\\.stack-work\\install\\8b79c707\\lib\\x86_64-windows-ghc-9.2.5\\pandoc-3.0-HOHiVyu81CU8bKnUqaz1c5-xml-light"
          , "C:\\Users\\runneradmin\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20221216\\mingw64\\lib"
          , "C:\\Users\\runneradmin\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20221216\\mingw64\\bin"
          ]
      , dpLibraries = [ "HSpandoc-3.0-HOHiVyu81CU8bKnUqaz1c5-xml-light" ]
      , dpHasExposedModules = True
      , dpExposedModules =
          fromList
            [ ModuleName "Text.Pandoc.XML.Light"
            , ModuleName "Text.Pandoc.XML.Light.Output"
            , ModuleName "Text.Pandoc.XML.Light.Proc"
            , ModuleName "Text.Pandoc.XML.Light.Types"
            ]
      , dpDepends =
          [ "base-4.16.4.0"
          , "containers-0.6.5.1"
          , "text-1.2.5.0"
          , "xml-1.3.14-KiW89sjmbIPAlN8B4nqhKb"
          , "xml-conduit-1.9.1.1-2pcaBXY4SmGGVoz4CdA3uA"
          , "xml-types-0.3.8-LZyzf9bLT8K9kdiyyQ9IUF"
          ]
      , dpHaddockInterfaces =
          [ "D:\\a\\pandoc\\pandoc\\.stack-work\\install\\8b79c707\\doc\\pandoc-3.0\\pandoc.haddock"
          ]
      , dpHaddockHtml =
          Just
            "D:\\a\\pandoc\\pandoc\\.stack-work\\install\\8b79c707\\doc\\pandoc-3.0"
      , dpIsExposed = False
      }
  ]

pandoc has an internal library xml-light, and it seems that the problem here is that stack is finding two copies, one cached from pandoc 3.0 and one from pandoc 3.0.1.

I would have thought stack would know to use the one from pandoc 3.0.1.

Stack version

2.9.3 installed on GitHub actions Windows 2019 CI VM.

Method of installation

CI

Platform

Windows 2019

@jgm
Copy link
Author

jgm commented Jan 30, 2023

I solved my own problem by deleting the cache and building again, but this still seems like non-optimal behavior.

@mpilgrem
Copy link
Member

@jgm, thanks for reporting. I see that, at the very least, I need to fix how that bug is reported by Stack.

mpilgrem added a commit that referenced this issue Jan 30, 2023
mpilgrem added a commit that referenced this issue Jan 30, 2023
@mpilgrem
Copy link
Member

I can reproduce this bug locally on Windows by:

  1. Cloning the pandoc repository (currently pandoc-3.0.1)
  2. stack test, after renaming the package to pandoc-3.0.0
  3. stack test, after reverting the package name to pandoc-3.0.1

@mpilgrem
Copy link
Member

mpilgrem commented Jan 30, 2023

Some notes for my own use:

stack exec -- ghc-pkg list -v has (extract):

C:\Users\mikep\Documents\Code\GitHub\pandoc\.stack-work\install\4ca13fc5\pkgdb
    pandoc-3.0.1 (pandoc-3.0.1-Dm0IhW6A8PTLZ0SLxb8qEw)
    (z-pandoc-z-xml-light-3.0.0 (pandoc-3.0.0-DFdhTdyCRzO7qwWvMULv7q-xml-light))
    (z-pandoc-z-xml-light-3.0.1 (pandoc-3.0.1-77ZLKePxhTaCRRSLZRG4Rc-xml-light))

Is the problem 'unregistering'? When local pandoc-3.0.1 is built, the existing pandoc-3.0.0 is unregistered, but z-pandoc-z-xml-light-3.0.0 (the munged package identifier for the internal library xml-light) is not unregistered.

mpilgrem added a commit that referenced this issue Jan 31, 2023
@mpilgrem
Copy link
Member

@jgm, I have proposed a pull request that I believe fixes this. My diagnosis was that something was amiss with the unregistering of a local package for a sub library of a parent package that was itself to be unregistered.

@jgm
Copy link
Author

jgm commented Jan 31, 2023

Great - I can't comment on the pull, as I don't know how stack works, but that seems plausible to me.
Feel free to close. I can't test this organically any more as I avoided the issue in another way.

mpilgrem added a commit that referenced this issue Feb 1, 2023
Also adds documentation.

Also adds an integration test.
mpilgrem added a commit that referenced this issue Feb 1, 2023
Fix #6046 Unregister local packages for sub libraries
jgm added a commit to jgm/pandoc that referenced this issue Feb 9, 2023
We're running into a stack bug with internal libraries.
See commercialhaskell/stack#6046.
liruqi pushed a commit to chinapedia/pandoc that referenced this issue Mar 3, 2023
We're running into a stack bug with internal libraries.
See commercialhaskell/stack#6046.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants