-
Notifications
You must be signed in to change notification settings - Fork 701
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
new-build --enable-benchmarks does not cause benchmarks to be built #6259
Comments
Here we can see clearly that despite |
nevermind; disregard the comment below -- I misunderstood your report at first @mrkkrp Btw, iow, does the
or specifically only the benchmarks via the special target
which denotes the enabled benchmarks of all components do what you expect? The target syntax is documented also at https://cabal.readthedocs.io/en/latest/nix-local-build.html#cabal-v2-build |
@mrkkrp ok, here's what's going on: the target in other words, the statement
gets resolved into
due to the target-resolution rules in the light of ambiguities; whereas you intended it to denote
does this make any sense? Fwiw, is there any reason you didn't simply use
which doesn't require you to enumerate the local packages explicitly? |
I don't think I knew about the Why do test suites get built though? They are other components, different from libraries, just like benchmarks. What cofuses me now is that test suites do get built, but not benchmarks. |
@mrkkrp you're right; something's inconsistent here; the target doesn't seem to be resolved the way I described it... needs more investigation |
Just hit this, i think for the third time |
I just double checked in the hls repo:
You can see in the second build and not in the first one |
It builds all project packages even if we they are not buildables (and are not included in hls due to flags) Its goal was build all tests and benchmarks but --enable-tests ans --enable-benchmarks should work Last one does not: haskell/cabal#6259
In continuation of #6259 (comment). In HLS we observed:
Fails (at the state of haskell/haskell-language-server@4ffdf45). The
to disable the In CI dev workflows we running The raw log of discussion in HLS: https://matrix.to/#/!oOjZFsoNYPAbTEgSOA:libera.chat/$0oqtvFoHlPe1At_LwJSQKrfboCKDcMvimyZUt8DS_jE?via=libera.chat&via=matrix.org&via=monoid.al |
Correction about #6259 (comment)
So sorry for the confusion, as penitence will try to reproduce the original issue in megaparsec with last cabal |
I can reproduce the first case with a recent cabal built from master:
So the bug is still present and it seems nowadays |
* Extract out ci build setup * Add required shell property * Add support for ghc-9.0.2 * Test ghc 9.0.2 * Add unix boot package * Use primitive-unlifted < 1.0 * Use primitive-unlifted < 1.0 for stack * Ude 9.0.1 for hackage We cant use 9.0.2 until all deps do not need allow-newer * Use a unified cabal-ghc90.project And bump up index state to get lastest hie-bios * Use last snapshot with ghc-9.0.2 support * Use new cabal-ghc90.project in build * Add stm-containers * Add specific tweaks for ghc-9.0.2 * Use the las ghc-boot-9.0 * Fix test adding allow-newer Co-Authored-By: @michaelpj * Use unix-compat from hackage * Use unix-compat from hackage * Make consistent lastest stack.yamls * Clean up cabal.project * more cleanups * Update tweaks in hackage ci * Correct comment * Correct fourmolu condition * Correct fourmolu condition in tests * Removing the all target from caching It builds all project packages even if we they are not buildables (and are not included in hls due to flags) Its goal was build all tests and benchmarks but --enable-tests ans --enable-benchmarks should work Last one does not: haskell/cabal#6259 * exclude Brittany 0.14.0.1 * Update snapshot to get new lsp * document flag * Document and build ghcide benchmark * Doc and use ghc-9.0.2 in hackage * Add ghc-9.2.1 to tested-with * Use 9.0.2 in gitlab * Use last *molus * Use same versions as cabal build * Use cabal freeze versions * Add dep for ghcide tests * one by one * Unnecessary change * Remove unnecessary flag * Corrections * Move blocks Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Hi, I just spent a while trying to debug a CI script of mine. Turns out I see this issue is labeled |
I don't think its actually info-needed at this point -- we do need to figure out the underlying cause and design. But the specific issue seems to be that So someone digging in and figuring out what exactly |
I'm going to look into this. |
Here's a little investigation, on a clean tmp project with a default testsuite and basic benchmark component: (1) Without listing a package, everything works as it probably should:
(2) However, in passing a pkg as an argument
Perhaps the name resolution logic here could account for --enable-{bench,test} flags and consider the argument a package if yes. Defaulting the argument to a package likely entails often building more things than necessary, and will change existing setups and workflows assuming this behaviour, but trying to be a bit smarter when in presence of such flags seems like a good compromise. (PS: about the megaparsec and megaparsec-tests package, the reason it builds tests but not benchmarks is likely because the benchmark is a component within one of those two packages whose name doesn't match the package name, thus doesn't get built because we fall into the second case) |
Perhaps a good first step in this issue is to give a warning to the user if they only specify selectors which resolve to non-benchmark components? Perhaps there should be a new selector for "all components from a package", perhaps that already exists and the error can suggest it. I think the selector syntax/logic should be kept as simple as possible and probably consistent with what already happens . |
There is a selector for all benchmarks:
|
I encountered a similar situation around installation: .. warning::
If not every package has an executable to install, use ``all:exes`` rather
than ``all`` as the target. fbdcad0#diff-7366bf7292133a6cd2005aed5db013b2774af3c8d49c8b7e20ec5e8e03e1ff2eR296-R300 |
I cannot reproduce the behavior you described @alt-romes. Specifically, you say that
This is on diff --git a/cabal.project b/cabal.project
index c4f84c2dd..e3eb698c1 100644
--- a/cabal.project
+++ b/cabal.project
@@ -27,7 +27,7 @@ packages:
strict-sop-core
-- We want to always build the test-suites and benchmarks
-tests: true
-benchmarks: true
+-- tests: true
+-- benchmarks: true
import: ./asserts.cabal Which makes it as a "clean project". Just used that project because I had it at hand. Also checked that is disabled in global config: ouroboros-consensus on main [$+?] via λ 9.6.4
➜ cat $(cygpath -m "C:\Users\Javier\AppData\Roaming\cabal\config") | grep tests
-- tests: False
-- run-tests:
-- tests: False
-- tests:
ouroboros-consensus on main [$+?] via λ 9.6.4
➜ cat $(cygpath -m "C:\Users\Javier\AppData\Roaming\cabal\config") | grep benchmarks
-- benchmarks: False
-- benchmarks: False |
Describe the bug
Passing
--enable-benchmarks
tonew-build
does not cause benchmarks to be built.To Reproduce
Here is Travis CI log for
megaparsec
which has broken benchmarks but still it's all green:https://travis-ci.org/mrkkrp/megaparsec/jobs/585309471#L296
The exact command in this case is:
yet even simpler command also doesn't build benchmarks:
It returns with exit code 0 even though the benchmarks are broken and do not compile.
I got at first a different result with
v2-build
: it failed as it should. Then after thatnew-build
also started to fail. Then later it started to report that the build is "up to date" returning 0 (the code is still broken).Expected behavior
When
--enable-benchmarks
is passed, all benchmarks should be built and if they do not compile we should reliably get non-zero exit status no matter what.System informataion
cabal
version 2.4.1.0ghc
version 8.6.5The text was updated successfully, but these errors were encountered: