dom96 / choosenim Goto Github PK
View Code? Open in Web Editor NEWTool for easily installing and managing multiple versions of the Nim programming language.
License: BSD 3-Clause "New" or "Revised" License
Tool for easily installing and managing multiple versions of the Nim programming language.
License: BSD 3-Clause "New" or "Revised" License
This causes issues when installing on systems where access to /tmp
is restricted (such as on shared web hosts that allow restricted SSH access). It should instead use the value of the $TMPDIR
environment variable.
choosenim ~/projects/nim
Future possibilities:
$your_fav_shell
so should this be choosenim
's job?~ » choosenim update stable
Updating stable
Info: Already up to date at version 0.17.0
~ » choosenim show
Channel: stable
Version: 0.16.0
Path: /Users/dom/.choosenim/toolchains/nim-0.16.0
~ » choosenim -v 1 ↵
choosenim v0.2.2 (2017-05-17 22:47:01) [macosx/amd64]
The gcc compiler was not downloaded before attempting to build nim.
... Error: Requested executable is missing. (Path: C:\Users\me\.choosenim\toolchains\mingw32\bin\gcc.exe)
Choosenim output attached.
I installed choosenim on Ubuntu 16.04 using
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
When I try to switch to 0.17.0 using
choosenim '#v0.17.0'
I get the following exception:
... lib/system.nim(408, 27) Error: type mismatch: got (type int)
... but expected one of:
... proc high[T](x: T): T
(I tried to follow the "Let's Make a Game in Nim" video by Jez Impbox:
https://www.youtube.com/watch?v=EwM1Z3WdqjM)
$ choosenim update stable
Updating stable
Downloading Nim 0.17.0 from nim-lang.org
[##################################################] 100.0% 0kb/s
Extracting nim-0.17.0.tar.gz
Error: Unable to extract. Error was 'invalid integer: 00000000000 '.
Tried running a MacOS autobuild on travis:
choosenim-init: Downloading choosenim-0.2.2_macosx_amd64
sh: line 46: /dev/tty: Device not configured
Hello,
I can build nim manually using this script.
I still I wanted to see what choosenim
looked like, but I am unable to install it. It fails with this error:
> curl https://nim-lang.org/choosenim/init.sh -sSf | sh
choosenim-init: Downloading choosenim-0.2.2_linux_amd64
/tmp/choosenim-0.2.2_linux_amd64: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /tmp/choosenim-0.2.2_linux_amd64)
/tmp/choosenim-0.2.2_linux_amd64: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by /tmp/choosenim-0.2.2_linux_amd64)
I am using RHEL 6.6.
Is that dependency failure for building choosenim
or nim
?
This is in particular a problem for macOS. Older versions come with openssl that is too old and does not support SSL offered by nim-lang.org.
This is an extension of #18.
All is in the title, I sent them a report for false detection (I hope :) ) with a link to the file
Collect statistics about OS usage, build fail rate (and reasons for failure), build times etc.
Notes:
Use Google analytics
Ask whether the user wants to be a part of the analytics or not when choosenim
is first started. When yes
is answered generate a UUID for their session and use that as proof that analytics are enabled.
References:
The Windows installer still fails with the following problem:
Downloading C compiler (Mingw32)
Traceback (most recent call last)
choosenim.nim(155) choosenim
choosenim.nim(136) performAction
choosenim.nim(74) choose
choosenim.nim(45) chooseVersion
download.nim(16) downloadMingw32
download.nim(169) downloadFile
download.nim(154) downloadFileNim
httpclient.nim(1256) downloadFile
httpclient.nim(951) parseBody
httpclient.nim(892) recvFull
httpclient.nim(866) reportProgress
download.nim(150) onProgressChanged
terminal.nim(657) showBar
terminal.nim(396) eraseLine
system.nim(2724) sysFatal
Error: unhandled exception: over- or underflow [OverflowError]
The system cannot find the path specified.
0 file(s) copied.
Work finished.
Now you must ensure that the Nimble bin dir is in your PATH:
C:\Users\Frank\.nimble\bin
Press any key to continue . . .
The issues is actually already fixed in the Nim repo:
nim-lang/Nim#7043
Since choosenim is supposed to be an easy entry to the world of Nim programming, it would be great if this could be fixed in a timely manner.
The SSL for nim-lang.org fails with ...
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
For some older versions of openssl. Serving from GitHub would solve that problem.
Context: https://irclogs.nim-lang.org/13-08-2017.html#19:53:37
Also re-evaluate the need for the proxy exe's to re-read the config.
It would be useful to see which binaries are "active" so to speak when running the show
command.
Right now, choosenim update
just redownloads everything and rebuilds from scratch using csources.
I think it should work this way:
choosenim update 0.16.0
(or in fact any tag) should be a noop - there is no need to update a fixed versionchoosenim update "#head"
should do a git pull and then use koch to rebuild using the existing nim.In fact, with this behaviour, the version is redundant: the only case in which it makes sense to update is when being on devel, so there could just be choosenim update
to update #head.
With the current behaviour, choosenim is inconvenient to keep up to date with latest Nim daily - a full clone and rebuild is too slow.
Analytics show users attempting to run choosenim 0.17.3
which results in a "Version 0.17.3 does not exist" error. It would be great to explain to the user that this is a development version and that they should try choosenim devel
.
If some file in "nim-#devel" or "nim-0.17.0" is being used - like opened in some editor, or some executable from this folder is running, choosenim throws this error:
C:\Users\Tiberium>choosenim update devel --verbose
Updating devel
Downloading Nim devel from GitHub
[##################################################] 100.0% 0kb/s
Error: unhandled exception: Access is denied.
[OSError]
In my case I was using VSCode with Nim plugin, and this plugin used nimsuggest.exe from "nim-#devel\bin" folder. Closing VSCode solved this issue to me
See https://forum.nim-lang.org/t/2944 for details.
Info: Nim 0.17.2 already downloaded
Extracting nim-0.17.2.tar.gz
Building Nim 0.17.2
Exception: Execution failed with exit code 1
... Command: build.bat
... Output: gcc -w -O3 -fno-strict-aliasing -Ic_code -c c_code\1_1\compiler_nim.c -o c_code\1_1\compiler_nim.o
... In file included from c_code\1_1\compiler_nim.c:7:0:
... c_code/nimbase.h:482:13: error: size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative
... typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1];
... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... FAILURE
... CSource compilation failed. Please check that the gcc compiler is in
... the PATH environment variable, and that you are calling the batch script
... that matches the target architecture of the compiler.
Cleaning failed build
Tip: 1 messages have been suppressed, use --verbose to show them.
Error: Build failed
Things to document:
Sorry to bother you again, but nimble
does not work without installing the dlls from the "Other dependencies" package:
https://nim-lang.org/download/dlls.zip
Error message I got:
could not load: libeay32.dll
I solved this, by downloading the dlls myself and putting them in the .nimble directory.
Would be great, if choosenim could do this for me ;)
Downloading Nim 0.17.2 from nim-lang.org
Traceback (most recent call last)
choosenim.nim(155) choosenim
choosenim.nim(136) performAction
choosenim.nim(74) choose
choosenim.nim(61) chooseVersion
choosenim.nim(23) installVersion
download.nim(227) download
download.nim(221) downloadImpl
download.nim(169) downloadFile
download.nim(154) downloadFileNim
httpclient.nim(1256) downloadFile
httpclient.nim(951) parseBody
httpclient.nim(892) recvFull
httpclient.nim(866) reportProgress
download.nim(150) onProgressChanged
terminal.nim(657) showBar
terminal.nim(396) eraseLine
system.nim(2724) sysFatal
Error: unhandled exception: over- or underflow [OverflowError]
1 file(s) copied.
Work finished.
Now you must ensure that the Nimble bin dir is in your PATH:
C:\Users\dawkot\.nimble\bin
Press any key to continue . . .
Running the Windows executable installer throws:
Downloading Nim 0.17.2 from nim-lang.org
Traceback (most recent call last)
choosenim.nim(155) choosenim
choosenim.nim(136) performAction
choosenim.nim(74) choose
choosenim.nim(61) chooseVersion
choosenim.nim(23) installVersion
download.nim(227) download
download.nim(221) downloadImpl
download.nim(169) downloadFile
download.nim(154) downloadFileNim
httpclient.nim(1256) downloadFile
httpclient.nim(951) parseBody
httpclient.nim(892) recvFull
httpclient.nim(866) reportProgress
download.nim(150) onProgressChanged
terminal.nim(657) showBar
terminal.nim(396) eraseLine
system.nim(2724) sysFatal
Error: unhandled exception: over- or underflow [OverflowError]
1 file(s) copied.
Work finished.
Now you must ensure that the Nimble bin dir is in your PATH:
C:\Users\matic\.nimble\bin
Tried it on Windows XP (x86) and Windows 10 (x64).
The reason that this is installed in the first place is because it forces the newest Nimble to be installed together with Nim 0.16.0. Choosenim instructs the user to install Nim via the #v0.16.0
tag when they attempt to use the older Nimble 0.8.2.
Proposed solution: Implement a --newest-nimble
(or similar) flag to force the newest Nimble to be installed with whatever Nim version is selected.
This won't solve the issue that #v0.16.0
cannot be installed, but it should solve the problem demi- was experiencing: https://irclogs.nim-lang.org/29-06-2017.html#20:52:04.
The Windows self-extracting EXE in the current releases page does not include any of the DLLs required for Nim (such as libeay32.dll
, libcurl.dll
, etc.).
Verify that the gcc
in the user's PATH matches the arch of Nim (as is done in finish.exe).
pi@raspberrypi:~ $ curl https://nim-lang.org/choosenim/init.sh -sSf | sh
choosenim-init: Error: Sorry, your platform (linux_arm) is not supported by choosenim.
Some preset release channels would be nice:
stable
- for the latest release.devel
- for the devel
branch.There should be a subcommand list
that lists out the available released versions so we don't have to guess at what is and isn't available (like, why 0.16.0
works but 0.16.1
does not).
You have to quote #head otherwise it's treated as a comment, however even quoting:
$ choosenim "#head"
Downloading Nim devel from GitHub
Error: unhandled exception: The handle is invalid.
[OSError]
It works fine in cmd.exe
> choosenim "#head"
Downloading Nim devel from GitHub
Traceback (most recent call last)
choosenim.nim(155) choosenim
choosenim.nim(136) performAction
choosenim.nim(78) choose
choosenim.nim(61) chooseVersion
choosenim.nim(23) installVersion
download.nim(227) download
download.nim(212) downloadImpl
download.nim(169) downloadFile
download.nim(154) downloadFileNim
httpclient.nim(1256) downloadFile
httpclient.nim(951) parseBody
httpclient.nim(892) recvFull
httpclient.nim(866) reportProgress
download.nim(150) onProgressChanged
terminal.nim(657) showBar
terminal.nim(396) eraseLine
system.nim(2724) sysFatal
Error: unhandled exception: over- or underflow [OverflowError]
Also perform the modification of PATH automatically on all platforms.
Freshly installed copy, trying to build https://github.com/evacchi/nimoy on macOS Sierra
Error: Traceback (most recent call last)
... nimble.nim(1073) nimble
... nimble.nim(991) doAction
... nimble.nim(973) execHook
... packageparser.nim(313) getPkgInfoFromFile
... packageparser.nim(288) readPackageInfo
... Could not read package info file in <OMISSIS>/nimoy/nimoy.nimble;
... Reading as ini file failed with:
... Invalid section: .
... Evaluating as NimScript file failed with:
... Error: cannot open '/Users/evacchi/.nimble/lib/system.nim'.
in fact the file is missing
% ls /Users/evacchi/.nimble/lib/system.nim
ls: /Users/evacchi/.nimble/lib/system.nim: No such file or directory
https://gist.github.com/dom96/bf798007e0ac2d8713d816aa0c1f9128 - This requires libc-dev
to be installed.
https://gist.github.com/dom96/4eb5f8730d5dd3a395b1bba17419b37a - This is likely due to the server having only 512mb. (Can confirm that this is due to OOM killer, it even happens on a server with 1GB of RAM :\ )
Match these errors when compilation fails and give a likely solution to the user.
nimble tasks
Tip: 1 messages have been suppressed, use --verbose to show them.
Error: Could not read package info file in /home/papillon/esperimenti/nimgraph/nimgraph.nimble;
... Reading as ini file failed with:
... Invalid section: .
... Evaluating as NimScript file failed with:
... Error: cannot open '/home/papillon/.nimble/lib/system.nim'.
./koch boot -d:release
iteration: 1
compiler/nim0 c -d:release --nimcache:nimcache/r_macosx_amd64 compiler/nim.nim
Error: Requested executable is missing. (Path: /Users/tiber/.choosenim/toolchains/nim-#devel/bin/nim0)
Info: If unexpected, please report this error to https://github.com/dom96/choosenim
FAILURE
Reported by @Yardanico
Possible solutions:
re"nim[0-9]"
as nim
in the proxy exe.Create a compiler.nimble-link
file in ~/.nimble/pkgs/compiler-#head
.
I'm using choosenim-0.2.2_windows_i386.exe. A working c build environment is created and nim compiles hello world just fine. g++ also exists in the path as a result, but the cpp nim backend target breaks. Attempting to only use g++ to build a cpp hello world also breaks, resulting in the following wchar_s not found error:
$ g++ -o test.exe test.cpp In file included from C:/Users/user/.choosenim/toolchains/mingw32/i686-w64-mingw32/include/c++/cwchar:44:0,
from C:/Users/user/.choosenim/toolchains/mingw32/i686-w64-mingw32/include/c++/bits/postypes.h:40,
from C:/Users/user/.choosenim/toolchains/mingw32/i686-w64-mingw32/include/c++/iosfwd:40,
from C:/Users/user/.choosenim/toolchains/mingw32/i686-w64-mingw32/include/c++/ios:38,
from C:/Users/user/.choosenim/toolchains/mingw32/i686-w64-mingw32/include/c++/ostream:38,
from C:/Users/user/.choosenim/toolchains/mingw32/i686-w64-mingw32/include/c++/iostream:39,
from test.cpp:1:
C:/Users/user/.choosenim/toolchains/mingw32/i686-w64-mingw32/include/wchar.h:1040:29: fatal error: sec_api/wchar_s.h: No such
file or directory
#include <sec_api/wchar_s.h>
^
compilation terminated.`
Running choosenim behind a proxy server isn't supported. This is a common situation for developers and important to support.
If a new version of choosenim has been released, the only way to update it is to remove the current binary, and to run the bash script to install it.
What if adding a new command called self
, to play with choosenim itself, like self update
or something like that (like rustup)?
I have gcc installed.
error message copy/paste below:
choosenim.nim(85) choose
... choosenim.nim(72) chooseVersion
... choosenim.nim(46) installVersion
... builder.nim(91) build
... builder.nim(23) buildCompiler
... builder.nim(10) buildFromCSources
... utils.nim(19) doCmdRaw
... Execution failed with exit code 1
... Command: build.bat
... Output: gcc -w -O3 -fno-strict-aliasing -Ic_code -c c_code\1_1\compiler_nim.c -o c_code\1_1\compiler_nim.o
... In file included from c_code\1_1\compiler_nim.c:7:0:
... c_code/nimbase.h:477:13: error: size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative
... typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1];
... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... FAILURE
Nim compilation fails for me with this error:
Info: Nim 0.17.0 already downloaded
Extracting nim-0.17.0.tar.gz
Building Nim 0.17.0
Exception: Execution failed with exit code 1
... Command: build.bat
... Output: gcc -w -O3 -fno-strict-aliasing -Ic_code -c c_code\1_1\compiler_nim.c -o c_code\1_1\compiler_nim.o
... In file included from c_code\1_1\compiler_nim.c:7:0:
... c_code/nimbase.h:482:13: error: size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative
... typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1];
... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... FAILURE
... CSource compilation failed. Please check that the gcc compiler is in
... the PATH environment variable, and that you are calling the batch script
... that matches the target architecture of the compiler.
Cleaning failed build
Tip: 1 messages have been suppressed, use --verbose to show them.
Error: Build failed
1 file(s) copied.
Work finished.
Now you must ensure that the Nimble bin dir is in your PATH:
C:\Users\moigagoo\.nimble\bin
Press any key to continue . . .
I think that's because I have 64 bit version of gcc installed, whereas the sources are expected to be compiled with a 32 bit version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.