Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cargo output is broken in MSYS2 #6108

Closed
Pzixel opened this issue Sep 27, 2018 · 8 comments · Fixed by #6122
Closed

New cargo output is broken in MSYS2 #6108

Pzixel opened this issue Sep 27, 2018 · 8 comments · Fixed by #6122

Comments

@Pzixel
Copy link

Pzixel commented Sep 27, 2018

I recently updated my compiler and figured out that you added fancy new output with progress bars and so on. Looks pretty nice, but it's output is somehow broken.

Here is example of one build output: https://gist.github.com/Pzixel/4a02dc90496a02a10b1208c4646bf096

It looks innocent, but if you add "word wrap" you could see following:

Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: Building [ ] 1/406: Building [ ] 2/406: Building [ ] 3/406: Building [ ] 4/406: Building [ ] 5/406: Building [ ] 6/406: Building [ ] 7/406: Building [> ] 8/406: Building [> ] 8/406: Building [> ] 8/406: Building [> ] 8/406: Building [> ] 8/406: Building [> ] 8/406: Building [> ] 8/406: Building [> ] 8/406: Building [> ] 9/406: Building [> ] 10/406: Building [> ] 11/406: Building [> ] 12/406: Building [> ] 13/406: Building [> ] 14/406: Building [=> ] 15/406: Building [=> ] 16/406: Building [=> ] 16/406: Building [=> ] 16/406: Building [=> ] 16/406: Building [=> ] 16/406: Building [=> ] 16/406: Building [=> ] 16/406: Building [=> ] 16/406: Building [=> ] 17/406: Building [=> ] 18/406: Building [=> ] 19/406: Building [=> ] 20/406: Building [=> ] 21/406: Building [==> ] 22/406: Building [==> ] 23/406: Building [==> ] 24/406: Building [==> ] 24/406: Building [==> ] 24/406: Building [==> ] 24/406: Building [==> ] 24/406: Building [==> ] 24/406: Building [==> ] 24/406: Building [==> ] 24/406: Building [==> ] 25/406: Building [==> ] 26/406: Building [==> ] 27/406: Building [==> ] 28/406: Building [===> ] 29/406: Building [===> ] 30/406: Building [===> ] 31/406: Building [===> ] 32/406: Building [===> ] 32/406: Building [===> ] 32/406: Building [===> ] 32/406: Building [===> ] 32/406: Building [===> ] 32/406: Building [===> ] 32/406: Building [===> ] 32/406: Building [===> ] 33/406: Building [===> ] 34/406: Building [===> ] 35/406: Building [===> ] 36/406: Building [====> ] 37/406: Building [====> ] 38/406: Building [====> ] 39/406: Building [====> ] 40/406: Building [====> ] 40/406: Building [====> ] 40/406: Building [====> ] 40/406: Building [====> ] 40/406: Building [====> ] 40/406: Building [====> ] 40/406: Building [====> ] 40/406: Building [====> ] 41/406: Building [====> ] 42/406: Building [====> ] 43/406: Building [=====> ] 44/406: Building [=====> ] 45/406: Building [=====> ] 46/406: Building [=====> ] 47/406: Building [=====> ] 48/406: Building [=====> ] 48/406: Building [=====> ] 48/406: Building [=====> ] 48/406: Building [=====> ] 48/406: Building [=====> ] 48/406: Building [=====> ] 48/406: Building [=====> ] 48/406: Building [=====> ] 49/406: Building [=====> ] 50/406: Building [======> ] 51/406: Building [======> ] 52/406: Building [======> ] 53/406: Building [======> ] 54/406: Building [======> ] 55/406: Building [======> ] 56/406: Building [======> ] 56/406: Building [======> ] 56/406: Building [======> ] 56/406: Building [======> ] 56/406: Building [======> ] 56/406: Building [======> ] 56/406: Building [======> ] 56/406: Building [======> ] 57/406: Building [=======> ] 58/406: Building [=======> ] 59/406: Building [=======> ] 60/406: Building [=======> ] 61/406: Building [=======> ] 62/406: Building [=======> ] 63/406: Building [=======> ] 64/406: Building [=======> ] 64/406: Building [=======> ] 64/406: Building [=======> ] 64/406: Building [=======> ] 64/406: Building [=======> ] 64/406: Building [=======> ] 64/406: Building [=======> ] 64/406: Building [=======> ] 65/406: Building [========> ] 66/406: Building [========> ] 67/406: Building [========> ] 68/406: Building [========> ] 69/406: Building [========> ] 70/406: Building [========> ] 71/406:
...

