9 Mar 2024 |
Qyriad | nix-shell -p doing that is kind of an artifact of the cursed way nix-shell is implemented — personally I would argue this is a good thing, and makes it more transparent that nix-shell is a derivation that relies on hooks to make it work | 01:51:32 |
Qyriad | though I suppose it is a lot of output for a common operation | 01:51:42 |
@a-n-n-a-l-e-e:matrix.org | Redacted or Malformed Event | 01:54:08 |
@a-n-n-a-l-e-e:matrix.org | $ nix-shell -I nixpkgs=. -p bash --run "exit"|wc -l
104
104 lines of output from the new logging.
| 01:55:16 |
@a-n-n-a-l-e-e:matrix.org | (when bash already built) | 01:55:55 |
@a-n-n-a-l-e-e:matrix.org | i thought i needed to add --print-build-logs but perhaps that is when using the experimental commands. | 02:01:00 |
@a-n-n-a-l-e-e:matrix.org | #! /usr/bin/env nix-shell
#! nix-shell -I nixpkgs=. -i bash -p bash
when nix-shell used as interpreter has same issue and the output is sent to stdout, which seems bad.
| 02:05:16 |
Qyriad | Ah right the nix- commands have print-build-logs by default, hm | 02:11:03 |
Qyriad | Well, I could leverage the Nix log FD that's already in stdenv, and make it log based on the loglevel setting Nix itself is called with — that would make it so getting the logs vs not wouldn't change the derivation | 02:12:00 |
@a-n-n-a-l-e-e:matrix.org | i think logging to stdout needs a fix or a revert as that will break pipelines that use nix-shell as an interpreter. i verified older nixpkgs log build output to stderr when below commands are run for the first time.
$ cat foo.sh
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p "(hello.overrideAttrs { postBuild = \"#0\"; })"
hello
$ ./foo.sh 2>/dev/null
Hello, world!
but outputs all the hook logging when run with nixpkgs with the hooks change.
| 02:39:02 |
@a-n-n-a-l-e-e:matrix.org | (i do like the hook logging in general -- seems like a good change) | 02:44:23 |
Qyriad | nods, just need to figure out the nix-shell thing | 03:18:30 |
Qyriad | As a stopgap I can throw if [[ -n "${IN_NIX_SHELL:-}" ]] guards on the logs | 04:38:43 |
Qyriad | As a stopgap I can throw if [[ -n "${IN_NIX_SHELL:-}" ]]; then return guards on the logs | 04:38:56 |
Qyriad | which seems to work | 04:39:06 |
Qyriad | though it would also make impure builds from within a nix-shell not log hooks | 04:39:51 |
Artturin | In reply to @qyriad:katesiria.org As a stopgap I can throw if [[ -n "${IN_NIX_SHELL:-}" ]]; then return guards on the logs nix develop doesn't set that iirc | 05:22:41 |
Artturin | * nix shell doesn't set that iirc | 05:22:59 |
Qyriad | nix develop is a different case though | 05:23:05 |
Qyriad | nix-shell -p foo is one of the canonical ways for "just give me these packages for a sec"; nix develop is explicitly a dev command | 05:23:30 |
Artturin | Yeah I edited | 05:23:31 |
Qyriad | oh nix shell | 05:23:39 |
Qyriad | nix shell isn't implemented in terms of mkDerivation like nix-shell is | 05:23:50 |
11 Mar 2024 |
Puna | In reply to @opna2608:matrix.org thanks! adding the entry to the file now, so the original PR can go back to referring to Hydra build results and use your script for requesting an upload: https://github.com/NixOS/nixpkgs/pull/293257 now using maintainers/scripts/bootstrap-files/refresh-tarballs.bash --targets=powerpc64-unknown-linux-gnuabielfv2 for the bootstrapFiles , tested the new files with the rest of my patches on hardware. should hopefully be good now? https://github.com/NixOS/nixpkgs/pull/255451 | 10:02:49 |
Puna | In reply to @opna2608:matrix.org thanks! adding the entry to the file now, so the original PR can go back to referring to Hydra build results and use your script for requesting an upload: https://github.com/NixOS/nixpkgs/pull/293257 * now using maintainers/scripts/bootstrap-files/refresh-tarballs.bash --targets=powerpc64-unknown-linux-gnuabielfv2 for the bootstrapFiles built by hydra, tested the new files with the rest of my patches on hardware. should hopefully be good now? https://github.com/NixOS/nixpkgs/pull/255451 | 10:03:14 |
trofi | Looks great! | 14:42:35 |
Puna | thanks! i'll check which fixes are still needed to get stuff building and start submitting them to nixpkgs 🥳 | 17:58:40 |
13 Mar 2024 |
trofi | Redacted or Malformed Event | 09:22:38 |
14 Mar 2024 |
| @federicodschonborn:matrix.org left the room. | 02:04:37 |
| NixOS Moderation Botchanged room power levels. | 18:44:41 |