cargo_wrapper: Write to log with line-buffering

So we get log output while cargo is running, not just when it completes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1031>
This commit is contained in:
Nirbheek Chauhan 2022-12-29 03:49:44 +05:30
parent 9ee7118bf6
commit f94e422b61

View file

@ -67,9 +67,9 @@ def generate_depfile_for(fpath):
if __name__ == "__main__": if __name__ == "__main__":
opts = PARSER.parse_args() opts = PARSER.parse_args()
logdir = opts.root_dir / 'meson-logs'
logfile = open(opts.root_dir / 'meson-logs' / logfile_path = logdir / f'{opts.src_dir.name}-cargo-wrapper.log'
f'{opts.src_dir.name}-cargo-wrapper.log', 'w') logfile = open(logfile_path, mode='w', buffering=1)
print(opts, file=logfile) print(opts, file=logfile)
cargo_target_dir = opts.build_dir / 'target' cargo_target_dir = opts.build_dir / 'target'