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

RUN: Support build tool window #3926

Merged
merged 8 commits into from Aug 12, 2019
Merged

RUN: Support build tool window #3926

merged 8 commits into from Aug 12, 2019

Conversation

mchernyavsky
Copy link
Member

@mchernyavsky mchernyavsky commented May 30, 2019

Closes #2638. Fixes #3777. Fixes #3843. Fixes #3530.

toolwindow

Overview:

  • New build toolwindow is used for build, run and test commands (except for test --doc).
  • Now Debug, Profile, Valgrind and Coverage runners are available only for configurations that can be built and run:
    • изображение
    • изображение
    • изображение
    • изображение
    • изображение
    (run and test without --doc)
  • In CLion, "Build" (⌘+F9) is available only for configurations that can be built:
    • изображение
    • изображение
    • изображение
    • изображение
    • изображение
    (build, run and test without --doc)
    In other IDEs (e.g. IDEA, PyCharm), this button builds all projects, so is always available.
  • The build toolwindow should work for all OSs, cargo +1.32.0, and editions 2015/2018.
  • You can disable the build toolwindow by setting org.rust.cargo.build.tool.window variable to false (see Actions > Registry...).
  • The build toolwindow can work with -vv option (very verbose output). For example, we can understand "Fresh" compilation status:
    изображение
  • The build toolwindow ignores --quite option. It should also ignore -q option (RUN: Ignore -q option if using new build toolwindow #4253).
  • You can stop the current build process using the progress indicator.
  • The build toolwindow runs commands with --message-format=json option. Currently JSON messages from compiler don't contain color information. See corresponding issue in Cargo issue tracker - Don't remove color information from rendered string in --message-format=json output rust-lang/cargo#6994. A partial fix - RUN: Support for ANSI colors in build tool window #4254.
  • 2019.1 and 2019.2 have a different UI for the build toolwindow.
  • The build toolwindow doesn't have "Restart" and "Stop" buttons. Fix - RUN: Add "Restart" and "Stop" buttons to Cargo build tool window #4245.

Copy link
Member

@Undin Undin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have three copy of quite big CargoBuildOutputParser class
Maybe move common code into base class to reduce code duplication?

@mchernyavsky mchernyavsky changed the title RUN: Support build toolwindow RUN: Support build tool window Jul 1, 2019
@mchernyavsky mchernyavsky marked this pull request as ready for review July 1, 2019 13:27
@mchernyavsky mchernyavsky added this to the v102 milestone Jul 8, 2019
@mchernyavsky mchernyavsky removed this from the v102 milestone Jul 20, 2019
@lancelote
Copy link
Member

lancelote commented Aug 1, 2019

Should it report syntax errors as well? E.g. running something stupid like

fn main() {
    foo(
}

results in "Build failed" without much details so I have to run cargo in the terminal to see the error message:

Screen Shot 2019-08-01 at 14 14 43

cargo 1.36.0 (c4fcfb725 2019-05-15)
macOS 10.14.4

@mchernyavsky
Copy link
Member Author

@lancelote Thanks! Should be fixed now.

@mchernyavsky
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Aug 7, 2019
@bors
Copy link
Contributor

bors bot commented Aug 7, 2019

try

Build failed

@mchernyavsky mchernyavsky added this to the v104 milestone Aug 8, 2019
@Undin Undin added this to In Progress in To test Aug 9, 2019
@artemmukhin
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Aug 12, 2019
3926: RUN: Support build tool window r=ortem a=mchernyavsky

Closes #2638. Fixes #3777. Fixes #3843.

![toolwindow](https://user-images.githubusercontent.com/6079006/60440179-efefd380-9c1c-11e9-9ea3-4c319552694c.gif)

Overview:
- TODO

rust-lang/cargo#6994

Co-authored-by: mchernyavsky <mikhail.chernyavsky@jetbrains.com>
Co-authored-by: Mikhail Chernyavsky <mikhail.chernyavsky@jetbrains.com>
@bors
Copy link
Contributor

bors bot commented Aug 12, 2019

@bors bors bot merged commit 7564b1b into intellij-rust:master Aug 12, 2019
To test automation moved this from In Progress to Test Aug 12, 2019
@mchernyavsky mchernyavsky deleted the build-run branch August 12, 2019 16:56
bors bot added a commit that referenced this pull request Aug 13, 2019
4253: RUN: Ignore `-q` option if using new build toolwindow r=mchernyavsky a=mchernyavsky

Relates to #3926.

bors r+


Co-authored-by: Mikhail Chernyavsky <mikhail.chernyavsky@jetbrains.com>
bors bot added a commit that referenced this pull request Aug 13, 2019
4253: RUN: Ignore `-q` option if using new build toolwindow r=mchernyavsky a=mchernyavsky

Relates to #3926.

bors r+


Co-authored-by: Mikhail Chernyavsky <mikhail.chernyavsky@jetbrains.com>
@Undin
Copy link
Member

Undin commented Aug 13, 2019

The build toolwindow ignores --quite option. It should also ignore -q option

Why?

@mchernyavsky
Copy link
Member Author

@Undin With --quite option Cargo still shows compiler messages (errors & warnings), but we need Cargo messages to correctly display errors in the build toolwindow.

@lancelote
Copy link
Member

@mchernyavsky After disabling cargo.build.tool.window.enabled I can no longer run build run configurations. Clicking buttons has no effect, no relevant logs are recorded as well.

bors bot added a commit that referenced this pull request Aug 14, 2019
4257: RUN: Fix Build action when build toolwindow is disabled r=mchernyavsky a=mchernyavsky

Fixes #3926 (comment).

bors r+

Co-authored-by: Mikhail Chernyavsky <chemike47@gmail.com>
bors bot added a commit that referenced this pull request Aug 14, 2019
4257: RUN: Fix Build action when build toolwindow is disabled r=mchernyavsky a=mchernyavsky

Fixes #3926 (comment).

bors r+

Co-authored-by: Mikhail Chernyavsky <chemike47@gmail.com>
@Undin Undin added the to be documented Pull requests that should be documented label Aug 14, 2019
@lancelote lancelote moved this from Test to Done in To test Aug 26, 2019
bors bot added a commit that referenced this pull request Sep 2, 2019
4217: TYPE: New interactive inlay type hints support r=vlad20012 a=ortem

![type_hints](https://user-images.githubusercontent.com/4854600/62386077-7458ad80-b55f-11e9-8956-375670ffd342.gif)


4245: RUN: Add "Restart" and "Stop" buttons to Cargo build tool window r=ortem a=mchernyavsky

Relates to #3926.

<img width="315" alt="restart-stop" src="https://user-images.githubusercontent.com/6079006/62889650-77ffe780-bd4a-11e9-9b30-8e3ca5869f2c.png">



4323: INT: Handle trailing comma in ChopListIntention r=mchernyavsky a=ortem



Co-authored-by: ortem <ortem00@gmail.com>
Co-authored-by: Mikhail Chernyavsky <mikhail.chernyavsky@jetbrains.com>
bors bot added a commit that referenced this pull request Sep 2, 2019
4245: RUN: Add "Restart" and "Stop" buttons to Cargo build tool window r=ortem a=mchernyavsky

Relates to #3926.

<img width="315" alt="restart-stop" src="https://user-images.githubusercontent.com/6079006/62889650-77ffe780-bd4a-11e9-9b30-8e3ca5869f2c.png">



4323: INT: Handle trailing comma in ChopListIntention r=mchernyavsky a=ortem



4346: Fix switch to AST when resolving nested macro with the new engine r=vlad20012 a=vlad20012

The bug was introduced in #3750 (not released yet)

Co-authored-by: Mikhail Chernyavsky <mikhail.chernyavsky@jetbrains.com>
Co-authored-by: ortem <ortem00@gmail.com>
Co-authored-by: vlad20012 <beskvlad@gmail.com>
bors bot added a commit that referenced this pull request Sep 2, 2019
4217: TYPE: New interactive inlay type hints support r=vlad20012 a=ortem

![type_hints](https://user-images.githubusercontent.com/4854600/62386077-7458ad80-b55f-11e9-8956-375670ffd342.gif)


4245: RUN: Add "Restart" and "Stop" buttons to Cargo build tool window r=ortem a=mchernyavsky

Relates to #3926.

<img width="315" alt="restart-stop" src="https://user-images.githubusercontent.com/6079006/62889650-77ffe780-bd4a-11e9-9b30-8e3ca5869f2c.png">



Co-authored-by: ortem <ortem00@gmail.com>
Co-authored-by: Mikhail Chernyavsky <mikhail.chernyavsky@jetbrains.com>
bors bot added a commit that referenced this pull request Oct 23, 2019
4397: RUN: Build Action builds only selected configuration if possible r=Undin a=mchernyavsky

Currently, Build Action
<img width="343" alt="изображение" src="https://user-images.githubusercontent.com/6079006/64972715-70d07a00-d8b2-11e9-8e12-4faf1cb44f2a.png">
runs
```
cargo build --all --all-targets
```
even if we have selected configuration.
With this PR Build Action builds only the selected configuration. E.g. for
```
cargo run --package main --bin main
```
it will run
```
cargo build --package main --bin main
```

NB: It works only if the [experimental build tool window](#3926) is enabled.

NB2: CLion has its own implementation of Build Action and already knows how to build only the selected configuration.

Fixes #3530, fixes #4511.

Co-authored-by: Mikhail Chernyavsky <mikhail.chernyavsky@jetbrains.com>
bors bot added a commit that referenced this pull request Dec 17, 2020
4254: RUN: Support for ANSI colors in build tool window r=Undin a=mchernyavsky

Relates to #3926.

Fixes #4288.
Fixes #4898.

Note: `CARGO_TERM_PROGRESS_WHEN` and `CARGO_TERM_PROGRESS_WIDTH` variables were stabilized in the 1.48.0 release.

![image](https://user-images.githubusercontent.com/6079006/65837422-ebac8280-e2ff-11e9-8ef2-5f263f933888.png)


Co-authored-by: mchernyavsky <chernyavsky.mikhail@gmail.com>
Co-authored-by: Arseniy Pendryak <a.pendryak@yandex.ru>
@MarinaKalashina MarinaKalashina removed the to be documented Pull requests that should be documented label Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
To test
  
Done
5 participants