!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1178 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org192 Servers

Load older messages


SenderMessageTime
13 Jun 2021
@toonn:matrix.orgtoonn What do you think about depending on importing that file as much as possible? 19:32:36
@freakenstein:matrix.orgiammrinal0 joined the room.20:53:41
@daiderd:matrix.orgLnLsounds good, you can split it into sdk versions and extras for the old stuff or something22:02:24
@toonn:matrix.orgtoonn Oki. nn : ) 22:06:46
15 Jun 2021
@abueide:matrix.orgabueide joined the room.05:14:07
@abueide:matrix.orgabueidehi everyone. I'm newish to nix. Could some one help me figure out how to get started porting packages to support macos & upstreaming the changes? For example currently I'm trying to add support for qbittorrent which has a macos binary available05:16:58
@abueide:matrix.orgabueideI cloned the nixpkgs repo and I'm looking at the qbittorrent nix file but kind of hard to know where to get started05:19:22
@skochen:matrix.orgStéphan abueide: Nix typically doesn't use external binaries. I guess the first step is to see why the Nix build fails. In a Nixpkgs checkout, you can do nix-build -A qbittorrent. It'll tell you how to circumvent the platform restriction, or you can just remove platforms = ... in the file you already found. From there it depends on learning style, I guess? I personally pieced together stuff a lot from the nixos.org manuals and nix pills. 🙂 06:27:45
@daiderd:matrix.orgLnLI think 3 of the llvm11 builds went through, but then another staging eval came in :p15:28:17
@sarahhodne:matrix.orgSarah Hodne joined the room.17:14:12
@sarahhodne:matrix.orgSarah Hodne

Hiya, I just tried setting up Nix and nix-darwin on a brand new Big Sur Mac, and it seems the Git in Nix is quite a bit slower than the one installed by Xcode. I'm not entirely sure if this is a Nix thing or something else, but I'm not sure what to debug next.

~
❯ time /usr/bin/git --version # system git                                                                                                                                                                                                                ~
git version 2.30.1 (Apple Git-130)
/usr/bin/git --version # system git  0.01s user 0.02s system 51% cpu 0.061 total

~
❯ time /run/current-system/sw/bin/git --version # nix git                                                                                                                                                                                                 ~
git version 2.31.1
/run/current-system/sw/bin/git --version # nix git  0.00s user 0.01s system 1% cpu 1.156 total
17:15:44
@sarahhodne:matrix.orgSarah Hodne

Looks like it may be while loading the libraries:

Total pre-main time: 1.2 seconds (100.0%)
         dylib loading time: 1.2 seconds (99.5%)
        rebase/binding time:   0.71 milliseconds (0.0%)
            ObjC setup time:   0.07 milliseconds (0.0%)
           initializer time:   4.07 milliseconds (0.3%)
           slowest intializers :

git version 2.31.1

17:34:16
@sarahhodne:matrix.orgSarah Hodne *

Looks like it may be while loading the libraries:

Total pre-main time: 1.2 seconds (100.0%)
         dylib loading time: 1.2 seconds (99.5%)
        rebase/binding time:   0.71 milliseconds (0.0%)
            ObjC setup time:   0.07 milliseconds (0.0%)
           initializer time:   4.07 milliseconds (0.3%)
           slowest intializers :

git version 2.31.1
17:34:23
@sarahhodne:matrix.orgSarah Hodne Yeah, setting DYLD_PRINT_LIBRARIES=1 as well, I see the slowness as it' printing dyld: loaded: /nix/store/… lines. Not sure if this is a Nix thing or just a "uses a lot of dylibs" thing 17:46:09
@emilazy:matrix.orgemilysounds roughly as expected18:01:11
@emilazy:matrix.orgemilyiirc binary spawning is a little slow on NixOS too due to the linking model18:01:23
@emilazy:matrix.orgemilypeople have thought about optimizing it but I don't think anything's actually made its way upstream18:01:34
@emilazy:matrix.orgemilydunno if anyone has done such work for macOS though18:02:02
@toonn:matrix.orgtoonn LnL: Hydra's such a cruel mistress, : s 19:51:09
@toonn:matrix.orgtoonn LnL: Hmm, could use some advice. The updated darwin.hfs is lacking the entire core/ subdirectory. And this is the only bit that was used. Headers with similar names do appear in other subdirectories but they already did in the older hfs. And in the older hfs their contents differs from the ones in core/. Should I refrain from updating this apple_source_release? 20:02:31
@daiderd:matrix.orgLnL Sarah Hodne: weird, I'd expect the dyld3 caching to apply to everything not just system binaries 20:09:39
@daiderd:matrix.orgLnL toonn: not sure, depends a bit what we need it for, sometimes stuff disappears or gets moved to other packages some good things to look for it is are the raw sdk and googling with site:opensource.apple.com 20:11:44
@toonn:matrix.orgtoonn LnL: Hmm, I'm not sure what I'm looking for. Both the SDKs have the headers in the Kernel.framework. 20:59:43
@daiderd:matrix.orgLnL site:opensource.apple.com "_HFS_ENCODINGS_H_" points me to hfs and xnu 21:17:41
@daiderd:matrix.orgLnLboth old however so seems like it was moved somewhere else21:19:43
@toonn:matrix.orgtoonn I think it was moved from xnu/bsd/hfs to hfs at some point. 21:54:37
16 Jun 2021
@thefloweringash:matrix.orgthefloweringash I expect binary spawning on macos to be similar to regularly compiled programs. In my quick tests, nix git is very similar to apple git (nix is around 5 ms faster). Spending 1.2 seconds in dylib loading is very unusual. 05:53:49
@thefloweringash:matrix.orgthefloweringash which revision of nixpkgs is this, maybe something is broken? (nix-info will show this) 05:54:39
@sarahhodne:matrix.orgSarah Hodne
❯ nix-info
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
system: "x86_64-darwin", multi-user?: yes, version: nix-env (Nix) 2.3.12, channels(sarah): "darwin, home-manager, nixpkgs", warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
nixpkgs: /Users/sarah/.nix-defexpr/channels/nixpkgs
07:54:04
@sarahhodne:matrix.orgSarah Hodne
❯ cat ~/.nix-defexpr/channels/nixpkgs/.git-revision
51bb9f3e9ab6161a3bf7746e20b955712cef618b
07:56:11

Show newer messages


Back to Room ListRoom Version: 6