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

cabal-validate: Better output verbosity defaults #10573

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

9999years
Copy link
Collaborator

Closes #10569
Closes #10570

A new --quiet switch has been added, and some behavior in ./validate.sh (without --verbose) has been moved into --quiet mode:

  • --hide-successes will be passed to test suites in --quiet mode, making it easier to track tests as they run
  • Subprocess output is only captured in --quiet mode, making it easier to watch cabal build and test suite output

Some output has been hidden unless --verbose is used:

  • The build plan (listing of all local packages and transitive dependencies) and the dry-run build used to produce the build plan are skipped unless --verbose is given
  • The runtime configuration (e.g. the ghc and cabal-install executables being used) and tool versions are not printed unless --verbose is given

Additionally, print-config, print-tool-versions, and time-summary are no longer explicit steps, and are instead run implicitly. This means that ./validate.sh -v -s build will print the config and tool versions; they do not have to be listed explicitly.

time-summary is redundant in its current form and is removed. It may be added back in the future with more detailed output (e.g., which steps were run, how long did they take individually). (Partially closes #10571)

@9999years 9999years added the cabal-validate validate.sh (cabal-validate) test suite runner label Nov 21, 2024
@9999years 9999years force-pushed the validate-verbose branch 2 times, most recently from ca7f688 to 96bc9c3 Compare November 22, 2024 23:37
@9999years 9999years marked this pull request as ready for review November 25, 2024 17:34
@Kleidukos Kleidukos added the attention: needs-manual-qa PR is destined for manual QA label Dec 5, 2024
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.

Yay for removing code!

@9999years 9999years added the merge me Tell Mergify Bot to merge label Dec 10, 2024
@mergify mergify bot added the ready and waiting Mergify is waiting out the cooldown period label Dec 10, 2024
@ulysses4ever
Copy link
Collaborator

The description doesn't explicitly say how it affects CI output (arguably, the most visible use case of cabal-validate). First, worth reminding that CI seems to run the verbose mode. Next, attaching screenshots of some notable portions of CI output before and after the change would greatly help to evaluate the effect. But we can just wait and see, as usual...

I tried to sense the effect quickly by eyeballing parts of the output... I'm a big fan of GitHub's collapsible steps output, which are erased after this change for some steps. For instance, it's easier to locate tool versions with the old setup than the new one.

While doing this, I noticed something that may or may not worked better in the past: the headers like

═══ build (dry run) ════════════════════════════════════════════════════════════

look displaced: they are printed after the actual output of the corresponding step. I think it used to work fine (first the header, then the output). This is an issue I observe on master as well. Could it be a regression introduced by cabal-validate?..

@geekosaur
Copy link
Collaborator

They definitely used to come out first. I don't recall if that changed with the first version of cabal-validate.

@9999years
Copy link
Collaborator Author

They're still printed in the correct spot locally. I wonder if it's a stderr/stdout buffering issue.

@geekosaur
Copy link
Collaborator

Easy to check (on POSIX, at least): pipe it through cat.

@geekosaur
Copy link
Collaborator

Also,

  1. hFlush
  2. Give some thought to what happens if stdout and stderr don't go the same place.

9999years added a commit to 9999years/cabal that referenced this pull request Dec 10, 2024
9999years added a commit to 9999years/cabal that referenced this pull request Dec 10, 2024
I though this was the default, but apparently not! This seems to fix
output ordering issues.

Noticed here: haskell#10573 (comment)
`print-config`, `print-tool-versions`, and `time-summary` are no longer
explicit steps, and are instead run implicitly (closes haskell#10570).

`time-summary` is redundant in its current form and is removed. It may
be added back in the future with more detailed output (e.g., which steps
were run, how long did they take individually).

`print-config` and `print-tool-versions` are hidden unless `--verbose`
is given.
Hide the build plan (listing of local packages and transitive
dependencies) unless `--verbose` is given.
Doesn't do anything yet.
These are no longer explicit steps and will be printed at the start of
each `validate.sh` run individually. (This is more accurate because
flags like `--with-cabal` and `--extra-hc`, which are only used in some
steps, influence the configuration and tool versions in use.)
I though this was the default, but apparently not! This seems to fix
output ordering issues.

Noticed here: haskell#10573 (comment)
@9999years
Copy link
Collaborator Author

OK, fixed the output ordering issue in 17ffa59. Not sure what caused it — some weird combination of subprocesses with inherited stdout/stderr handles and not explicitly setting buffering? Anyways, just setting the buffering explicitly seemed to fix it.

@geekosaur
Copy link
Collaborator

If you don't explicitly set buffering, it'll be line buffering on things that appear to be ttys and block buffered (8K on Linux, possibly 4K elsewhere) otherwise. Every process does its own buffering, so that will also affect things.

GNU stdbuf can be used on POSIX systems to partially (fully, if the program uses GNU libc) control subprocess buffering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attention: needs-manual-qa PR is destined for manual QA cabal-validate validate.sh (cabal-validate) test suite runner merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period
Projects
Status: Waiting
5 participants