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/1038>
This commit is contained in:
Nirbheek Chauhan 2022-12-29 03:49:44 +05:30 committed by Sebastian Dröge
parent a0dbb94e01
commit a5a3c44951

View file

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