CLion 2018.1 EAP: Valgrind on WSL, partial commits in Git and C++ support improvements
Hi,
The new CLion 2018.1 EAP (build 181.3870.21) is now available for download. Get it now from our site or wait for a patch update right in the IDE (if you are using previous EAP build).
Valgrind on WSL
Valgrind Memcheck was integrated into CLion in v2017.3 and gave Linux and macOS user ability to catch memory errors and leaks right from the IDE. Unfortunately, Windows users are lacking Valgrind. But since WSL is here and supported in CLion, we’ve enabled Valgrind on WSL!
When you have WSL toolchains configured in CLion, you can now see the Valgrind settings in Settings | Build, Execution, Deployment. Install Valgrind on your WSL instance (`sudo apt-get install valgrind`) and provide a path to the Valgrind executable in Valgrind settings in CLion. Now you can select a Run/Debug configuration and run it under Valgrind memcheck via the Run | Run Valgrind Memcheck… or special icon in the Navigation bar located next to the Run and Debug options:
In the Valgrind tab in the Run toolwindow you’ll get all the possible errors found by Valgrind, along with the source code location and a stack trace:
C++ support improvements
This build also brings a set of improvements to C++ language engine, which reduces the number of incorrect warnings and errors in code analysis:
- False error for variadic function declaration when comma before ellipsis is absent (CPP-5811)
- False syntax error for override function with try/catch block (CPP-9143)
- Incorrect parsing in case of unnamed-only function parameters (CPP-2755)
- Macro call breaks parsing of types (CPP-4314)
- Braces init list is not parsed inside parent initializer (CPP-7608)
- Parentheses in array-of-pointers argument declaration confuse CLion (CPP-8331)
- And more
Partial commits in Git
Partial Git commits (git add -p
) are now supported in CLion. That means only the selected changes from the file are committed, while other changes can be moved to another changelists. Moreover, you can now associate the code chunks, not the whole file, with a changelist, and track them separately.
You can include code chunks into a commit using the checkboxes in the Diff pane of the Commit Changes dialog:
or right from the editor, in the popup which appears when you click on a change marker in the gutter:
Find more details in the IntelliJ IDEA’s blog.
That’s it! Full release notes are available by the link.
Your CLion Team
JetBrains
The Drive to Develop
Tano says:
February 21, 2018Anastasia, when do we expect to receive the 2018.1 stable? (non-EAP)
Thanks
Arthur_J says:
February 21, 2018Or the Release Candidate ? I rely on Clion scarcely everyday so I shouldn’t use EAP in case some things are broken, like recommended in the EAP page.
Thanks, + additional thanks for Valgring with WSL and partial commits
Anastasia Kazakova says:
February 22, 2018Release Candidate is planned for mid March
Anastasia Kazakova says:
February 22, 2018Planned for the end of March currently.
Roman says:
February 21, 2018This version set a new record for “Resolve operation requires more time…”. I have waited 3 minutes!! to switch from myclass.h to myclass.cpp 🙁
Anastasia Kazakova says:
February 22, 2018Have you sent us the CPU snapshot from your case?
Roman says:
February 22, 2018Actually record was surpassed, next time I’ve waited 7 minutes to switch from header to source. I’ve attached auto-generated dumps to https://youtrack.jetbrains.com/issue/CPP-7652
Anastasia Kazakova says:
February 23, 2018Thanks. We’ll investigate.
Tano says:
February 22, 2018Question, perhaps offtopic: with latest EAP I get code analysis before commiting, which I disabled in the past, but it seems that it happens again. How can I disable it now?
Tano says:
February 22, 2018I find the option, just ignore my post, sorry
Anastasia Kazakova says:
February 23, 2018Do you mean the Perform Code analysis option in the commit dialog? Untick when commiting.
Adam Getchell says:
February 27, 2018CLion 2018.1 EAP is incompatible with using Ninja in the same directory.
In CLion 2017.3 and 2017.3 EAP, I could run a script to build out of source into build using Ninja, and then just use CLion’s Reload CMake Project.
Now Reload CMake Project warns that it’s incompatible with Ninja, and wants to specify another directory. Unfortunately, I actually need both to build at the same place (especially until CLion Ninja compatibility is done.)
Anastasia Kazakova says:
February 27, 2018Thank for the note. We’ll check if that was an intentional change and if there is a workaround, and will let you know later.
Nasser Gonzalez says:
February 28, 2018Hi Adam. I am looking to use also Ninja and Clion. I was trying to find any documentation to do this and I found your comment. Would you mind to share with me how are you able to use ninja and clion? 😀
Anastasia Kazakova says:
February 28, 2018This could probably help http://nevkontakte.com/2015/rogue-ninja-support-in-clion.html
Anastasia Kazakova says:
February 28, 2018Seems that the change is caused by this https://youtrack.jetbrains.com/issue/CPP-11857. Previously, CLion simply removed all the content silently.
Could you please share why exactly do you need both builds at the same place? Just to understand the usecase.
As a workaround you can achieve this in two ways: 1) Clean CMakeCache.txt in the build script 2) Use two different generation directories, and to redirect binaries into one directory using RUNTIME_OUTPUT_DIRECTORY var.
Hans Schnier says:
August 21, 2018Hi, I have question about Valgrind on WSL. I configured WSL toolchains (it works fine) and installed Valgrind on WSL, however, I keep getting message “Error running ‘project’: Permission denied” when I’m trying to use Valgrind. How can I fix it?
Anastasia Kazakova says:
August 22, 2018Can you check the Valgrind permissions please? It should be allowed for the user, which credentials are used for WSL in CLion. You can try and run Valgrind manually on WSL using these credentials.
Alexander Mokin says:
February 12, 2019Hello, I have installed valgrind using WSL, but what should I type in the “Valgrind executable” field in the settings?
Alexander Mokin says:
February 12, 2019I entered the path “usr/local/bin/valgrind”, but where it is located in Windows. And I get the “CreateProcess error=193”.
Alexander Mokin says:
February 12, 2019Okay, I figured out I have to set just “/usr/local/bin/valgrind”, but I didn’t know I had to set the WSL toolchain by default. Only that way it can see the Ubuntu executable. Now it seems to work.
Anastasia Kazakova says:
February 13, 2019And what CMake profile is selected for you in the bottom right switcher? If you select a profile with WSL toolchain, Valgrind should find the environment properly and run successfully.
Noa Cohen says:
April 28, 2019how do i change the Cmake profile?
I did add Release-WSL profile in the settings/…/cmake and the icon for running with valgrind memcheck is enabled but i keep getting an error about not finding the valgrind executable although i have entered the path “usr/local/bin/valgrind”
Anastasia Kazakova says:
April 28, 2019In case of WSL, Valgrind is running on your WSL. Is this path on your WSL?
Noa Cohen says:
April 30, 2019the problem was that I had two WSL profiles on toolchains the one that was default wasn’t configured. got it working!
thanks
Anastasia Kazakova says:
April 30, 2019Great! Thanks for letting us know