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

bear fails with erro #275145

Closed
ghost opened this issue Dec 18, 2023 · 8 comments
Closed

bear fails with erro #275145

ghost opened this issue Dec 18, 2023 · 8 comments
Labels
0.kind: bug Something is broken

Comments

@ghost
Copy link

ghost commented Dec 18, 2023

Describe the bug

bear is unable to produce compile_commands.json, fails with GLIBC error

Steps To Reproduce

Steps to reproduce the behavior:
executing bear -- make all inside a nix results in the following error
/usr/bin/env: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.38' not found (required by /nix/store/dghjv6hfz0s0z4kffa5ahyw2mhp79215-gcc-12.3.0-lib/lib/libstdc++.so.6)

Notify maintainers

@babariviere
@alyssais

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/zzjrl1zzc0lbwlc8dvs98l5k906cwd7z-nix-info
copying path '/nix/store/zzjrl1zzc0lbwlc8dvs98l5k906cwd7z-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.133.1-microsoft-standard-WSL2, Debian GNU/Linux, 12 (bookworm), nobuild`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.8.0`
 - channels(root): `"nixos-23.11-23.11, nixpkgs"`
 - channels(ah): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@ghost ghost added the 0.kind: bug Something is broken label Dec 18, 2023
@DieracDelta
Copy link
Member

#238531 this fix gets bear working for me fwiw

@laggron42
Copy link

This is still happening for me, using 23.11 or unstable.

@DieracDelta
Copy link
Member

DieracDelta commented Mar 13, 2024

@laggron42 looks like the backport is still open. The patch that fixes the problem hasn't made its way from master into 23.11 or unstable. #279035 (comment)

@laggron42
Copy link

@DieracDelta Thanks for your answer! I have pulled from master, but the problem still happens for me:

epita@rayquaza ~/tc $ nix develop --ignore-environment
bash-5.2$ bear -- make
  GEN      src/version.stamp
/bin/sh: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/ksk3rnb0ljx8gngzk19jlmbjyvac4hw6-glibc-2.38-44/lib/libdl.so.2)
/bin/sh: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/pp0jsd045xvfsz60kpbkfxbs9pbpk8z5-gcc-13.2.0-lib/lib/libstdc++.so.6)
/bin/sh: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/pp0jsd045xvfsz60kpbkfxbs9pbpk8z5-gcc-13.2.0-lib/lib/libstdc++.so.6)
/bin/sh: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/ksk3rnb0ljx8gngzk19jlmbjyvac4hw6-glibc-2.38-44/lib/libm.so.6)
make: *** [Makefile:2300: src/version.stamp] Error 1

The output of nix derivation show seems to indicate that my environment holds the patched bear by the presence of ./fix-functional-tests.patch and the additional CMake flags:

Output of nix derivation show
epita@rayquaza ~/tc $ nix develop
bash-5.2$ which bear
/nix/store/j0hm34ln27wpx05l0zbv7c4mria926xc-bear-3.1.3/bin/bear

nix derivation show /nix/store/j0hm34ln27wpx05l0zbv7c4mria926xc-bear-3.1.3

