| 7 Dec 2022 |
Artturin | so the env dict was not being created | 17:58:42 |
Artturin | 🤦♂️ | 18:01:07 |
Artturin | Redacted or Malformed Event | 18:21:27 |
Artturin | --- /nix/store/4kiy2jkqinfmkjps8p7ahjgj1d106990-compare-env-vars/not-structured
+++ /nix/store/4kiy2jkqinfmkjps8p7ahjgj1d106990-compare-env-vars/structured
@@ -1,26 +1,25 @@
-"
-"
-"
declare -x CC="gcc"
declare -x CONFIG_SHELL="bootstrap-tools/bin/bash"
declare -x CXX="g++"
declare -x HOME="/homeless-shelter"
+declare -x NIX_ATTRS_JSON_FILE="/build/.attrs.json"
+declare -x NIX_ATTRS_SH_FILE="/build/.attrs.sh"
declare -x NIX_BINTOOLS="bootstrap-stage0-binutils-wrapper-"
declare -x NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu="1"
declare -x NIX_BUILD_CORES="24"
declare -x NIX_BUILD_TOP="/build"
declare -x NIX_CC="bootstrap-stage1-gcc-wrapper-"
declare -x NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu="1"
-declare -x NIX_CFLAGS_COMPILE=" -frandom-seed=7256km5rkx"
+declare -x NIX_CFLAGS_COMPILE=" -frandom-seed=dpqf701mqa"
declare -x NIX_ENFORCE_NO_NATIVE="1"
declare -x NIX_ENFORCE_PURITY="1"
declare -x NIX_HARDENING_ENABLE="fortify stackprotector pic strictoverflow format relro bindnow"
declare -x NIX_INDENT_MAKE="1"
-declare -x NIX_LDFLAGS="-rpath expand-response-params/lib64 -rpath expand-response-params/lib "
+declare -x NIX_LDFLAGS="-rpath expand-response-params-structured/lib64 -rpath expand-response-params-structured/lib "
declare -x NIX_LOG_FD="2"
declare -x NIX_SSL_CERT_FILE="/no-cert-file.crt"
declare -x NIX_STORE="/nix/store"
declare -x OLDPWD="/build"
declare -x PATH="bootstrap-stage1-gcc-wrapper-/bin:bootstrap-tools/bin:bootstrap-stage0-binutils-wrapper-/bin:bootstrap-tools/bin"
declare -x PWD="/build"
declare -x SHELL="bootstrap-tools/bin/bash"
@@ -30,45 +29,10 @@
declare -x TEMP="/build"
declare -x TEMPDIR="/build"
declare -x TERM="xterm-256color"
declare -x TMP="/build"
declare -x TMPDIR="/build"
declare -x TZ="UTC"
declare -x XDG_DATA_DIRS=""
-declare -x __structuredAttrs=""
-declare -x buildInputs=""
-declare -x buildPhase="cp \$NIX_BUILD_TOP/env-vars \$out
-declare -x builder="bootstrap-tools/bin/bash"
-declare -x cmakeFlags=""
-declare -x configureFlags="--prefix=expand-response-params "
-declare -x depsBuildBuild=""
-declare -x depsBuildBuildPropagated=""
-declare -x depsBuildTarget=""
-declare -x depsBuildTargetPropagated=""
-declare -x depsHostHost=""
-declare -x depsHostHostPropagated=""
-declare -x depsTargetTarget=""
-declare -x depsTargetTargetPropagated=""
-declare -x doCheck=""
-declare -x doInstallCheck=""
-declare -x enableParallelBuilding="1"
-declare -x enableParallelChecking="1"
-declare -x installPhase="mkdir -p \$prefix/bin
declare -x lt_cv_deplibs_check_method="pass_all"
-declare -x mesonFlags=""
-declare -x name="expand-response-params"
-declare -x nativeBuildInputs=""
-declare -x out="expand-response-params"
-declare -x outputs="out"
-declare -x patches=""
-declare -x propagatedBuildInputs=""
-declare -x propagatedNativeBuildInputs=""
+declare -x out="expand-response-params-structured"
declare -x shell="bootstrap-tools/bin/bash"
-declare -x src="/build"
-declare -x stdenv="bootstrap-stage1-stdenv-linux"
-declare -x strictDeps="1"
-declare -x system="x86_64-linux"
-declare -x unpackPhase="cp \"\$src\" expand-response-params.c
-exit
-mv expand-response-params \$prefix/bin/
-src=\$PWD
-true 1
| 18:50:38 |
Artturin | let
pkgs = ((builtins.getFlake "nixpkgs").legacyPackages.${builtins.currentSystem});
pkgsNoStructured = import ./. { config = { structuredAttrsByDefault = false; }; };
pkgsStructured = import ./. { config = { structuredAttrsByDefault = true; }; };
expand-response-params = pkgsNoStructured.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.cc.expand-response-params.overrideAttrs (previousAttrs: {
buildPhase = ''
cp $NIX_BUILD_TOP/env-vars $out
true 1
exit
'';
});
expand-response-params-structured = pkgsStructured.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.cc.expand-response-params.overrideAttrs (previousAttrs: {
name = "expand-response-params-structured";
buildPhase = ''
dumpVars
cp $NIX_BUILD_TOP/env-vars $out
true
exit
'';
});
in
pkgs.runCommand "compare-env-vars"
{ nativeBuildInputs = [ pkgs.diffoscope ]; passthru = { inherit expand-response-params expand-response-params-structured;}; } ''
mkdir -p $out
cp ${expand-response-params} $out/not-structured
cp ${expand-response-params-structured} $out/structured
chmod -R +w $out
sort -o $out/not-structured{,}
sort -o $out/structured{,}
# remove hashes so diff works better
sed 's|/nix/store/.\{33\}||g' -i $out/not-structured
sed 's|/nix/store/.\{33\}||g' -i $out/structured
diffoscope $out/not-structured $out/structured
''
| 18:50:47 |
Artturin | * --- /nix/store/4kiy2jkqinfmkjps8p7ahjgj1d106990-compare-env-vars/not-structured
+++ /nix/store/4kiy2jkqinfmkjps8p7ahjgj1d106990-compare-env-vars/structured
@@ -1,26 +1,25 @@
-"
-"
-"
declare -x CC="gcc"
declare -x CONFIG_SHELL="bootstrap-tools/bin/bash"
declare -x CXX="g++"
declare -x HOME="/homeless-shelter"
+declare -x NIX_ATTRS_JSON_FILE="/build/.attrs.json"
+declare -x NIX_ATTRS_SH_FILE="/build/.attrs.sh"
declare -x NIX_BINTOOLS="bootstrap-stage0-binutils-wrapper-"
declare -x NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu="1"
declare -x NIX_BUILD_CORES="24"
declare -x NIX_BUILD_TOP="/build"
declare -x NIX_CC="bootstrap-stage1-gcc-wrapper-"
declare -x NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu="1"
-declare -x NIX_CFLAGS_COMPILE=" -frandom-seed=7256km5rkx"
+declare -x NIX_CFLAGS_COMPILE=" -frandom-seed=dpqf701mqa"
declare -x NIX_ENFORCE_NO_NATIVE="1"
declare -x NIX_ENFORCE_PURITY="1"
declare -x NIX_HARDENING_ENABLE="fortify stackprotector pic strictoverflow format relro bindnow"
declare -x NIX_INDENT_MAKE="1"
-declare -x NIX_LDFLAGS="-rpath expand-response-params/lib64 -rpath expand-response-params/lib "
+declare -x NIX_LDFLAGS="-rpath expand-response-params-structured/lib64 -rpath expand-response-params-structured/lib "
declare -x NIX_LOG_FD="2"
declare -x NIX_SSL_CERT_FILE="/no-cert-file.crt"
declare -x NIX_STORE="/nix/store"
declare -x OLDPWD="/build"
declare -x PATH="bootstrap-stage1-gcc-wrapper-/bin:bootstrap-tools/bin:bootstrap-stage0-binutils-wrapper-/bin:bootstrap-tools/bin"
declare -x PWD="/build"
declare -x SHELL="bootstrap-tools/bin/bash"
@@ -30,45 +29,10 @@
declare -x TEMP="/build"
declare -x TEMPDIR="/build"
declare -x TERM="xterm-256color"
declare -x TMP="/build"
declare -x TMPDIR="/build"
declare -x TZ="UTC"
declare -x XDG_DATA_DIRS=""
-declare -x __structuredAttrs=""
-declare -x buildInputs=""
-declare -x buildPhase="cp \$NIX_BUILD_TOP/env-vars \$out
-declare -x builder="bootstrap-tools/bin/bash"
-declare -x cmakeFlags=""
-declare -x configureFlags="--prefix=expand-response-params "
-declare -x depsBuildBuild=""
-declare -x depsBuildBuildPropagated=""
-declare -x depsBuildTarget=""
-declare -x depsBuildTargetPropagated=""
-declare -x depsHostHost=""
-declare -x depsHostHostPropagated=""
-declare -x depsTargetTarget=""
-declare -x depsTargetTargetPropagated=""
-declare -x doCheck=""
-declare -x doInstallCheck=""
-declare -x enableParallelBuilding="1"
-declare -x enableParallelChecking="1"
-declare -x installPhase="mkdir -p \$prefix/bin
declare -x lt_cv_deplibs_check_method="pass_all"
-declare -x mesonFlags=""
-declare -x name="expand-response-params"
-declare -x nativeBuildInputs=""
-declare -x out="expand-response-params"
-declare -x outputs="out"
-declare -x patches=""
-declare -x propagatedBuildInputs=""
-declare -x propagatedNativeBuildInputs=""
+declare -x out="expand-response-params-structured"
declare -x shell="bootstrap-tools/bin/bash"
-declare -x src="/build"
-declare -x stdenv="bootstrap-stage1-stdenv-linux"
-declare -x strictDeps="1"
-declare -x system="x86_64-linux"
-declare -x unpackPhase="cp \"\$src\" expand-response-params.c
-exit
-mv expand-response-params \$prefix/bin/
-src=\$PWD
-true 1
| 18:51:00 |
Artturin | In reply to @artturin:matrix.org
--- /nix/store/4kiy2jkqinfmkjps8p7ahjgj1d106990-compare-env-vars/not-structured
+++ /nix/store/4kiy2jkqinfmkjps8p7ahjgj1d106990-compare-env-vars/structured
@@ -1,26 +1,25 @@
-"
-"
-"
declare -x CC="gcc"
declare -x CONFIG_SHELL="bootstrap-tools/bin/bash"
declare -x CXX="g++"
declare -x HOME="/homeless-shelter"
+declare -x NIX_ATTRS_JSON_FILE="/build/.attrs.json"
+declare -x NIX_ATTRS_SH_FILE="/build/.attrs.sh"
declare -x NIX_BINTOOLS="bootstrap-stage0-binutils-wrapper-"
declare -x NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu="1"
declare -x NIX_BUILD_CORES="24"
declare -x NIX_BUILD_TOP="/build"
declare -x NIX_CC="bootstrap-stage1-gcc-wrapper-"
declare -x NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu="1"
-declare -x NIX_CFLAGS_COMPILE=" -frandom-seed=7256km5rkx"
+declare -x NIX_CFLAGS_COMPILE=" -frandom-seed=dpqf701mqa"
declare -x NIX_ENFORCE_NO_NATIVE="1"
declare -x NIX_ENFORCE_PURITY="1"
declare -x NIX_HARDENING_ENABLE="fortify stackprotector pic strictoverflow format relro bindnow"
declare -x NIX_INDENT_MAKE="1"
-declare -x NIX_LDFLAGS="-rpath expand-response-params/lib64 -rpath expand-response-params/lib "
+declare -x NIX_LDFLAGS="-rpath expand-response-params-structured/lib64 -rpath expand-response-params-structured/lib "
declare -x NIX_LOG_FD="2"
declare -x NIX_SSL_CERT_FILE="/no-cert-file.crt"
declare -x NIX_STORE="/nix/store"
declare -x OLDPWD="/build"
declare -x PATH="bootstrap-stage1-gcc-wrapper-/bin:bootstrap-tools/bin:bootstrap-stage0-binutils-wrapper-/bin:bootstrap-tools/bin"
declare -x PWD="/build"
declare -x SHELL="bootstrap-tools/bin/bash"
@@ -30,45 +29,10 @@
declare -x TEMP="/build"
declare -x TEMPDIR="/build"
declare -x TERM="xterm-256color"
declare -x TMP="/build"
declare -x TMPDIR="/build"
declare -x TZ="UTC"
declare -x XDG_DATA_DIRS=""
-declare -x __structuredAttrs=""
-declare -x buildInputs=""
-declare -x buildPhase="cp \$NIX_BUILD_TOP/env-vars \$out
-declare -x builder="bootstrap-tools/bin/bash"
-declare -x cmakeFlags=""
-declare -x configureFlags="--prefix=expand-response-params "
-declare -x depsBuildBuild=""
-declare -x depsBuildBuildPropagated=""
-declare -x depsBuildTarget=""
-declare -x depsBuildTargetPropagated=""
-declare -x depsHostHost=""
-declare -x depsHostHostPropagated=""
-declare -x depsTargetTarget=""
-declare -x depsTargetTargetPropagated=""
-declare -x doCheck=""
-declare -x doInstallCheck=""
-declare -x enableParallelBuilding="1"
-declare -x enableParallelChecking="1"
-declare -x installPhase="mkdir -p \$prefix/bin
declare -x lt_cv_deplibs_check_method="pass_all"
-declare -x mesonFlags=""
-declare -x name="expand-response-params"
-declare -x nativeBuildInputs=""
-declare -x out="expand-response-params"
-declare -x outputs="out"
-declare -x patches=""
-declare -x propagatedBuildInputs=""
-declare -x propagatedNativeBuildInputs=""
+declare -x out="expand-response-params-structured"
declare -x shell="bootstrap-tools/bin/bash"
-declare -x src="/build"
-declare -x stdenv="bootstrap-stage1-stdenv-linux"
-declare -x strictDeps="1"
-declare -x system="x86_64-linux"
-declare -x unpackPhase="cp \"\$src\" expand-response-params.c
-exit
-mv expand-response-params \$prefix/bin/
-src=\$PWD
-true 1
dumpVars only shows env variables which are exported | 18:51:27 |
Artturin | and substituteAll only substitutes with global vars | 18:51:40 |
Artturin | (because awk is used to get the vars) https://github.com/NixOS/nixpkgs/blob/a3c1a4abc78df37b537cb08414efa8eac38211b6/pkgs/stdenv/generic/setup.sh#L790 | 18:59:32 |
Artturin | it was made to use awk in https://github.com/NixOS/nixpkgs/pull/28799 | 19:02:43 |
Artturin | before that the variables did not have to be exported | 19:02:54 |
Artturin | i think | 19:03:27 |
Artturin | $ export hello="1"
$ hello1="2"
$ awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'
hello
skip_global_compinit
$ hello2="3" awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'
hello2
hello
skip_global_compinit
| 19:07:14 |
Artturin | * $ export hello="1"
$ hello1="2"
$ awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'
hello
$ hello2="3" awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'
hello2
hello
| 19:07:35 |
| 8 Dec 2022 |
Artturin | Robert Hensing (roberth): Rick (Mindavi) i undrafted https://github.com/NixOS/nixpkgs/pull/175649 | 00:05:12 |
Artturin | there's useful prior art in https://github.com/NixOS/nixpkgs/compare/structured-attrs for any future PRs | 00:59:25 |
Artturin | https://gist.github.com/GrahamcOfBorg/8f677e11a810eeef79d69be89ec0c2fb | 02:16:36 |
Artturin | diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix
index be2e3567da8..6945f5b0720 100644
--- a/pkgs/build-support/bintools-wrapper/default.nix
+++ b/pkgs/build-support/bintools-wrapper/default.nix
@@ -106,7 +106,7 @@ stdenv.mkDerivation {
outputs = [ "out" ] ++ optionals propagateDoc ([ "man" ] ++ optional (bintools ? info) "info");
passthru = {
- inherit targetPrefix suffixSalt;
+ inherit targetPrefix suffixSalt bintools_bin;
inherit bintools libc nativeTools nativeLibc nativePrefix;
emacsBufferSetup = pkgs: ''
@@ -366,7 +366,7 @@ stdenv.mkDerivation {
gnugrep_bin = if nativeTools then "" else gnugrep;
wrapperName = "BINTOOLS_WRAPPER";
inherit dynamicLinker targetPrefix suffixSalt coreutils_bin;
- inherit bintools_bin libc_bin libc_dev libc_lib;
+ inherit libc_bin libc_dev libc_lib;
};
meta =
| 02:17:14 |
Artturin | nix-repl> legacyPackages.x86_64-darwin.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.cc.bintools.bintools_bin
{ name = "bootstrap-stage0-binutils"; outPath = «derivation /nix/store/wn8fif83s2lwxl8n4s7916c3pj8lli6l-bootstrap-tools.drv»; }
| 02:17:27 |
Artturin | does not contain a type = derivation | 02:18:03 |
Artturin | on linux it does | 02:19:56 |
Artturin | * https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/darwin/default.nix#L265 | 02:20:06 |
Artturin | binutils-unwrapped = { name = "bootstrap-stage0-binutils"; outPath = bootstrapTools; }; | 02:20:19 |
Artturin | linux https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/linux/default.nix#L179 | 02:21:28 |
Artturin | done in https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/linux/default.nix#L179 | 02:23:17 |
Artturin | * done in https://github.com/nixos/nixpkgs/commit/768aae66efcb50672f0ed728f218f18348193e27 | 02:23:24 |
Artturin | https://github.com/NixOS/nixpkgs/pull/175649/commits/7939e734af127d8d36add1c5e22fd555b15f9750 | 02:32:09 |
Artturin | nix-repl> legacyPackages.x86_64-linux.fastStdenv
error: The ‘env’ attribute set cannot contain any attributes passed to derivation. The following attributes are overlapping: cc
«derivation
| 02:54:56 |
Artturin | https://github.com/NixOS/nixpkgs/pull/175649/commits/d437fe5edfae31ab61cea995446d31b9cefb8ea4 | 03:02:30 |
Sandro 🐧 | those links are already dead | 14:50:03 |