darcs

Issue 2655 building with -fcurl fails: PACKAGE_VERSION is not defined

Title building with -fcurl fails: PACKAGE_VERSION is not defined
Priority Status unknown
Milestone Resolved in
Superseder Nosy List slyfox
Assigned To
Topics

Created on 2020-08-23.05:58:19 by slyfox, last changed 2020-08-24.06:08:26 by bf.

Messages
msg22441 (view) Author: slyfox Date: 2020-08-23.05:58:17
It's an upstream bug report of downstream https://bugs.gentoo.org/737236

Excerpt from full build'log at https://737236.bugs.gentoo.org/attachment.cgi?id=654756

"""
src/hscurl.c:50:12: error:
     error: expected ‘,’ or ‘;’ before ‘PACKAGE_VERSION’
       50 |   "darcs/" PACKAGE_VERSION " libcurl/" LIBCURL_VERSION;
          |            ^~~~~~~~~~~~~~~
   |
50 |   "darcs/" PACKAGE_VERSION " libcurl/" LIBCURL_VERSION;
   |            ^
`x86_64-pc-linux-gnu-gcc' failed in phase `C Compiler'. (Exit code: 1)
"""

I think it happens because ghc-8.8 (And/or Cabal-3?) does not define
PACKAGE_VERSION and defines CURRENT_PACKAGE_VERSION instead:

"""
$ fgrep -R PACKAGE_VERSION .
./dist/build/autogen/cabal_macros.h:#ifndef CURRENT_PACKAGE_VERSION
./dist/build/autogen/cabal_macros.h:#define CURRENT_PACKAGE_VERSION "2.16.1"
./dist/build/autogen/cabal_macros.h:#endif /* CURRENT_PACKAGE_VERSION */
./src/hscurl.c:  "darcs/" PACKAGE_VERSION " libcurl/" LIBCURL_VERSION;
./CHANGELOG:   * 1824: avoid PACKAGE_VERSION under Windows
"""

-- 

  Sergei
msg22444 (view) Author: bf Date: 2020-08-24.06:08:24
Thanks for the report!

I can reproduce the problem and the proposed fix is, I think, correct.
Indeed it fails for all supported compiler versions when I pass -fcurl
to cabal build.

Please note that building with -fcurl is no longer necessary and we
recommend to build without this flag nowadays.
History
Date User Action Args
2020-08-23 05:58:20slyfoxcreate
2020-08-24 06:08:26bfsetmessages: + msg22444
title: darcs-2.16.1 fails to build on ghc-8.8:: PACKAGE_VERSION is not defined -> building with -fcurl fails: PACKAGE_VERSION is not defined