dlang / visuald

Visual D - Visual Studio extension for the D programming language
http://rainers.github.io/visuald/visuald/StartPage.html
Boost Software License 1.0
288 stars 69 forks source link

Cannot find input file `-c.d` #269

Closed JudgeFish closed 9 months ago

JudgeFish commented 9 months ago

When building the default "D/VC++ based Windows Application" template in VS2022 I get the following error: COMPILED : error : cannot find input file -c.d

After investigating what dmd actually got it looks like the first argument argv[1] begins with a BOM. So the first argument "-c" becomes 239, 187, 191, 45, 99, 0 (0xEFBBBF is the UTF-8 byte order mark)

The compilation error only occurs for dmd builds, not for ldc and only when having the experimental UTF-8 support in Windows 11 enabled: Region Settings - "Beta: Use Unicode UTF-8 for worldwide language support" It does not happen in "visuald" projects either.

I have not debugged ldc to see if same thing happens there but I suspect it might ignore the BOM.

rainers commented 9 months ago

I can reproduce this: with UTF-8 as the system encoding the response file is now created with UTF-8 encoding as well. The C# StreamWriter defaults to adding a BOM in this case (which has been disabled for LDC). Should be fixed in https://github.com/dlang/visuald/releases/tag/v1.4.0-rc1