https://pulumi.com logo
#dotnet
Title
a

able-camera-57198

12/03/2021, 2:56 AM
Is there any way to tell pulumi to not compile a project twice?
b

bored-oyster-3147

12/04/2021, 5:46 PM
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
w

worried-city-86458

12/07/2021, 6:32 PM
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?
b

bored-oyster-3147

12/07/2021, 11:09 PM
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.
w

worried-city-86458

12/07/2021, 11:11 PM
Got a link to your PR so I can see what it did around
IPluginProvider
?
b

bored-oyster-3147

12/07/2021, 11:16 PM
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: https://github.com/pulumi/pulumi/pull/6951 Note that it's targeting an old master branch
👍 2