F1bonacc1 / process-compose

Process Compose is a simple and flexible scheduler and orchestrator to manage non-containerized applications.
https://f1bonacc1.github.io/process-compose/
Apache License 2.0
1.34k stars 52 forks source link

Nix built binary is dynamically linked and missing RUNPATH/RPATH #265

Closed vkryachko closed 1 month ago

vkryachko commented 1 month ago

Defect

Make sure that these boxes are checked before submitting your issue -- thank you!

Version of process-compose:

Any version build with nix. Example nix build github:F1bonacc1/process-compose/main

OS environment:

Any linux distro

Steps or code to reproduce the issue:

  1. run nix build github:F1bonacc1/process-compose/main or install from nixpkgs
  2. ldd ./result/bin/process-compose

Expected result:

I would expect one of 2 things:

  1. The binary is reported as not a dynamic executable, this is the case with the binaries downloaded from https://github.com/F1bonacc1/process-compose/releases
  2. The binary has appropriate RUNPATH/RPATH that informs ld.so where to look for shared libraries

Actual result:

Running ldd on the nix built binary results in the following warnings and .so listings:

$ ldd /nix/store/dc6x42b1l0hyj3pskl1hp38y22j66gyh-process-compose-1.34.0/bin/process-compose 
/nix/store/dc6x42b1l0hyj3pskl1hp38y22j66gyh-process-compose-1.34.0/bin/process-compose: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/dc6x42b1l0hyj3pskl1hp38y22j66gyh-process-compose-1.34.0/bin/process-compose)
/nix/store/dc6x42b1l0hyj3pskl1hp38y22j66gyh-process-compose-1.34.0/bin/process-compose: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /nix/store/dc6x42b1l0hyj3pskl1hp38y22j66gyh-process-compose-1.34.0/bin/process-compose)
        linux-vdso.so.1 (0x00007fff5b1fc000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f57a7234000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f57a7060000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f57a7046000)
        /nix/store/apab5i73dqa09wx0q27b6fbhd1r18ihl-glibc-2.39-31/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f57a725b000)

readelf is missing RUNPATH

$ readelf -d ./result/bin/process-compose 

Dynamic section at offset 0xfe3aa0 contains 20 entries:
  Tag        Type                         Name/Value
 0x0000000000000004 (HASH)               0xf20b00
 0x0000000000000006 (SYMTAB)             0xf20ec0
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000005 (STRTAB)             0xf20be0
 0x000000000000000a (STRSZ)              709 (bytes)
 0x0000000000000007 (RELA)               0xf20628
 0x0000000000000008 (RELASZ)             24 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x0000000000000003 (PLTGOT)             0x13e3be0
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libresolv.so.2]
 0x000000006ffffffe (VERNEED)            0xf20aa0
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0xf20a40
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000002 (PLTRELSZ)           1008 (bytes)
 0x0000000000000017 (JMPREL)             0xf20640
 0x0000000000000000 (NULL)               0x0