Skip to content

gorge(Ex) fails after a few calls on OSX #12337

Closed
@genotrance

Description

@genotrance

Reproduced on 0.19.6 - devel on OSX only.

Failure linked above is because gorgeEx returns output of "" and error code -1. Failing line of code is here. bash exists on OSX but gorgeEx does not even run. From the code, looks like we are getting an OSError or IOError.

I created a simpler snippet that fails consistently on my OSX laptop at the 123rd iteration.

import macros

proc run(): string =
  for i in 0 .. 200:
    let (x, y) = gorgeEx("which bash")
    doAssert y == 0, "Failed in loop " & $i & ", return value was " & $y
    result &= x & "\n"

macro gen(): untyped =
  var
    name = newIdentNode("abc")
  result = newNimNode(nnkStmtList)
  result.add(quote do:
    const `name` = run()
  )

  echo result.repr

gen()

echo abc

Curious how to debug further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions