!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

416 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.138 Servers

Load older messages


SenderMessageTime
15 Aug 2025
@helle:tacobelllabs.nethelle (just a stray cat girl)no, this is a feature MacOS X will support in the future, but our binaries are built on a new version, but still should run on older ones 19:13:59
@helle:tacobelllabs.nethelle (just a stray cat girl)so this will be amusing failures if we don't do this19:14:13
@emilazy:matrix.orgemilythat's what availability annotations are for19:43:26
@emilazy:matrix.orgemily if (__builtin_available(macOS …, *)) or such 19:43:36
@emilazy:matrix.orgemilybut you will have to compile with an SDK that supports that feature, which if it's not even shipping yet Nixpkgs won't have the SDK19:43:53
@emilazy:matrix.orgemily which means an availability check inside an #if if you want to land the code before then I guess 19:44:11
@helle:tacobelllabs.nethelle (just a stray cat girl)there is a different trick in this case that we can do19:45:46
@helle:tacobelllabs.nethelle (just a stray cat girl)I need to finish this patch tomorrow19:45:56
@helle:tacobelllabs.nethelle (just a stray cat girl)this is for SOCK_CLOEXEC, we can even if we are compiled with it, try and fail and retry without even if the #ifdef showed it was available 19:49:53
@emilazy:matrix.orgemilywhat's the functionality?19:48:25
@emilazy:matrix.orgemily wait, macOS is adding SOCK_CLOEXEC? is that in Tahoe? 19:51:04
@helle:tacobelllabs.nethelle (just a stray cat girl)at some point, it is in the new POSIX spec so we are expecting MacOS X to support it "soon"19:51:41
@helle:tacobelllabs.nethelle (just a stray cat girl)hence needing to make sure we don't create ourselves some very funny bug reports19:51:57
@emilazy:matrix.orgemilyhmm, I wouldn't necessarily bet on that… Apple only certify macOS as UNIX 03, which corresponds to POSIX 200120:13:33
@helle:tacobelllabs.nethelle (just a stray cat girl)well, I think it is still worth while safeguarding the code against it, this isn't in a hot path, so we can easily support this20:14:10
@helle:tacobelllabs.nethelle (just a stray cat girl)(and the code itself is like 4 lines of code)20:14:20
@helle:tacobelllabs.nethelle (just a stray cat girl)(we discussed this with some people in person who actually suggested making sure we wouldn't have a breakage in this way when fixing all this)20:15:16
@emilazy:matrix.orgemilysure, feature detection is good in general :) it may help non-macOS20:16:27
@emilazy:matrix.orgemilyI would not expect Apple to add things that get added to POSIX in the general case though20:16:40
@emilazy:matrix.orgemilyI'm pretty sure there's things in POSIX 2008 they don't have20:16:51
@helle:tacobelllabs.nethelle (just a stray cat girl)yeah, for FreeBSD this is also a funny scenario of not supporting it rn but it being planned20:17:20
@emilazy:matrix.orgemily (it looks like errno = ESOCKTNOSUPPORT; return -1; would be a compliant implementation of SOCK_CLOEXEC so no guarantee that a POSIX 2024 OS actually supports it anyway) 20:19:57
@helle:tacobelllabs.nethelle (just a stray cat girl)oh, yeah, so we need that path regardless20:22:20
@helle:tacobelllabs.nethelle (just a stray cat girl)that is btw literally how it is handled20:22:27
@helle:tacobelllabs.nethelle (just a stray cat girl)ty for the sanity check20:22:43
@emilazy:matrix.orgemilywell, technically you can have POSIX-compliant systems that just refuse to implement half the spec, so there's a limit to how much fallback code is sensible to write :P20:30:30
@emilazy:matrix.orgemilybut in this case it seems reasonable20:30:35
@helle:tacobelllabs.nethelle (just a stray cat girl)heh, yeah, also it not being on a hot path and all20:37:14
@niko:nrab.lolniko ⚡️

That's awesome, darwin failures that only happened on nixpkgs-unstable no longer happen when I rebuilt lix today. Meanwhile, there's a new failure, this time libcmd. There's this small snippet:

    # Use a temporary home directory for the unit tests.
    # Otherwise, /homeless-shelter is created in the single-user sandbox, and functional tests will fail.
    # TODO(alois31): handle TMPDIR properly (meson can't, and setting HOME in the test is too late)…
    'HOME': '/tmp/nix-test/libcmd-unit-tests',

which you'd think makes everything work just fine, right? WRONG. The code does this:

        auto homeDir = getEnv("HOME");
        if (homeDir) {
            // Only use `$HOME` if it exists and is owned by the current user.
            struct stat st;
            int result = stat(homeDir->c_str(), &st);

and obviously HOME does not exist so it falls back to getpwuid_r. Which just so happens to work on Linux because dynamic sandbox user gets put in the user database, but OOPS it doesn't work on darwin!

22:23:52
@niko:nrab.lolniko ⚡️Now I need someone that'll help me come up with a solution to this problem, either how can I basically mkdir -p $HOME before running this test oooor idk what the alternative is but lix really wants to know the home directory of user22:24:45

Show newer messages


Back to Room ListRoom Version: 10