!9IQChSjwSHXPPWTa:lix.systems

Lix

1101 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms293 Servers

Load older messages


SenderMessageTime
30 Nov 2025
@weethet:catgirl.cloudWeetHetAutocxx doesn't support exceptions 😞21:59:46
@weethet:catgirl.cloudWeetHet* Autocxx doesn't support exceptions 21:59:53
@weethet:catgirl.cloudWeetHetBut there's a PR: https://github.com/google/autocxx/pull/142622:00:05
@raitobezarius:matrix.orgraitobezariusSeems too old :p22:31:42
@raitobezarius:matrix.orgraitobezariusEven if C++ exceptions were tackled, not sure how to interpp C++ coroutines and Rust async coroutine transformations22:32:39
@anouk:kif.rocks@anouk:kif.rocks left the room.23:28:51
@niko:nrab.lolniko ⚡️ and this is even more unexpected: nix-building a file like this { __functor = self: <derivation>; }, which obviously isn't "valid" nix code (technically valid, but for the sake of brevity let's just say it's invalid), actually builds the derivation... what? Surely this is not expected, that's not how functors work 23:51:11
@niko:nrab.lolniko ⚡️

Some more cursed observations. Given file:

# foo.nix
{
  foo = "hi from outside";
  __functor = _: {
    foo = "hi from inside";
  };
}

We can observe:

$ nix-instantiate --eval foo.nix
{ __functor = <CODE>; foo = "hi from outside"; }
$ nix-instantiate --eval foo.nix -A foo
"hi from inside"
23:57:39
1 Dec 2025
@niko:nrab.lolniko ⚡️

I guess this is kinda expected given how nix-build works, but still. I don't like this. And better yet:

# foo.nix
{
  __functor = _: {
    foo = "hi from inside";
  };
}
# bar.nix
{
  __functor = _: {}: {
    foo = "hi from inside";
  };
}
# baz.nix
{
  __functor = _: _: {
    foo = "hi from inside";
  };
}
$ nix-instantiate --eval foo.nix -A foo
"hi from inside"
$ nix-instantiate --eval bar.nix -A foo
"hi from inside"
$ nix-instantiate --eval baz.nix -A foo
error: the value being indexed in the selection path 'foo' at '' should be a set but is a function: «lambda __functor @ baz.nix:2:18»
00:02:11
@raitobezarius:matrix.orgraitobezarius
In reply to @niko:nrab.lol
and this is even more unexpected: nix-building a file like this { __functor = self: <derivation>; }, which obviously isn't "valid" nix code (technically valid, but for the sake of brevity let's just say it's invalid), actually builds the derivation... what? Surely this is not expected, that's not how functors work
Auto call semantics mindfucking again?
00:21:20
@raitobezarius:matrix.orgraitobezarius(yes all my homies hate *deep* auto calls.)00:21:36
@niko:nrab.lolniko ⚡️ Like, how does that even work in the first place? __functor has to always at least be a function which returns a function? At least in normal nix code, then how the hell does nix-instantiate apply that 00:23:12
@raitobezarius:matrix.orgraitobezariusWhere does it say that functors has to return a function?00:46:48
@raitobezarius:matrix.orgraitobezariusIIRC, functors have definitely been abused to make attrsets callables returning new non functional results00:47:12
@niko:nrab.lolniko ⚡️ Well, trying to call { __functor = x: 1; } will always error in normal nix code with integer is not a function 00:51:39
@niko:nrab.lolniko ⚡️ So while not strictly invalid nix code, since you can still do { __functor = x: 1; }.__functor {} and get a valid result, it's not a valid functor per se 00:52:54
@georgyo:nycr.chat@georgyo:nycr.chat left the room.02:57:38
@weethet:catgirl.cloudWeetHet For CLI I think a blocking API should be enough? On that note, it could also be noexcept as well I guess 06:29:31
@acidbong:envs.net@acidbong:envs.net left the room.06:43:48
@aloisw:julia0815.dealoisw You don't need delegation for the sandbox to work, just working user, PID and mount namespaces. 06:44:30
@aloisw:julia0815.dealoisw (Yes working mount namespaces includes that you can actually mount things, Ubuntu.) 06:44:43
@aloisw:julia0815.dealoisw root:nogroup is very weird, are you sure you have the UID and GID mapping set up properly? 06:46:13
@aloisw:julia0815.dealoisw I think it should work if the store is owned by your user and your current UID and GID are identity-mapped. 06:46:42
@piegames:flausch.socialpiegames
In reply to @niko:nrab.lol
Like, how does that even work in the first place? __functor has to always at least be a function which returns a function? At least in normal nix code, then how the hell does nix-instantiate apply that
This is a good question, could just be that the autocaller simply is ass here
07:35:04
@piegames:flausch.socialpiegames
In reply to @raitobezarius:matrix.org
Where does it say that functors has to return a function?
But they really should, right? If a functor doesn't return a function, then how does one kniw how to call it? Only the autocaller could call that, and that is weird
07:36:37
@thubrecht:matrix.orgthubrechtI mean, technically __functor is just an attrset element that sometimes has different semantics07:45:30
@thubrecht:matrix.orgthubrechtWhich is well....07:45:39
@thubrecht:matrix.orgthubrechtAlso you could build oneshot functors07:46:24
@jlamur:matrix.orgJules Lamur
In reply to @aloisw:julia0815.de
root:nogroup is very weird, are you sure you have the UID and GID mapping set up properly?
Yes, you're right, map-{users,groups}=all fixes that issue. I then had a problem with sethostname being filtered by the default podman policy which prevent the sandbox from starting. My goal initially was to make the sandbox work on default podman containers, so this is not going to work at all, sadly!
07:52:26
@niko:nrab.lolniko ⚡️ Am I the one in the wrong here? It doesn't matter what functor returns, it's fine if it returns an int, another attrset, or whatever else! My point is, __functor = x: 1; is not a functor. Same as __functor = 1; isn't. A valid functor is at least __functor = _: _: 1. The first argument takes self, the attrset being called, and then we return a function. If we don't do that, evaluating this nix code and trying to call the functor will error! Always! 08:03:53

Show newer messages


Back to Room ListRoom Version: 10