We’ve been investigating since yesterday about the issue, without much luck.
I made a quick reproducer here: Go in a Nix Shell · GitHub
Running this code on my own NixOS laptop but also on my own Amazon Workspace (based on RedHat) works pretty fine. I don’t think the issue is related to Nix at all since the beginning.
However, running exactly the same steps on his Amazon Workspace (based on Ubuntu) doesn’t work:
❯ git clone https://gist.github.com/drupol/e8db5a7e22611d3aa9cd94ca5acc4f6e
Cloning into 'e8db5a7e22611d3aa9cd94ca5acc4f6e'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.
❯ cd e8db5a7e22611d3aa9cd94ca5acc4f6e/
direnv: error /home/<redacted>/projects/e8db5a7e22611d3aa9cd94ca5acc4f6e/.envrc is blocked. Run `direnv allow` to approve its content
❯ direnv allow
direnv: loading ~/projects/e8db5a7e22611d3aa9cd94ca5acc4f6e/.envrc
direnv: using flake
warning: creating lock file '/home/<redacted>/projects/e8db5a7e22611d3aa9cd94ca5acc4f6e/flake.lock':
• Added input 'nixpkgs':
'github:nixos/nixpkgs/25865a40d14b3f9cf19f19b924e2ab4069b09588' (2024-05-05)
warning: Git tree '/home/<redacted>/projects/e8db5a7e22611d3aa9cd94ca5acc4f6e' is dirty
direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_LDFLAGS +NIX_STORE +NM +OBJCOPY +OBJDUMP +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +TEMP +TEMPDIR +TMP +TMPDIR +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS
❯ go get
❯ go build
❯ ./foo
exec: Failed to execute process './foo': The file exists and is executable. Check the interpreter or linker?
❯ ldd ./foo
linux-vdso.so.1 (0x00007ffea015e000)
libresolv.so.2 => /nix/store/apab5i73dqa09wx0q27b6fbhd1r18ihl-glibc-2.39-31/lib/libresolv.so.2 (0x00007ad67b9b6000)
libpthread.so.0 => /nix/store/apab5i73dqa09wx0q27b6fbhd1r18ihl-glibc-2.39-31/lib/libpthread.so.0 (0x00007ad67b9b1000)
libc.so.6 => /nix/store/apab5i73dqa09wx0q27b6fbhd1r18ihl-glibc-2.39-31/lib/libc.so.6 (0x00007ad67b7c4000)
/nix/store/35pq4hr29c3sl79lgfwgsvd9nwzyp4am-glibc-2.39-5/lib/ld-linux-x86-64.so.2 => /nix/store/apab5i73dqa09wx0q27b6fbhd1r18ihl-glibc-2.39-31/lib64/ld-linux-x86-64.so.2 (0x00007ad67b9c9000)
❯
Do you have a clue on what’s going on ?
