Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_command in configure fails for jq dependency even if jq exists #7925

Open
stefanwouldgo opened this issue Dec 10, 2024 · 8 comments
Open

Comments

@stefanwouldgo
Copy link

Issue and Steps to Reproduce

I want to build core lightning v24.11 (same problem is already there in v24.08 and probably earlier, but not in v23.08.1) on ubuntu18.04 arm64. This needs jq as a dependency (apparently new). So I installed jq and it works fine (just typing jq outputs its help), but the configure script doesn't recognize it and stops. I guess this is some problem in the check_command() function.

@whitslack
Copy link
Collaborator

@stefanwouldgo: What do you get if you run /bin/sh -c 'jq </dev/null ; echo $?'? The last line of output should show 0.

It's possible that Ubuntu 18.04 (quite an old release) might supply an older version of jq that does not return success when given a null input and no filter spec. Be aware that CLN build requires jq 1.6 or newer, as it makes use of the walk/1 built-in function.

@stefanwouldgo
Copy link
Author

@stefanwouldgo: What do you get if you run /bin/sh -c 'jq </dev/null ; echo $?'? The last line of output should show 0.

I just get a 0. So I guess that should be fine.

It's possible that Ubuntu 18.04 (quite an old release) might supply an older version of jq that does not return success when given a null input and no filter spec. Be aware that CLN build requires jq 1.6 or newer, as it makes use of the walk/1 built-in function.

Indeed, I have version 1.5.-1 (this is a nodl-OG). So I will have to cross-build the binaries on another device then?

@whitslack
Copy link
Collaborator

Indeed, I have version 1.5.-1 (this is a nodl-OG). So I will have to cross-build the binaries on another device then?

@stefanwouldgo: Or just build a newer version of jq and put it in your PATH before the system version.

@stefanwouldgo
Copy link
Author

@stefanwouldgo: Or just build a newer version of jq and put it in your PATH before the system version.

thanks, that worked. Didn't even have to build it myself. So with jq 1.7.1 configure runs through. But then, make fails pretty quickly:

Makefile:404: warning: overriding recipe for target '&'
Makefile:307: warning: ignoring old recipe for target '&'
CC: cc -DCLN_NEXT_VERSION="v24.11" -DPKGLIBEXECDIR="/usr/local/libexec/c-lightning" -DBINDIR="/usr/local/bin" -DPLUGINDIR="/usr/local/libexec/c-lightning/plugins" -DCCAN_TAL_NEVER_RETURN_NULL=1 -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -Werror -Wno-maybe-uninitialized -Wshadow=local -std=gnu11 -g -fstack-protector-strong -Og -I ccan -I external/libwally-core/include/ -I external/libwally-core/src/secp256k1/include/ -I external/jsmn/ -I external/libbacktrace/ -I external/gheap/ -I external/build-aarch64-linux-gnu/libbacktrace-build -I . -I/usr/local/include  -I/usr/include/postgresql    -DSHACHAIN_BITS=48 -DJSMN_PARENT_LINKS  -DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DCOMPAT_V072=1 -DCOMPAT_V073=1 -DCOMPAT_V080=1 -DCOMPAT_V081=1 -DCOMPAT_V082=1 -DCOMPAT_V090=1 -DCOMPAT_V0100=1 -DCOMPAT_V0121=1  -c -o
LD: cc   -Og  config.vars  -Lexternal/build-aarch64-linux-gnu -lwallycore -lsecp256k1 -ljsmn -lbacktrace -L/usr/local/include -lm -lsqlite3  -L/usr/lib/aarch64-linux-gnu -lpq -lsodium -lz -o
PYTHONPATH=contrib/msggen python3 contrib/msggen/msggen/__main__.py bundle doc/schemas
Traceback (most recent call last):
  File "contrib/msggen/msggen/__main__.py", line 9, in <module>
    from msggen.utils import load_jsonrpc_service, combine_schemas
  File "/opt/bitcoin/lightning/contrib/msggen/msggen/utils/__init__.py", line 1, in <module>
    from .utils import load_jsonrpc_method, load_jsonrpc_service, combine_schemas  # noqa
  File "/opt/bitcoin/lightning/contrib/msggen/msggen/utils/utils.py", line 3, in <module>
    from importlib import resources
ImportError: cannot import name 'resources'
contrib/msggen/Makefile:15: recipe for target 'contrib/msggen/msggen/schema.json' failed
make: *** [contrib/msggen/msggen/schema.json] Error 1

@whitslack
Copy link
Collaborator

Makefile:404: warning: overriding recipe for target '&'
Makefile:307: warning: ignoring old recipe for target '&'

@stefanwouldgo: Are you using GNU Make? You need at least GNU Make 4.3 since CLN uses grouped targets.

ImportError: cannot import name 'resources'

What version of Python are you running? importlib.resources was added to the standard library in Python 3.7. CLN requires Python 3.8 or newer.

Is there a reason you're trying to build CLN on such an outdated OS? Ubuntu 18.04 reached "end of support" in April 2023.

@stefanwouldgo
Copy link
Author

stefanwouldgo commented Dec 13, 2024

@stefanwouldgo: Are you using GNU Make? You need at least GNU Make 4.3 since CLN uses grouped targets.

GNU make 4.1

What version of Python are you running? importlib.resources was added to the standard library in Python 3.7. CLN requires Python 3.8 or newer.

3.6.9. Is there any place these minimum versions are documented?

Is there a reason you're trying to build CLN on such an outdated OS? Ubuntu 18.04 reached "end of support" in April 2023.

As I said, this is an old nodl device. They haven't updated their base distribution. So unless I want to switch to a whole different system, I guess I am stuck with this outdated Ubuntu. Of course, you cannot be expected to support any old system. But it would be nice to have more explicit build errors/instructions. There used to be a binary ppa for arm64, but for now it seems I just have to stay on my old CLN or cross compile it myself.

@whitslack
Copy link
Collaborator

Is there any place these minimum versions are documented?

There's not any one place that I'm aware of. And, now that I'm looking at it, the installation.md document says it should be possible to build and install on "Ubuntu 15.10 or above," but that is obviously an outdated assertion.

The minimum Python version is visible in pyproject.toml.

As I said, this is an old nodl device. They haven't updated their base distribution.

Well, okay, but it's Ubuntu, right? You can run do-release-upgrade to bring it up to date?

@stefanwouldgo
Copy link
Author

stefanwouldgo commented Dec 13, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants