You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is there a way for a package to detect that it's building on hackage? #1414
This is however not an ideal situation, as it has to be done for each version. A PR to hackage to allow disabling tests across all versions (including yet-to-be-uploaded) would be welcome.
Addition: test runner should use --test-show-details=direct or always. Hiding the test output is no point in CI
Running 1 test suites...
Test suite smoke: RUNNING...
Test suite smoke: PASS
is useless, especially as that suite probably says that it's skipped (because no external runtime dependency is found), but I cannot be sure as output is omitted.
Returning to the original question of how to fix the Hackage tests for copilot-bluespec: I wouldn't mind opening a PR on the hackage-doc-builder-config to add bluespec to the list of packages in build-depends.nix. That being said, I have a question about the scope of build-depends.nix. The top of that file says:
# Packages available to packages built using the Hackage Haddock builder
The key phrase there is "Haddock builder". Is it acceptable to add packages there solely for the sake of running tests? (copilot-bluespec uses bsc in its test suite, but otherwise its Haddocks build without issue.)
This is however not an ideal situation, as it has to be done for each version. A PR to hackage to allow disabling tests across all versions (including yet-to-be-uploaded) would be welcome.
I published a few packages on hackage recently with external dependencies, one even used z3 in tests.
I didn't do anything to disable test and don't remember any issue with failing test.
So Hackage just stores the uploaded archive.
Is building test a special Hackage feature available on request?
@yaitskov if you upload Haddocks yourself, Hackage recognizes it as a hint not to build the package (or run tests). This is somewhat coincidental: the builder was originally just to build docs and later extended also to run tests, but the old logic "don't bother to build if an author has already provided Haddocks" remains.
That's not the intention. Rather, the nix config for hackage-builder is to provide third party non-haskell binaries that are necessary for building (and testing as well) packages uploaded to hackage.
That's not the intention. Rather, the nix config for hackage-builder is to provide third party non-haskell binaries that are necessary for building (and testing as well) packages uploaded to hackage.
aha I missed the point that ci works with a archive not a git, but technically as a hack cabal can include a few nix files as extras. The nix config is classic, just master, no flakes, no nix.conf tuning like in cardano-ledger.
then the whole class of such issues wouldn't exist.
Activity
phadej commentedon Jul 10, 2025
Hackage doesn't build tests, or at least doesn't run themm does it?
gbaz commentedon Jul 10, 2025
Hackage does build and run tests. This can be disabled per-package on hackage: https://hackage.haskell.org/package/copilot-bluespec/maintain
This is however not an ideal situation, as it has to be done for each version. A PR to hackage to allow disabling tests across all versions (including yet-to-be-uploaded) would be welcome.
Bodigrim commentedon Jul 10, 2025
One can update Hackage configutation to install
bluespecby submitting a PR to https://github.com/haskell-infra/hackage-doc-builder-configivanperez-keera commentedon Jul 11, 2025
Tagging @RyanGlScott .
phadej commentedon Jul 11, 2025
Interesting. I find that somewhat surprising. I'd prefer running tests to be opt-in, I don't find it useful at all.
I don't want my docs building failing because of test issues (mostly missing compile or run time dependencies)
phadej commentedon Jul 11, 2025
Addition: test runner should use --test-show-details=direct or always. Hiding the test output is no point in CI
is useless, especially as that suite probably says that it's skipped (because no external runtime dependency is found), but I cannot be sure as output is omitted.
Bodigrim commentedon Jul 13, 2025
I think it's independent: docs will be built just fine even if tests fail.
I raised this recently in #1397.
RyanGlScott commentedon Jul 14, 2025
Returning to the original question of how to fix the Hackage tests for
copilot-bluespec: I wouldn't mind opening a PR on thehackage-doc-builder-configto addbluespecto the list of packages inbuild-depends.nix. That being said, I have a question about the scope ofbuild-depends.nix. The top of that file says:The key phrase there is "Haddock builder". Is it acceptable to add packages there solely for the sake of running tests? (
copilot-bluespecusesbscin its test suite, but otherwise its Haddocks build without issue.)ivanperez-keera commentedon Jul 14, 2025
@RyanGlScott I don't know that the current setting to disable tests would help us otherwise.
Currently
copilot-bluespecis set to not run tests:However, it still shows that building the tests failed:
Apparently, a re-build (which I tried to trigger last week) does not help.
ivanperez-keera commentedon Sep 17, 2025
Any updates on this question?
yaitskov commentedon Nov 15, 2025
I published a few packages on hackage recently with external dependencies, one even used z3 in tests.
I didn't do anything to disable test and don't remember any issue with failing test.
So Hackage just stores the uploaded archive.
Is building test a special Hackage feature available on request?
Bodigrim commentedon Nov 15, 2025
@yaitskov if you upload Haddocks yourself, Hackage recognizes it as a hint not to build the package (or run tests). This is somewhat coincidental: the builder was originally just to build docs and later extended also to run tests, but the old logic "don't bother to build if an author has already provided Haddocks" remains.
ivanperez-keera commentedon Nov 21, 2025
Gentle ping.
gbaz commentedon Nov 21, 2025
Adding packages to the nix config for running tests as well as building haddocks should be fine, within reason, imho.
yaitskov commentedon Nov 21, 2025
Could a hackage-server use nix files from the project?
I nixified the copilot in my fork.
gbaz commentedon Nov 21, 2025
That's not the intention. Rather, the nix config for hackage-builder is to provide third party non-haskell binaries that are necessary for building (and testing as well) packages uploaded to hackage.
yaitskov commentedon Nov 21, 2025
aha I missed the point that ci works with a archive not a git, but technically as a hack cabal can include a few nix files as extras. The nix config is classic, just master, no flakes, no nix.conf tuning like in cardano-ledger.
then the whole class of such issues wouldn't exist.
ivanperez-keera commentedon Dec 4, 2025
I think that'd be a good idea.
ulysses4ever commentedon Dec 4, 2025
What does the Nix config has to do with the initial topic of this issue:
I think it'd be good to address this issue regardless of what is there in the Nix config.
Merge branch 'develop-fix-hackage-tests'. Close #673.