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

Sublibraries not registered if no library #6318

Closed
mpilgrem opened this issue Oct 25, 2023 · 0 comments
Closed

Sublibraries not registered if no library #6318

mpilgrem opened this issue Oct 25, 2023 · 0 comments

Comments

@mpilgrem
Copy link
Member

If a package has a library and sublibraries, the sublibraries are installed and registered.

However, if a package has only sublibraries, the sublibraries are installed but not registered. That appears to me to be a bug.

    let hasLibrary =
          case packageLibraries package of
            NoLibraries -> False
            HasLibraries _ -> True
        packageHasComponentSet f = not $ Set.null $ f package
        hasInternalLibrary = packageHasComponentSet packageInternalLibraries
        hasExecutables = packageHasComponentSet packageExes
        shouldCopy =
             not isFinalBuild
          && (hasLibrary || hasInternalLibrary || hasExecutables)
    when shouldCopy $ withMVar eeInstallLock $ \() -> do
      announce "copy/register"
      eres <- try $ cabal KeepTHLoading ["copy"]
      case eres of
        Left err@CabalExitedUnsuccessfully{} ->
          throwM $ CabalCopyFailed
                     (packageBuildType package == C.Simple)
                     (displayException err)
        _ -> pure ()
      when hasLibrary  $ cabal KeepTHLoading ["register"] -- <<<< This seems to be the problem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant