Errors when trying to generate a test coverage report
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- haskell
- Área
- build-system, testing-qa
Línea de trabajo
Reproduce el comando de cobertura cabal test intmap-lazy-properties --enable-coverage e inspecciona PtrEquality.hs junto con compiler/GHC/StgToCmm/Prim.hs en emitPrimop. Después, compara los directorios mix de HPC indicados con la invocación manual de hpc markup. Se considera terminado cuando el informe de cobertura puede generarse sin eliminar el código reallyUnsafePtrEquality# ni proporcionar manualmente los directorios mix.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I tried to generate a test coverage report and ran into an entire zoo of errors.
I'll describe the issues so we can try to get this fixed, and a workaround. Skip to the end for the workaround.
Issue 1
Let's start with
$ cabal test intmap-lazy-properties --enable-coverage
<...>
[ 5 of 37] Compiling Utils.Containers.Internal.PtrEquality ( <...> )
<no location info>: error:
compiler/GHC/StgToCmm/Prim.hs:(344,32)-(345,74): Non-exhaustive patterns in lambda
Error: cabal: Failed to build containers-0.6.8 (which is required by
containers-tests-0).
The locations leads us to the emitPrimop for ReallyUnsafePtrEqualityOp.
https://gitlab.haskell.org/ghc/ghc/-/blob/ghc-9.6/compiler/GHC/StgToCmm/Prim.hs?ref_type=heads#L344-345
I am baffled.
Let's continue with a workaround, by removing all the reallyUnsafePtrEquality# stuff in PtrEquality.hs.
Issue 2
$ cabal test intmap-lazy-properties --enable-coverage
<...>
Running 1 test suites...
Test suite intmap-lazy-properties: RUNNING...
Test suite intmap-lazy-properties: PASS
Test suite logged to:
/home/meooow/dev/containers/dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/test/containers-tests-0-intmap-lazy-properties.log
hpc-ghc-9.6.3: can not find containers-0.6.8-inplace/Utils.Containers.Internal.StrictPair in ./.hpc, /home/meooow/dev/containers/dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/mix/containers-tests-0, /home/meooow/dev/containers/dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/mix/intmap-lazy-properties
CallStack (from HasCallStack):
error, called at libraries/hpc/Trace/Hpc/Mix.hs:122:15 in hpc-0.6.2.0:Trace.Hpc.Mix
Error: cabal: Tests failed for containers-tests-0.
Okay we got the tests to run successfully. But hpc failed.
I find that I have two vanilla/mix dirs:
- dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/mix
- dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-0.6.8/hpc/vanilla/mix
For some reason, hpc attempts to find containers-0.6.8 mix files without being aware of the containers-0.6.8 directory. This looks like a Cabal issue? Let's try to work around it by running hpc manually.
Using hpc
I had to jump through a few hoops with hpc but they aren't really bugs so I won't go into the details. The gist is that I needed to go into containers-test and run hpc providing the tix file and mix dirs manually.
$ cd containers-tests
$ hpc markup \
../dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/tix/intmap-lazy-properties/intmap-lazy-properties.tix \
--hpcdir ../dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/mix/containers-tests-0 \
--hpcdir ../dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/mix/intmap-lazy-properties \
--hpcdir ../dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-0.6.8/hpc/vanilla/mix/containers-0.6.8
Writing: containers-0.6.8-inplace/Utils.Containers.Internal.Coercions.hs.html
<...>
Writing: IntMapValidity.hs.html
Writing: hpc_index.html
Writing: hpc_index_fun.html
Writing: hpc_index_alt.html
Writing: hpc_index_exp.html
Success!
Workaround tl;dr
- Delete the imports and usages of
reallyUnsafePtrEquality#inPtrEquality.hs - Run the test with
cabal test intmap-lazy-properties --enable-coverage. The test will run but hpc will fail, that's fine. cd containers-tests- Run hpc providing the tix file and mix dirs
hpc markup \ ../dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/tix/intmap-lazy-properties/intmap-lazy-properties.tix \ --hpcdir ../dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/mix/containers-tests-0 \ --hpcdir ../dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-tests-0/hpc/vanilla/mix/intmap-lazy-properties \ --hpcdir ../dist-newstyle/build/x86_64-linux/ghc-9.6.3/containers-0.6.8/hpc/vanilla/mix/containers-0.6.8
- Lenguaje dominante
- Haskell
- Estrellas
- 356
- Forks
- 196
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de haskell/containers
-
unfoldTree is too lazyAbiertomajor-release strictness Tree
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
haskell/containers#1260 ·
-
macOS CI is brokenAbiertotesting
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
haskell/containers#1272 · 1 comentario ·
-
major-release Seq strictness
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
haskell/containers#1270 · 2 comentarios ·
-
Questionable behavior of Seq's stimes on overflowPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug pitfall Seq
Dificultad 4/5 1-2 días Aptitud para principiantes 48/100
haskell/containers#1269 ·
-
Overflow bugs in takeR, dropR, splitAtRPosiblemente ocupada @meooow25 la tomó hace 5 días. Abiertobug Seq
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
haskell/containers#1267 ·
Todos los issues de haskell/containers
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
haskell/blog.haskell.org#48 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Under the `C` locale a non-ASCII argument such as `--hide Φ.bar` is garbled, and the error about it crashes on stderrPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
objectionary/phino#2222 ·
Los mantenedores suelen responder en 1 día
-
area:stack expires:card-driven gap
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día