{
  "/nix/store/w86rc4js58760n5qr8fimizap85547g3-bear-3.1.3.drv": {
    "args": [
      "-e",
      "/nix/store/v6x3cs394jgqfbi0a42pam708flxaphh-default-builder.sh"
    ],
    "builder": "/nix/store/4vzal97iq3dmrgycj8r0gflrh51p8w1s-bash-5.2p26/bin/bash",
    "env": {
      "__structuredAttrs": "",
      "buildInputs": "/nix/store/nl6dmqmbcliwaqmzcsyh8q09aa8r4s11-grpc-1.62.0 /nix/store/5g29ind1alcyqa7r820jvhmcpyi5i8pb-protobuf-24.4 /nix/store/xpz5n8nd9minrr31yw2d63xwg0941xb7-openssl-3.0.13-dev /nix/store/fnc247gqx35njq660m7aylf7cf0shxb4-nlohmann_json-3.11.3 /nix/store/zbbp7rpnlv7jk8ynj07zjrqsli9jm7y6-gtest-1.14.0-dev /nix/store/7k5dkgi4hqcqpzr9zsr2g5favzqndsan-spdlog-1.13.0-dev /nix/store/w3cv7kvp2ax8mh06vk3w234wh4ir105a-c-ares-1.27.0-dev /nix/store/hlirwi0zfhna90xp2j2mnyplyjz437h5-zlib-1.3.1-dev /nix/store/17iz09krgkygjb4dkl2r76y5dnw8r7yk-sqlite-3.45.1-dev /nix/store/20brkr5zibka9wjn44dspp1jibrc1scl-re2-2024-02-01-dev",
      "builder": "/nix/store/4vzal97iq3dmrgycj8r0gflrh51p8w1s-bash-5.2p26/bin/bash",
      "cmakeFlags": "-DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_LIBDIR=lib -DENABLE_UNIT_TESTS:BOOL=FALSE -DENABLE_FUNC_TESTS:BOOL=FALSE",
      "configureFlags": "",
      "depsBuildBuild": "",
      "depsBuildBuildPropagated": "",
      "depsBuildTarget": "",
      "depsBuildTargetPropagated": "",
      "depsHostHost": "",
      "depsHostHostPropagated": "",
      "depsTargetTarget": "",
      "depsTargetTargetPropagated": "",
      "doCheck": "",
      "doInstallCheck": "",
      "mesonFlags": "",
      "name": "bear-3.1.3",
      "nativeBuildInputs": "/nix/store/9walp7knvqvmnpp9pqwjsdpnx2524ack-cmake-3.28.3 /nix/store/d6bvhfhg3aw2lj0nyb08y0ahlj5md6p8-ninja-1.11.1 /nix/store/a3752l19hc76dmzh1wgrxbsxh6lfx67z-pkg-config-wrapper-0.29.2 /nix/store/j3rcmgzjg61h94fgcjj4kpysvr0miz6l-python3.11-lit-17.0.6 /nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8",
      "out": "/nix/store/j0hm34ln27wpx05l0zbv7c4mria926xc-bear-3.1.3",
      "outputs": "out",
      "patches": "/nix/store/aym0v0a1c7wix8fywy2bg0likz5q100s-fix-functional-tests.patch",
      "pname": "bear",
      "postPatch": "patchShebangs test/bin\n\n# /usr/bin/env is used in test commands and embedded scripts.\nfind test -name '*.sh' \\\n  -exec sed -ie 's|/usr/bin/env|/nix/store/mb488rr560vq1xnl10hinnyfflcrd51n-coreutils-9.4/bin/env|g' {} +\n",
      "propagatedBuildInputs": "",
      "propagatedNativeBuildInputs": "",
      "src": "/nix/store/blwxxfk6dk91xms2pxgchpscv54izg0y-source",
      "stdenv": "/nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux",
      "strictDeps": "",
      "system": "x86_64-linux",
      "version": "3.1.3"
    },
    "inputDrvs": {
      "/nix/store/092s4n6d7dhm1xcfl5m1q4qybnnwn1lw-gtest-1.14.0.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "dev"
        ]
      },
      "/nix/store/28dkg1wfig3f7vwf7gxbi90kppzdcngy-nlohmann_json-3.11.3.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/2gp6pdljs2b8rv7spyqn1zx62hpp3q4m-re2-2024-02-01.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "dev"
        ]
      },
      "/nix/store/4risxx9frn02fraphwrb0jbcpcx78a0g-ninja-1.11.1.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/66j28a1lxf21cl3fbsynqc2ac79dgzag-cmake-3.28.3.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/77827b36qz2s0713m61z12w73sr3dzlz-python3.11-lit-17.0.6.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/8brdx72cmmmjrap80d8x4k58f69h4247-stdenv-linux.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/9by54ylsfw1a617njnldvhn8dr5j01wx-pkg-config-wrapper-0.29.2.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/bnkny1qgs16q84kshlmfqdnc8a154nzy-coreutils-9.4.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/bzik9pfby875yv5xzchcs9ad3mvaahc1-grpc-1.62.0.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/ccxb8wmah8w11x94n58hxzi5z25nkrc9-openssl-3.0.13.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "dev"
        ]
      },
      "/nix/store/gp8zp58fh5rfrz4ypqqq460dlihaldk7-sqlite-3.45.1.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "dev"
        ]
      },
      "/nix/store/ha2jqykyvnszwdd40x58bpswfqlp956b-zlib-1.3.1.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "dev"
        ]
      },
      "/nix/store/i8lcijxxjy4akf79741l8m6aasg2cw9g-spdlog-1.13.0.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "dev"
        ]
      },
      "/nix/store/kpgpdkllqj1jp4fq1ky418axbfxf8v7x-c-ares-1.27.0.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "dev"
        ]
      },
      "/nix/store/kqbwi7q7b4nq8m4xh7m5d08yiijfdvsj-python3-3.11.8.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/p4hkq7hz2y80b43rz9nn3253ki69l73z-protobuf-24.4.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/pmrqjyxrwr4m19pah4l698xkx8z9cwni-source.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      },
      "/nix/store/y1j406svnfr5i2i78z4ybg8rg30ngmkj-bash-5.2p26.drv": {
        "dynamicOutputs": {},
        "outputs": [
          "out"
        ]
      }
    },
    "inputSrcs": [
      "/nix/store/aym0v0a1c7wix8fywy2bg0likz5q100s-fix-functional-tests.patch",
      "/nix/store/v6x3cs394jgqfbi0a42pam708flxaphh-default-builder.sh"
    ],
    "name": "bear-3.1.3",
    "outputs": {
      "out": {
        "path": "/nix/store/j0hm34ln27wpx05l0zbv7c4mria926xc-bear-3.1.3"
      }
    },
    "system": "x86_64-linux"
  }
}
If this helps, here's the metadata on my machine
epita@rayquaza ~/tc $ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.0-91-generic, Ubuntu, 22.04.3 LTS (Jammy Jellyfish), nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(epita): `"home-manager"`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

