Skip to content

fix: make benchmark host builds resolve the generator correctly - #125

Merged
kieronlanning merged 3 commits into
mainfrom
fix/benchmark-host-build
Sep 16, 2026
Merged

kieronlanning merged 3 commits into
mainfrom
fix/benchmark-host-build

Conversation

@kieronlanning

Copy link
Copy Markdown
Contributor

Fixes the benchmark suite so BenchmarkDotNet's autogenerated host build can compile and run.

Root cause: the host build passes \ArtifactsPath/\OutDir/\OutputPath\ and \UseSharedCompilation=false\ as global properties. Those propagated into the generator project (via its analyzer ProjectReference) and relocated its build output into stray folders relative to the project, and Roslyn's in-process analyzer loader then could not resolve the generator's \Purview.SourceGeneratorFramework\ runtime dependencies.

Changes:

  • \src/Directory.Build.props: keep intermediates in \obj/\ via \UseArtifactsOutput=false\ even when a global \ArtifactsPath\ is present.
  • \�enchmarks/Directory.Build.props\ (new): same for the benchmark project.
  • \Purview.Telemetry.Benchmarks.csproj: strip \ArtifactsPath;OutDir;OutputPath\ from the generator ProjectReference globals, and load the two \Purview.SourceGeneratorFramework\ runtime assemblies as analyzers so they are present in the analyzer load context under \UseSharedCompilation=false.

Verified: filtered Release benchmark run on net10.0 executes end-to-end (32 benchmarks, no host-build failure); main + sample solutions build; csharpier lint passes.

@kieronlanning
kieronlanning merged commit ac85887 into main Sep 16, 2026
2 checks passed
@kieronlanning
kieronlanning deleted the fix/benchmark-host-build branch September 16, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant