hlb
hlb copied to clipboard
add infinite loop detection
This is a confusing edge case that is hard to debug. If we are lucky we will get a stack overflow error, but depending on the graph to get to the loop this might take hours. Here is a simple repro:
fs cycle() {
copy cycle "/" "/"
}
hlb run -t cycle ./test.hlb
[+] Building 0.0s (0/0)
runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc020b60370 stack=[0xc020b60000, 0xc040b60000]
fatal error: stack overflow