haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.61k stars 691 forks source link

Build fails without any particular error messages #8776

Open yurivict opened 1 year ago

yurivict commented 1 year ago

The build of the verismith project fails without any particular error messages. Here are 3 sequential logs:

The first log has 3 lines ending with "error:" but they are followed by warnings. The subsequent 2 logs don't have any errors.

The compiler should either succeed or print some error messages.

All 3 logs suffer from the problem that they don't contain any errors and the compiler still failed.

hs-cabal-install-3.6.2.0 ghc-9.2.5 FreeBSD 13.1


After taking a second look I found that cabal prints errors in an unconventional way prepending them with "cabal:", not "error:".

The build fails to find the generated header resulting from lib/include/HsTimeConfig.h.in

So there are 3 errors: (1) warnings are printed as errors (2) errors are printed prepended with "cabal:" (3) failure to find header generated from *.h.in

I will create a separate issue for the third problem.

gbaz commented 1 year ago

The first is an issue with ghc, not cabal.

The second is not an error, its just your personal preference. There is no particular standard we're adhering to here, though having something particularly uniform is worth going for. Prefixing that notice with cabal is so it doesn't get mixed up with the output from the tools cabal calls -- a design decision made for sound reasons.

The third may be an issue in the package, not cabal.

yurivict commented 1 year ago

This message is abnormal:

/tmp/ghc91417_0/ghc_12.c:10:164: error:
     warning: passing 'char *' to parameter of type 'const unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
   |
10 | HsWord64 ghczuwrapperZC1ZChashablezm1zi4zi2zi0zminplaceZCDataziHashableziLowLevelZChashablezufnvzuhash(char* a1, HsInt64 a2, HsInt64 a3) {return hashable_fnv_hash(a1, a2, a3);}
   |                                                                                                                                                                    ^
HsWord64 ghczuwrapperZC1ZChashablezm1zi4zi2zi0zminplaceZCDataziHashableziLowLevelZChashablezufnvzuhash(char* a1, HsInt64 a2, HsInt64 a3) {return hashable_fnv_hash(a1, a2, a3);}
                                                                                                                                                                   ^~

include/HsHashable.h:19:53: error:
     note: passing argument to parameter 'str' here
   |
19 | FNV_UNSIGNED hashable_fnv_hash(const unsigned char* str, FNV_SIGNED len, FNV_UNSIGNED salt);
   |                                                     ^
FNV_UNSIGNED hashable_fnv_hash(const unsigned char* str, FNV_SIGNED len, FNV_UNSIGNED salt);
                                                    ^
1 warning generated.

It first says that this is an error, and then it says that this is a warning.

There is no particular standard we're adhering to here, though having something particularly uniform is worth going for.

There are tools that analyze logs, and there is no reason to not use the {file-name}:{line-number}:{column-number}: error: {message} format.