Command Line too long
See original GitHub issueThe command line generated appears to exceed a threshold
Perhaps it would be better to generate a command file, to avoid command length limitations
The command line is too long.
Write-Err : Cannot bind argument to parameter 'msg' because it is an empty string.
At C:\Users\GeorgeRu\AppData\Local\Microsoft\VisualStudio\15.0_13f2e2ac\Extensions\43s1b10b.dwz\clang-build.ps1:567
char:15
+ Write-Err ($compileResult.Output)
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Write-Err], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Write-Err
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (6 by maintainers)
Top Results From Across the Web
IDEA 10.5 Command line is too long
In Intellij, go to "edit configurations" (Run -> Edit Configurations), in the configuration tab that comes up in the line "shorten command ......
Read more >"command line is too long" error message
First, "command line" is where you type and execute commands, not the command itself. I suggest renaming the option to Shorten command.
Read more >Command prompt line string limitation - Windows Client
The maximum length of the string that you can use at the command prompt is 8191 characters. This limitation applies to: the command...
Read more >Intellij - fix for Error running unit tests. Command line is too ...
Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun.
Read more >How to fix " Command line is too long. Shorten ... - YouTube
Error running 'CSVExample': Command line is too long. Shorten command line for CSVExample.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello guys,
I had some time and looked into why Tidy does not work. The mentioned “YAML” error indeed means, Tidy does not treat the “–config” option the same way as Clang does.
To put it short: for a Clang run, we can put the whole command line into a file and call Clang with “–config filename” For a Tidy run, we have a command line like this: clang-tidy.exe tidy-params – params-passed-from-tidy-to-clang
So the command line includes the Tidy params as well as the params passed on from Tidy to Clang, separated by “–”.
You guessed the solution yet? Split the Tidy command line at the “–” separator and pass the left side to Tidy, and pass the right side as in a file to Clang.
I have tested this and it works for me with LLVM6, VS2017 with Clang and Tidy runs.
To patch your installation, please:
if ($aUseParallelCompile)
I am not a PowerShell programmer so maybe it is not elegant, not optimal, but it works. It checks if we are doing a Clang or a Tidy run. For a Clang run, the command line is simply saved. For a Tidy run, the string will be split and the left side goes to Tidy, the rest to Clang.
I hope the developers will look into this and give us a fix soon. Have fun guys.
Excellent solution, @dzolee.
At first, we were skeptical of this approach, since it means creating and deleting thousands of temporary files, one per cpp. We don’t want to slow down Clang Power Tools and we also want to avoid having two (or more) ways of doing things. So we decided to test for it…
We ran a multitude of compilation tests on our test repository, consisting of around 140 projects and 8000 CPP files. To our surprise, we found that the temporary-file creation and deletion additional cost is practically zero.
In the majority of tests the compilation was slightly faster (around 1%) than the baseline of the control group. There appears to be a tiny time cost associated with a long command line, perhaps from
CMD.EXE
command line parsing. The tests were ran on the same machine, in identical conditions, on both SSDs and HDDs, yielding similar results.We are very pleased with the results and are happy to inform you that starting with Clang Power Tools
v3.8
(i.e. next release) we’ll move to using config files for giving arguments toclang
.Thank you all for your very insightful and helpful feedback.