Skip to content

Allow loading compiler from disk - #178

Merged
jjonescz merged 105 commits into
mainfrom
local-roslyn-to-main
Oct 29, 2026
Merged

jjonescz merged 105 commits into
mainfrom
local-roslyn-to-main

Conversation

@jjonescz

Copy link
Copy Markdown
Owner

And some other features from the hackathon feature branch.

svick and others added 30 commits September 15, 2026 13:41
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI max review requested due to automatic review settings October 28, 2026 16:36
@jjonescz jjonescz added the enhancement New feature or request label Oct 28, 2026
@jjonescz
jjonescz force-pushed the local-roslyn-to-main branch from 72a8267 to 88f9fc8 Compare October 28, 2026 16:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved defects block Desktop compilation, misconfigure the desktop release test gate, omit Android’s release network permission, and break source generation with InternalApi and in-session package-version changes.

5 open issues
What changed in this PR

Adds local Roslyn/Razor compiler loading and reload controls to .NET Lab, alongside source-generator integration, native application hosts, and expanded runtime tooling.

Changes:

  • Adds local folder selection, filesystem adapters, compiler snapshots, and reload controls.
  • Integrates NuGet/SDK source generators, additional compiler directives, and configurable diagnostic formatting.
  • Introduces Desktop/Android hosts, CoreCLR JIT disassembly, and supporting tests, build tooling, and packaging workflows.

This pull request requires changes.

