[Haskell-cafe] Core optimizations affected by package provenance

Li-yao Xia lysxia at gmail.com
Fri Aug 7 01:52:22 UTC 2020


Hello Café,

I've been testing properties of some optimized Core using the 
inspection-testing library. Some functions appear to be optimized 
differently depending on whether one of the package dependencies comes 
from Hackage or elsewhere. As far as I can tell, the source code is 
identical, and the only difference is whether or not I add the path to 
the local package in my cabal.project.

Why would a dependency be compiled differently depending on where it 
comes from?
Any suggestions on how to troubleshoot this?

To be more concrete, the relevant packages are generic-random and 
splitmix. The following commands should reproduce the issue:


git clone https://github.com/Lysxia/generic-random
git clone https://github.com/phadej/splitmix
cd generic-random

# With local splitmix
echo "packages: . ../splitmix" > cabal.project
cabal test --flags="enable-inspect"
# PASS

# With remote splitmix
echo "packages: ." > cabal.project
cabal test --flags="enable-inspect"
# FAIL


It would be useful to know whether anyone can reproduce this behavior or 
not.

Cheers,
Li-yao

PS, link to Github issue: https://github.com/Lysxia/generic-random/issues/22


More information about the Haskell-Cafe mailing list