Closed dkrejsa closed 1 year ago
When building or using ICU, some output to stdout and stderr done by the pkgdata tool may be dropped
Could you provide the steps to reproduce the issue?
Well, basically, build ICU from source using makepkg-mingw and examine the build logs, looking especially for the lines starting with 'pkgdata: bash -c ' such as
pkgdata: bash -c "cd ../lib/ && /usr/bin/install -c libicudt73.dll C:/msys64/...
that are output by the runCommand() function in pkgdata.cpp right before calling system(). (Or rather, that would be output if not for the lack of flushing.) I can probably provide more details and an example log if necessary, but not immediately.
Thanks for the info. Could you provide the expected output and the actual output both?
Apologies -- I cannot figure out how to reproduce this problem in a pure mingw environment. I could reproduce it in my own build environment, which was a weird cross build on Windows using a MINGW ICU build and its tools to package the ICU data in a cross build on Windows for VxWorks, using a suspect "bash" shell environment as part of the build, with the output being redirected to a file by a cmd.exe shell calling make; and adding the fflush() calls helped for that case. Anyhow, I'll close this bug since it is not be likely to affect common MINGW64 uses.
Description / Steps to reproduce the issue
When building or using ICU, some output to
stdout
andstderr
done by the pkgdata tool may be dropped, and not be visible in the build logs. This dropped output is confusing and can complicate debugging build problems when using pkgdata.This can occur when the
runCommand()
function in pkgdata.cpp calls the system() function to run various commands.runCommand()
callsprintf()
to display the command to be run immediately before calling system(), and will also write tostderr
immediately afterwards ifsystem()
returns a nonzero result.Inserting calls to
fflush()
forstdout
andstderr
after the printf() and before thesystem()
call, as suggested by Microsoft documentation forsystem()
in the Remarks section, will prevent this useful diagnostic output from being lost. I suggest changing the above code to
Expected behavior
Diagnostic or informational output from the pkgdata program should not be accidentally dropped.
Actual behavior
Currently, diagnostic output, such as the following bit added for
U_PF_MINGW
inpkg_generateLibraryFile()
, may not be visible due to this issue:Verification
Windows Version
MINGW64_NT-10.0-19045
MINGW environments affected
Are you willing to submit a PR?
No response