我想我的第一個包上傳到Hackage(耶!),我得到這個錯誤:哈斯克爾:測試包對基地的多個版本Hackage
The dependency 'build-depends: base' does not specify an upper bound on the version number. Each major release of the 'base' package changes the API in various ways and most packages will need some changes to compile with it. The recommended practise is to specify an upper bound on the version of the 'base' package. This ensures your package will continue to build when a new major version of the 'base' package is released. If you are not sure what upper bound to use then use the next major version. For example if you have tested your package with 'base' version 2 and 3 then use 'build-depends: base >= 2 && < 4'.
這似乎是一個完全可以接受的有理由拒絕我的包裹。
是否有一個很好的工具來測試我的包與各種版本的base
,所以我可以看到什麼是邊界(而不是隻是猜測)?我能想到的最好的方法是使用一些shell腳本來做類似的事情:
% for v in $BASE_VERSIONS
do
cabal install base-$v &&\
cabal configure --enable-tests &&\
cabal build &&\
cabal test && echo "$v ok" || echo "$v fail"
done
但是我覺得應該有更好的東西。