<commit_before>{system ? builtins.currentSystem}:

with import ../../top-level/all-packages.nix {inherit system;};

rec {


  # We want coreutils without ACL support.
  coreutils_ = coreutils.override (args: {
    aclSupport = false;
  });

  # bzip2 wants utime.h, a header 'legacy' in uclibc
  uclibcForBzip2 = uclibc.override {
    extraConfig = ''
        UCLIBC_SUSV3_LEGACY y
        UCLIBC_SUSV4_LEGACY y
    '';
  };

  gccLinkStatic = wrapGCCWith (import ../../build-support/gcc-wrapper) uclibcForBzip2
    stdenv.gcc.gcc;
  stdenvLinkStatic = overrideGCC stdenv gccLinkStatic;

  curlStatic = import ../../tools/networking/curl {
    stdenv = stdenvLinkStatic;
    inherit fetchurl;
    zlibSupport = false;
    sslSupport = false;
    linkStatic = true;
  };


  bzip2Static = import ../../tools/compression/bzip2 {
    stdenv = stdenvLinkStatic;
    inherit fetchurl;
    linkStatic = true;
  };

  #gccNoShared = wrapGCC ( gcc.gcc.override { enableShared = false; } );

  busyboxStaticSh = busybox.override {
    extraConfig = ''
      CLEAR
      CONFIG_STATIC y

      CONFIG_ASH y
      CONFIG_BASH_COMPAT y
      CONFIG_ASH_ALIAS y
      CONFIG_ASH_GETOPTS y
      CONFIG_ASH_CMDCMD y
      CONFIG_ASH_JOB_CONTROL y
      CONFIG_ASH_BUILTIN_ECHO y
      CONFIG_ASH_BUILTIN_PRINTF y
      CONFIG_ASH_BUILTIN_TEST y
    '';
  };

  busyboxStaticLn = busybox.override {
    extraConfig = ''
      CLEAR
      CONFIG_STATIC y
      CONFIG_LN y
    '';
  };

  busyboxStaticMkdir = busybox.override {
    extraConfig = ''
      CLEAR
      CONFIG_STATIC y
      CONFIG_MKDIR y
    '';
  };

  busyboxStaticCpio = busybox.override {
    extraConfig = ''
      CLEAR
      CONFIG_STATIC y
      CONFIG_CPIO y
      CONFIG_FEATURE_CPIO_O y
      CONFIG_FEATURE_CPIO_P y
    '';
  };

  build = 

    stdenv.mkDerivation {
      name = "build";

      buildInputs = [nukeReferences cpio];

      buildCommand = ''
	set -x
        ensureDir $out/bin $out/lib $out/libexec

        # Copy what we need of Glibc.
        cp -d ${glibc}/lib/ld*.so* $out/lib
        cp -d ${glibc}/lib/libc*.so* $out/lib
        cp -d ${glibc}/lib/libc_nonshared.a $out/lib<commit_msg>Add a comment wondering why our static cpio is configured with creation and passthrough capabilities.  I may test to see if stdenv can be built without these features (I see no reason why not)<commit_after>{system ? builtins.currentSystem}:

with import ../../top-level/all-packages.nix {inherit system;};

rec {


  # We want coreutils without ACL support.
  coreutils_ = coreutils.override (args: {
    aclSupport = false;
  });

  # bzip2 wants utime.h, a header 'legacy' in uclibc
  uclibcForBzip2 = uclibc.override {
    extraConfig = ''
        UCLIBC_SUSV3_LEGACY y
        UCLIBC_SUSV4_LEGACY y
    '';
  };

  gccLinkStatic = wrapGCCWith (import ../../build-support/gcc-wrapper) uclibcForBzip2
    stdenv.gcc.gcc;
  stdenvLinkStatic = overrideGCC stdenv gccLinkStatic;

  curlStatic = import ../../tools/networking/curl {
    stdenv = stdenvLinkStatic;
    inherit fetchurl;
    zlibSupport = false;
    sslSupport = false;
    linkStatic = true;
  };


  bzip2Static = import ../../tools/compression/bzip2 {
    stdenv = stdenvLinkStatic;
    inherit fetchurl;
    linkStatic = true;
  };

  #gccNoShared = wrapGCC ( gcc.gcc.override { enableShared = false; } );

  busyboxStaticSh = busybox.override {
    extraConfig = ''
      CLEAR
      CONFIG_STATIC y

      CONFIG_ASH y
      CONFIG_BASH_COMPAT y
      CONFIG_ASH_ALIAS y
      CONFIG_ASH_GETOPTS y
      CONFIG_ASH_CMDCMD y
      CONFIG_ASH_JOB_CONTROL y
      CONFIG_ASH_BUILTIN_ECHO y
      CONFIG_ASH_BUILTIN_PRINTF y
      CONFIG_ASH_BUILTIN_TEST y
    '';
  };

  busyboxStaticLn = busybox.override {
    extraConfig = ''
      CLEAR
      CONFIG_STATIC y
      CONFIG_LN y
    '';
  };

  busyboxStaticMkdir = busybox.override {
    extraConfig = ''
      CLEAR
      CONFIG_STATIC y
      CONFIG_MKDIR y
    '';
  };

  busyboxStaticCpio = busybox.override {
    extraConfig = ''
      CLEAR
      CONFIG_STATIC y
      CONFIG_CPIO y
      # (shlevy) Are these necessary?
      CONFIG_FEATURE_CPIO_O y
      CONFIG_FEATURE_CPIO_P y
    '';
  };

  build = 

    stdenv.mkDerivation {
      name = "build";

      buildInputs = [nukeReferences cpio];

      buildCommand = ''
	set -x
        ensureDir $out/bin $out/lib $out/libexec

        # Copy what we need of Glibc.
        cp -d ${glibc}/lib/ld*.so* $out/lib
        cp -d ${glibc}/lib/libc*.so* $out/lib
        cp -d ${glibc}/lib/libc_nonshared.a $out/lib
{'fraction_non_alphanumeric': 0.09581232185924139, 'fraction_numerical': 0.0030695023021267264, 'mean_word_length': 2.4172284644194755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3389003', 'n_tokens_mistral': 1676, 'n_tokens_neox': 1590, 'n_words': 346}