@DieracDelta
Copy link
Member

Ack, yeah it's broken for me too (with the same error). Not sure how to fix that...

@DieracDelta
Copy link
Member

So, it's a mismatch between the glibc in nix-23.11 and nixos-unstable/master. If I rebuild my own config with nixos-unstable then nix run nixpkgs#bear -- make, compile_commands are generated and I get no errors.

@siraben
Copy link
Member

siraben commented Mar 14, 2024

Closing because it's due to nixpkgs versioning mismatch, and works on unstable.

@siraben siraben closed this as completed Mar 14, 2024
@ro6
Copy link
Contributor

ro6 commented Sep 2, 2024

Still doesn't work for me. Is there some requirement that that Bear be built against an older version of glibc than what you run it with? In that case, I may need to pin an older version since I'm running on CentOS 7 with glibc 2.17. Or maybe I just need to set up the environment so bear dynamically links against a glibc from the nix store at runtime? I don't know bear internals enough to know how it interacts with the program being wrapped, and whether their glibc versions need to be compatible.

I'm still getting errors like:

make: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/f4szlnrx9x7nhm026qg0nraxw4v5d304-bear-3.1.4/lib/bear/libexec.so)
make: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /nix/store/f4szlnrx9x7nhm026qg0nraxw4v5d304-bear-3.1.4/lib/bear/libexec.so)
make: /lib64/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/wlffq5p6mxxgfap10sav3ij936jzqm59-glibc-2.39-52/lib/libdl.so.2)
make: /lib64/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/wlffq5p6mxxgfap10sav3ij936jzqm59-glibc-2.39-52/lib/libdl.so.2)
make: /lib64/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libstdc++.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.26' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libstdc++.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libstdc++.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libstdc++.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libstdc++.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libstdc++.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libstdc++.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libstdc++.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/wlffq5p6mxxgfap10sav3ij936jzqm59-glibc-2.39-52/lib/libm.so.6)
make: /lib64/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/wlffq5p6mxxgfap10sav3ij936jzqm59-glibc-2.39-52/lib/libm.so.6)
make: /lib64/libc.so.6: version `GLIBC_2.35' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libgcc_s.so.1)
make: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/zx9zgvy2nsxcmpn0fzx277m5lk352cdf-gcc-13.3.0-lib/lib/libgcc_s.so.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants