-
Notifications
You must be signed in to change notification settings - Fork 696
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
Regression in cabal-3.12.1.0: cabal install --lib Adga
no longer works.
#10235
Comments
I think the passed build directory is fine. But looking at the build logs you can see that
The install step with cabal 3.12 then fails because the This happens either when using |
@JaSpa: Thanks for the analysis and figuring out the root cause! I think issues like this one are the reasons that We can now speculate as to whether this was an intended change in |
I believe this is the same issue as #9777, which tracks with what @JaSpa reports in #10235 (comment). |
This seems very tricky to disentangle, because to "complete" the install of the agda lib, the executable is presumed to be already built. Is it possible to move the generate-interfaces portion of the setup.hs to the hooks of the agda executable? what would be the consequences? |
Agda's Setup.hs calls the agda executable to generate interface files (*.agdai) for the Agda core modules. |
@andreasabel I'm trying to better understand the needs of the Agda package. I don't understand why it is not sufficient to only install the Agda standard library interface files when the executable is installed, and not when the library is installed. If it is indeed the case that you only need the Agda interface files for the executable, then I would think updating the Agda copyHook' :: PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()
copyHook' pd lbi hooks flags = do
copyHook simpleUserHooks pd lbi hooks flags
when (wantInterfaces flags) $ do
generateInterfaces pd lbi
copyHook simpleUserHooks pd lbi hooks flags
wantInterfaces :: CopyFlags -> Bool
wantInterfaces _flags =
#if MIN_VERSION_Cabal(3,11,0)
any isAgdaExe (copyArgs _flags)
where
isAgdaExe "exe:agda" = True
isAgdaExe _ = False
#else
True
#endif I think this would be an improvement for people who depend on
With this approach, you can still install both the library and executable in a single invocation of |
Sorry, I meant perhaps moving the generate-interfaces portion of the setup into the executable install section of the setup.hs script not just the executable per-se. So when you generated the executable, it would be in the post-hook for the executable build that files were built, where you could be guaranteed the executable was already built. But this would still all be invoked by |
@gbaz: Which of the hooks would that be? https://downloads.haskell.org/ghc/latest/docs/libraries/Cabal-3.12.0.0-0d16/Distribution-Simple-UserHooks.html |
As mentioned by e8c9d19, Cabal 3.12 introduced a breaking change where an unnecessary (not requested) component of a package with a "Custom" build-type is no longer built. This caused breakage for Agda, and was undocumented. The behaviour, despite breaking, is the desired one -- a package shouldn't assume the executable will be built if only the library was requested. This commit documents the breaking change to make sure it is more visible. In the meantime, we've also patched Agda to no longer expect the executable to be built when only the library is installed. Closes haskell#9777 and haskell#10235
As mentioned by e8c9d19, Cabal 3.12 introduced a breaking change where an unnecessary (not requested) component of a package with a "Custom" build-type is no longer built. This caused breakage for Agda, and was undocumented. The behaviour, despite breaking, is the desired one -- a package shouldn't assume the executable will be built if only the library was requested. This commit documents the breaking change to make sure it is more visible. In the meantime, we've also patched Agda to no longer expect the executable to be built when only the library is installed. Closes haskell#9777 and haskell#10235
As mentioned by e8c9d19, Cabal 3.12 introduced a breaking change where an unnecessary (not requested) component of a package with a "Custom" build-type is no longer built. This caused breakage for Agda, and was undocumented. The behaviour, despite breaking, is the desired one -- a package shouldn't assume the executable will be built if only the library was requested. This commit documents the breaking change to make sure it is more visible. In the meantime, we've also patched Agda to no longer expect the executable to be built when only the library is installed. Closes haskell#9777 and haskell#10235
I'm going to close this in favour of #9777, which should be fixed by #10311 plus agda/agda#7471 (which fixes this one more directly, upstream.) |
As mentioned by e8c9d19, Cabal 3.12 introduced a breaking change where an unnecessary (not requested) component of a package with a "Custom" build-type is no longer built. This caused breakage for Agda, and was undocumented. The behaviour, despite breaking, is the desired one -- a package shouldn't assume the executable will be built if only the library was requested. This commit documents the breaking change to make sure it is more visible. In the meantime, we've also patched Agda to no longer expect the executable to be built when only the library is installed. Closes haskell#9777 and haskell#10235
As mentioned by e8c9d19, Cabal 3.12 introduced a breaking change where an unnecessary (not requested) component of a package with a "Custom" build-type is no longer built. This caused breakage for Agda, and was undocumented. The behaviour, despite breaking, is the desired one -- a package shouldn't assume the executable will be built if only the library was requested. This commit documents the breaking change to make sure it is more visible. In the meantime, we've also patched Agda to no longer expect the executable to be built when only the library is installed. Closes haskell#9777 and haskell#10235
As mentioned by e8c9d19, Cabal 3.12 introduced a breaking change where an unnecessary (not requested) component of a package with a "Custom" build-type is no longer built. This caused breakage for Agda, and was undocumented. The behaviour, despite breaking, is the desired one -- a package shouldn't assume the executable will be built if only the library was requested. This commit documents the breaking change to make sure it is more visible. In the meantime, we've also patched Agda to no longer expect the executable to be built when only the library is installed. Closes haskell#9777 and haskell#10235
Downstream issue: agda/agda#7401
cabal-3.10.3.0 install --lib Agda
still works.cabal-3.12.1.0 communicates a wrong build dir to Agda's
Setup.hs
:https://github.com/agda/agda/blob/5da3f3f2be5fc0d4ed6a2b828bd751e44e29292f/Setup.hs#L92-L101
P.S.: Here is a MWE showing the difference between 3.10 and 3.12: https://github.com/andreasabel/cabal-issue-10235/actions/runs/10163928863/job/28108067382
The text was updated successfully, but these errors were encountered: