choosenim icon indicating copy to clipboard operation
choosenim copied to clipboard

assortment of bugs with some choosenim commands

Open timotheecour opened this issue 4 years ago • 15 comments

Somehow choosenim on windows keeps breaking regularly. Today, nothing seems to work.

on windows in this bug.

choosenim -v choosenim v0.5.1 (2020-01-15 06:05:40) [windows/amd64]

  • [x] bug 1: choosenim update self; EDIT: works after manually downloading/installing v0.6 from release page (see below) Updating choosenim
[#                                                 ] 0mb 4kb/s
httpclient.nim(1053)     downloadFile
Error: unhandled exception: 404 Not Found [HttpRequestError]

(note: i do have internet)

  • [x] bug 2: choosenim update latest; EDIT: invalid command
   Updating latest
fatal.nim(39)            sysFatal
Error: unhandled exception: version.nim(43, 11) `ver.len == 0 or ver[0] in {'#', '\x00'} + Digits` Wrong version: latest [AssertionError]
  • [ ] bug 3: choosenim 1.2.0
choosenim 1.2.0
Switched to Nim 1.2.0
C:\Users\timothee>choosenim --verbose #c2699648604cc57cd55ecd7d88ccd55ed38099fb
Info: No client ID found in 'C:\Users\timothee\.choosenim\analytics', not sending analytics.
Info: No client ID found in 'C:\Users\timothee\.choosenim\analytics', not sending analytics.
Warning 'C:\Program' is not recognized as an internal or external command,
... operable program or batch file.
... git ls-remote failed
Downloading Nim c2699648604cc57cd55ecd7d88ccd55ed38099fb from GitHub
Info: C:\Users\timothee\.choosenim\downloads\c2699648604cc57cd55ecd7d88ccd55ed38099fb.tar.gz already downloaded
Extracting c2699648604cc57cd55ecd7d88ccd55ed38099fb.tar.gz
Can't create '\\?\C:\Users\timothee\AppData\Local\Temp\nimarchive-4228026316\Nim-c2699648604cc57cd55ecd7d88ccd55ed38099fb\bin\nim-gdb.bash': -25
Info: No client ID found in 'C:\Users\timothee\.choosenim\analytics', not sending analytics.
Info: No client ID found in 'C:\Users\timothee\.choosenim\analytics', not sending analytics.
Error: Unable to extract. Error was 'The process cannot access the file because it is being used by another process.
... '.

note: not sure if related, but I ^C on a previous call to choosenim 1.2.0 (but this shouldn't break choosenim, especially after I restarted windows and deleted C:\Users\timothee\AppData\Local\Temp\nimarchive-4228026316 etc)

  • [ ] bug 4: choosenim #c2699648604cc57cd55ecd7d88ccd55ed38099fb
choosenim --verbose #c2699648604cc57cd55ecd7d88ccd55ed38099fb
Info: No client ID found in 'C:\Users\timothee\.choosenim\analytics', not sending analytics.
Info: No client ID found in 'C:\Users\timothee\.choosenim\analytics', not sending analytics.
Warning 'C:\Program' is not recognized as an internal or external command,
... operable program or batch file.
... git ls-remote failed
Downloading Nim c2699648604cc57cd55ecd7d88ccd55ed38099fb from GitHub
Info: C:\Users\timothee\.choosenim\downloads\c2699648604cc57cd55ecd7d88ccd55ed38099fb.tar.gz already downloaded
Extracting c2699648604cc57cd55ecd7d88ccd55ed38099fb.tar.gz
Can't create '\\?\C:\Users\timothee\AppData\Local\Temp\nimarchive-4228026316\Nim-c2699648604cc57cd55ecd7d88ccd55ed38099fb\bin\nim-gdb.bash': -25
Info: No client ID found in 'C:\Users\timothee\.choosenim\analytics', not sending analytics.

Info: No client ID found in 'C:\Users\timothee\.choosenim\analytics', not sending analytics.
Error: Unable to extract. Error was 'The process cannot access the file because it is being used by another process.
... '.
  • [ ] bug 5: nimble install choosenim
Installing choosenim@#head
Building choosenim/choosenim.exe using c backend
Tip: 114 messages have been suppressed, use --verbose to show them.
Error: Build failed for package: choosenim
... Details:
... Execution failed with exit code 1
... Command: "C:\Users\timothee\.nimble\bin\nim.exe" c --noNimblePath -d:NimblePkgVersion=0.6.0 -d:release --path:"C:\Users\timothee\.nimble\pkgs\nimble-#5bb795a"
--path:"C:\Users\timothee\.nimble\pkgs\nimarchive-0.3.6"
--path:"C:\Users\timothee\.nimble\pkgs\nimterop-0.4.4"
--path:"C:\Users\timothee\.nimble\pkgs\regex-0.13.1"
--path:"C:\Users\timothee\.nimble\pkgs\unicodedb-0.9.0"
--path:"C:\Users\timothee\.nimble\pkgs\unicodeplus-0.6.0"
--path:"C:\Users\timothee\.nimble\pkgs\unicodedb-0.9.0"
--path:"C:\Users\timothee\.nimble\pkgs\segmentation-0.1.0"
--path:"C:\Users\timothee\.nimble\pkgs\unicodedb-0.9.0"
--path:"C:\Users\timothee\.nimble\pkgs\cligen-0.9.42"
--path:"C:\Users\timothee\.nimble\pkgs\libcurl-1.0.0"
--path:"C:\Users\timothee\.nimble\pkgs\analytics-0.2.0"
--path:"C:\Users\timothee\.nimble\pkgs\uuids-0.1.10"
--path:"C:\Users\timothee\.nimble\pkgs\isaac-0.1.3"
--path:"C:\Users\timothee\.nimble\pkgs\osinfo-0.3.2"
--path:"C:\Users\timothee\.nimble\pkgs\osinfo-0.3.2"
-o:"C:\Users\timothee\AppData\Local\Temp\nimble_1452\githubcom_dom96choosenim_#head\bin\choosenim.exe" "C:\Users\timothee\AppData\Local\Temp\nimble_1452\githubcom_dom96choosenim_#head\src\choosenim.nim"
... Output: Hint: used config file 'C:\Users\timothee\.choosenim\toolchains\nim-1.2.0\config\nim.cfg' [Conf]
... Hint: used config file 'C:\Users\timothee\AppData\Roaming\nim\config.nims' [Conf]
... # Resetting C:\Users\timothee\nimcache\nimterop\nimarchive\bzip2
... # Running make -j 4 libbz2.a
... #
Path: C:\Users\timothee\nimcache\nimterop\nimarchive\bzip2
... stack trace: (most recent call last)
... C:\Users\timothee\.nimble\pkgs\nimterop-0.4.4\nimterop\build.nim(1032, 23)
... C:\Users\timothee\.nimble\pkgs\nimterop-0.4.4\nimterop\build.nim(802, 9) buildLibrary
... C:\Users\timothee\.nimble\pkgs\nimterop-0.4.4\nimterop\build.nim(619, 18) make
... C:\Users\timothee\.nimble\pkgs\nimterop-0.4.4\nimterop\build.nim(105, 11) execAction
... C:\Users\timothee\.choosenim\toolchains\nim-1.2.0\lib\system\assertions.nim(29, 26) failedAssertImpl
... C:\Users\timothee\.choosenim\toolchains\nim-1.2.0\lib\system\assertions.nim(22, 11) raiseAssert
... C:\Users\timothee\.choosenim\toolchains\nim-1.2.0\lib\system\fatal.nim(49, 5) sysFatal
... C:\Users\timothee\AppData\Local\Temp\nimble_1452\githubcom_dom96choosenim_#head\src\choosenim.nim(9, 1) template/generic instantiation from here
... C:\Users\timothee\AppData\Local\Temp\nimble_1452\githubcom_dom96choosenim_#head\src\choosenimpkg\download.nim(10, 1) template/generic instantiation from here
... C:\Users\timothee\AppData\Local\Temp\nimble_1452\githubcom_dom96choosenim_#head\src\choosenimpkg\telemetry.nim(13, 1) template/generic instantiation from here
... C:\Users\timothee\AppData\Local\Temp\nimble_1452\githubcom_dom96choosenim_#head\src\choosenimpkg\utils.nim(4, 1) template/generic instantiation from here
... C:\Users\timothee\.nimble\pkgs\nimarchive-0.3.6\nimarchive\bzlib.nim(22, 10) template/generic instantiation of `getHeader` from here

C:\Users\timothee\.choosenim\toolchains\nim-1.2.0\lib\system\fatal.nim(49, 5) Error: unhandled exception: 
C:\Users\timothee\.nimble\pkgs\nimterop-0.4.4\nimterop\build.nim(105, 16) `false` Command failed: 2

... cmd: cmd /c C: && cd C:\Users\timothee\nimcache\nimterop\nimarchive\bzip2 && make -j 4 libbz2.a
... result:
... cc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c
... Makefile:120: recipe for target 'huffman.o' failed
... process_begin: CreateProcess(NULL, cc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c, ...) failed.
... make (e=2): The system cannot find the file specified.
... make: *** [huffman.o] Error 2
... make: *** Waiting for unfinished jobs....
... If compilation produces errors, or a large number of warnings,
... please read README.COMPILATION.PROBLEMS -- you might be able to
... adjust the flags in this Makefile to improve matters.
... Also in README.COMPILATION.PROBLEMS are some hints that may help
... if your build produces an executable which is unable to correctly
... handle so-called 'large files' -- files of size 2GB or more.
... cc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c
... Makefile:117: recipe for target 'blocksort.o' failed
... process_begin: CreateProcess(NULL, cc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c, ...) failed.
... make (e=2): The system cannot find the file specified. 
... make: *** [blocksort.o] Error 2
...
[AssertionError]
  • [x] bug 6: choosenim #head ; EDIT: works after updating to v0.6 this "works" but installs an old head because I had already called choosenim #head some time before; it seems like a bug to me and should instead install current head.
 Warning 'C:\Program' is not recognized as an internal or external command,
        ... operable program or batch file.
        ... git ls-remote failed
Downloading Nim devel from GitHub
      Info: C:\Users\timothee\.choosenim\downloads\devel.tar.gz already downloaded
 Extracting devel.tar.gz
   Building Nim #head
   Warning: Building from latest C sources. They may not be compatible with the Nim version you have chosen to install.
      Info: C:\Users\timothee\.choosenim\downloads\master.tar.gz already downloaded
 Extracting master.tar.gz
   Building C sources
   Building koch
   Building Nim
   Building tools (nimble, nimgrep, nimpretty, nimsuggest)
   Switched to Nim #head
  • [x] bug 7: choosenim update #head this just gives same bug as bug 3, so I can't update head either

timotheecour avatar Apr 13 '20 22:04 timotheecour

update: after downloading from https://github.com/dom96/choosenim/releases and manually copying choosenim-0.6.0_windows_amd64.exe to /c/Users/timothee/.nimble/bin/choosenim.exe I get:

choosenim -v
choosenim v0.6.0 (2020-03-06 18:45:17) [windows/amd64]

choosenim update self
   Updating choosenim
      Info: Already up to date at version 0.6.0


choosenim update #head
works

so these now work:

  • bug1
  • bug6

but other commands are still broken:

  • bug2

  • bug4

  • bug5

  • bug3 might still be relevant but haven't tried ^C to avoid breaking what I have

timotheecour avatar May 21 '20 23:05 timotheecour

Bug 2 - latest is neither a branch, tag, commit ID nor channel. Use choosenim update stable.

Bug 3 & 4 - looks like git is in Program Files and not running correctly due to the space. A quoteShell() should fix it. Unclear if that's causing the subsequent failures. By the way, both 3 & 4 look the same to me.

Bug 5 - the bzip2 Makefile sets CC=cc. Set the env var CC=gcc and it should work. Are you using clang on Windows by any chance?

Bug 6 - choosenim #head installs the first time. After that it just switches to it if not already selected. I believe you need to do choosenim update #head.

genotrance avatar May 22 '20 04:05 genotrance

updated top post after your input; i'll update it again after https://github.com/dom96/choosenim/pull/198 is merged, hopefully will fix bug3,bug4

Bug 5 - the bzip2 Makefile sets CC=cc. Set the env var CC=gcc and it should work. Are you using clang on Windows by any chance?

nim r --hint:cc --listcmd main shows I'm using gcc.exe

where gcc
C:\Users\timothee\mingw64\bin\gcc.exe
  • [ ] bug8 now I'm getting a different error for bug5:
nimble install choosenim
Downloading https://github.com/dom96/choosenim using git
  Verifying dependencies for [email protected]
   Warning: No .nimble or .nimble-link file found for C:\Users\timothee\.nimble\pkgs\nimble-0.11.0
      Info: Dependency on nimble@#5bb795a already satisfied
  Verifying dependencies for nimble@#5bb795a
      Info: Dependency on nimarchive@>= 0.3.4 already satisfied
       Tip: 7 messages have been suppressed, use --verbose to show them.
     Error: Could not read package info file in C:\Users\timothee\.nimble\pkgs\nimarchive-0.3.6\nimarchive.nimble;
        ...   Reading as ini file failed with:
        ...     Invalid section: .
        ...   Evaluating as NimScript file failed with:
        ...     C:\Users\timothee\.nimble\pkgs\nimarchive-0.3.6\nimarchive_6544.nims(23, 18) Error: cannot open file: nimterop/docs
        ... printPkgInfo() failed.

timotheecour avatar May 22 '20 10:05 timotheecour

The git bugfix has been merged to choosenim head. Also, have fixed the bzlib.h issue on Windows in nimarchive.

Please try latest choosenim head with latest nimarchive.

genotrance avatar May 22 '20 18:05 genotrance

@genotrance how?

all these fail with Error: cannot open file: nimterop/docs

nimble install choosenim # fails
nimble install choosenim@#head  # fails
nimble install nimarchive
nimble install nimarchive@#head

I've noticed that choosenim breaks fairly regularly (unlike most packages I'm using), and I'm curious what's the underlying reason; I'm passing no judgement whatsoever (and thanks for your work on choosenim btw), I'm genuinely interested in figuring out which parts are due to inherent problem complexity vs implementation accidental complexity.

In particular, is there a way to cut down number of dependencies for choosenim (as I wrote in https://github.com/dom96/choosenim/issues/177#issuecomment-585530912) to avoid large surface area of bugs?

timotheecour avatar May 23 '20 01:05 timotheecour

What does nimble path nimterop return? Looks like you have some old version of nimterop@#head lying around without the docs module.

Meanwhile, just comment out the docs task from nimarchive if you want a local build.

genotrance avatar May 23 '20 01:05 genotrance

nimble path nimterop C:\Users\timothee.nimble\pkgs\nimterop-0.1.1

Looks like you have some old version of nimterop@#head lying around without the docs module.

doesn't seem so:

dir C:\Users\timothee\.nimble\pkgs\nimterop-*
 Volume in drive C has no label.
 Volume Serial Number is CE9E-F42C

 Directory of C:\Users\timothee\.nimble\pkgs

02/13/2019  08:53 PM    <DIR>          nimterop-0.1.0
04/13/2020  03:47 PM    <DIR>          nimterop-0.1.1
               0 File(s)              0 bytes
               2 Dir(s)  219,772,878,848 bytes free

timotheecour avatar May 23 '20 01:05 timotheecour

ok i figured out part of the problem:

  • [ ] bug9
  • I had done nimble develop inside choosenim clone (with an old version checked out), so it was picking that up instead of the one in C:\Users\timothee.nimble\pkgs\nimterop-0.1.1 => this seems like a nimble bug, nimble path nimterop was returning C:\Users\timothee.nimble\pkgs\nimterop-0.1.1 instead of C:\Users\timothee\git_clone\choosenim

  • Now I did nimble install nimterop, and it runs into another bug I've seen many times:

  • [ ] bug10
nimble install choosenim # works
nimble path nimterop
C:\Users\timothee\.nimble\pkgs\nimterop-0.5.5

nimble install choosenim # fails
nimble path nimterop
C:\Users\timothee\.nimble\pkgs\nimterop-0.1.1

nimble install choosenim # works
nimble install choosenim # fails
etc
nimble install nimterop
Downloading https://github.com/genotrance/nimterop using git
  Verifying dependencies for [email protected]
   Warning: No .nimble or .nimble-link file found for C:\Users\timothee\.nimble\pkgs\nimble-0.11.0
      Info: Dependency on regex@>= 0.14.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.7.2 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodeplus@>= 0.5.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.8 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on segmentation@>= 0.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.8.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on cligen@>= 0.9.45 already satisfied
  Verifying dependencies for [email protected]
 Installing [email protected]
   Building nimterop/nimterop/toast.exe using c backend
   Success: nimterop installed successfully.

C:\Users\timothee\git_clone\choosenim>nimble path nimterop
C:\Users\timothee\.nimble\pkgs\nimterop-0.5.5

C:\Users\timothee\git_clone\choosenim>nimble install nimterop
Downloading https://github.com/genotrance/nimterop using git
  Verifying dependencies for [email protected]
   Warning: No .nimble or .nimble-link file found for C:\Users\timothee\.nimble\pkgs\nimble-0.11.0
      Info: Dependency on regex@>= 0.14.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.7.2 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodeplus@>= 0.5.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.8 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on segmentation@>= 0.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.8.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on cligen@>= 0.9.45 already satisfied
  Verifying dependencies for [email protected]
 Installing [email protected]
   Building nimterop/nimterop/toast.exe using c backend
    Prompt: [email protected] already exists. Overwrite? [y/N]
    Answer: y
       Tip: 18 messages have been suppressed, use --verbose to show them.
     Error: Could not read package info file in C:\Users\timothee\.nimble\pkgs\nimterop-0.1.1\nimterop.nimble;
        ...   Reading as ini file failed with:
        ...     Invalid section: .
        ...   Evaluating as NimScript file failed with:
        ...     C:\Users\timothee\.nimble\pkgs\nimterop-0.1.1\config.nims(22, 10) Warning: import os.nim instead; ospaths is deprecated [Deprecated]
        ... io.nim(774)              readFile
        ... Error: unhandled exception: cannot open: C:\Users\timothee\.choosenim\toolchains\nim-#head\lib\pure\ospaths.nim [IOError]
        ... printPkgInfo() failed.

timotheecour avatar May 23 '20 02:05 timotheecour

and after that (after an "odd" number of nimble install choosenim so i end up in a successful build), nimble install choosenim fails:

  • [ ] bug11
nimble install choosenim

Downloading https://github.com/dom96/choosenim using git
  Verifying dependencies for [email protected]
   Warning: No .nimble or .nimble-link file found for C:\Users\timothee\.nimble\pkgs\nimble-0.11.0
      Info: Dependency on nimble@#5bb795a already satisfied
  Verifying dependencies for nimble@#5bb795a
      Info: Dependency on nimarchive@>= 0.3.4 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on nimterop@>= 0.3.3 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on regex@>= 0.14.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.7.2 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodeplus@>= 0.5.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.8 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on segmentation@>= 0.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.8.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on cligen@>= 0.9.45 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on libcurl@>= 1.0.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on analytics@>= 0.2.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on uuids@>= 0.1.7 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on isaac@>= 0.1.3 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on osinfo@>= 0.3.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on osinfo@>= 0.3.0 already satisfied
  Verifying dependencies for [email protected]
 Installing [email protected]
   Building choosenim/choosenim.exe using c backend
    Prompt: Build failed for '[email protected]', would you like to try installing 'choosenim@#head' (latest unstable)? [y/N]
    Answer: y
Downloading https://github.com/dom96/choosenim using git
  Verifying dependencies for choosenim@#head
      Info: Dependency on nimble@#5bb795a already satisfied
  Verifying dependencies for nimble@#5bb795a
      Info: Dependency on nimarchive@>= 0.3.4 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on nimterop@>= 0.3.3 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on regex@>= 0.14.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.7.2 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodeplus@>= 0.5.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.8 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on segmentation@>= 0.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.8.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on cligen@>= 0.9.45 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on libcurl@>= 1.0.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on analytics@>= 0.2.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on uuids@>= 0.1.7 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on isaac@>= 0.1.3 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on osinfo@>= 0.3.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on osinfo@>= 0.3.0 already satisfied
  Verifying dependencies for [email protected]
 Installing choosenim@#head
   Building choosenim/choosenim.exe using c backend
       Tip: 71 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: choosenim
        ... Details:
        ... Execution failed with exit code 1
        ... Command: "C:\Users\timothee\.nimble\bin\nim.exe" c --noNimblePath -d:NimblePkgVersion=0.6.0 -d:release --path:"C:\Users\timothee\.nimble\pkgs\nimble-#5bb795a"  --path:"C:\Users\timothee\.nimble\pkgs\nimarchive-0.3.6"  --path:"C:\Users\timothee\.nimble\pkgs\nimterop-0.5.5"  --path:"C:\Users\timothee\.nimble\pkgs\regex-0.15.0"  --path:"C:\Users\timothee\.nimble\pkgs\unicodedb-0.9.0"  --path:"C:\Users\timothee\.nimble\pkgs\unicodeplus-0.6.0"  --path:"C:\Users\timothee\.nimble\pkgs\unicodedb-0.9.0"  --path:"C:\Users\timothee\.nimble\pkgs\segmentation-0.1.0"  --path:"C:\Users\timothee\.nimble\pkgs\unicodedb-0.9.0"  --path:"C:\Users\timothee\.nimble\pkgs\cligen-0.9.47"  --path:"C:\Users\timothee\.nimble\pkgs\libcurl-1.0.0"  --path:"C:\Users\timothee\.nimble\pkgs\analytics-0.2.0"  --path:"C:\Users\timothee\.nimble\pkgs\uuids-0.1.10"  --path:"C:\Users\timothee\.nimble\pkgs\isaac-0.1.3"  --path:"C:\Users\timothee\.nimble\pkgs\osinfo-0.3.2"  --path:"C:\Users\timothee\.nimble\pkgs\osinfo-0.3.2"  -o:"C:\Users\timothee\AppData\Local\Temp\nimble_24596\githubcom_dom96choosenim_#head\bin\choosenim.exe" "C:\Users\timothee\AppData\Local\Temp\nimble_24596\githubcom_dom96choosenim_#head\src\choosenim.nim"
        ... Output: Hint: used config file 'C:\Users\timothee\.choosenim\toolchains\nim-#head\config\nim.cfg' [Conf]
        ... Hint: used config file 'C:\Users\timothee\.choosenim\toolchains\nim-#head\config\config.nims' [Conf]
        ... Hint: used config file 'C:\Users\timothee\AppData\Roaming\nim\config.nims' [Conf]
        ... # Resetting C:\Users\timothee\nimcache\nimterop\nimarchive\bzip2
        ... # Running make -j 4 libbz2.a
        ... #   Path: C:\Users\timothee\nimcache\nimterop\nimarchive\bzip2
        ... stack trace: (most recent call last)
        ... C:\Users\timothee\.nimble\pkgs\nimterop-0.5.5\nimterop\build.nim(1095, 23)
        ... C:\Users\timothee\.nimble\pkgs\nimterop-0.5.5\nimterop\build.nim(867, 11) buildLibrary
        ... C:\Users\timothee\.nimble\pkgs\nimterop-0.5.5\nimterop\build.nim(655, 23) make
        ... C:\Users\timothee\.nimble\pkgs\nimterop-0.5.5\nimterop\build.nim(133, 11) execAction
        ... C:\Users\timothee\.choosenim\toolchains\nim-#head\lib\system\assertions.nim(29, 26) failedAssertImpl
        ... C:\Users\timothee\.choosenim\toolchains\nim-#head\lib\system\assertions.nim(22, 11) raiseAssert
        ... C:\Users\timothee\.choosenim\toolchains\nim-#head\lib\system\fatal.nim(49, 5) sysFatal
        ... C:\Users\timothee\AppData\Local\Temp\nimble_24596\githubcom_dom96choosenim_#head\src\choosenim.nim(9, 1) template/generic instantiation from here
        ... C:\Users\timothee\AppData\Local\Temp\nimble_24596\githubcom_dom96choosenim_#head\src\choosenimpkg\download.nim(10, 1) template/generic instantiation from here
        ... C:\Users\timothee\AppData\Local\Temp\nimble_24596\githubcom_dom96choosenim_#head\src\choosenimpkg\telemetry.nim(13, 1) template/generic instantiation from here
        ... C:\Users\timothee\AppData\Local\Temp\nimble_24596\githubcom_dom96choosenim_#head\src\choosenimpkg\utils.nim(4, 1) template/generic instantiation from here
        ... C:\Users\timothee\.nimble\pkgs\nimarchive-0.3.6\nimarchive\bzlib.nim(22, 10) template/generic instantiation of `getHeader` from here
        ... C:\Users\timothee\.choosenim\toolchains\nim-#head\lib\system\fatal.nim(49, 5) Error: unhandled exception: C:\Users\timothee\.nimble\pkgs\nimterop-0.5.5\nimterop\build.nim(133, 16) `false` Command failed: 2
        ... cmd: cmd /c C: && cd C:\Users\timothee\nimcache\nimterop\nimarchive\bzip2 && make -j 4 libbz2.a
        ... result:
        ... cc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c
        ... Makefile:120: recipe for target 'huffman.o' failed
        ... process_begin: CreateProcess(NULL, cc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c, ...) failed.
        ... make (e=2): The system cannot find the file specified.
        ... make: *** [huffman.o] Error 2
        ... make: *** Waiting for unfinished jobs....
        ... If compilation produces errors, or a large number of warnings,
        ... please read README.COMPILATION.PROBLEMS -- you might be able to
        ... adjust the flags in this Makefile to improve matters.
        ... Also in README.COMPILATION.PROBLEMS are some hints that may help
        ... if your build produces an executable which is unable to correctly
        ... handle so-called 'large files' -- files of size 2GB or more.
        ... cc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c
        ... Makefile:117: recipe for target 'blocksort.o' failed
        ... process_begin: CreateProcess(NULL, cc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c, ...) failed.
        ... make (e=2): The system cannot find the file specified.
        ... make: *** [blocksort.o] Error 2
        ...  [AssertionDefect]

timotheecour avatar May 23 '20 02:05 timotheecour

I see why the nimterop/docs issue is happening - it is because you had this old version of nimterop which didn't have docs yet. I can improve that in nimarchive but it's a limitation of Nim that I cannot cleanly import a module only if a package is installed.

https://github.com/genotrance/nimarchive/blob/master/nimarchive.nimble#L17 is a poor man's workaround and it breaks. I can make an exception by checking for minimum version but I'll just take it out and do it some other way.

As for the second failure, note you are still using nimarchive-0.3.6. I need to update the choosenim required version of nimarchive to fix that.

genotrance avatar May 23 '20 05:05 genotrance

Ill reply to other points later but isnt' bug10 super weird? not sure what causes this thing to work/fail/work/fail in cycles

timotheecour avatar May 23 '20 05:05 timotheecour

Not sure how nimble decides which package version to return on nimble path but you'd think it uses the same algorithm as the requires search and gets you the latest.

But it's not important, what matters is what nimble returns for the require search since it doesn't really run nimble path to find out.

Perhaps running with verbose will print what the paths to Nim end up as.

genotrance avatar May 23 '20 12:05 genotrance

I can improve that in nimarchive but it's a limitation of Nim that I cannot cleanly import a module only if a package is installed. a poor man's workaround and it breaks I can make an exception by checking for minimum version

I implemented that, hopefully it's robust, by querying for installed package metadata (in particular version) via calling nimble dump mypkg and parsing it; there are other ways to do that too, eg using nimble path + checking for a subdirectory but IMO querying for metadata + installed version is more general + cleaner.

I intend to turn it into a stdlib module that provides reflection on nimble packages, eg parsing nimble metadata that nimble knows about for a package, including the version (major,minor,patch). There are other use cases beyond the one you described so it's really stdlib territory.

note, it involves parsing output of nimble dump which is an adhoc text format instead of json; which, no matter how easy, is the wrong thing to do as it's inherently fragile (eg wrt forward compatibility). So I've sent out https://github.com/nim-lang/nimble/issues/803 which addresses this point and more; at least the nimble dumpjson mypkg command should be easy to add to nimble for starters.

I have other use cases in mind for getting nimble metadata, eg getting the src field (ref https://github.com/nim-lang/Nim/pull/14456)

timotheecour avatar May 26 '20 10:05 timotheecour

Any more concerns on this issue?

genotrance avatar Jun 02 '20 15:06 genotrance

I think there are still a lot of unresolved issues I've mentioned here; eg bug10 which succeeds,fails,succeeds,fails etc

timotheecour avatar Jun 03 '20 01:06 timotheecour