<commit_before>{ lib }:
  let inherit (lib.attrsets) mapAttrs; in

rec {
  doubles = import ./doubles.nix { inherit lib; };
  parse = import ./parse.nix { inherit lib; };
  inspect = import ./inspect.nix { inherit lib; };
  platforms = import ./platforms.nix { inherit lib; };
  examples = import ./examples.nix { inherit lib; };
  architectures = import ./architectures.nix { inherit lib; };

  /* List of all Nix system doubles the nixpkgs flake will expose the package set
     for. All systems listed here must be supported by nixpkgs as `localSystem`.

     **Warning**: This attribute is considered experimental and is subject to change.
  */
  flakeExposed = import ./flake-systems.nix { };

  # TODO(@sternenseemann): remove before 21.11
  supported = throw "2022-05-23: Use lib.systems.flakeExposed instead of lib.systems.supported.hydra, as lib.systems.supported has been removed";

  # Elaborate a `localSystem` or `crossSystem` so that it contains everything
  # necessary.
  #
  # `parsed` is inferred from args, both because there are two options with one
  # clearly prefered, and to prevent cycles. A simpler fixed point where the RHS
  # always just used `final.*` would fail on both counts.
  elaborate = args': let
    args = if lib.isString args' then { system = args'; }
           else args';
    final = {
      # Prefer to parse `config` as it is strictly more informative.
      parsed = parse.mkSystemFromString (if args ? config then args.config else args.system);
      # Either of these can be losslessly-extracted from `parsed` iff parsing succeeds.
      system = parse.doubleFromSystem final.parsed;
      config = parse.tripleFromSystem final.parsed;
      # Determine whether we can execute binaries built for the provided platform.
      canExecute = platform:
        parse.isCompatible final.parsed.cpu platform.parsed.cpu
        && final.parsed.kernel == platform.parsed.kernel;
      # Derived meta-data
      libc =
        /**/ if final.isDarwin              then "libSystem"
        else if final.isMinGW               then "msvcrt"
        else if final.isWasi                then "wasilibc"
        else if final.isRedox               then "relibc"
        else if final.isMusl                then "musl"
        else if final.isUClibc              then "uclibc"
        else if final.isAndroid             then "bionic"
        else if final.isLinux /* default */ then "glibc"
        else if final.isAvr                 then "avrlibc"
        else if final.isNone                then "newlib"
        else if final.isNetBSD              then "nblibc"
        # TODO(@Ericson2314) think more about other operating systems
        else                                     "native/impure";
      # Choose what linker we wish to use by default. Someday we might also
      # choose the C compiler, runtime library, C++ standard library, etc. in
      # this way, nice and orthogonally, and deprecate `useLLVM`. But due to
      # the monolithic GCC build we cannot actually make those choices
      # independently, so we are just doing `linker` and keeping `useLLVM` for
      # now.
      linker =
        /**/ if final.useLLVM or false      then "lld"
        else if final.isDarwin              then "cctools"
        # "bfd" and "gold" both come from GNU binutils. The existance of Gold<commit_msg>lib.systems: inform isCompatible users about removal<commit_after>{ lib }:
  let inherit (lib.attrsets) mapAttrs; in

rec {
  doubles = import ./doubles.nix { inherit lib; };
  parse = import ./parse.nix { inherit lib; };
  inspect = import ./inspect.nix { inherit lib; };
  platforms = import ./platforms.nix { inherit lib; };
  examples = import ./examples.nix { inherit lib; };
  architectures = import ./architectures.nix { inherit lib; };

  /* List of all Nix system doubles the nixpkgs flake will expose the package set
     for. All systems listed here must be supported by nixpkgs as `localSystem`.

     **Warning**: This attribute is considered experimental and is subject to change.
  */
  flakeExposed = import ./flake-systems.nix { };

  # TODO(@sternenseemann): remove before 21.11
  supported = throw "2022-05-23: Use lib.systems.flakeExposed instead of lib.systems.supported.hydra, as lib.systems.supported has been removed";

  # Elaborate a `localSystem` or `crossSystem` so that it contains everything
  # necessary.
  #
  # `parsed` is inferred from args, both because there are two options with one
  # clearly prefered, and to prevent cycles. A simpler fixed point where the RHS
  # always just used `final.*` would fail on both counts.
  elaborate = args': let
    args = if lib.isString args' then { system = args'; }
           else args';
    final = {
      # Prefer to parse `config` as it is strictly more informative.
      parsed = parse.mkSystemFromString (if args ? config then args.config else args.system);
      # Either of these can be losslessly-extracted from `parsed` iff parsing succeeds.
      system = parse.doubleFromSystem final.parsed;
      config = parse.tripleFromSystem final.parsed;
      # Determine whether we can execute binaries built for the provided platform.
      canExecute = platform:
        parse.isCompatible final.parsed.cpu platform.parsed.cpu
        && final.parsed.kernel == platform.parsed.kernel;
      isCompatible = _: throw "2022-05-23: isCompatible has been removed in favor of canExecute, refer to the 22.11 changelog for details";
      # Derived meta-data
      libc =
        /**/ if final.isDarwin              then "libSystem"
        else if final.isMinGW               then "msvcrt"
        else if final.isWasi                then "wasilibc"
        else if final.isRedox               then "relibc"
        else if final.isMusl                then "musl"
        else if final.isUClibc              then "uclibc"
        else if final.isAndroid             then "bionic"
        else if final.isLinux /* default */ then "glibc"
        else if final.isAvr                 then "avrlibc"
        else if final.isNone                then "newlib"
        else if final.isNetBSD              then "nblibc"
        # TODO(@Ericson2314) think more about other operating systems
        else                                     "native/impure";
      # Choose what linker we wish to use by default. Someday we might also
      # choose the C compiler, runtime library, C++ standard library, etc. in
      # this way, nice and orthogonally, and deprecate `useLLVM`. But due to
      # the monolithic GCC build we cannot actually make those choices
      # independently, so we are just doing `linker` and keeping `useLLVM` for
      # now.
      linker =
        /**/ if final.useLLVM or false      then "lld"
        else if final.isDarwin              then "cctools"
        # "bfd" and "gold" both come from GNU binutils. The existance of Gold
{'fraction_non_alphanumeric': 0.08150196477950808, 'fraction_numerical': 0.006403725804104206, 'mean_word_length': 2.3262342691190705, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1967433', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1873, 'n_words': 736}