File Description
test/​UnitTests/​UnitTests.csproj Adds Razor and Desktop test references.
test/​UnitTests/​SourceGeneratorLoaderTests.cs Tests generator discovery, dependency ordering, and deduplication.
test/​UnitTests/​Snapshots/​TreeFormatterTests.Symbols.verified.txt Refreshes metadata-token expectations.
test/​UnitTests/​LanguageServiceTests.cs Covers asynchronous updates and generator diagnostics.
test/​UnitTests/​FileLevelDirectiveTests.cs Tests memory-safety and Razor-version directives.
test/​UnitTests/​ExecutorTests.cs Updates the combinatorial-testing namespace.
test/​UnitTests/​AnalyzerNuGetDllFilterTests.cs Tests analyzer asset and version selection.
src/​WorkerWebAssembly/​wwwroot/​main.js Handles directory transfers and exception-resource configuration.
src/​WorkerWebAssembly/​WebFileSystem.cs Implements browser directory and file access.
src/​WorkerWebAssembly/​Program.cs Registers the browser filesystem.
src/​WorkerApi/​Utils/​FileSystem.cs Defines filesystem and folder-picker contracts.
src/​WorkerApi/​Lab/​CompilerDependency.cs Adds local compiler specifiers and snapshot metadata.
src/​WorkerApi/​InputMessage.cs Adds forced compiler reload requests.
src/​Worker/​WorkerServices.cs Registers local resolution and fallback filesystem services.
src/​Worker/​Lab/​NuGetDownloader.cs Downloads and filters compatible analyzer assemblies.
src/​Worker/​Lab/​LocalCompilerDependencyResolver.cs Resolves compiler assemblies from local build outputs.
src/​Worker/​Lab/​DependencyRegistry.cs Supports explicit assembly paths and path-or-data access.
src/​Worker/​Lab/​CompilerProxy.cs Passes compiler references as paths or bytes.
src/​Worker/​Lab/​CompilerDependencyProvider.cs Supports reloads and improves resolution errors.
src/​Worker/​Lab/​AzDoDownloader.cs Selects artifacts from the latest build-job attempt.
src/​Worker/​Executor.cs Forwards reload requests and awaits language-service updates.
src/​WebAssembly/​wwwroot/​js/​FileSystem.js Manages selected directory snapshots and file reads.
src/​WebAssembly/​Program.cs Registers browser picker and filesystem services.
src/​Shared/​Shared.csproj Embeds BCL source-generator assemblies.
src/​Shared/​SdkAnalyzerAssemblies.cs Exposes embedded SDK analyzers.
src/​Shared/​RefAssemblies.cs Separates analyzers from reference assemblies.
src/​Shared/​INuGetDownloader.cs Adds analyzer results and compiler-version filtering.
src/​Shared/​ILanguageServices.cs Updates asynchronous notifications and assembly-reference contracts.
src/​Shared/​ICompiler.cs Adds path-or-data references and diagnostic-format preferences.
src/​RoslynWorkspaceAccess/​RoslynWorkspaceAccessors.cs Updates telemetry integration and fault logging.
src/​RoslynAccess/​RoslynAccessors.cs Supports plain and Roslyn-test diagnostic formats.
src/​Directory.Build.targets Removes shared runtime-identifier defaults.
src/​Directory.Build.props Adjusts source-generator handling for watch builds.
src/​Desktop/​wwwroot/​css/​desktop.css Customizes native-host loading indicators.
src/​Desktop/​Properties/​AssemblyInfo.cs Exposes Desktop internals to unit tests.
src/​Desktop/​Program.cs Initializes the Photino host and desktop platform services.
src/​Desktop/​NativeMethods.cs Adds Windows hardware-keyboard detection.
src/​Desktop/​DesktopFileSystem.cs Implements native folder selection and filesystem access.
src/​Desktop/​Desktop.csproj Defines the desktop application project.
src/​CoreClr/​RuntimeJitCodeProvider.cs Collects native method bodies from runtime events.
src/​CoreClr/​RuntimeEntryPoint.cs Resolves architecture-specific native entry stubs.
src/​CoreClr/​Properties/​AssemblyInfo.cs Exposes CoreCLR internals to unit tests.
src/​CoreClr/​JitCodeDisassembler.cs Formats native instructions and resolves symbols.
src/​CoreClr/​JitAsmDisassembler.cs Coordinates JIT preparation and disassembly.
src/​CoreClr/​CoreClr.csproj Defines the native disassembly library.
src/​Compiler/​Utils/​Utils.cs Adds path-backed references and Razor configuration compatibility helpers.
src/​Compiler/​SourceGeneratorLoader.cs Loads generators and exposes workspace analyzer references.
src/​Compiler/​LanguageServices.cs Integrates generators into workspace diagnostics.
src/​Compiler/​FileLevelDirectiveParser.cs Adds analyzer downloads and compiler properties.
src/​Compiler/​Compiler.cs Integrates generators, diagnostic formats, and Razor-version selection.
src/​Compiler/​Api.cs Collects and deduplicates additional analyzers.
src/​App/​wwwroot/​js/​WorkerController.js Transfers directory snapshots and manages their lifetimes.
src/​App/​wwwroot/​js/​BlazorMonacoInterop.js Adds diagnostic severity tokenization.
src/​App/​Utils/​Monaco/​CustomMonacoTheme.cs Defines diagnostic severity colors.
src/​App/​Utils/​Monaco/​BlazorMonacoInterop.cs Exposes diagnostic-language registration.
src/​App/​Lab/​WorkerController.cs Coordinates local-directory requests and forced reloads.
src/​App/​Lab/​Settings.razor Adds local compiler selection, reloads, and detailed errors.
src/​App/​Lab/​SavedState.cs Persists diagnostic-format preferences.
src/​App/​Lab/​Page.razor Adds formatting controls and diagnostic highlighting.
src/​App/​Lab/​CompilerVersionInfo.razor Displays snapshot timestamps, checkout details, and reload controls.
src/​App/​App.cs Registers the fallback file picker.
src/​Android/​wwwroot/​css/​android.css Customizes Android loading indicators.
src/​Android/​wwwroot/​blazor-webview-android-bridge.js Bridges WebView messaging to Blazor.
src/​Android/​wwwroot/​android-clipboard.js Exposes native clipboard operations to JavaScript.
src/​Android/​PlatformServices.cs Implements Android host, display, and worker services.
src/​Android/​Platforms/​Android/​Resources/​values/​styles.xml Defines the splash theme.
src/​Android/​Platforms/​Android/​Resources/​values/​colors.xml Defines the app icon background color.
src/​Android/​Platforms/​Android/​Resources/​values-v35/​styles.xml Configures Android edge-to-edge behavior.
src/​Android/​Platforms/​Android/​Resources/​mipmap-anydpi-v26/​appicon.xml Defines the adaptive application icon.
src/​Android/​Platforms/​Android/​Resources/​mipmap-anydpi-v26/​appicon_round.xml Defines the round adaptive icon.
src/​Android/​Platforms/​Android/​Resources/​drawable/​splash_screen.xml Defines the splash-screen layout.
src/​Android/​Platforms/​Android/​MainApplication.cs Adds the MAUI application entry point.
src/​Android/​Platforms/​Android/​MainActivity.cs Configures the activity and system-bar insets.
src/​Android/​Platforms/​Android/​AndroidManifest.xml Defines Android application metadata.
src/​Android/​Platforms/​Android/​AndroidClipboardBridge.cs Implements native clipboard access.
src/​Android/​MauiProgram.cs Configures MAUI and shared application services.
src/​Android/​MainPage.cs Hosts Blazor and registers the clipboard bridge.
src/​Android/​AndroidMauiApp.cs Creates the application window.
src/​Android/​Android.csproj Defines Android build and host configuration.
README.md Documents the expanded project structure.
global.json Updates SDK, workload, and build-tool versions.
eng/​Wap/​Wap.wapproj Adds conditional Windows packaging project loading.
eng/​Wap/​Package.appxmanifest Defines Windows package identity and capabilities.
eng/​Wap/​Core.props Configures desktop packaging and assets.
eng/​BuildTools/​snapshots/​Razor.json Updates the diagnostic output language.
eng/​BuildTools/​snapshots/​Cshtml.json Updates the diagnostic output language.
eng/​BuildTools/​snapshots/​Cshtml.GlobalOutputs.2.Text.txt Refreshes decompiled C# expectations.
eng/​BuildTools/​snapshots/​Cshtml.GlobalOutputs.1.Text.txt Refreshes decompiler source mappings.
eng/​BuildTools/​snapshots/​CSharp.json Updates the diagnostic output language.
eng/​BuildTools/​BuildTools.csproj Updates the generator target framework and watch handling.
DotNetLab.slnx Adds native projects, packaging, and platform configurations.
Directory.Packages.props Updates dependencies and adds native-host packages.
Directory.Build.targets Includes static assets in packaging outputs.
Directory.Build.props Adds build-copy optimizations and runtime-async configuration.
.vscode/​tasks.json Adds a desktop watch task.
.vscode/​settings.json Customizes workspace status-bar colors.
.vscode/​launch.json Adds Desktop and MAUI launch configurations.
.gitignore Excludes signing keystores.
.github/​workflows/​pack-desktop.yml Adds desktop testing, packaging, and Store submission automation.
.github/​workflows/​pack-android.yml Adds Android signing and Play Store publishing.
.github/​workflows/​deploy-info.yml Expands deployment-info triggers to all PR branches.
.github/​workflows/​deploy-cleanup.yml Expands cleanup triggers to all PR branches.
.github/​workflows/​build.yml Updates branch triggers, incremental checks, and test invocation.
.github/​actions/​setup/​action.yml Installs the Android workload alongside WebAssembly workloads.

Review effort: Max

Comment thread .github/workflows/pack-desktop.yml Resolved
Comment thread src/Desktop/NativeMethods.cs Resolved
Comment thread src/Compiler/Compiler.cs Resolved
Comment thread src/Compiler/SourceGeneratorLoader.cs Resolved
Copilot AI max review requested due to automatic review settings October 28, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

An unsafe pointer signature blocks Desktop and UnitTests builds, while missing Android INTERNET permission and source-generator execution and loading defects break required functionality.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Filter generators by supported CSharp language

src/​Compiler/​SourceGeneratorLoader.cs:193

Checking only the attribute's type name ignores its supported languages. A language-neutral analyzer DLL can contain both C# and Visual Basic generators, so a type marked [Generator(LanguageNames.VisualBasic)] is currently instantiated and passed to the C# generator driver as well. This can produce VB source or generator-failure diagnostics in a C# compilation. Filter the attribute's Languages for CSharp before loading the generator.

5 resolved since last review

Review effort: Max

@jjonescz
jjonescz merged commit 66337a1 into main Oct 29, 2026
7 checks passed
@jjonescz
jjonescz deleted the local-roslyn-to-main branch October 29, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants