!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

909 Members
For people hacking on the Nix package manager itself190 Servers

Load older messages


SenderMessageTime
13 Mar 2025
@0rzklv:matrix.org@0rzklv:matrix.org joined the room.07:46:39
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Fixing very significant debugger performance regression introduced in 2.21: https://github.com/NixOS/nix/pull/1264513:42:40
@roberthensing:matrix.orgRobert Hensing (roberth) What do we think of suffixing fields with _ to make them visually distinct from locals/params? I'm open to it (implicit this-> may have been a mistake, hurting understanding and refactoring) but esp John Ericson tomberek Eelco Mic92 will also have to look at such code 14:59:57
@joerg:thalheim.ioMic92 Robert Hensing (roberth): my lsp does it locally for my editor, but we don't have in github, so might be worth it. There is clang-tidy also can do this automatically: https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html#cmdoption-arg-ClassMemberPrefix 15:05:03
@joerg:thalheim.ioMic92 * Robert Hensing (roberth): my lsp does it locally for my editor with colors, but we don't have in github, so might be worth it. There is clang-tidy also can do this automatically: https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html#cmdoption-arg-ClassMemberPrefix 15:06:44
@roberthensing:matrix.orgRobert Hensing (roberth)Also suffix, nice! @Mic92 on GitHub we don't have that highlighting, for doing reviews15:19:39
@niksnut:matrix.orgniksnutI wouldn't love it, seems a bit ugly. Yeah seems better if the lsp can figure it out.15:30:18
@Ericson2314:matrix.orgJohn Ericson
In reply to @roberthensing:matrix.org
What do we think of suffixing fields with _ to make them visually distinct from locals/params? I'm open to it (implicit this-> may have been a mistake, hurting understanding and refactoring) but esp John Ericson tomberek Eelco Mic92 will also have to look at such code
We do use a _ suffix for other things right now FYI
15:40:41
@niksnut:matrix.orgniksnut yeah, mostly for Sync state values 16:00:58
@mschwaig:matrix.orgMartin Schwaighofer

I'm trying to re-implement the way content-addressed derivations do dependency resolution from unresolved to resolved (aka basic) derivation, but outside of Nix - because I'm trying to do stricter validation with different signatures. I've gotten fairly far with that, but I'm seeing some "placeholder paths" like "/163l1qfs4mlpsl1g8m4ra6n08n8cscdgs9xgcbpijp61c1fjhcal" or "/0k24dfvijqra5pjhd1xhkg467fvh33cllgsxvpyklyhzymrm13xb/bin/bash" in the output of nix derivation show in places like the builder field of unresolved derivations. I don't know how I can resolve those myself, because I don't know how to find out either the unresolved derivation output it is associated with, or the store path nix wants it resolved to. In contrast, I can already resolve the outputs listed in inputDrvs to store paths myself just fine with the same results as Nix.

So I'm wondering, how do those placeholder paths work?

I saw that builtins.placeholder exists, but I don't really get how that relates to my problem from just reading the docs. 😅

(I also see one such path in resolved derivations, but there it's always the same "/1rz4g4znpzjwh1xymhjpm42vipw92pr73vdgl6xs1hycac8kf2n9" path in the "out" environment variable, so I think that's a different issue.)

16:06:18
@puck:puck.moepuck
In reply to @mschwaig:matrix.org

I'm trying to re-implement the way content-addressed derivations do dependency resolution from unresolved to resolved (aka basic) derivation, but outside of Nix - because I'm trying to do stricter validation with different signatures. I've gotten fairly far with that, but I'm seeing some "placeholder paths" like "/163l1qfs4mlpsl1g8m4ra6n08n8cscdgs9xgcbpijp61c1fjhcal" or "/0k24dfvijqra5pjhd1xhkg467fvh33cllgsxvpyklyhzymrm13xb/bin/bash" in the output of nix derivation show in places like the builder field of unresolved derivations. I don't know how I can resolve those myself, because I don't know how to find out either the unresolved derivation output it is associated with, or the store path nix wants it resolved to. In contrast, I can already resolve the outputs listed in inputDrvs to store paths myself just fine with the same results as Nix.

