!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

137 Members
49 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
2 Mar 2024
@qyriad:katesiria.orgQyriad joined the room.19:34:40
3 Mar 2024
@philiptaron:matrix.orgPhilip Taron (UTC-8)

stdenv folks, Qyriad concocted a PR which really helps make the stdenv hooks more self-documenting. I've reviewed it, and while more eyes would definitely be better, having built my NixOS system with it, I think it's good to go.

What's needed in order to get it either further reviewed or merged?

23:00:03
4 Mar 2024
@opna2608:matrix.orgPuna
In reply to @trofi:matrix.org
Let's start from a tiny https://github.com/NixOS/nixpkgs/pull/288250
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
14:07:46
9 Mar 2024
@philiptaron:matrix.orgPhilip Taron (UTC-8) Qyriad: did you see a-n-n-a-l-e-e 's comment on your merged PR? 01:47:16
@qyriad:katesiria.orgQyriadI did just now01:49:09
@qyriad:katesiria.orgQyriadThat is correct behavior for how the change was designed — it outputs just as part of the build log, just like phase headers do01:50:03
@qyriad:katesiria.orgQyriad 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:katesiria.orgQyriadthough I suppose it is a lot of output for a common operation01:51:42
@a-n-n-a-l-e-e:matrix.org@a-n-n-a-l-e-e:matrix.orgRedacted or Malformed Event01:54:08
@a-n-n-a-l-e-e:matrix.org@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@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@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@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:katesiria.orgQyriad Ah right the nix- commands have print-build-logs by default, hm 02:11:03
@qyriad:katesiria.orgQyriadWell, 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 derivation02:12:00
@a-n-n-a-l-e-e:matrix.org@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@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:katesiria.orgQyriad nods, just need to figure out the nix-shell thing 03:18:30
@qyriad:katesiria.orgQyriad As a stopgap I can throw if [[ -n "${IN_NIX_SHELL:-}" ]] guards on the logs 04:38:43
@qyriad:katesiria.orgQyriad As a stopgap I can throw if [[ -n "${IN_NIX_SHELL:-}" ]]; then return guards on the logs 04:38:56
@qyriad:katesiria.orgQyriadwhich seems to work04:39:06
@qyriad:katesiria.orgQyriadthough it would also make impure builds from within a nix-shell not log hooks04:39:51
@artturin:matrix.orgArtturin
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:matrix.orgArtturin* nix shell doesn't set that iirc05:22:59
@qyriad:katesiria.orgQyriad nix develop is a different case though 05:23:05
@qyriad:katesiria.orgQyriad 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:matrix.orgArtturinYeah I edited05:23:31

Show newer messages


Back to Room ListRoom Version: 9