diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2020-09-26 17:38:11 +0200 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2020-09-26 17:38:11 +0200 |
commit | a76fb07314d3c5dea06ac2c1a36f8af1e76c2dde (patch) | |
tree | 24432b25d0efb6b13b26aa0c9edbc622462c142d /src/libmain/progress-bar.cc | |
parent | 8b4a542d1767e0df7b3c0902b766f34352cb0958 (diff) |
libmain/progress-bar: don't trim whitespace on the left
When running `nix build -L` it can be fairly hard to read the output if
the build program intentionally renders whitespace on the left. A
typical example is `g++` displaying compilation errors.
With this patch, the whitespace on the left is retained to make the log
more readable:
```
foo> no configure script, doing nothing
foo> building
foo> foobar.cc: In function 'int main()':
foo> foobar.cc:5:5: error: 'wrong_func' was not declared in this scope
foo> 5 | wrong_func(1);
foo> | ^~~~~~~~~~
error: --- Error ------------------------------------------------------------------------------------- nix
error: --- Error --- nix-daemon
builder for '/nix/store/i1q76cw6cyh91raaqg5p5isd1l2x6rx2-foo-1.0.drv' failed with exit code 1
```
Diffstat (limited to 'src/libmain/progress-bar.cc')
-rw-r--r-- | src/libmain/progress-bar.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc index be3c06a38..07b45b3b5 100644 --- a/src/libmain/progress-bar.cc +++ b/src/libmain/progress-bar.cc @@ -256,7 +256,7 @@ public: } else if (type == resBuildLogLine || type == resPostBuildLogLine) { - auto lastLine = trim(getS(fields, 0)); + auto lastLine = chomp(getS(fields, 0)); if (!lastLine.empty()) { auto i = state->its.find(act); assert(i != state->its.end()); |