@@ -106,7 +106,7 @@ func (host *wasmHost) GetModuleInstance(ctx context.Context, plugin *plugins.Plu
106106 span , ctx := utils .NewSentrySpanForCurrentFunc (ctx )
107107 defer span .Finish ()
108108
109- cfg := getModuleConfig (ctx , buffers )
109+ cfg := getModuleConfig (ctx , buffers , plugin )
110110 mod , err := host .runtime .InstantiateModule (ctx , plugin .Module , cfg )
111111 if err != nil {
112112 return nil , fmt .Errorf ("failed to instantiate the plugin module: %w" , err )
@@ -127,7 +127,7 @@ func (host *wasmHost) CompileModule(ctx context.Context, bytes []byte) (wazero.C
127127 return cm , nil
128128}
129129
130- func getModuleConfig (ctx context.Context , buffers utils.OutputBuffers ) wazero.ModuleConfig {
130+ func getModuleConfig (ctx context.Context , buffers utils.OutputBuffers , plugin * plugins. Plugin ) wazero.ModuleConfig {
131131
132132 // Get the logger and writers for the plugin's stdout and stderr.
133133 log := logger .Get (ctx ).With ().Bool ("user_visible" , true ).Logger ()
@@ -155,7 +155,7 @@ func getModuleConfig(ctx context.Context, buffers utils.OutputBuffers) wazero.Mo
155155 // And https://gophers.slack.com/archives/C040AKTNTE0/p1719587772724619?thread_ts=1719522663.531579&cid=C040AKTNTE0
156156 cfg := wazero .NewModuleConfig ().
157157 WithName ("" ).
158- WithStartFunctions ("_initialize" , "_start" ).
158+ WithStartFunctions (plugin . StartFunction ).
159159 WithSysWalltime ().WithSysNanotime ().
160160 WithRandSource (rand .Reader ).
161161 WithStdout (wOut ).WithStderr (wErr ).
0 commit comments