curl CLI stop working after sourcing toolchain env (curl: symbol lookup error)

If I source the toolchain environment (using
eval "$(nrfutil sdk-manager toolchain env --ncs-version v3.2.1 --as-script sh)"), the curl CLI stops working:

~$ curl example.org
<!doctype html><html lang="en"><head><title>Example Domain</title><meta name="viewport" content="width=device-width, initial-sca
le=1"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.
8}a:link,a:visited{color:#348}</style><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples with
out needing permission. Avoid use in operations.<p><a href="https://iana.org/domains/example">Learn more</a></div></body></html>
~$ ldd $(which curl) | grep 'libcurl\|libnghttp'
        libcurl.so.4 => /lib/x86_64-linux-gnu/libcurl.so.4 (0x000076c4242ac000)
        libnghttp2.so.14 => /lib/x86_64-linux-gnu/libnghttp2.so.14 (0x000076c424265000)
~$ eval "$(nrfutil sdk-manager toolchain env --ncs-version v3.2.1 --as-script sh)"
~$ curl example.org
curl: symbol lookup error: /lib/x86_64-linux-gnu/libcurl.so.4: undefined symbol: nghttp2_option_set_no_rfc9113_leading_and_trail
ing_ws_validation
~$ ldd $(which curl) | grep 'libcurl\|libnghttp'
        libcurl.so.4 => /lib/x86_64-linux-gnu/libcurl.so.4 (0x000075cb8274a000)
        libnghttp2.so.14 => /home/rodrigo/ncs/toolchains/43683a87ea/usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x000075cb8270400
0)
~$ echo $LD_LIBRARY_PATH
/home/rodrigo/ncs/toolchains/43683a87ea/usr/lib:/home/rodrigo/ncs/toolchains/43683a87ea/usr/lib/x86_64-linux-gnu:/home/rodrigo/n
cs/toolchains/43683a87ea/usr/local/lib:
~$

The toolchain environment is setting LD_LIBRARY_PATH, which causes curl to use an incompatible version of one of its libraries.

I am on Ubuntu 24.04.3 LTS.

Parents Reply Children
  • Yes, this does circumvent the problem:

    ~$ eval "$(nrfutil sdk-manager toolchain env --ncs-version v3.2.1 --as-script sh)"
    ~$ curl example.org
    curl: symbol lookup error: /lib/x86_64-linux-gnu/libcurl.so.4: undefined symbol: nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation
    ~$ LD_LIBRARY_PATH= curl example.org
    <!doctype html><html lang="en"><head><title>Example Domain</title><meta name="viewport" content="width=device-width, initial-scale=1"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</style><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.<p><a href="https://iana.org/domains/example">Learn more</a></div></body></html>

    My main problem is that I use Neovim in the terminal, and one of the plugins I have is using curl internally. I could open Neovim with LD_LIBRARY_PATH='', but I am afraid that may break something in the toolchain.

  • Hi,

     

    Unfortunately, we do not have a good workaround for this use-case with our toolchain.

    It can be possible if you manually install sdk-ng:

    https://github.com/zephyrproject-rtos/sdk-ng

    However, we unfortunately do not support manual installation.

     

    Kind regards,

    Håkon

Related