Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

fix: set portable interpreter path for Linux release binaries - #21

Open
MoshiBin wants to merge 1 commit into
tobi:masterfrom
MoshiBin:fix/portable-interpreter-path
Open

fix: set portable interpreter path for Linux release binaries#21
MoshiBin wants to merge 1 commit into
tobi:masterfrom
MoshiBin:fix/portable-interpreter-path

Conversation

@MoshiBin

@MoshiBinMoshiBin commented May 19, 2026

Copy link
Copy Markdown

This change uses patchelf to set the interpreter as ld-linux-x86-64.so.2 (or ld-linux-aarch64.so.1 on aarch64) instead of the default, which references Nix and isn't available on other distros.

See #15 for reference. The built try from the releases page shows:

$ file try
try: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/xx7cm72qy2c0643cm1ipngd87aqwkcdp-glibc-2.40-66/lib/ld-linux-
x86-64.so.2

Which causes this error when running:

$ ./try
bash: ./try: No such file or directory

This change adds patchelf as a step after building to explicitly point at the actual paths for ld-linux.

Honestly, I'm not familiar enough with Nix at this point to know if this is the best way of doing it. I used an agent to help me implement this.

I'm leaning towards #17 as a better fix for this behavior, as I feel this is more of a temp workaround.

@MoshiBin
MoshiBinforce-pushed the fix/portable-interpreter-path branch from 281ef66 to d28e5dbCompareMay 19, 2026 17:02
Release binaries built with Nix have hardcoded Nix store paths for the
dynamic linker, causing them to fail on non-Nix Linux systems with
"No such file or directory" error.
This fix adds patchelf to the Nix build process for cross-compilation
packages (x86_64-linux and aarch64-linux) to set the interpreter path to
standard system locations during the installPhase:
- /lib64/ld-linux-x86-64.so.2 for x86_64
- /lib/ld-linux-aarch64.so.1 for aarch64
This approach is cleaner than adding patchelf as a CI dependency since
patchelf is already available in nixpkgs and the fix is applied at build
time rather than as a post-processing step.
Fixestobi#15
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@MoshiBin
MoshiBin marked this pull request as draft May 19, 2026 17:03
@MoshiBin
MoshiBinforce-pushed the fix/portable-interpreter-path branch from d28e5db to de061ddCompareMay 19, 2026 17:03
@MoshiBin
MoshiBin marked this pull request as ready for review May 19, 2026 17:10
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@MoshiBin