!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

230 Members
74 Servers

Load older messages


SenderMessageTime
10 Aug 2023
@p14:matrix.orgp14 *

Wow, this is unfortunate. If I build:

nix build --rebuild pkgsLLVM.llvmPackages_15.compiler-rt-no-libc.stdenv.cc.bintools```

I get:

-r--r--r-- 1 root root 0 Jan 1 1970 result/nix-support/setup-hook


Now if I try to determine _why_ setup-hook is empty by setting the preHook to include 'set -x', then, it's non-empty and works correctly:

preHook = if bintoolsName == "llvm-binutils" then "set -x" else null;


I end up with:

-r--r--r-- 1 root root 4781 Jan 1 1970 result/nix-support/setup-hook


What's going on?
11:39:43
@p14:matrix.orgp14 *

Wow, this is unfortunate. If I build:

nix build --rebuild pkgsLLVM.llvmPackages_15.compiler-rt-no-libc.stdenv.cc.bintools
```
I get:

-r--r--r-- 1 root root 0 Jan 1 1970 result/nix-support/setup-hook


Now if I try to determine _why_ setup-hook is empty by setting the preHook to include 'set -x', then, it's non-empty and works correctly:

preHook = if bintoolsName == "llvm-binutils" then "set -x" else null;


I end up with:

-r--r--r-- 1 root root 4781 Jan 1 1970 result/nix-support/setup-hook


What's going on?
11:40:10
@p14:matrix.orgp14 *

Wow, this is unfortunate. If I build:

nix build --rebuild pkgsLLVM.llvmPackages_15.compiler-rt-no-libc.stdenv.cc.bintools

I get:

-r--r--r-- 1 root root 0 Jan  1  1970 result/nix-support/setup-hook

Now if I try to determine why setup-hook is empty by setting the preHook to include 'set -x', then, it's non-empty and works correctly:

preHook = if bintoolsName == "llvm-binutils" then "set -x" else null;

I end up with:

-r--r--r-- 1 root root 4781 Jan  1  1970 result/nix-support/setup-hook

What's going on?

11:40:35
@artturin:matrix.orgArtturin
In reply to @p14:matrix.org
I guess I'm seeing: https://github.com/NixOS/nixpkgs/blob/2283bf968f3b6a2f100d81fb43db6d91f6aea706/pkgs/stdenv/generic/setup.sh#L936
https://github.com/NixOS/nixpkgs/blob/b8392f9eb12070b647d711c3964ebc89c5d34854/pkgs/stdenv/generic/setup.sh#L1438
11:56:28
@artturin:matrix.orgArtturinthis putting the output to setup-hook11:56:38
@p14:matrix.orgp14Yep11:56:58
@artturin:matrix.orgArtturinmaking a pr11:57:03
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/pull/24834012:09:24
@p14:matrix.orgp14 I need some trofi -like magic for identifying the cause of this bizzarro behaviour. 13:41:29
@p14:matrix.orgp14

On my machine,

nix build --rebuild nixpkgs/73f18ca8b33ad1281958193e7e35f63b6ef47e52#pkgsLLVM.llvmPackages_15.compiler-rt-no-libc.stdenv.cc.bintools
stat -c%s result/nix-support/setup-hook
``
Apparently, with --rebuild, reproducibly gives me a zero-byte setup-hook. But not on another machine. So, nondeterminism lurking somewhere nasty?
13:42:13
@p14:matrix.orgp14 *

On my machine,

nix build --rebuild nixpkgs/73f18ca8b33ad1281958193e7e35f63b6ef47e52#pkgsLLVM.llvmPackages_15.compiler-rt-no-libc.stdenv.cc.bintools
stat -c%s result/nix-support/setup-hook

Apparently, with --rebuild, reproducibly gives me a zero-byte setup-hook. But not on another machine. So, nondeterminism lurking somewhere nasty?

13:42:19
@p14:matrix.orgp14 If I drop into a dev shell I don't get the zero byte setup hook. Is this a case of something bad getting cached in my nix store? I'm a long way away from running out of disk space (Terabytes free). 13:43:49
@p14:matrix.orgp14

I'm afraid that if I simply delete the bad paths I won't be able to reproduce this. Though I dare say that keeping the bad outputs doesn't help me much either.

That said, I'm doing a --rebuild, that shouldn't keep corrupted paths on disk would it? This means surely that I'm repeatably generating the bad file, (I hope, tell me if I'm wrong?)

13:45:25
@p14:matrix.orgp14Inserting diagnostics like NIX_DEBUG makes the problem go away13:46:26
@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

Show newer messages


Back to Room ListRoom Version: 9