Nixpkgs Stdenv | 234 Members | |
| 75 Servers |
| Sender | Message | Time |
|---|---|---|
| 10 Aug 2023 | ||
| But 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 | |
| Is there an easy way I can attach strace to the builder 🤔 | 13:53:17 | |
I usually strace -f nix-daemon itself and see what it forks out :) | 13:54:41 | |
| So to make nix use that I'd start by killing the existing daemon and then running that as root, I guess. | 13:55:08 | |
| AFAIU setup-hook is the file that gets passed to the derivation as an input as is: Then pkgs/stdenv/generic/setup.sh merges them into a single file in | 13:56:34 | |
| Download setup-hook-trace.log | 14:01:08 | |
| A 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 happening | 14:02:02 | |
| I'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 think | 14:02:33 | |
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 | |
* 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 | |
| When I do set -x like that, the problem goes away | 14:03:11 | |
| But 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 | |
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 | |
you can also add -y to strace to get something more readable. | 14:04:38 | |
| Oh my goodness, TIL. | 14:04:54 | |
| Uhm, is a path of this form expected... | 14:07:07 | |
| 14:07:10 | |
ANything fancy in your extra-sandbox-paths = in /etc/nixo/nix.conf by chance? | 14:07:13 | |
Yeah, You see how nix actually builds a chroot environment :) | 14:07:46 | |
* Anything fancy in your extra-sandbox-paths = in /etc/nixo/nix.conf by chance? | 14:07:59 | |
In reply to @trofi:matrix.orgBlank. sandbox = true. sandbox-fallback = false. | 14:08:52 | |
| I have ca-derivations turned on. | 14:09:04 | |
| Looks safe. | 14:09:16 | |
| Should be fine (I do as well). | 14:09:37 | |
| try to compare strace on "good" and "bad" machines. the derivations looks small enough to have a chance to be diffable. | 14:10:42 | |
strace also has -s 999999 flag to increase size of visible strings flying around. | 14:11:28 | |
Phew, I think I'm going to have to take a break from this. I've not learned anything more with -y. I see the file get opened, it gets dup'd to FD 1, closed, writes go to fd1, then fd1 has something else dup'd over it. And at the end of the day I'm left with an empty file | 14:13:13 | |
| The file does appear to be written to twice with identical contents, oddly. | 14:13:39 | |
| But not in parallel as best as I can see. | 14:13:51 | |
| I'm not seeing a truncate or another open which would truncate the file | 14:14:08 | |