Open philderbeast opened 3 years ago
I made a mistake in the initial report:
- > cabal test uom-plugin:doctest --project-file=901.cabal.project
+ > cabal test uom-plugin-tutorial:doctest --project-file=901.cabal.project
With that change, cabal fails too but for a different reason:
> cabal test uom-plugin-tutorial:doctest --project-file=901.cabal.project
Build profile: -w ghc-9.0.1 -O0
In order, the following will be built (use -v for more details):
- uom-plugin-tutorial-0.3.0.1 (test:doctest) (ephemeral targets)
Preprocessing test suite 'doctest' for uom-plugin-tutorial-0.3.0.1..
Building test suite 'doctest' for uom-plugin-tutorial-0.3.0.1..
Running 1 test suites...
Test suite doctest: RUNNING...
doc/Data/UnitsOfMeasure/Tutorial.hs:50:1: error:
Could not load module ‘Data.UnitsOfMeasure’
It is a member of the hidden package ‘uom-plugin-0.4.0.0’.
You can run ‘:set -package uom-plugin’ to expose it.
(Note: this unloads all the modules in the current scope.)
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
50 | import Data.UnitsOfMeasure
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
Test suite doctest: FAIL
Test suite logged to:
/.../ghc-9.0.1/uom-plugin-tutorial-0.3.0.1/t/doctest/noopt/test/uom-plugin-tutorial-0.3.0.1-doctest.log
0 of 1 test suites (0 of 1 test cases) passed.
cabal: Tests failed for test:doctest from uom-plugin-tutorial-0.3.0.1.
@adamgundry I got this to compile for the stack build with https://github.com/adamgundry/uom-plugin/pull/90 by changing seti
to set
. As this is for the tutorial and in GHCI seti
is the way to go, perhaps we could use set
for the doctest while showing seti
in the haddocks?
I think we could do this using an unreferenced chunk?
With regard the cabal test failure, adding -package uom-plugin
to the doctest setup worked but I stashed that change, blew away the dist-newstyle
folder and tried again and found the failure with cabal test to be not reproducible.
I'm building with stack against ghc-9.0.1 and noticed this error called out for
stack test uom-plugin-tutorial:doctest
but not forcabal test uom-plugin-tutorial:doctest --project-file=901.cabal.project
regarding the following line:https://github.com/adamgundry/uom-plugin/blob/f92df5464e7d496082fba841af3263a070050e80/uom-plugin/doc/Data/UnitsOfMeasure/Tutorial.hs#L80
From the
ghc-9.2
branch, this change tostack.yaml
reproduces the problem: