!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1174 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 Jan 2026
@samasaur:matrix.orgsamasaur okay yes it does change that list. i was running nix-store -qR on the built stdenv and not the drv. I don't really understand why that differs but that's OK 06:30:17
@samasaur:matrix.orgsamasauroh wait duh that's buildtime vs runtime deps isn't it06:32:04
@samasaur:matrix.orgsamasaur

okay so applying this diff

diff --git a/pkgs/by-name/at/atf/package.nix b/pkgs/by-name/at/atf/package.nix
index 326419c5f7..a285cd207f 100644
--- a/pkgs/by-name/at/atf/package.nix
+++ b/pkgs/by-name/at/atf/package.nix
@@ -1,19 +1,13 @@
 {
   lib,
   stdenv,
-  darwin,
   fetchFromGitHub,
-  fetchpatch,
   autoreconfHook,
   kyua,
   gitUpdater,
 }:
 
-let
-  # atf is a dependency of libiconv. Avoid an infinite recursion with `pkgsStatic` by using a bootstrap stdenv.
-  stdenv' = if stdenv.hostPlatform.isDarwin then darwin.bootstrapStdenv else stdenv;
-in
-stdenv'.mkDerivation (finalAttrs: {
+stdenv.mkDerivation (finalAttrs: {
   pname = "atf";
   version = "0.23";
 
@@ -31,12 +25,12 @@
         --replace-fail 'atf_test_program{name="srcdir_test"}' ""
     ''
     # These tests fail on Darwin.
-    + lib.optionalString (finalAttrs.doInstallCheck && stdenv'.hostPlatform.isDarwin) ''
+    + lib.optionalString (finalAttrs.doInstallCheck && stdenv.hostPlatform.isDarwin) ''
       substituteInPlace atf-c/detail/process_test.c \
         --replace-fail 'ATF_TP_ADD_TC(tp, status_coredump);' ""
     ''
     # This test fails on Linux.
-    + lib.optionalString (finalAttrs.doInstallCheck && stdenv'.hostPlatform.isLinux) ''
+    + lib.optionalString (finalAttrs.doInstallCheck && stdenv.hostPlatform.isLinux) ''
       substituteInPlace atf-c/detail/fs_test.c \
         --replace-fail 'ATF_TP_ADD_TC(tp, eaccess);' ""
     '';
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libiconv/package.nix b/pkgs/os-specific/darwin/apple-source-releases/libiconv/package.nix
index be9b1e32d6..169d9f8b24 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libiconv/package.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libiconv/package.nix
@@ -5,6 +5,8 @@
   mkAppleDerivation,
   pkg-config,
   stdenv,
+  runTests ? false,
+  libiconv,
 }:
 
 let
@@ -72,7 +74,7 @@
   nativeInstallCheckInputs = [ pkg-config ];
   installCheckInputs = [ atf ];
 
-  doInstallCheck = stdenv.buildPlatform.canExecute hostPlatform;
+  doInstallCheck = runTests;
 
   # Can’t use `mesonCheckPhase` because it runs the wrong hooks for `installCheckPhase`.
   installCheckPhase = ''
@@ -81,6 +83,8 @@
     runHook postInstallCheck
   '';
 
+  passthru.tests = libiconv.override { runTests = true; };
+
   meta = {
     description = "Iconv(3) implementation";
     license = [
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index a63e0c9b07..62f8e5774f 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -236,7 +236,6 @@
   # Any libraries in the list must only be used as dependencies of packages in this list.
   stage1Packages = prevStage: {
     inherit (prevStage)
-      atf
       autoconf
       automake
       bison
@@ -251,7 +250,6 @@
       gettext
       groff
       jq
-      kyua
       libedit
       libtool
       m4
@@ -266,7 +264,6 @@
       python3Minimal
       scons
       serf
-      sqlite
       subversion
       texinfo
       unzip
@@ -650,6 +647,7 @@
           self = self.python3-bootstrap;
           pythonAttr = "python3-bootstrap";
           enableLTO = false;
+          withSqlite = false;
         };
 
         scons = super.scons.override { python3Packages = self.python3.pkgs; };

I get the following diff in the output of nix-store -qR:

69d68
< 5.2.darwin.patch
95,96d93
< atf-0.23.drv
< atf-0.23.drv
234d230
< CVE-2022-28805.patch
337,339d332
< kyua-0.13-unstable-2024-01-22.drv
< kyua-0.13-unstable-2024-01-22.drv
< kyua-check-hook.sh
400,404d392
< lua-5.2.4.drv
< lua-5.2.4.tar.gz.drv
< lua-setup-hook
< lutok-0.4.drv
< lutok-0.4.drv
634,639d621
< source.drv
< source.drv
< source.drv
< sqlite-3.51.1.drv
< sqlite-autoconf-3510100.tar.gz.drv
< sqlite-doc-3510100.zip.drv
685,686d666
< utils.sh
< utils.sh.drv

and nix-build -A darwin.libiconv.passthru.tests does still build and run the tests

06:49:47
@samasaur:matrix.orgsamasaur oh dear though I didn't check anything under pkgsStatic 06:51:53
@samasaur:matrix.orgsamasaur I'm also noticing that none of the following in stage1Packages are actually in the nix-store -qR output: brotli, cyrus_sasl, groff, libedit, openssh, patchutils, python3Minimal, scons, serf, subversion. admittedly scons is manually overridden to use the bootstrap python but it doesn't appear to actually be used anywhere 07:00:40
@samasaur:matrix.orgsamasaurI almost feel like I'm checking wrong here, because this is a lot of things in that package list that aren't actually used...07:01:02
@samasaur:matrix.orgsamasaur nix-build -A pkgsStatic.libiconv.passthru.tests also works 08:10:05
@samasaur:matrix.orgsamasaur my assumption is that these are listed here because if they were needed, they would need to be specified this way? and it doesn't actually matter that they're in this list if they're never referenced? 08:10:43
@jopejoe1:matrix.orgjopejoe1 (4094@epvpn) changed their display name from jopejoe1 (4094@39c3) to jopejoe1 (4094@epvpn).08:25:59
@reckenrode:matrix.orgRandy EckenrodeIt’s not harmful if those are there. It’s possible whatever pulled those into the bootstrap no longer does.11:33:56
@reckenrode:matrix.orgRandy Eckenrode

This is a weird error:


[1425/1666] Linking Swift shared library lib/swift/host/plugins/libObservationMacros.dylib; Update mtime of library outputs workaround
FAILED: lib/swift/host/plugins/libObservationMacros.dylib lib/Macros/Sources/ObservationMacros/CMakeFiles/ObservationMacros.dir/Availability.swift.o lib/Macros>
: && /nix/store/bvspgzdhr13qnkdd3klkz3ihy78h7z8k-swiftc-cxx_bootstrap-6.2.3/bin/swiftc -j 16 -num-threads 16 -emit-library -o lib/swift/host/plugins/libObserva>
<unknown>:0: warning: using (deprecated) legacy driver, Swift installation does not contain swift-driver at: '/nix/store/bvspgzdhr13qnkdd3klkz3ihy78h7z8k-swift>
<unknown>:0: warning: option '-no-emit-module-separately-wmo' is only supported in swift-driver
impure path `/0sra2y18lr3h6j58qjm0w46yv36h1wjmilb09n8aimdpivdymscx/lib/swift/host/libObservationMacros.dylib' used in link
12:25:30
@reckenrode:matrix.orgRandy Eckenrode *

This is a weird error:

[1425/1666] Linking Swift shared library lib/swift/host/plugins/libObservationMacros.dylib; Update mtime of library outputs workaround
FAILED: lib/swift/host/plugins/libObservationMacros.dylib lib/Macros/Sources/ObservationMacros/CMakeFiles/ObservationMacros.dir/Availability.swift.o lib/Macros>
: && /nix/store/bvspgzdhr13qnkdd3klkz3ihy78h7z8k-swiftc-cxx_bootstrap-6.2.3/bin/swiftc -j 16 -num-threads 16 -emit-library -o lib/swift/host/plugins/libObserva>
<unknown>:0: warning: using (deprecated) legacy driver, Swift installation does not contain swift-driver at: '/nix/store/bvspgzdhr13qnkdd3klkz3ihy78h7z8k-swift>
<unknown>:0: warning: option '-no-emit-module-separately-wmo' is only supported in swift-driver
impure path `/0sra2y18lr3h6j58qjm0w46yv36h1wjmilb09n8aimdpivdymscx/lib/swift/host/libObservationMacros.dylib' used in link
12:25:40
@reckenrode:matrix.orgRandy EckenrodeThat’s when building the stage 1 compiler for Swift.12:25:47
@reckenrode:matrix.orgRandy EckenrodeRegarding the bootstrap, what I would like to do is define stage 1 as “bootstrap tools can build most things”. From there, build stage 2 with stage 1 as the host platform and stage 2 as the target, then do that again with stage 2 and 3 as host and target.12:26:55
@reckenrode:matrix.orgRandy EckenrodeStage 4 would be the only overlay stage that sets up the stage 3 compiler such that stage 4 can be host and target.12:27:23
@reckenrode:matrix.orgRandy EckenrodeOne issue I can see with a cross-like bootstrap is it will pull in more packages and build more things, which people may not like.12:33:20
@reckenrode:matrix.orgRandy EckenrodeAlso, if we ever add Swift to the bootstrap, that is going to pull in a ton of crap.12:33:43
@reckenrode:matrix.orgRandy EckenrodeThis exercise to remove sqlite feels pointless if we want to include Swift because it will put it right back in the bootstrap.12:34:18
@emilazy:matrix.orgemily what does Swift pull in anyway? 12:56:16
@emilazy:matrix.orgemilyI'm curious what it's using SQLite for12:56:33
@emilazy:matrix.orgemily but yeah I didn't mean to set @samasaur:matrix.org out on the errand with a guarantee that we'd want to do it :) just that it seemed worth exploring 12:57:06
@reckenrode:matrix.orgRandy EckenrodeCaches.12:57:07
@reckenrode:matrix.orgRandy EckenrodeI think something is pulling in Rust.12:57:38
@emilazy:matrix.orgemilyuh, yeah Rust in the bootstrap might be one to avoid 😅12:58:15
@emilazy:matrix.orgemilyI think we could still trim down closures with a cross setup, right? it'd just be a set of overrides for the build platform12:58:51
@reckenrode:matrix.orgRandy EckenrodeSwift and (maybe more so) SwiftPM appear to favor using SQLite to record build information.12:59:04
@emilazy:matrix.orgemilymostly the less stuff in the bootstrap the less annoying it is to test updates on Darwin for them12:59:28
@reckenrode:matrix.orgRandy EckenrodeCan we define a platform that simply never runs tests?12:59:34
@emilazy:matrix.orgemilysure why not. I mean cross conditions them on canExecute anyway13:00:05
@reckenrode:matrix.orgRandy EckenrodeLike only stage 3 would run tests. It would trim down some of the dependencies.13:00:18

Show newer messages


Back to Room ListRoom Version: 6