#I assume shut down is triggered by
1 messages · Page 1 of 1 (latest)
We're working on formalizing the interface there so it can be documented (https://github.com/dagger/dagger/issues/3830), but in the meantime, yeah it's intentional that it shutsdown once the stdin is closed (helps ensure it always shuts down when the parent dies)
In general, how are you trying to invoke it? Did you take a look at how it's called out to in the various existing SDKs? I.e. go here: https://github.com/dagger/dagger/blob/dea51153c37566831d1075479f708d7d51bbcf5d/sdk/go/internal/engineconn/dockerprovision/dockerprovision.go#L35
That approach with Diagnostics.Process doesn't seem to satisfy the Go library. I'll keep poking around. https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.standardinput?view=net-6.0
Oh okay interesting, so you're basically saying that in Windows if you try to read from the stdin like that you'll end up with an error or something?
In general, while we want to support windows of course we're currently limited by lack of automated testing (https://github.com/dagger/dagger/issues/3462) so things are extra hit-or-miss right now. Anything you encounter that seems like it doesn't work well on windows is something we want to know about so we can fix it up though.
It's not an error. The process blocks further shell execution. If I redirect stdin Go sees it as a closed stream and exits. If I comment out the above lines, it runs perpetually in the background.
I could wrap that in an OS check, but I don't want to change expected behavior.
I'll test on PowerShell in Linux as well. I assume this is .Net or PowerShell related and not platform.
I think I've got it. I wasn't keeping the IO.StreamWriter object in scope and it was being Disposed and closing the stream.
Or so I thought 😞
So, did you find how to fix it, now?