test: patchelf ELF interpreter in release docker image#198
Open
rishitesh-snt wants to merge 3 commits into
Open
test: patchelf ELF interpreter in release docker image#198rishitesh-snt wants to merge 3 commits into
rishitesh-snt wants to merge 3 commits into
Conversation
Nix-built sxt-node has an ELF interpreter pointing at /nix/store/... which parity/base-bin lacks, causing runtime ENOENT masked as '/usr/local/bin/sxt-node: No such file or directory'. This patches the interpreter to Ubuntu's default path before docker build to test if that alone unblocks execution.
1.69.2 |
Nix-built binary references GLIBC_2.38 and GLIBC_2.39 symbols. Ubuntu 22.04 (parity/base-bin:latest) only ships glibc 2.35. Ubuntu 24.10 provides glibc 2.40, matching Nix's toolchain. Explicit ca-certificates because ubuntu:24.10 doesn't ship them by default (parity/base-bin did).
Contributor
Author
|
Follow-up commit |
24.04 provides glibc 2.39 which covers all GLIBC symbol versions the binary needs (2.38 and 2.39 were the flagged ones). Also more reliable apt mirrors in CI than the short-support 24.10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Since
1fc8650(2026-03-03, "ci: switch ubuntu runners to nix exclusively") the release workflow builds sxt-node insidenix develop. Cargo therefore links against Nix's glibc, and the resulting binary's ELFPT_INTERPheader points at:sxtnode.Dockerfilecopies this binary intoparity/base-bin:latest(Ubuntu), which has no/nix/store/. The kernel can't resolve the interpreter,execve()returnsENOENT, and the shell prints the misleading:Discovered while trying to deploy
v1.69.1to testnet.What this PR does
Inserts a
patchelf --set-interpreterstep in thesxtnode_dockerjob, after the artifact is downloaded and beforedocker buildx build. This rewritesPT_INTERPto Ubuntu's default linker path (/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2) so the container's kernel can actually launch the binary.What this PR does NOT do
symbol lookup error: ... GLIBC_X.YZ not foundat runtime — an informative next error to diagnose.pkgs.dockerTools.buildLayeredImageso the whole closure is Nix-native. This is the fastest unblock only.How to test
Run the
Releaseworkflow on this branch viaworkflow_dispatch. That will publishspaceandtime.jfrog.io/sxtnode-docker-local/sxt-node:patchelf-interpreter. Then:docker pull spaceandtime.jfrog.io/sxtnode-docker-local/sxt-node:patchelf-interpreter docker run --rm --entrypoint sh spaceandtime.jfrog.io/sxtnode-docker-local/sxt-node:patchelf-interpreter \ -c '/usr/local/bin/sxt-node --version'Success case: version prints. Failure case:
GLIBC_X.YZ not foundor similar — proves the interpreter was the first blocker but there's a secondary glibc mismatch to solve.Test plan
fix/patchelf-interpreterbranchsxtnode-docker-local/sxt-node:patchelf-interpreterappears on JFrog--versioncommand above