building on ubuntu 16.04 since commit 5c07afac7d082ee4d878c6fe20c2910bbc08458d
Issue and Steps to Reproduce
Since commit 5c07afac7d082ee4d878c6fe20c2910bbc08458d i can no longer build on ubuntu 16.04.6 LTS. Building on ubuntu 18.04.1 LTS works fine.
I've doublechecked the prereqs, but i always end up with following error messages:
cc -DBINTOPKGLIBEXECDIR="\"../libexec/c-lightning\"" -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -Werror -Wno-error=maybe-uninitialized -std=gnu11 -g -fstack-protector -Og -I ccan -I external/libwally-core/include/ -I external/libwally-core/src/secp256k1/include/ -I external/jsmn/ -I external/libbacktrace/ -I external/libbacktr ace-build -I . -I/usr/local/include -DSHACHAIN_BITS=48 -DJSMN_PARENT_LINKS -DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DBINTOPKGLIBEXECDIR="\"../libexec /c-lightning\"" -c -o hsmd/hsmd.o hsmd/hsmd.c
hsmd/hsmd.c: In function 'handle_channel_update_sig':
hsmd/hsmd.c:696:59: error: passing argument 2 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
if (!fromwire_channel_update_option_channel_htlc_max(cu, &sig,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'secp256k1_ecdsa_signature * {aka struct <anonymous> *}'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:697:4: error: passing argument 3 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&chain_hash, &scid, ×tamp, &message_flags,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'u32 * {aka unsigned int *}' but argument is of type 'struct bitcoin_blkid *'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:697:17: error: passing argument 4 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&chain_hash, &scid, ×tamp, &message_flags,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'struct bitcoin_blkid *' but argument is of type 'struct short_channel_id *'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:697:24: error: passing argument 5 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&chain_hash, &scid, ×tamp, &message_flags,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'u16 * {aka short unsigned int *}' but argument is of type 'u32 * {aka unsigned int *}'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:697:36: error: passing argument 6 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&chain_hash, &scid, ×tamp, &message_flags,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'struct amount_msat *' but argument is of type 'u8 * {aka unsigned char *}'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:698:20: error: passing argument 8 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&channel_flags, &cltv_expiry_delta,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'struct amount_msat *' but argument is of type 'u16 * {aka short unsigned int *}'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:699:4: error: passing argument 9 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&htlc_minimum, &fee_base_msat,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'u32 * {aka unsigned int *}' but argument is of type 'struct amount_msat *'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:699:19: error: passing argument 10 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&htlc_minimum, &fee_base_msat,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'struct short_channel_id *' but argument is of type 'u32 * {aka unsigned int *}'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:700:4: error: passing argument 11 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&fee_proportional_mill, &htlc_maximum)) {
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'secp256k1_ecdsa_signature * {aka struct <anonymous> *}' but argument is of type 'u32 * {aka unsigned int *}'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:700:28: error: passing argument 12 of 'fromwire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&fee_proportional_mill, &htlc_maximum)) {
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:166:6: note: expected 'u32 * {aka unsigned int *}' but argument is of type 'struct amount_msat *'
bool fromwire_channel_update_option_channel_htlc_max(const void *p, u8 *message_flags, u32 *timestamp, struct bitcoin_blkid *chain_hash, u16 *cltv_expiry_delta, struct amount_msat *htlc_maximu
^
hsmd/hsmd.c:712:61: error: passing argument 2 of 'towire_channel_update_option_channel_htlc_max' makes integer from pointer without a cast [-Werror=int-conversion]
cu = towire_channel_update_option_channel_htlc_max(tmpctx, &sig, &chain_hash,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'u8 {aka unsigned char}' but argument is of type 'secp256k1_ecdsa_signature * {aka struct <anonymous> *}'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
hsmd/hsmd.c:712:67: error: passing argument 3 of 'towire_channel_update_option_channel_htlc_max' makes integer from pointer without a cast [-Werror=int-conversion]
cu = towire_channel_update_option_channel_htlc_max(tmpctx, &sig, &chain_hash,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'u32 {aka unsigned int}' but argument is of type 'struct bitcoin_blkid *'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
hsmd/hsmd.c:713:8: error: passing argument 4 of 'towire_channel_update_option_channel_htlc_max' from incompatible pointer type [-Werror=incompatible-pointer-types]
&scid, timestamp, message_flags, channel_flags,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'const struct bitcoin_blkid *' but argument is of type 'struct short_channel_id *'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
hsmd/hsmd.c:713:26: error: incompatible type for argument 6 of 'towire_channel_update_option_channel_htlc_max'
&scid, timestamp, message_flags, channel_flags,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'struct amount_msat' but argument is of type 'u8 {aka unsigned char}'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
hsmd/hsmd.c:714:8: error: incompatible type for argument 8 of 'towire_channel_update_option_channel_htlc_max'
cltv_expiry_delta, htlc_minimum,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'struct amount_msat' but argument is of type 'u16 {aka short unsigned int}'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
hsmd/hsmd.c:714:27: error: incompatible type for argument 9 of 'towire_channel_update_option_channel_htlc_max'
cltv_expiry_delta, htlc_minimum,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'u32 {aka unsigned int}' but argument is of type 'struct amount_msat'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
hsmd/hsmd.c:715:8: error: passing argument 10 of 'towire_channel_update_option_channel_htlc_max' makes pointer from integer without a cast [-Werror=int-conversion]
fee_base_msat, fee_proportional_mill,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'const struct short_channel_id *' but argument is of type 'u32 {aka unsigned int}'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
hsmd/hsmd.c:715:23: error: passing argument 11 of 'towire_channel_update_option_channel_htlc_max' makes pointer from integer without a cast [-Werror=int-conversion]
fee_base_msat, fee_proportional_mill,
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'const secp256k1_ecdsa_signature * {aka const struct <anonymous> *}' but argument is of type 'u32 {aka unsigned int}'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
hsmd/hsmd.c:716:8: error: incompatible type for argument 12 of 'towire_channel_update_option_channel_htlc_max'
htlc_maximum);
^
In file included from hsmd/hsmd.c:54:0:
./wire/gen_peer_wire.h:165:5: note: expected 'u32 {aka unsigned int}' but argument is of type 'struct amount_msat'
u8 *towire_channel_update_option_channel_htlc_max(const tal_t *ctx, u8 message_flags, u32 timestamp, const struct bitcoin_blkid *chain_hash, u16 cltv_expiry_delta, struct amount_msat htlc_maxi
^
cc1: all warnings being treated as errors
<builtin>: recipe for target 'hsmd/hsmd.o' failed
make: *** [hsmd/hsmd.o] Error 1
what version of python are you running? we generate methods for the towire/fromwires and looks like the argument lists are being iterated through in the wrong order.
@mocacinno if it's not too much trouble, could you check out branch in PR #2832. i have a hunch it might fix this problem.
I encountered this problem and confirm #2832 does fix this. I recommend to use make clean && ./configure && make. Closing as #2832 is now merged.
@niftynei : thanks for jumping right in :) To answer your questions, my python version is Python 2.7.12 I fetched the latest commit (since ZmnSCPxj said it was merged) and tried to build, it was succesful.