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

Update the cabal test all command to hide verbose output #402

Open
mmontin opened this issue May 15, 2024 · 3 comments
Open

Update the cabal test all command to hide verbose output #402

mmontin opened this issue May 15, 2024 · 3 comments

Comments

@mmontin
Copy link
Collaborator

mmontin commented May 15, 2024

For now, we have a hack in our flake to redefine cabal test all such that it provides coverage information. This could be improved, especially since our regular expression hiding excessive output of the commande seem to not work on some machines.

@florentc
Copy link
Member

We could introduce aliases in our dev environment shell to launch cabal test all with or without coverage analysis. For example cooked-test and cooked-test-coverage. Most of the time we don't care about the coverage analysis and we would launch cooked-test, we only check coverage punctually (in which case having excessive output once is not a big deal) and would then launch cooked-test-coverage. (or any better names)

@mmontin
Copy link
Collaborator Author

mmontin commented Jun 16, 2024

Is it really buggy though? It works on my environements? Could it be linked to direnv? @florentc

@florentc
Copy link
Member

florentc commented Jun 19, 2024

Yes it is linked to direnv.

The current shellHook defines and exports a shell function to override cabal. When going in the dev shell with nix develop, you end up in a bash shell where this works.

In my case, I use direnv so I actually stay in the same shell (zsh instead of bash) where for some reason this override does not work (anymore? I remember it used to).

The shellHook does work with direnv and other shells such as zsh usually. I use shell hooks in other projects with direnv + zsh without any issue. Here, if I add an export (e.g export FOO=1), I get 1 as an output to echo $FOO in my environment enhanced by direnv. So I think the issue is just that defining a function then exporting it with export -f is not the way to go in zsh. Even when using zsh compatible syntax it doesn't work. It seems that direnv doesn't make it possible to inherit functions from the shell hook.

We could consider this a non issue because it is: if you play by the rules (nix develop) it works. However, I think my workflow is quite common in practice so if we find some easy fix let's do it.

In any case, this is extremely low priority.

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