I got really annoyed by this, so i decided to dig a bit more.
    
    
    $ nimble install pixie --debug
        Reading official package list
    Downloading https://github.com/treeform/pixie using git
        Cloning latest tagged version: 5.0.2
      Executing git clone --recursive --depth 1 -b 5.0.2 
https://github.com/treeform/pixie 
/var/folders/76/60fp513x38991r0s6cg_npcw0000gp/T/nimble_40295/githubcom_treeformpixie
    
    
    Run

this still hangs.

After debugging i discovered that nimble hangs in `io.nim` procedure `readLine` 
of the `File` type:
    
    
    var fgetsSuccess: bool
        while true:
          # fixes #9634; this pattern may need to be abstracted as a template 
if reused;
          # likely other io procs need this for correctness.
          fgetsSuccess = c_fgets(cast[cstring](addr line[pos]), sp.cint, f) != 
nil
          if fgetsSuccess: break
          when not defined(nimscript):
            if errno == EINTR:
              errno = 0
              c_clearerr(f)
              continue
          checkErr(f)
          break
    
    
    Run

It's basically hanging in fgets and it never exits the while true. breaking in 
the debugger, it always breaks into the fgets.

Then decided to try the same command nimble is executing in a nim program:
    
    
    import std/osproc
    
    when isMainModule:
      let cmd = "git clone --config core.autocrlf=false --recursive --depth 1 
-b 5.0.2 " &
        "https://github.com/treeform/pixie " &
        
"/var/folders/76/60fp513x38991r0s6cg_npcw0000gp/T/nimble_43913/githubcom_treeformpixie"
      
      execCmdEx(cmd)
    
    
    Run

and it still hangs for me at the execCmdEx (execProcess and friends produce the 
same issue).

But then i tried a simple stupid C program, and this magically works.
    
    
    #include <stdio.h>
    #include <stdlib.h>
    
    int main()
    {
        system("git clone --config core.autocrlf=false --recursive --depth 1 -b 
5.0.2 "
            "https://github.com/treeform/pixie "
            
"/var/folders/76/60fp513x38991r0s6cg_npcw0000gp/T/nimble_43913/githubcom_treeformpixie");
        
        return 0;
    }
    
    
    Run

So there is something fishy in the nim io internals.

Reply via email to