Is there any way to tell pulumi to not compile a p...
# dotnet
Is there any way to tell pulumi to not compile a project twice?
When is it compiling twice? Like for preview & up separately? For dotnet & golang you can pre-compile yourself and then point Pulumi to the binaries via project settings, but when you do that you lose plugin-discovery so you have to take responsibility for running “Pulumi plugin install” on the correct plugins/versions that you need
That reminds me, we really need a way to discover the plugin versions at compile time. (When using the automation api and pre-compiling to binaries.) Some sort of source generator perhaps?
I have an open PR for this that has since been abandoned and it possibly had its own issues, I think source generators would be a novel/fitting solution for this. On compile you could do the dependency search and generate an implementation for some IPluginProvider or something that just has those constant values written in. That would definitely work and I think is worth pursuing.
Got a link to your PR so I can see what it did around
I believe I made up that interface just spitballing. You'd want to generate some service that would then be invoked on plug-in discovery. I think this would only work for stand-alone Pulumi programs and not for inline programs but I guess that was always a problem with plug-in discovery. Here’s the PR: Note that it's targeting an old master branch
👍 2