So I'm wondering, how do those placeholder paths work?

I saw that builtins.placeholder exists, but I don't really get how that relates to my problem from just reading the docs. 😅

(I also see one such path in resolved derivations, but there it's always the same "/1rz4g4znpzjwh1xymhjpm42vipw92pr73vdgl6xs1hycac8kf2n9" path in the "out" environment variable, so I think that's a different issue.)

they are values derived from either the current drv's output, or any input drv + its output. its representation is / then the nixbase32 repr of the full sha256 of either "nix-output: " or "nix-upstream-output: :<the name the output would have; so either drv's name or append a dash and the output name>"
16:39:23
@puck:puck.moepuckyou'll have to pessimistically calculate every possible placeholder and its replacement value, then just search+replace the environment and builder args for said placeholders16:40:00
@puck:puck.moepuck(note though, you may want to check the signature that gets signed for realisations if you haven't already; it might serve your needs if you just want a drv + its realised input paths signed)16:41:04
@puck:puck.moepuck
In reply to @puck:puck.moe
they are values derived from either the current drv's output, or any input drv + its output. its representation is / then the nixbase32 repr of the full sha256 of either "nix-output: " or "nix-upstream-output: :<the name the output would have; so either drv's name or append a dash and the output name>"
uh, one colon. element's not letting me edit this message :v
16:42:22
@jade_:matrix.orgjade_ NIX_REMOTE 20:41:29
@jade_:matrix.orgjade_its really badly documented but it is actually equivalent to --store internally; see my hastily scrawled notes on all env-vars used by cppnix derivatives https://docs.lix.systems/manual/lix/stable/contributing/testing.html?highlight=NIX_REMOTE#used-by-lix20:42:58
@Ericson2314:matrix.orgJohn EricsonYou can also use just use NIX_CONFIG, the one env var to rule them all20:48:09
@jade_:matrix.orgjade_mhm20:49:55
@jade_:matrix.orgjade_it seems like sometimes env-vars get introduced like NIX_ABORT_ON_WARN which should just be more NIX_CONFIG20:51:35
@Ericson2314:matrix.orgJohn EricsonIf they correspond to an option, yes20:55:44
@Ericson2314:matrix.orgJohn EricsonBtw, you should see what we just did to derivation goal20:55:58
@Ericson2314:matrix.orgJohn EricsonEven if you're gonna rewrite it in Rust anyways 20:56:06
14 Mar 2025
@jade_:matrix.orgjade_ yeah, NIX_ABORT_ON_WARN does, i am not sure why it was added; we caught this in code review of builtins.warn 00:04:27
@Ericson2314:matrix.orgJohn EricsonNo idea either04:20:24
@roberthensing:matrix.orgRobert Hensing (roberth) Continuity with Nixpkgs lib.warn, and in turn the ability to produce a trace from the first warning encountered 08:20:46
@roberthensing:matrix.orgRobert Hensing (roberth)Could be deprecated I think08:22:02
@emilazy:matrix.orgemilythe functionality is used by e.g. Nixpkgs release checks but I think the question is why it's an environment variable15:27:32
@magic_rb:matrix.redalder.orgmagic_rbSounds like it should be a cli flag15:42:31
@jade_:matrix.orgjade_aaaaaaah this explains a lot as well as why it is not a CLI flag. okay. admissible I guesssssss, but bad. IMO we should fix the release checks to set the nix config instead.16:44:20
@jade_:matrix.orgjade_* aaaaaaah this explains a lot as well as why it is not a CLI flag. okay. admissible I guesssssss, but bad. IMO we should fix the release checks to set the nix config as well16:44:32

Show newer messages


Back to Room ListRoom Version: 6