Skip to content

Commit e54d197

Browse files
Philip Oakleydscho
Philip Oakley
authored andcommitted
contrib/buildsystems: redirect errors of the dry run into a log file
Rather than swallowing the errors, it is better to have them in a file. To make it obvious what this is about, use the file name 'msvc-build-makedryerrors.txt'. Further, if the output is empty, simply delete that file. As we target Git for Windows' SDK (which, unlike its predecessor msysGit, offers Perl versions newer than 5.8), we can use the quite readable syntax `if -f -z $ErrsFile` (available in Perl >=5.10). Note that the file will contain the new values of the GIT_VERSION and GITGUI_VERSION if they were generated by the make file. They are omitted if the release is tagged and indentically defined in their respective GIT_VERSION_GEN file DEF_VER variables. Signed-off-by: Philip Oakley <philipoakley@iee.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 9a73519 commit e54d197

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

contrib/buildsystems/engine.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ sub showUsage
7373
EOM
7474

7575
# Pipe a make --dry-run into a variable, if not already loaded from file
76-
@makedry = `cd $git_dir && make -n MSVC=1 V=1 2>/dev/null` if !@makedry;
76+
# Capture the make dry stderr to file for review (will be empty for a release build).
77+
78+
my $ErrsFile = "msvc-build-makedryerrors.txt";
79+
@makedry = `make -C $git_dir -n MSVC=1 V=1 2>$ErrsFile` if !@makedry;
80+
# test for an empty Errors file and remove it
81+
unlink $ErrsFile if -f -z $ErrsFile;
7782

7883
# Parse the make output into usable info
7984
parseMakeOutput();

0 commit comments

Comments
 (0)