bug in cabal from Debian ?
Hello, I am trying to integrate cabal in my hkl project (autotools based)
In fact I am try to fix this bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071315
I decided to replace my home made build by calling cabal from Makefile.
So I endup with this code in my Makefile.am
---
bin_PROGRAMS = binoculars-ng
binoculars_ng_SOURCES=$(EXTRA_DIST)
binoculars-ng$(EXEEXT):
@rm -f cabal.project.local
cabal build $(srcdir) \
-fuseHklDev \
--disable-shared \
--enable-optimization \
--enable-static \
--extra-include-dirs=$(abs_top_srcdir) \
--extra-include-dirs=$(abs_top_srcdir)/binoculars-ng/binoculars \
--extra-lib-dirs=$(abs_top_builddir)/hkl/.libs \
--extra-lib-dirs=$(abs_top_builddir)/binoculars-ng/binoculars/.libs \
--offline
$(LN_S) $(shell cabal list-bin binoculars-ng) $@
---
locally it work and produce the right binoculars-ng program. GREAT.
BUT distchek failed with this error
---
make[4] : on quitte le répertoire « /home/picca/src/repo.or.cz/hkl/hkl-5.0.0.3456/_build/sub/binoculars-ng/binoculars »
make[4] : on entre dans le répertoire « /home/picca/src/repo.or.cz/hkl/hkl-5.0.0.3456/_build/sub/binoculars-ng »
Error: cabal: There is no <pkgname>.cabal package file or cabal.project file.
To build packages locally you need at minimum a <pkgname>.cabal file. You can
use 'cabal init' to create one.
For non-trivial projects you will also want a cabal.project file in the root
directory of your project. This file lists the packages in your project and
all other build configuration. See the Cabal user guide for full details.
cabal build ../../../binoculars-ng \
-fuseHklDev \
--disable-shared \
--enable-optimization \
--enable-static \
--extra-include-dirs=/home/picca/src/repo.or.cz/hkl/hkl-5.0.0.3456/_build/sub/../.. \
--extra-include-dirs=/home/picca/src/repo.or.cz/hkl/hkl-5.0.0.3456/_build/sub/../../binoculars-ng/binoculars \
--extra-lib-dirs=/home/picca/src/repo.or.cz/hkl/hkl-5.0.0.3456/_build/sub/hkl/.libs \
--extra-lib-dirs=/home/picca/src/repo.or.cz/hkl/hkl-5.0.0.3456/_build/sub/binoculars-ng/binoculars/.libs \
--offline
Error: cabal: There is no <pkgname>.cabal package file or cabal.project file.
To build packages locally you need at minimum a <pkgname>.cabal file. You can
use 'cabal init' to create one.
For non-trivial projects you will also want a cabal.project file in the root
directory of your project. This file lists the packages in your project and
all other build configuration. See the Cabal user guide for full details.
---
What I understand is :
distcheck is building out of tree
cabal is run from the $(builddir) and indeed there is no hkl.cabal file in this directory since it is only available in the $(srcdir).
BUT the cabal build --help print provide this.
---
Examples:
cabal build
Build the package in the current directory or all packages in the project
cabal build pkgname
Build the package named pkgname in the project
cabal build ./pkgfoo
Build the package in the ./pkgfoo directory
cabal build cname
Build the component named cname in the project
cabal build cname --enable-profiling
Build the component in profiling mode (including dependencies as needed)
---
So it seems that it is possible to build a package located under a directory (3rd proposition).
I tryed it and it keep saying
---
~/tmp$ cabal build /home/picca/src/repo.or.cz/hkl/binoculars-ng/
Error: cabal: There is no <pkgname>.cabal package file or cabal.project file.
To build packages locally you need at minimum a <pkgname>.cabal file. You can
use 'cabal init' to create one.
For non-trivial projects you will also want a cabal.project file in the root
directory of your project. This file lists the packages in your project and
all other build configuration. See the Cabal user guide for full details.
---
Is it a known issue ?
thanks for your help
Fred
Reply to: