The Wayback Machine - https://web.archive.org/web/20220708075753/https://github.com/github/codeql/pull/9705
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: Implement correct behavior for dotnet build tracing #9705

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

criemen
Copy link
Contributor

@criemen criemen commented Jun 24, 2022

For proper C# tracing, dotnet build needs the parameter
/p:UseSharedCompilation=false. However, we can't pass that to the other
subcommands of dotnet, therefore we need to figure out which subcommand
of dotnet is being invoked.

For proper C# tracing, `dotnet build` needs the parameter
/p:UseSharedCompilation=false. However, we can't pass that to the other
subcommands of `dotnet`, therefore we need to figure out which subcommand
of `dotnet` is being invoked.
@criemen criemen added the C# label Jun 24, 2022
@criemen criemen requested a review from as a code owner Jun 24, 2022
@criemen criemen marked this pull request as draft Jun 24, 2022
Copy link
Contributor

@tamasvajk tamasvajk left a comment

Looks plausible to me.

-- The dotnet CLI has the following usage instructions:
-- dotnet [sdk-options] [command] [command-options] [arguments]
-- we are interested in dotnet build, which has the following usage instructions:
-- dotnet [options] build [<PROJECT | SOLUTION>...]
-- however, `dotnet -h build`, although documented, does not work
-- For now, parse the command line as follows:
-- Everything that starts with `-` will be ignored.
-- The first non-option argument is treated as the command.
-- if that's `build`, we append `/p:UseSharedCompilation=false` to the command line,
-- otherwise we do nothing.
Copy link
Contributor

@tamasvajk tamasvajk Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing -d before the build command works. But I think ignoring everything that starts with- is correct and will handle this case too.

-- dotnet [options] build [<PROJECT | SOLUTION>...]
-- however, `dotnet -h build`, although documented, does not work
-- For now, parse the command line as follows:
-- Everything that starts with `-` will be ignored.
Copy link
Contributor

@tamasvajk tamasvajk Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line could also state that anything prefixed / will be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants