!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

255 Members
79 Servers

Load older messages


SenderMessageTime
10 Aug 2023
@p14:matrix.orgp14dropping into a develop shell makes the problem go away13:46:40
@trofi:matrix.orgtrofi Is it an exact command? THe command coplains to me as error: flake 'flake:nixpkgs/73f18ca8b33ad1281958193e7e35f63b6ef47e52' does not provide attribute 13:46:45
@p14:matrix.orgp14Uh, should be, is it possible I have something in my flake registry messing things up?13:47:06
@p14:matrix.orgp14 How about ix build --rebuild github:nixos/nixpkgs/73f18ca8b33ad1281958193e7e35f63b6ef47e52#pkgsLLVM.llvmPackages_15.compiler-rt-no-libc.stdenv.cc.bintools -L; stat -c%s result/nix-support/setup-hook ? 13:47:25
@p14:matrix.orgp14 * How about nix build --rebuild github:nixos/nixpkgs/73f18ca8b33ad1281958193e7e35f63b6ef47e52#pkgsLLVM.llvmPackages_15.compiler-rt-no-libc.stdenv.cc.bintools -L; stat -c%s result/nix-support/setup-hook ? 13:47:31
@artturin:matrix.orgArtturin nix build --rebuild nixpkgs/73f18ca8b33ad1281958193e7e35f63b6ef47e52#pkgsLLVM.llvmPackages_15.compiler-rt-no-libc.stdenv.cc.bintools works fine here 13:48:03
@artturin:matrix.orgArtturinfine as in no error: flake...13:49:22
@trofi:matrix.orgtrofi getting 4781 here. is it a nixos? 13:49:25
@p14:matrix.orgp14Yes, it's a nixos.13:49:33
@p14:matrix.orgp14And I get 4781 on my good machine as well13:49:42
@p14:matrix.orgp14But 0 on the bad (obv).13:49:52
@trofi:matrix.orgtrofiAnd nothing different in build log either compared to the "good" one? Let's see what populates that setup-hook.13:50:42
@p14:matrix.orgp14

Build logs appear the same.

x86_64-unknown-linux-gnu-llvm-binutils-wrapper> unpacking sources
x86_64-unknown-linux-gnu-llvm-binutils-wrapper> patching sources
x86_64-unknown-linux-gnu-llvm-binutils-wrapper> updateAutotoolsGnuConfigScriptsPhase
x86_64-unknown-linux-gnu-llvm-binutils-wrapper> installing
x86_64-unknown-linux-gnu-llvm-binutils-wrapper> post-installation fixup
x86_64-unknown-linux-gnu-llvm-binutils-wrapper> shrinking RPATHs of ELF executables and libraries in /nix/store/9kaazhysw3pmzlrslpb1nsgy97hq8hlm-x86_64-unknown-linux-gnu-llvm-binutils-wrapper-15.0.7
x86_64-unknown-linux-gnu-llvm-binutils-wrapper> checking for references to /build/ in /nix/store/9kaazhysw3pmzlrslpb1nsgy97hq8hlm-x86_64-unknown-linux-gnu-llvm-binutils-wrapper-15.0.7...
x86_64-unknown-linux-gnu-llvm-binutils-wrapper> patching script interpreter paths in /nix/store/9kaazhysw3pmzlrslpb1nsgy97hq8hlm-x86_64-unknown-linux-gnu-llvm-binutils-wrapper-15.0.7

13:51:18
@p14:matrix.orgp14 I'm wondering how I can get my hands on more detailed diagnostics without perturbing the problem as NIX_DEBUG and set -x seem to. One idea is to diff the build closures of the good machine and bad machine somehow 13:51:54
@p14:matrix.orgp14Though I kinda suspect they'll be the same13:52:02
@p14:matrix.orgp14Another idea is to use 'perf trace record' or similar and try and get a trace of what the builder is doing.13:52:29
@p14:matrix.orgp14But I'm not sure I'll be able to dig through it, I'm not really sure what I'm looking for. I suppose I could start by trying to identify the writes of the setup hook.13:52:54
@p14:matrix.orgp14Is there an easy way I can attach strace to the builder 🤔13:53:17
@trofi:matrix.orgtrofi I usually strace -f nix-daemon itself and see what it forks out :) 13:54:41
@p14:matrix.orgp14So to make nix use that I'd start by killing the existing daemon and then running that as root, I guess.13:55:08
@trofi:matrix.orgtrofi

AFAIU setup-hook is the file that gets passed to the derivation as an input as is: pkgs/build-support/bintools-wrapper/default.nix: ./setup-hook.sh. Make sure your store contains non-empty input file.

Then pkgs/stdenv/generic/setup.sh merges them into a single file in fixupPhase(). substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook". Something probably fails there.

13:56:34
@p14:matrix.orgp14Download setup-hook-trace.log14:01:08
@p14:matrix.orgp14A fragment of the strace where setup-hook.sh is opened for reading and /nix-support/setup-hook is opened for writing. There is a load of file descriptor dup'ing going on which complicates understanding what is happening14:02:02
@p14:matrix.orgp14I'm struggling a bit to make sense of it. The writes to fd 1 (beginning '# Binutils Wrapper hygiene') are the content which is missing, I think14:02:33
@trofi:matrix.orgtrofi You can also try to add ... .overrideDerivation(oa: { preFixup = "set -x"; }) into your expression. Will probably require slightly changing your build command to nix build --expr with import builtinsFetch.git { ... }; <your thing>`. 14:02:54
@trofi:matrix.orgtrofi * You can also try to add ... .overrideDerivation(oa: { preFixup = "set -x"; }) into your expression. Will probably require slightly changing your build command to nix build --expr 'with import builtinsFetch.git { ... }; \<your thing>\. 14:03:08
@p14:matrix.orgp14When I do set -x like that, the problem goes away14:03:11
@p14:matrix.orgp14But with the given strace, the problem is present (assuming --rebuild doesn't do something funny whereby the build functions correctly but I'd get a bad file under result/nix-support/setup-hook)14:03:57
@p14:matrix.orgp14 In the trace, /nix/store/9kaazhysw3pmzlrslpb1nsgy97hq8hlm-x86_64-unknown-linux-gnu-llvm-binutils-wrapper-15.0.7/nix-support/setup-hook in file descriptor 3 is the empty file, and the writes to file descriptor 1 are what it should contain (but it is empty). 14:04:35
@trofi:matrix.orgtrofi you can also add -y to strace to get something more readable. 14:04:38

Show newer messages


Back to Room ListRoom Version: 9