Closed pb-cdunn closed 5 years ago
If I copy a working foo.nimble
from another repo, it fails here. That means the actual failure is not in the .nimble
file itself. Something else in the directory is the problem. I need much more information to debug this.
Here is the repo: https://github.com/jangko/msgpack4nim
Maybe someone else could figure out the problem?
Yeah, if I copy the "bad" .nimble into a different repo, it works fine there. So there is a problem in the directory, is nimble is not tell me.
I've copied my older nimble, built as part of nim-0.19, and it's working fine. I think there is a pretty serious problem with nimble in the 0.20.0
release.
@genotrance can you take a look?
I just tried this in multiple ways and didn't see any issue with that package. It works with NIMBLE_DIR set, with --nimbleDir and without as well. I tried on Ubuntu.
I presume you were in /pbi/flash/cdunn/repo/nim-falcon/repos/msgpack4nim
directory when you ran those commands.
Note that nimble now needs nim in the path to process the nimble file since it no longer embeds the compiler. It seems you are running nimble by providing the full path.
@dom96 - seems like we need a --nim
flag like testament or allow adding nim location in the ini file to support this usage.
@pb-cdunn can you please confirm if Nim isn't in the path and if you add it, it works for you?
nim
is in $PATH
for sure. I was getting nim
and nimble
from the same directory.
I'm disappointed that this is not reproducible. I can't spend a huge amount of time on each new Nim installation. I simply installed Nim as I've always done -- from csources -- and hit this strange problem. So I copied an old nimble
into Nim/bin
and it worked.
When I have time, I will try another full Nim installation from devel
and see if it happens again. I have not had a problem using nimble
from GitHub, so I assumed there was a problem with how the Nim release acquires Nimble source-code.
I just ran into this one. Clearing /tmp/nimblecache
worked for me. The pkgxyz.ini
were full of weird escaped debug
output from when I was debugging the compiler. I vaguely remember the no-compiler PR passing info via stdin/stderr so maybe connected?
@dumjyl - can you please clarify further? Are you saying the ini file generated by nocompiler was garbled? How is this connected to stdout? Is there some known issue in 0.20.0?
@pb-cdunn - can you please share the contents of /tmp/nimblecache/msgpack4nim-*
if you can still reproduce the issue? And then delete /tmp/nimblecache
and try again?
Are you saying the ini file generated by nocompiler was garbled?
The file looks like this:
{
"kind": [34m"tyRange"[0m,
"id": [33m3606[0m,
"sym": {
"kind": [34m"skType"[0m,
"name": [32m"Positive"[0m,
# ... more ast output ...
"kind": [34m"nkIntLit"[0m,
"intVal": [33m9223372036854775807[0m
}]
}
}
[Package]
version: """0.10.2"""
author: """Dominik Picheta"""
description: """Nim package manager."""
license: """BSD"""
srcdir: """src"""
backend: """c"""
installExt: "nim"
bin: "nimble"
[Deps]
requires: "nim >= 0.13.0"
How is this connected to stdout?
That output is from this https://github.com/nim-lang/Nim/blob/devel/compiler/astalgo.nim#L34 which outputs via stdout. This is for debugging the compiler and should not make it into a real/release version of the compiler, but could be a way to reproduce the issue. The stderr/stdout comment was partly speculation from a comment that I kinda remember from irc. I realize the 'weird escaping' is just terminal coloring.
Is there some known issue in 0.20.0?
This was from debugging something unrelated to this nimble issue. So nothing relevant.
Hopefully this is more helpful.
This basically suggests not using stdout for returning info to nimble from nim e
since compiler could spit out random stuff that would garble the ini file.
Considering we use the outfile for json, I propose updating the code to use the same mechanism for printPkgInfo
as well. That way, only the content generated will go into the ini file and not any other debug/warning info from the compiler.
@dom96 - please confirm and I'll make this update to make it more resilient.
% cat /tmp/nimblecache/falcon_6979361620520236082/falcon.ini
thisDir:/pbi/flash/cdunn/repo/nim-falcon
HELLO in nim-falcon/configs.nim
[Package]
version: """0.0.0"""
author: """Christopher Dunn"""
Yep, I think it's my debugging output from my config.nims
:
% cat config.nims
#--parallelBuild:0
echo "thisDir:", thisDir()
--debuginfo
--listCmd
echo "HELLO in nim-falcon/configs.nim"
I just pushed a branch with a fix for this - can you please verify?
https://github.com/genotrance/nimble/tree/nocompiler-fixes-3
Verified.
Use koch --latest nimble
to get this fix in an existing install.
That happens with the nimble in
0.20
ondevel
. Different versions of nimble work fine for me. Could I have done something wrong?