I've tested it in powershell console and I've got much nicer output:

PS C:\Users\Alex\Documents\Repo\parity-ethereum> cargo +nightly-x86_64-pc-windows-msvc build
   Compiling ring v0.12.1 (https://github.com/paritytech/ring#bae475e9)
   Compiling evm v0.1.0 (C:\Users\Alex\Documents\Repo\parity-ethereum\ethcore\evm)
   Compiling wasm v0.1.0 (C:\Users\Alex\Documents\Repo\parity-ethereum\ethcore\wasm)
error: failed to run custom build command for `ring v0.12.1 (https://github.com/paritytech/ring#bae475e9)`
process didn't exit successfully: `C:\Users\Alex\Documents\Repo\parity-ethereum\target\debug\build\ring-4b8f5fc9e045b30e\build-script-build` (exit code: 101)
@ehuss
Copy link
Contributor

ehuss commented Sep 27, 2018

Hm, I'm unable to reproduce any issues with the progress bar. Which console are you using (mintty? conemu? etc.) Which version? Which msys distribution and version are using?

@Pzixel
Copy link
Author

Pzixel commented Sep 27, 2018

@ehuss I'm using bash installed via Git for Windows (C:\Program Files\Git\git-bash.exe). Git version is 2.16.2, not sure what version of MSYS it has though. It's MinTTY.

image


I've just installed the latest version 2.19.0 (as you can see on the screenshot above), still have the same issue.


That's quite weird. Here is my output:

image

But then I do cargo clean + cargo build and it somehow fix the output:

image

I'm not sure what it was, but I think issue is ok to be closed now. We can always reopen it if we figure out what's causing it.

@Pzixel Pzixel closed this as completed Sep 27, 2018
@ehuss
Copy link
Contributor

ehuss commented Sep 27, 2018

Indeed strange. It looks like in your second attempt the window was resized? That might impact it. The window does need to be at least 60 characters wide, but it looks like you started with the default 80.

@Pzixel
Copy link
Author

Pzixel commented Sep 27, 2018

Yep, I resized it indeed, but then I resized it back, but correct behavior persisted... Not sure what does affect this.

@Pzixel Pzixel reopened this Oct 1, 2018
@Pzixel
Copy link
Author

Pzixel commented Oct 1, 2018

I've reproduces the issue again on latest MSYS

image
image

I'm not sure what's wrong though.

@alexcrichton
Copy link
Member

@ehuss FWIW I can reproduce this as well. After opening a msys terminal and without changing its size at all we print the status across many lines.

I wonder if we have an off-by-one error or something like that which is causing us to print more characters than intended?

@ehuss
Copy link
Contributor

ehuss commented Oct 1, 2018

Hm, I couldn't repro on my desktop, but I started a fresh VM and was able to repro there. The console is reporting a width of 119 regardless of the actual width.

I don't have any good ideas. Some options I'm thinking:

  • Unconditionally use max 60 width in msys terminals. Even though terminals like conemu report the correct size, there's not an easy way to differentiate between that and mintty.
  • Shell out to stty size if it is available.

Any thoughts?

@alexcrichton
Copy link
Member

Weird! I wonder if something changed recnetly in windows?

In any case using 60 seems fine by me, and stty size as a fallback also seems ok

bors added a commit that referenced this issue Oct 3, 2018
Second attempt at fixing msys terminal width.

Lock the max width on msys-based terminals to 60. I tried a lot of different
things, but I was unable to find a way to detect the correct width in mintty.
Unfortunately this means that terminals that work correctly like ConEmu will
also be capped at 60. C'est la vie.

Of course this does not affect cmd, powershell, etc.

Fixes #6108
@bors bors closed this as completed in #6122 Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants