Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
0.9.24-beta.2: Infinite new-process recursion using dub decribe within preGenerateCommands #616
For me it hangs in the pre-generate command of "gen-package-version". I have a lot of "bootstrap.exe" processes visible in task manager. The only thing that happens within DUB is a
I've dug a little more and it turns out that it's hanging inside a nested invocation of dub. But we didn't notice that because one of my tools is capturing the stdout for that invocation instead of being forwarding it through to the console.
auto rawJson = runCollect("dub describe");
auto rawJson = run("dub describe --vverbose");
Then try again and you'll notice that invocation of dub is hanging right after several lines of
Figured out what's happening:
On one hand, it does make some sense that
Oh, that makes sense. One trivial possibility, which I actually almost had implemented because I already stumbled over something similar, would be to add a
But that IMO wouldn't be completely satisfying, because it's opt-in and thus will still be easy to get wrong. At least it would require an additional warning/error message in case of recursive invocations. But if we have that logic, we can as well replace the proposed switch by that automated logic.
So... any idea for the recursion detection other than creating a temporary
PS: Another idea: add a
Actually, I was just about to suggest the reverse:
My only (small) concern with the envvar approach is possible confusion when querying sourceFiles yields different results (fewer files) inside of pre/postGenerateCommands than outside. But that does actually make sense too though, and it'd probably be easier for users than needing to choose "Do I want --run-generate-commands or not"?