Libc.so.6 version GLIBC_2.34 not found in custom package

As a musician trying to learn NixOS :metal:, I’m currently in an attempt to nix-ify some packages that might be practical and fun to use. And in the meantime, I’m trying to get some hands-on experience with creating my own package derivations.

I’m currently trying to tackle the meterec project:

meterec: Console based multi-track monitoring and recording tool.

However, I’m running into some speed bumps.

Problem :face_with_head_bandage:

This project is dependent on jack, so I included libjack.so.0 as a dependency in my buildInputs.
My build finishes without blocking errors.

When running the compiled meterec binary, I am greeted with the following error messages:

$ meterec -h
meterec: /nix/store/ikl21vjfq900ccbqg1xasp83kadw6q8y-glibc-2.32-46/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/hjp4xargcykf7slwi7spb7g2arw1353p-pipewire-0.3.51-jack/lib/libjack.so.0)
meterec: /nix/store/ikl21vjfq900ccbqg1xasp83kadw6q8y-glibc-2.32-46/lib/libc.so.6: version `GLIBC_2.33' not found (required by /nix/store/bdrqxrcqz0yf8k6z3rgk9hkgq4psax0a-pipewire-0.3.51-lib/lib/libpipewire-0.3.so.0)
meterec: /nix/store/ikl21vjfq900ccbqg1xasp83kadw6q8y-glibc-2.32-46/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/bdrqxrcqz0yf8k6z3rgk9hkgq4psax0a-pipewire-0.3.51-lib/lib/libpipewire-0.3.so.0)

Troubleshooting :gear:

I’ve been digging a bit deeper, and found that my issue might be related to pipewire + jack, which is enabled on my system:

services.pipewire.enable = true;
services.pipewire.jack.enable = true;
...

Looking into the PipeWire sources, it looks like one of the side effects is that it overrides the LD_LIBRARY_PATH environment variable.

I can get around it by (un)setting that LD_LIBRARY_PATH variable myself:

$ LD_LIBRARY_PATH="" meterec -h
version 0.9.3

meterec [-f freqency] [-r ref-level] [-s session-name] [-j jack-name] [-o output-format] [-u uuid] [-t][-p][-c][-i]

but obviously I’m not able to connect to PipeWire’s jack replacement server (as it’s not a real jackd service that is running).

$ LD_LIBRARY_PATH="" meterec -s demo                                                                                                                                             
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
# ...
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Failed to start 'meterec' jack client: 17 - Is jackd running?

Sources :robot:

meterec/derivation.nix
{ stdenv
, lib
, fetchurl
, pkg-config
, glibc
, libconfig
, libjack2
, libsndfile
, ncurses
}:

stdenv.mkDerivation rec {
  pname = "meterec";
  version = "0.9.3";

  src = fetchurl {
    url = "mirror://sourceforge/meterec/meterec-${version}.tgz";
    sha256 = "FO0a8ex0qqjemIXZ3bwiy31V48WPFJjX7W9Tz7K0hHQ=";
  };

  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs = [
    glibc glibc.static
    libconfig
    libjack2
    libsndfile
    ncurses
  ];

  meta = with lib; {
    description = "Console based multi-track monitoring and recording tool.";
    homepage = "http://meterec.sourceforge.net/";
    license = licenses.gpl3Only;
  };
}

Advice wanted :face_with_monocle:

From what I gather from the runtime error messages, there is a conflict between the current version of glibc (used in my derivation) and the version that was used to build the drop-in libjack.so.0, provided by PipeWire.

The built meterec binaries should be compatible with the drop-in libjack.so.0 replacement that is provided by PipeWire.

What am I missing here? :thinking:
Can anyone nudge me into the right direction of how to resolve this conflict via my derivation? :sweat_smile: Any help would be appreciated :innocent:

3 Likes