ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.83k stars 899 forks source link

build fail on freebsd11 #2850

Closed arowser closed 5 years ago

arowser commented 5 years ago

Issue and Steps to Reproduce

Tested with 6c7a45623e6c2367315f8db58f8faf0c47592943 on freebsd 11.2 ./configure gmake

error log

tools/generate-wire.py --page impl tools/test/gen_test.h test_type < tools/test/test_cases > tools/test/gen_test.c
tools/test/gen_test.c:
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 6: Missing dependency operator
make[1]: Unknown modifier ' '
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 7: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 8: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 22: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 25: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 27: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 29: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 31: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 33: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 35: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 37: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 39: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 41: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 43: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 46: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 48: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 51: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 200: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 202: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 204: Need an operator
make[1]: "external/external/Makefile" line 25: Missing dependency operator
make[1]: "external/external/Makefile" line 28: Need an operator
make[1]: "external/external/Makefile" line 30: Need an operator
make[1]: "wire/wire/Makefile" line 52: Missing dependency operator
make[1]: "wire/wire/Makefile" line 59: Need an operator
make[1]: "wire/wire/Makefile" line 61: warning: duplicate script for target "wire/gen_peer_wire_csv" ignored
make[1]: "wire/wire/Makefile" line 54: warning: using previous script for "wire/gen_peer_wire_csv" defined here
make[1]: "wire/wire/Makefile" line 64: warning: duplicate script for target "wire/gen_onion_wire_csv" ignored
make[1]: "wire/wire/Makefile" line 57: warning: using previous script for "wire/gen_onion_wire_csv" defined here
make[1]: "wire/wire/Makefile" line 65: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 236: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 238: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 244: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 246: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 248: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 257: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 260: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 263: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 286: Missing dependency operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 288: Need an operator
make[1]: "/home/vagrant/workspace/c-lightning-x86-freebsd11/Makefile" line 290: Need an operator
make[1]: Fatal errors encountered -- cannot continuegmake: *** [tools/test/Makefile:34: tools/test/gen_test.c] Error 1
ZmnSCPxj commented 5 years ago

Can you give gmake version? gmake --version should work.

arowser commented 5 years ago

gmake -version GNU Make 4.2.1 Built for amd64-portbld-freebsd11.2 Copyright (C) 1988-2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

ZmnSCPxj commented 5 years ago

Thanks. I wonder if one of our inner Makefiles is using make directly instead of $(MAKE), I will have to search more, please wait. I presume you have a make --version that is not a GNU make, as this is a BSD?

arowser commented 5 years ago

yes, make --version return nothing, so its should not a GNU make.

On Fri, Jul 26, 2019 at 6:10 PM ZmnSCPxj, ZmnSCPxj jxPCSmnZ < notifications@github.com> wrote:

Thanks. I wonder if one of our inner Makefiles is using make directly instead of $(MAKE), I will have to search more, please wait. I presume you have a make --version that is not a GNU make, as this is a BSD?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ElementsProject/lightning/issues/2850?email_source=notifications&email_token=AAEEDCUI2S4QDQN45R7QWR3QBLESHA5CNFSM4IHCGJC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD24EU6I#issuecomment-515394169, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEDCTHZLBJ7JF5SOFMEJTQBLESHANCNFSM4IHCGJCQ .

arowser commented 5 years ago

I guess you are right, I just make a test: sudo mv /usr/bin/make /usr/bin/make_old sudo cp /usr/local/bin/gmake /usr/bin/make

Then run rebuild, the makefile issue gone, then I got another errors, but these errors seems not Makefile related:

tools/test/gen_test.c:12:90: error: expected function body after function
declarator
struct amount_msat fromwire_amount_msat(const u8 **cursor UNNEEDED, size_t
*max UNNEEDED)n{ fprintf(stderr, "fromwire_amount_msat called!\n");
abort(); }

             ^
tools/test/gen_test.c:426:2: error: implicit declaration of function
'towire_test_short_id' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
        towire_test_short_id(&ptr, &r->tlv3->subtype);
        ^
tools/test/gen_test.c:426:2: error: this function declaration is not a
prototype [-Werror,-Wstrict-prototypes]
tools/test/gen_test.c:427:2: error: implicit declaration of function
'towire_subtype_var_len' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
        towire_subtype_var_len(&ptr, &r->tlv3->varlen_subtype);
        ^
tools/test/gen_test.c:427:2: error: this function declaration is not a
prototype [-Werror,-Wstrict-prototypes]
tools/test/gen_test.c:428:2: error: implicit declaration of function
'towire_subtype_var_assign' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
        towire_subtype_var_assign(&ptr, &r->tlv3->varlen_assigned);
...

On Fri, Jul 26, 2019 at 6:28 PM daniel arowser@gmail.com wrote:

yes, make --version return nothing, so its should not a GNU make.

On Fri, Jul 26, 2019 at 6:10 PM ZmnSCPxj, ZmnSCPxj jxPCSmnZ < notifications@github.com> wrote:

Thanks. I wonder if one of our inner Makefiles is using make directly instead of $(MAKE), I will have to search more, please wait. I presume you have a make --version that is not a GNU make, as this is a BSD?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ElementsProject/lightning/issues/2850?email_source=notifications&email_token=AAEEDCUI2S4QDQN45R7QWR3QBLESHA5CNFSM4IHCGJC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD24EU6I#issuecomment-515394169, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEDCTHZLBJ7JF5SOFMEJTQBLESHANCNFSM4IHCGJCQ .

ZmnSCPxj commented 5 years ago

Could you check the output of gmake -p | grep MAKE?

We use $(MAKE) relatively consistently, so I wonder if gmake is somehow setting MAKE = make instead of MAKE = gmake.

rustyrussell commented 5 years ago

Yes, it would be a fair bit of work to support non-GNU make, and I'm sure it would break constantly. But we should use $(MAKE) everywhere, and obviously fix compile issues for the BSDs....

arowser commented 5 years ago

gmake -p | grep MAKE

tools/test/gen_test.c:12:90: error: expected function body after function declarator
struct amount_msat fromwire_amount_msat(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)n{ fprintf(stderr, "fromwire_amount_msat called!\n"); abort(); }
                                                                                         ^
tools/test/gen_test.c:426:2: error: implicit declaration of function 'towire_test_short_id' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        towire_test_short_id(&ptr, &r->tlv3->subtype);
        ^
tools/test/gen_test.c:426:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
tools/test/gen_test.c:427:2: error: implicit declaration of function 'towire_subtype_var_len' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        towire_subtype_var_len(&ptr, &r->tlv3->varlen_subtype);
        ^
tools/test/gen_test.c:427:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
tools/test/gen_test.c:428:2: error: implicit declaration of function 'towire_subtype_var_assign' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        towire_subtype_var_assign(&ptr, &r->tlv3->varlen_assigned);
        ^
tools/test/gen_test.c:428:2: note: did you mean 'towire_subtype_var_len'?
tools/test/gen_test.c:427:2: note: 'towire_subtype_var_len' declared here
        towire_subtype_var_len(&ptr, &r->tlv3->varlen_subtype);
        ^
tools/test/gen_test.c:428:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        towire_subtype_var_assign(&ptr, &r->tlv3->varlen_assigned);
        ^
tools/test/gen_test.c:429:2: error: implicit declaration of function 'towire_subtype_varlen_varsize' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        towire_subtype_varlen_varsize(&ptr, &r->tlv3->test_sbt_varlen_varsize);
        ^
tools/test/gen_test.c:429:2: note: did you mean 'towire_subtype_var_assign'?
tools/test/gen_test.c:428:2: note: 'towire_subtype_var_assign' declared here
        towire_subtype_var_assign(&ptr, &r->tlv3->varlen_assigned);
        ^
tools/test/gen_test.c:429:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        towire_subtype_varlen_varsize(&ptr, &r->tlv3->test_sbt_varlen_varsize);
        ^
tools/test/gen_test.c:444:3: error: implicit declaration of function 'towire_test_features' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                towire_test_features(&ptr, r->tlv3->varlen_varsize[i]);
                ^
tools/test/gen_test.c:444:3: note: did you mean 'towire_test_enum'?
tools/test/enum.h:11:6: note: 'towire_test_enum' declared here
void towire_test_enum(u8 **pptr, const enum test_enum test_enum);
     ^
tools/test/gen_test.c:444:3: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
                towire_test_features(&ptr, r->tlv3->varlen_varsize[i]);
                ^
tools/test/gen_test.c:456:2: error: implicit declaration of function 'fromwire_test_short_id' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        fromwire_test_short_id(cursor, plen, &r->tlv3->subtype);
        ^
tools/test/gen_test.c:456:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
tools/test/gen_test.c:457:29: error: implicit declaration of function 'fromwire_subtype_var_len' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        r->tlv3->varlen_subtype = *fromwire_subtype_var_len(r->tlv3, cursor, plen);
                                   ^
