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.

CompilerInvocations and parsing command line executable

See original GitHub issue

Hey,

I have found that the command line formatting and parsing in CompilerInvocations is very brittle. On my machine for example I get the following on a dotnet net5.0 project:

C:\Program Files\dotnet\dotnet.exe exec "C:\Program Files\dotnet\sdk\5.0.100-rc.2.20479.15\Roslyn\bincore\csc.dll" /noconfig /unsafe- /checked- /nowarn:1701,1702,CS1591,1701,1702 /fullpaths ....

First, because the removal of csc.dll doesn’t work (it matches css.dll with a space at the end, likely it works on Linux but not on Windows)

https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/4b307e49dcf171f054239db07f6c9dbb01b36fd0/src/StructuredLogger/Analyzers/CompilerInvocations.cs#L173-L180

The second problem more annoying is that the command C:\Program Files\dotnet\dotnet.exe exec is not parse-able easily due to the lack of embraced by ". I’m worried that it is buried into msbuild logging and something we can’t change…

Any ideas?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jairbubblescommented, Dec 19, 2020

@xoofx Well the aim is to run the application as a .NET Core application and it’s only possible since .NET Core 3.1. But sure the lib could target netcoreapp2.1 if you feel like it would bring more compatibility.

Lib => net472;netcoreapp2.1 // To match exactly MsBuild App => net472;netcoreapp3.1 // WPF is only supported since 3.1

0reactions
xoofxcommented, Dec 19, 2020

Yeah, netcoreapp2.1 only for the Lib, for the App, you can use whatever is more suitable

Read more comments on GitHub >

github_iconTop Results From Across the Web

clang::CompilerInvocation Class Reference
Check that Args can be parsed and re-serialized without change, emiting diagnostics for any differences. This check is only suitable for command-lines that...
Read more >
Getting Started with the Swift Frontend: Lexing & Parsing
performFrontend parses command-line arguments to determine the FrontendOptions::RequestedAction , by using the CompilerInvocation::parseArgs ...
Read more >
Does the Windows "cmd.exe" parse arguments differently?
Any application can parse the command line in any way it sees fit. Most applications use the C runtime library parser, but there...
Read more >
class CompilerInvocation: LLVM/Clang 15.x documentation
Parse command line options that map to LangOptions. Declared at: clang/include/clang/Frontend/CompilerInvocation.h:249. Parameters. clang::LangOptions& Opts ...
Read more >
Solved: Is there a package for parsing command line flags?
I'm building an application which runs as a standalone executable. I want to optionally start the program with command line arguments, ...
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