question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clang-build fails with "Illegal character in Path"

See original GitHub issue

When I clang-build a VS Project, it fails for me with the following message (German Windows):

--- CLANG TIDY STARTED ---

Get-ChildItem : Illegales Zeichen im Pfad.
In C:\users\uid38621\appdata\local\microsoft\visualstudio\16.0_cec81720\extensions\z2xrjrot.1qu\Tooling\v1\clang-build.
ps1:545 Zeichen:12
+    $slns = Get-ChildItem -recurse -LiteralPath $pathToCheck -Filter " ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ChildItem], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.GetChildItemCommand
 
Cannot find given project(s)

--- CLANG TIDY FINISHED ---

I tracked down the issue to the following line of code:

https://github.com/Caphyon/clang-power-tools/blob/041844f6f3e1f3e11b4c5736eba8c38975cfaa49/ClangPowerTools/ClangPowerTools/Tooling/v1/clang-build.ps1#L545

I believe, this is due to adding \\?\ and running the command in PowerShell x86. While I can run the command in x64 Powershell, it fails in x86:

image image

I literally just removed the code adding the \\?\ prefix for making it work:

https://github.com/Caphyon/clang-power-tools/blob/041844f6f3e1f3e11b4c5736eba8c38975cfaa49/ClangPowerTools/ClangPowerTools/Tooling/v1/clang-build.ps1#L538-L543

I didn’t draft a PR, as there is probably a reason for this code to exist. However it looks to me like it either needs to be removed, or the Addin must make sure it runs in x64 Powershell.


  • Win 10 x64
  • VS 2019
  • Project configured with CMake
  • Powershell 5
    Name                           Value
    ----                           -----
    PSVersion                      5.1.19041.2364
    PSEdition                      Desktop
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    BuildVersion                   10.0.19041.2364
    CLRVersion                     4.0.30319.42000
    WSManStackVersion              3.0
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
FlorianReimoldcommented, Feb 2, 2023

Hi @mariru27

I tried it out, but it didn’t work: image

1reaction
mariru27commented, Feb 2, 2023

Hi @FlorianReimold,

Thank you for reporting this issue, and for provided information We are looking into it and working towards a fix. We will keep you updated as progress is made.

Best regards, Marina

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio build error "Illegal characters in path"
go to obj\Debug folder then find yourProject.csproj.FileListAbsolute.txt file open it then delete what you found in building the project. In my ...
Read more >
MSBuild error: MSB4014 "Illegal characters in path" #8875
MSBuild error: MSB4014 "Illegal characters in path" #8875 ... error MSB4014: The build stopped unexpectedly because of an internal failure.
Read more >
Illegal Characters In Path Error : r/VisualStudio
Everytime i try and create the project i get an error saying "Illegal Characters in path". Restarted, updated and tried again to no...
Read more >
Illegal characters in path. - Microsoft Q&A
I am trying to create a new project through following procedure but visual studio is throwing exception.
Read more >
Illegal characters in path when creating class ...
... class will appear “Illegal characters in the path” (Add “existing project” works) Then I repaired VS and restarted,but I still get the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found