tools/test/gen_test.c:457:29: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
tools/test/gen_test.c:457:28: error: indirection requires pointer operand ('int' invalid)
        r->tlv3->varlen_subtype = *fromwire_subtype_var_len(r->tlv3, cursor, plen);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/test/gen_test.c:458:30: error: implicit declaration of function 'fromwire_subtype_var_assign' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        r->tlv3->varlen_assigned = *fromwire_subtype_var_assign(r->tlv3, cursor, plen);
                                    ^
tools/test/gen_test.c:458:30: note: did you mean 'fromwire_subtype_var_len'?
tools/test/gen_test.c:457:29: note: 'fromwire_subtype_var_len' declared here
        r->tlv3->varlen_subtype = *fromwire_subtype_var_len(r->tlv3, cursor, plen);
                                   ^
tools/test/gen_test.c:458:30: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        r->tlv3->varlen_assigned = *fromwire_subtype_var_assign(r->tlv3, cursor, plen);
                                    ^
tools/test/gen_test.c:458:29: error: indirection requires pointer operand ('int' invalid)
        r->tlv3->varlen_assigned = *fromwire_subtype_var_assign(r->tlv3, cursor, plen);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake: *** [<builtin>: tools/test/gen_test.o] Error 1
MAKEFILE_LIST :=  Makefile config.vars external/Makefile bitcoin/Makefile bitcoin/test/Makefile common/Makefile common/test/Makefile wire/Makefile wire/test/Makefile hsmd/Makefile gossipd/Makefile gossipd/test/Makefile openingd/Makefile channeld/Makefile channeld/test/Makefile closingd/Makefile onchaind/Makefile onchaind/test/Makefile connectd/Makefile connectd/test/Makefile lightningd/Makefile wallet/Makefile wallet/test/Makefile lightningd/test/Makefile cli/Makefile cli/test/Makefile doc/Makefile devtools/Makefile tools/Makefile tools/test/Makefile plugins/Makefile
GNUMAKEFLAGS := 
HAVE_POINTER_SAFE_MAKECONTEXT = 0
MAKELEVEL := 0
MAKE = $(MAKE_COMMAND)
MAKE_VERSION := 4.2.1
MAKE_COMMAND := gmake
MAKEFLAGS = p
MAKEFILES := 
MAKEINFO = makeinfo
MAKE_TERMERR := /dev/pts/0
MAKE_HOST := amd64-portbld-freebsd11.2
    $(MAKE) -C external/libwally-core DESTDIR=$$(pwd)/external install-exec
    cd external/libwally-core && ./tools/autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-module-recovery --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
    $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@
    $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@
    $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@
    $(MAKE) -C ../.. onchaind-all
    $(MAKE) -C ../.. opening-all
    cd external/libwally-core && ./tools/autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-module-recovery --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
    $(MAKE) -C external/libwally-core DESTDIR=$$(pwd)/external install-exec
    $(MAKE) -C .. lightningd-all
    $(MAKE) -C .. doc-all
    $(MAKE) -C .. lightningd-all
    $(MAKE) -C ../.. closingd-all
    $(MAKE) -C external/libsodium DESTDIR=$$(pwd)/external install-exec
    $(MAKE) -C ../.. lightningd/channel-all
    cd external/libwally-core && ./tools/autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-module-recovery --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
    $(MAKE) -C .. wire-all
    $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@
    $(MAKE) ccan/config.h
    $(MAKE) -C .. lightningd/hsm-all
    $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@
    $(MAKE) DESTDIR=$$(pwd)/testinstall install
    $(MAKE) DESTDIR=$$(pwd)/testinstall uninstall
    $(MAKE) -C external/libwally-core DESTDIR=$$(pwd)/external install-exec
    $(MAKE) installcheck
    $(MAKE) pytest
    $(MAKE) -C .. gossipd-all
    $(MAKE) -C .. connectd-all
    $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@
    cd external/libsodium && ./autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-shared=no --enable-tests=no --prefix=/ --libdir=/ && $(MAKE)
    cd external/libbacktrace-build && ../libbacktrace/configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
    $(MAKE) -C external/libbacktrace-build DESTDIR=$$(pwd)/external install-exec
ZmnSCPxj commented 5 years ago

Thanks @arowser ! Can you check #2861 and see if it fixes the issue?

arowser commented 5 years ago

Yes, build pass with https://github.com/ElementsProject/lightning/pull/2861, thanks