When I call 'nim doc foo.nim' with version 1.4.4 the following error shows up:
Error: unknown substition variable: attype
A quick search revealed the problem in '/etc/nim/nimdoc.cfg'
...
# Chunk of HTML emitted for each entry in the HTML table of contents.
# See doc.item for available substitution variables.
doc.item.toc = """
<li><a class="reference" href="#$itemSymOrIDEnc"
title="$header_plain">$name<span class="attachedType">$attype</span></a></li>
"""
# This is used for TOC items which are grouped by the same name (e.g. procs).
doc.item.tocTable = """
<li><a class="reference" href="#$itemSymOrIDEnc"
title="$header_plain">$itemSymOrID<span class="attachedType">$attype</span></a></li>
"""
...
I installed nim with the archlinux package manager and there might be something missing.
Any help is appreciated ...
that line in the nimdoc.cfg changed in v1.4.2. pacman doesn't overwrite config files when upgrading: (arch wiki) I expect you have a .pacnew file with the upgrade that you need to move over. I recommend pacmatic for upgrading, it prompts you about config file changes
i know it goes against the arch way, but i also recommend using choosenim (in the aur) to maintain and install nim versions, it'll let you switch easily between stable/devel should that interest you.
Thank you very much. It is exactly as you write.
I overlooked it twice. shame on me :(
I would love to use choosenim but it is not running anymore without IPv6 :(
oserr.nim(94) raiseOSError
Error: unhandled exception: Address family not supported by protocol [OSError]
I'm not allowed to use IPv6 :(It's not working neither.
After nimble install choosenim there is a problem installing nimterop ...
stack trace: (most recent call last)
cpp.nim(7, 21) cpp
setup.nim(38, 10) treesitterCppSetup
shell.nim(366, 42) gitPull
shell.nim(335, 34) gitAtCheckout
shell.nim(90, 11) execAction
assertions.nim(30, 26) failedAssertImpl
assertions.nim(23, 11) raiseAssert
fatal.nim(49, 5) sysFatal
/usr/lib/nim/system/fatal.nim(49, 5) Error: unhandled exception: shell.nim(90, 7) `not die` Command failed: 128
After fixing the bug as you recommended to me I am not out of trouble. The nim doc ... command now causes the same bug as described a few forum entries earlier https://forum.nim-lang.org/t/7679
I have the impression that downloading via the packet manager might cause some instability.
But my internet connection is not the best today, I'll give another try tomorrow.
i got that error too when trying to install nimterop, due to my crappy internet and an interrupted download. the problem was a git clone left an empty folder somewhere. I think nimble uninstall nimterop and nimble install nimterop should do it, or rm -rf ~/.nimble/pkgs/nimterop* manually
i'm sorry you're having so much trouble, i saw the nim doc issue too, other than getting choosenim to work i'm afraid the only workaround for the moment is to to create a symlink from /usr/doc to /usr/share/nim/doc which is pretty unpalatable.
There was no nimterop to remove, only a nimble-#8f7af86 from yesterday, which very much looks like an interrupted git clone. I kicked it and running nimble install choosenim again produces the same error. I send you this time the full error msg ...
[user71383@Lenovo ~]$ nimble install choosenim
Downloading https://github.com/dom96/choosenim using git
Verifying dependencies for [email protected]
Info: Dependency on nimble@#8f7af86 already satisfied
Verifying dependencies for nimble@#8f7af86
Installing nimterop@>= 0.6.12
Downloading https://github.com/genotrance/nimterop using git
Verifying dependencies for [email protected]
Info: Dependency on regex@>= 0.15.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on unicodedb@>= 0.7.2 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on cligen@>= 1.0.0 already satisfied
Verifying dependencies for [email protected]
Installing [email protected]
Building nimterop/nimterop/loaf using c backend
Building nimterop/nimterop/toast using c backend
# Resetting /home/user71383/.cache/nim/nimterop/nimterop/treesitter
# Resetting /home/user71383/.cache/nim/nimterop/nimterop/treesitter_c
# Resetting /home/user71383/.cache/nim/nimterop/nimterop/treesitter_cpp
stack trace: (most recent call last)
cpp.nim(7, 21) cpp
setup.nim(38, 10) treesitterCppSetup
shell.nim(366, 42) gitPull
shell.nim(335, 34) gitAtCheckout
shell.nim(90, 11) execAction
assertions.nim(30, 26) failedAssertImpl
assertions.nim(23, 11) raiseAssert
fatal.nim(49, 5) sysFatal
/usr/lib/nim/system/fatal.nim(49, 5) Error: unhandled exception: shell.nim(90, 7) `not die` Command failed: 128
cmd: cd /home/user71383/.cache/nim/nimterop/nimterop/treesitter_cpp && git log --decorate --no-color -n 1 --format=oneline
result:
fatal: your current branch 'master' does not have any commits yet [AssertionDefect]
Prompt: Build failed for '[email protected]', would you like to try installing 'nimterop@#head' (latest unstable)? [y/N]
I typed Y and the same error msg showed up again. I spare you the output.
That looks suspicious to me:
fatal: your current branch 'master' does not have any commits yet [AssertionDefect]
I'm happy to help you in return, there is no need to apologise. And its only the documentation, everything else runs fine :)
Yep, it ran through this time and Success: choosenim installed successfully. showed up on the screen.
And nim doc ... is working fine again :)
Thank you very much.
FYI:
I found another remainder from the interrupted download ...
~/.nimble/bin/nimble linked to ../pkgs/nimble-#8f7af86/nimble