zqqw / pakku

Pacman wrapper with AUR support
GNU General Public License v3.0
39 stars 3 forks source link

Nim 1.5 build issues #9

Closed zqqw closed 3 years ago

zqqw commented 3 years ago
==> Starting build()...
NIM: src/pakku
pakku/src/utils.nim(295, 34) Warning: Deprecated since 1.5; TaintedString is deprecated [Deprecated]
pakku/src/feature/syncinstall.nim(210, 52) template/generic instantiation of `createCloneProgress` from here
pakku/src/feature/syncinstall.nim(42, 3) Error: cannot instantiate: 'result:type'
make: *** [Makefile:120: src/pakku] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

Fix for TaintedString warning, but not the last bit:
diff --git a/src/utils.nim b/src/utils.nim
index 1f58b8f..5cd33f6 100644
--- a/src/utils.nim
+++ b/src/utils.nim
@@ -292,13 +292,13 @@ proc execRedirect*(args: varargs[string]): int =
     return -1
   var outp = outputStream(p)
   close(inputStream(p))
-  var line = newStringOfCap(120).TaintedString
+  var line = newStringOfCap(120)
   while true:
     if outp.readLine(line):
       if writeFlag == false:
-        echo line.string
+        echo line
       else:
-        discard write(fd[1], line.string.cstring, len(line.string))
+        discard write(fd[1], line.cstring, len(line))
         discard write(fd[1], "\n".cstring, 1)
     else:
       code = peekExitCode(p)

(TaintedString wasn't really doing much here, it got included with something that I had adapted from elsewhere)

The last bit is something related to the update/terminate closures again, and I'll also try another newer build of nim-git as that was one built on the 14th.

zqqw commented 3 years ago
 proc createCloneProgress(config: Config, count: int, flexible: bool, printMode: bool):
-  (proc (update: int, terminate: int) {.closure.}, proc {.closure.}) =
+  (proc(update: int, terminate: int) {.closure.}, proc() {.closure.}) =

That's what I had so far after reading your suggestion on the other bug which compiled at nim-git 0286a0879bc44e5267a5fd36e6f4aac8f78713ea, and it ran pakku -Syu. I will get back to this later now. I see there is another change in your patch too in src/format.nim, thank you, not sure what issue that fixes?