stdenv: Remove log nesting

Nix/Hydra no longer support pretty printing of logs, so this is no
longer useful.

+4 -161
-4
pkgs/development/tools/build-managers/gnumake/3.82/default.nix
··· 15 16 patches = 17 [ 18 - # Provide nested log output for subsequent pretty-printing by 19 - # nix-log2xml. 20 - ./log.patch 21 - 22 # Purity: don't look for library dependencies (of the form 23 # `-lfoo') in /lib and /usr/lib. It's a stupid feature anyway. 24 # Likewise, when searching for included Makefiles, don't look in
··· 15 16 patches = 17 [ 18 # Purity: don't look for library dependencies (of the form 19 # `-lfoo') in /lib and /usr/lib. It's a stupid feature anyway. 20 # Likewise, when searching for included Makefiles, don't look in
-125
pkgs/development/tools/build-managers/gnumake/3.82/log.patch
··· 1 - diff -rc job.c job.c 2 - *** job.c 2006-03-20 04:03:04.000000000 +0100 3 - --- job.c 2009-01-19 19:37:28.000000000 +0100 4 - *************** 5 - *** 1083,1089 **** 6 - appear. */ 7 - 8 - message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) 9 - ! ? "%s" : (char *) 0, p); 10 - 11 - /* Tell update_goal_chain that a command has been started on behalf of 12 - this target. It is important that this happens here and not in 13 - --- 1083,1089 ---- 14 - appear. */ 15 - 16 - message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) 17 - ! ? (enable_nested_output ? "\e[3s\e[a%s\e[b" : "%s") : (char *) 0, p); 18 - 19 - /* Tell update_goal_chain that a command has been started on behalf of 20 - this target. It is important that this happens here and not in 21 - diff -rc main.c main.c 22 - *** main.c 2006-03-20 03:36:37.000000000 +0100 23 - --- main.c 2009-01-19 19:41:41.000000000 +0100 24 - *************** 25 - *** 886,891 **** 26 - --- 886,900 ---- 27 - } 28 - 29 - 30 - + static void close_nesting() 31 - + { 32 - + while (stdout_nesting_level--) 33 - + printf("\e[q"); 34 - + while (stderr_nesting_level--) 35 - + fprintf(stderr, "\e[q"); 36 - + } 37 - + 38 - + 39 - #ifdef _AMIGA 40 - int 41 - main (int argc, char **argv) 42 - *************** 43 - *** 931,936 **** 44 - --- 940,950 ---- 45 - atexit (close_stdout); 46 - #endif 47 - 48 - + atexit(close_nesting); 49 - + 50 - + if (getenv("NIX_INDENT_MAKE")) 51 - + enable_nested_output = 1; 52 - + 53 - /* Needed for OS/2 */ 54 - initialize_main(&argc, &argv); 55 - 56 - *************** 57 - *** 3095,3100 **** 58 - --- 3109,3120 ---- 59 - 60 - /* Use entire sentences to give the translators a fighting chance. */ 61 - 62 - + if (entering && enable_nested_output) 63 - + { 64 - + printf("\e[p"); 65 - + stdout_nesting_level++; 66 - + } 67 - + 68 - if (makelevel == 0) 69 - if (starting_directory == 0) 70 - if (entering) 71 - *************** 72 - *** 3124,3129 **** 73 - --- 3144,3159 ---- 74 - printf (_("%s[%u]: Leaving directory `%s'\n"), 75 - program, makelevel, starting_directory); 76 - 77 - + if (!entering && enable_nested_output) 78 - + { 79 - + printf("\e[q"); 80 - + stdout_nesting_level--; 81 - + } 82 - + 83 - /* Flush stdout to be sure this comes before any stderr output. */ 84 - fflush (stdout); 85 - } 86 - + 87 - + int enable_nested_output = 0; 88 - + int stdout_nesting_level = 0; 89 - + int stderr_nesting_level = 0; 90 - diff -rc make.h 91 - *** make.h 2006-02-16 00:54:43.000000000 +0100 92 - --- make.h 2009-01-19 19:32:03.000000000 +0100 93 - *************** 94 - *** 609,611 **** 95 - --- 609,614 ---- 96 - 97 - #define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \ 98 - while((_v)==0 && errno==EINTR) 99 - + extern int enable_nested_output; 100 - + extern int stdout_nesting_level; 101 - + extern int stderr_nesting_level; 102 - diff -rc reremake.c 103 - *** remake.c 2006-03-20 03:36:37.000000000 +0100 104 - --- remake.c 2009-01-19 19:39:40.000000000 +0100 105 - *************** 106 - *** 1120,1126 **** 107 - --- 1120,1137 ---- 108 - /* The normal case: start some commands. */ 109 - if (!touch_flag || file->cmds->any_recurse) 110 - { 111 - + if (enable_nested_output) 112 - + { 113 - + log_working_directory (1); 114 - + fprintf(stderr, "\e[pbuilding %s\n", file->name); 115 - + stderr_nesting_level++; 116 - + } 117 - execute_file_commands (file); 118 - + if (enable_nested_output) 119 - + { 120 - + fprintf(stderr, "\e[q"); 121 - + stderr_nesting_level--; 122 - + } 123 - return; 124 - } 125 -
···
+4 -32
pkgs/stdenv/generic/setup.sh
··· 77 ###################################################################### 78 # Logging. 79 80 - nestingLevel=0 81 - 82 - startNest() { 83 - # Assert natural as sanity check. 84 - let nestingLevel+=1 "nestingLevel>=0" 85 - echo -en "\033[$1p" 86 - } 87 - 88 - stopNest() { 89 - # Assert natural as sanity check. 90 - let nestingLevel-=1 "nestingLevel>=0" 91 - echo -en "\033[q" 92 - } 93 - 94 - header() { 95 - startNest "$2" 96 - echo "$1" 97 - } 98 - 99 - # Make sure that even when we exit abnormally, the original nesting 100 - # level is properly restored. 101 - closeNest() { 102 - while [ $nestingLevel -gt 0 ]; do 103 - stopNest 104 - done 105 - } 106 107 # Prints a command such that all word splits are unambiguous. We need 108 # to split the command in three parts because the middle format string ··· 122 exitHandler() { 123 exitCode=$? 124 set +e 125 - 126 - closeNest 127 128 if [ -n "$showBuildStats" ]; then 129 times > "$NIX_BUILD_TOP/.times" ··· 593 echo "do not know how to unpack source archive $curSrc" 594 exit 1 595 fi 596 - stopNest 597 } 598 599 ··· 688 # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.) 689 # shellcheck disable=SC2086 690 $uncompress < "$i" 2>&1 | patch ${patchFlags:--p1} 691 - stopNest 692 done 693 694 runHook postPatch ··· 973 echo 974 echo "@ phase-succeeded $out $curPhase" 975 fi 976 - 977 - stopNest 978 done 979 } 980
··· 77 ###################################################################### 78 # Logging. 79 80 + # Obsolete. 81 + stopNest() { true; } 82 + header() { echo "$1"; } 83 + closeNest() { true; } 84 85 # Prints a command such that all word splits are unambiguous. We need 86 # to split the command in three parts because the middle format string ··· 100 exitHandler() { 101 exitCode=$? 102 set +e 103 104 if [ -n "$showBuildStats" ]; then 105 times > "$NIX_BUILD_TOP/.times" ··· 569 echo "do not know how to unpack source archive $curSrc" 570 exit 1 571 fi 572 } 573 574 ··· 663 # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.) 664 # shellcheck disable=SC2086 665 $uncompress < "$i" 2>&1 | patch ${patchFlags:--p1} 666 done 667 668 runHook postPatch ··· 947 echo 948 echo "@ phase-succeeded $out $curPhase" 949 fi 950 done 951 } 952