!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

232 Members
75 Servers

Load older messages


SenderMessageTime
2 May 2023
@artturin:matrix.orgArtturin
From 12d47e9bbef05c69c5b49f53eb8d73e53124af63 Mon Sep 17 00:00:00 2001
From: Artturin <Artturin@artturin.com>
Date: Tue, 2 May 2023 20:52:13 +0300
Subject: [PATCH] minimal-bootstrap: work towards making it independant of a
 initialized nixpkgs

dont use top-level newScope to prevent accidentally using top-level attrs
---
 pkgs/os-specific/linux/minimal-bootstrap/default.nix  | 11 ++++++-----
 .../linux/minimal-bootstrap/stage0-posix/utils.nix    |  9 +++------
 pkgs/top-level/all-packages.nix                       |  2 +-
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/pkgs/os-specific/linux/minimal-bootstrap/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/default.nix
index fd1693e761b..6f6c5852576 100644
--- a/pkgs/os-specific/linux/minimal-bootstrap/default.nix
+++ b/pkgs/os-specific/linux/minimal-bootstrap/default.nix
@@ -1,11 +1,12 @@
-{ lib
-, newScope
-, stdenv
+{ buildPlatform
+, hostPlatform
+, config
+, lib ? import ../../lib
 }:

-lib.makeScope newScope (self: with self; {
+lib.makeScope (extra: lib.callPackageWith ({ inherit lib config buildPlatform hostPlatform; } // extra)) (self: with self; {
   fetchurl = import ../../../build-support/fetchurl/boot.nix {
-    inherit (stdenv.buildPlatform) system;
+    inherit (buildPlatform) system;
   };

   inherit (callPackage ./stage0-posix { }) kaem m2libc mescc-tools mescc-tools-extra writeTextFile writeText runCommand;
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/utils.nix b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/utils.nix
index 239d17e4fbc..4d44b7447fb 100644
--- a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/utils.nix
+++ b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/utils.nix
@@ -1,7 +1,6 @@
 { lib
-, stdenv
+, buildPlatform
 , callPackage
-, fetchurl
 , kaem
 , kaem-unwrapped
 , mescc-tools
@@ -9,9 +8,7 @@
 }:

 let
-  checkMeta = callPackage ../../../../stdenv/generic/check-meta.nix {
-    inherit (stdenv) hostPlatform;
-  };
+  checkMeta = callPackage ../../../../stdenv/generic/check-meta.nix { };
 in
 rec {
   derivationWithMeta = attrs:
@@ -24,7 +21,7 @@ rec {
       validity.handled
       ({ inherit meta passthru; } // passthru)
       (derivation ({
-        inherit (stdenv.buildPlatform) system;
+        inherit (buildPlatform) system;
         inherit (meta) name;
       } // (builtins.removeAttrs attrs [ "meta" "passthru" ])));

diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index dfdc90afaa8..efa5d3a7cac 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26943,7 +26943,7 @@ with pkgs;

   metastore = callPackage ../os-specific/linux/metastore { };

-  minimal-bootstrap = recurseIntoAttrs (callPackage ../os-specific/linux/minimal-bootstrap { });
+  minimal-bootstrap = recurseIntoAttrs (import ../os-specific/linux/minimal-bootstrap { inherit (stdenv) buildPlatform hostPlatform; inherit config lib; });

   mingetty = callPackage ../os-specific/linux/mingetty { };

--
2.40.0
18:02:38
@emilytrau:matrix.orgemilytrau Artturin: heya. love this change for preventing accidental leaks thank you! i hadn't considered uses of minimal-bootstrap outside of nixpkgs, and in the near future will likely draw in some top-level packages after constructing stdenv. is this a use case you're after? 23:11:40
3 May 2023
@artturin:matrix.orgArtturin
In reply to @emilytrau:matrix.org
Artturin: heya. love this change for preventing accidental leaks thank you! i hadn't considered uses of minimal-bootstrap outside of nixpkgs, and in the near future will likely draw in some top-level packages after constructing stdenv. is this a use case you're after?
I don't have a use case, I just thought it would be good to have it as independent as possible if it's going to be used in bootstrapping
01:10:37
@emilytrau:matrix.orgemilytrau you raise a good point. the "can't use fetchurl in this package because it's in bootstrap" footgun is prickly enough as a new contributor. it might be good since this bootstrap is starting from scratch to do a clean division even if that means a little duplication of packages? 01:13:36
@emilytrau:matrix.orgemilytrau (Artturin, sorry forgot to add the mention) 01:14:51
@qyliss:fairydust.spaceAlyssa RossI think it's okay — we already have packages that can't use fetchpatch because they're in the bootstrap.09:44:04
@federicodschonborn:matrix.orgFederico Damián Schonborn joined the room.23:57:29
10 May 2023
@wegank:matrix.orgWeijia joined the room.09:45:17
@wegank:matrix.orgWeijiahttps://github.com/NixOS/nixpkgs/issues/23093309:45:30
12 May 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.00:58:18
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.19:34:12
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their display name from Federico Schonborn to Federico Damián Schonborn.19:34:57
24 May 2023
@yuka:yuka.devYureka (she/her) joined the room.11:13:12
25 May 2023
@thevar1able:var1able.networkthevar1able joined the room.11:56:06
@raitobezarius:matrix.orgraitobezarius changed their display name from raitobezarius to disko in NixOS 23.11 when.13:32:37
@raitobezarius:matrix.orgraitobezarius changed their display name from disko in NixOS 23.11 when to raitobezarius.13:37:37
27 May 2023
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.16:41:02
@j-k:matrix.orgj-kminimal-bootstrap: I reworked one of my previous attempts to support multiple commits & rewrote the fetcher in python for concurrency, nice flags, and easier handling of datastructures such as JSON https://github.com/NixOS/nixpkgs/pull/23446817:36:00
2 Jun 2023
@ckie:ckie.devckie (they/them) changed their display name from ckie (they/them; limited keyboard usage, voice preferred) to ckie (they/them).22:17:49
4 Jun 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.17:40:23
6 Jun 2023
@vcunat:matrix.orgvcunat changed their display name from Vladimír Čunát to @vcunat.17:21:06
13 Jun 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.20:55:41
15 Jun 2023
@mon:tchncs.deribosomerocker joined the room.16:40:09
17 Jun 2023
@jtojnar:matrix.orgJan Tojnar joined the room.19:43:16
27 Jun 2023
@trofi:matrix.orgtrofi Signal-boosting linuxHeaders update to 6.4: https://github.com/NixOS/nixpkgs/pull/240013 18:56:04
30 Jun 2023
@artturin:matrix.orgArtturinsomething is wrong with substituteAll in bootPackages16:05:24
@artturin:matrix.orgArtturin
$ nix build --impure --expr "with import ./. { config = { structuredAttrsByDefault = true; }; }; stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.libxcrypt"
this derivation will be built:
  /nix/store/994qfy50ylyafndz12zh8zq1a73gi5ll-libxcrypt-4.4.35.drv
building '/nix/store/994qfy50ylyafndz12zh8zq1a73gi5ll-libxcrypt-4.4.35.drv'...
libxcrypt> structuredAttrs is enabled
libxcrypt> unpacking sources
libxcrypt> unpacking source archive /nix/store/spzw99ag9wq184zd9il0n66937m30dzl-libxcrypt-4.4.35.tar.xz
libxcrypt> source root is libxcrypt-4.4.35
libxcrypt> setting SOURCE_DATE_EPOCH to timestamp 1686071870 of file libxcrypt-4.4.35/config.h.in
libxcrypt> patching sources
libxcrypt> updateAutotoolsGnuConfigScriptsPhase
libxcrypt> Updating Autotools / GNU config script to a newer upstream version: ./build-aux/m4-autogen/config.sub
libxcrypt> cp: cannot stat '@gnu_config@/config.sub': No such file or directory
16:05:27
@artturin:matrix.orgArtturinthat failure was exposed by https://github.com/NixOS/nixpkgs/pull/23796816:05:39
@artturin:matrix.orgArtturin
$ nix path-info -r --impure --expr "with import ./. { config = { structuredAttrsByDefault = true; }; }; stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.libxcrypt" --derivation
/nix/store/00qr10y7z2fcvrp9b2m46710nkjvj55z-update-autotools-gnu-config-scripts.sh
/nix/store/2195bmvj8zqjj8kfc61r4iwc9llpwnfh-cc-wrapper.sh
...
16:06:18
@artturin:matrix.orgArtturin

/nix/store/2195bmvj8zqjj8kfc61r4iwc9llpwnfh-cc-wrapper.sh contains unsubstituted variables

if [[ -n "@coreutils_bin@" && -n "@gnugrep_bin@" ]]; then
    PATH="@coreutils_bin@/bin:@gnugrep_bin@/bin"
fi

source @out@/nix-support/utils.bash
16:06:42

Show newer messages


Back to Room ListRoom Version: 9