nim-lang / nimble

Package manager for the Nim programming language.
https://nim-lang.github.io/nimble/index.html
Other
1.25k stars 191 forks source link

Compiler warnings end up in nimblecache package.ini #694

Closed zevv closed 5 years ago

zevv commented 5 years ago

This nimble file:

# Package

version       = "0.1.3"
author        = "Ico Doornekamp"
description   = "Nim Z3 theorem prover bindings"
license       = "MIT"
srcDir        = "src"
installExt    = @["nim"]

# Dependencies

requires "nim >= 0.19.0"

Results in a nasty error when trying to do anything with nimble, for example nimble check:

nimble check
     Error: Could not validate package:
        ... Could not read package info file in /home/ico/sandbox/prjs/nimz3/z3.nimble;
        ...   Reading as ini file failed with: 
        ...     Invalid section: .
        ...   Evaluating as NimScript file failed with: 
        ...     Invalid field: /home/ico/sandbox/prjs/nimz3/z3_19831.nims.

The problem seems to be that a compiler warning message ends up in the nimblecache/z3.ini file:

/home/ico/sandbox/prjs/nimz3/z3_19831.nims(5, 22) Warning: imported and not used: 'strutils' [UnusedImport]
zevv commented 5 years ago

In deb20ee57a71476610a3cc6e149c04d1b8c0a74f sending stderr of nim e to stdout was explicitly enabled:

-    result = execCmdEx(cmd, options = {poUsePath})
+    result = execCmdEx(cmd, options = {poUsePath, poStdErrToStdOut})

Reverting this commit seems to fix my problem.

dom96 commented 5 years ago

I wonder if this is the same issue as #693. Definitely similar at least.

genotrance commented 5 years ago

This is fixed in https://github.com/nim-lang/nimble/pull/667.

Per @zevv, koch wasn't rebuilt so it was still pulling the older version of nimble.