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

"Silent" (zero exit code) failure with mismatched temporary files #37

Closed
geekosaur opened this issue Dec 16, 2024 · 7 comments
Closed
Assignees

Comments

@geekosaur
Copy link

I attempted to print-api on haskell/cabal (haskell/cabal#10259) and forgot to clean up the dist directory I use for print-api, which had leftovers from building for print-api on cabal's 3.12.1.0 release. The result was print-api complaining about symbols from 3.12.1.0 and dying, but with a 0 exit code so the Makefile didn't detect the error and copied zero-length output over the old API records.

@Kleidukos
Copy link
Owner

@geekosaur was it print-api complaining or the GHC API? Do you still have the error message? If no, could you give me a list of steps to reproduce?

@Kleidukos Kleidukos self-assigned this Dec 16, 2024
@geekosaur
Copy link
Author

I'm re-running the reproducer, but it's somewhat complicated: I need to cherry-pick the API checking commit into a fork of cabal's 3.12 branch, run make update-api, then switch back to my local branch for haskell/cabal#10259 and run make generate-api there without removing dist-* first.

The error message is definitely from the GHC API, but I'd hope it would be possible to catch errors from it.

@geekosaur
Copy link
Author

ghcup run --ghc 9.10.1 -- print-api --package-name cabal-install-solver | sed 's/\([( ]\)[Cc]abal-[-0-9.][-0-9]*:/\1/g' >cabal-install-solver-9.10.1.api
print-api: <no location info>: error: [GHC-87110]
    Could not load module `Distribution.Client.Utils.Assertion'.
    It is a member of the hidden package `cabal-install-solver-3.12.1.0'.
HasCallStack backtrace:
  finally, called at compiler/GHC/Utils/Panic.hs:303:7 in ghc-9.10.1-69c3:GHC.Utils.Panic


make generate-api  338.85s user 13.88s system 100% cpu 5:50.77 total

Note that (a) it's referencing a symbol from 3.12.1.0, and (b) make believes print-api succeeded. It's not the pipeline that caused it, because failures in a pipeline fail the whole pipeline:

hilfy «crawl:master» Z$ false | cat
zsh: exit 1     false | 
zsh: done       cat

@Kleidukos
Copy link
Owner

Thank you very much!

@geekosaur
Copy link
Author

Hm, I stand corrected, so I may have to edit that pipeline (I think the sed ended up being unnecessary anyway, but see #14).

hilfy «crawl:master» Z$ (false | cat) || echo oops
hilfy «crawl:master» Z$    

@geekosaur
Copy link
Author

Okay, yes, it's the pipeline, apparently I'd forgotten that shells don't handle "internal" failures right even in 2024.

hilfy «crawl:master» Z$ {false | cat} && echo oops
zsh: exit 1     false | 
zsh: done       cat
oops
hilfy «crawl:master» Z$ 

Or POSIX requires them to be dumb about it for backward compatibility, or something.

@geekosaur
Copy link
Author

Okay, yes, fails properly without the sed. Closing.

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

2 participants