I am using exec (promisified) to run a Makefile:
const out = await exec('make', { maxBuffer: 1024 * 1024 * 10 });
However when I take a look at the Makefiles output even when the building was successful the stderr
field is always populated.
"stdout": "stuff...",
"stderr": "0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
9 4813k 9 439k 0 0 29.1M 0 --:--:-- --:--:-- --:--:-- 28.6M
100 4813k 100 4813k 0 0 101M 0 --:--:-- --:--:-- --:--:-- 100M
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 17939 100 17939 0 0 1063k 0 --:--:-- --:--:-- --:--:-- 1094k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 17939 100 17939 0 0 1352k 0 --:--:-- --:--:-- --:--:-- 1459k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 17939 100 17939 0 0 1577k 0 --:--:-- --:--:-- --:--:-- 1751k".
As you can see there my Makefile downloads 4 files at some point. It however populates the stderr field. Also if the file does not download (url incorrect) it just states 0% instead of 100%, which doesn't make things better.
Is there anyway to get only errors in the stderr, it's difficult to get error handling correct when this is happening.