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

handle build reports in v2-build #7567

Merged
merged 1 commit into from
Sep 11, 2021
Merged

handle build reports in v2-build #7567

merged 1 commit into from
Sep 11, 2021

Conversation

gbaz
Copy link
Collaborator

@gbaz gbaz commented Aug 23, 2021

Resolves #6851 -- or rather resolves it enough for the purposes of hackage builder, which is likely the only thing that ever cared about these flags.

In particular makes the --report-planning-failure and --build-summary flags do anything at all. Note that this preserves the v1 behavior that by default, build-summary information for all builds gets written to ~/.cabal/logs/build.log (which had been lost with v2-build before). The former flag writes build-summary info even if the solver fails (otherwise such info is written only if a build occurs). The latter controls where to write summary info to.

Some notes on what this doesn't do:

This does not provide the still missing "remote build reports" (enabled by --remote-build-reporting) since hackage builder doesn't use them, and nobody else seems to use or miss them either. At this point I think we should probably remove the flag from v2 and just strip the functionality entirely (saving code) when v1 is removed (if not sooner). For background context, the idea of anonymous/remote build reports was that instead of a central docbuilder, cabals could be taught to tarball up all the information from their builds so they could automatically upload it and "report to a central server" any successes or failures, optionally with logs, etc. It was an interesting idea, but never fully implemented. The existing machinery is not very fleshed out on the tricky bits (i.e. actually uploading the reports, controlling policy well, etc.) and there was never a clear policy worked out nor any upstream support. As such, I think we can strip out the code for this from the codebase and if we embark on this in the future, start fresh with a clear architecture and design first, and then write new code to suit that.

Further, this does not write detailed logs for --report-planning-failure but rather just the summary log. It seemed an extra bit of unnecessary functionality, given that hackage builder doesn't use these logs, and as far as I can tell nobody else did, who might miss them. This means that as far as I can see, the --build-log argument to v2-build never gets used (though I may be mistaken here). It would be future work to confirm these flags are unused at the moment, and potentially to clean them up. Certainly something is still writing logs to ~/.cabal/logs/ghc-x.x.x/pkg-name-hash.log but I'm not sure of that codepath.

@Mikolaj
Copy link
Member

Mikolaj commented Aug 23, 2021

I'm all for removing --remote-build-reporting ASAP (but not backporting the removal to 3.6) to give people the theoretical chance to yell at us if anybody uses it (and uses master branch, both unlikely but that's the best we can do with low effort).

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Is the new code copied from the v1- version? From where exactly?

[edti: and how much is it changed OOI?]

@gbaz
Copy link
Collaborator Author

gbaz commented Aug 23, 2021

The standard buildreport code is from here in v1, but I inlined the report generation since the types changed enough I couldn't make use of the existing functions:

https://github.com/haskell/cabal/blob/master/cabal-install/src/Distribution/Client/Install.hs#L821

The planning failure code is from here:

https://github.com/haskell/cabal/blob/master/cabal-install/src/Distribution/Client/Install.hs#L728

Let's get this merged, then I'll make another PR cleaning up remote build reporting (removing it from v1 as well as removing the useless flags from v2)

@Mikolaj
Copy link
Member

Mikolaj commented Aug 24, 2021

We need one more review, pretty please. :)

@gbaz gbaz added the merge me Tell Mergify Bot to merge label Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BuildReports don't seem to work with v2-build
3 participants