Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

There are 2 ways of using mpc -i

For instance

mpc -I ../../Assembly-CSharp.csproj -o MessagePackGenerated.cs
vs
mpc -i ../../ -o MessagePackGenerated.cs -o MessagePackGenerated.cs

My team members for the most part have had better luck, but we have inconsistent results with compile times, or whether the commands work at all.

For me, I noticed that the method that targets a director (not a csproj) finishes in about 15s, with a full build. Very reasonable.

The method that targets the .csproj, I have typically cancelled after leaving it running for hours, it spins up a lot of threads, and eats at least 40gb of memory.

This is because the codepath that uses PseudoCompilation.CreateFromDirectoryAsync is quite fast, whereas OpenMSBuildProjectAsync is problematic for me.

I've been debugging mpc and turned logs on etc.

var project = await workspace.OpenProjectAsync(projectPath, logger, null, cancellationToken);

This line is where I get to, and inside it, it seems like every so often (with logging turned on) I'll get a new log line like this

Target PrepareForBuild:
    Creating directory "Temp/obj//Unity.RenderPipelines.Universal.Runtime/".
Target CoreCompile:
    /usr/local/share/dotnet/dotnet exec "/usr/local/share/dotnet/sdk/8.0.401/Roslyn/bincore/csc.dll" /noconfig /unsafe+ /checked- /nowarn:0169,USG0001,1701,1702

It makes a ton of these directories, each of these lines can take seconds to minutes to appear.

Normally, I'd just use the directory version, and move on with my life, but it turns out we have other assemblies that are pulled in if I take that codepath.

I'm struggling to understand why this is worse on my machine, whether it's a M3 Mac issue, a dotnet 8 issue, a newer roselyn, etc. I'm going to keep digging into this but I'd love any sort of insight.

You must be logged in to vote

Replies: 1 comment

Comment options

We're not investing in mpc any more. Can you try the source generator in the latest prerelease on nuget.org, as documented in our README file *in the develop branch?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.