class Rake::InvocationChain

def append(invocation)

if the invocation already listed.
Append an invocation to the chain of invocations. It is an error
def append(invocation)
  if member?(invocation)
    fail RuntimeError, "Circular dependency detected: #{to_s} => #{invocation}"
  end
  conj(invocation)
end