summary refs log tree commit diff stats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* tools/finish: don't quote path with space (#14058) [backport]alaviss2020-04-221-3/+2
| | | | | | | | | | Path with spaces should be added as is, quoting them makes utilities treat the quotes as part of the path. This makes `nim` unable to be used from the command line even if it appears to be added to user's Path environment variable. Even more confusing, Windows 10's PATH editor shows the path without any quotes, you only see them when you use "Edit text". Took me a good 15 minutes to figure out why couldn't I run `nim` despite it being in Path.
* Make file descriptors from stdlib non-inheritable by default (#13201)alaviss2020-04-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * io: make file descriptors non-inheritable by default This prevents file descriptors/handles leakage to child processes that might cause issues like running out of file descriptors, or potential security issues like leaking a file descriptor to a restricted file. While this breaks backward compatibility, I'm rather certain that not many programs (if any) actually make use of this implementation detail. A new API `setInheritable` is provided for the few that actually want to use this functionality. * io: disable inheritance at file creation time for supported platforms Some platforms provide extension to fopen-family of functions to allow for disabling descriptor inheritance atomically during File creation. This guards against possible leaks when a child process is spawned before we managed to disable the file descriptor inheritance (ie. in a multi-threaded program). * net, nativesockets: make sockets non inheritable by default With this commit, sockets will no longer leak to child processes when you don't want it to. Should solves a lot of "address in use" that might occur when your server has just restarted. All APIs that create sockets in these modules now expose a `inheritable` flag that allow users to toggle inheritance for the resulting sockets. An implementation of `setInheritance()` is also provided for SocketHandle. While atomically disabling inheritance at creation time is supported on Windows, it's only implemented by native winsock2, which is too much for now. This support can be implemented in a future patch. * posix: add F_DUPFD_CLOEXEC This command duplicates file descriptor with close-on-exec flag set. Defined in POSIX.1-2008. * ioselectors_kqueue: don't leak file descriptors File descriptors internally used by ioselectors on BSD/OSX are now shielded from leakage. * posix: add O_CLOEXEC This flag allows file descriptors to be open() with close-on-exec flag set atomically. This flag is specified in POSIX.1-2008 * tfdleak: test for selectors leakage Also simplified the test by using handle-type agnostic APIs to test for validity. * ioselectors_epoll: mark all fd created close-on-exec File descriptors from ioselectors should no longer leaks on Linux. * tfdleak: don't check for selector leakage on Windows The getFd proc for ioselectors_select returns a hardcoded -1 * io: add NoInheritFlag at compile time * io: add support for ioctl-based close-on-exec This allows for the flag to be set/unset in one syscall. While the performance gains might be negliable, we have one less failure point to deal with. * tfdleak: add a test for setInheritable * stdlib: add nimInheritHandles to restore old behaviors * memfiles: make file handle not inheritable by default for posix * io: setInheritable now operates on OS file handle On Windows, the native handle is the only thing that's inheritable, thus we can assume that users of this function will already have the handle available to them. This also allows users to pass down file descriptors from memfiles on Windows with ease, should that be desired. With this, nativesockets.setInheritable can be made much simpler. * changelog: clarify * nativesockets: document setInheritable return value * posix_utils: atomically disable fd inheritance for mkstemp
* make fuzzy search a bit less fuzzy (#13996) [backport:1.2]Miran2020-04-162-1/+4
|
* Improve #12920 fix (#13958)genotrance2020-04-121-3/+3
|
* posix: add full Haiku support (#13931)alaviss2020-04-091-0/+1
| | | | | | | | | | * posix: add full Haiku support This commit provides a posix_haiku derived from posix_other, with types following Haiku's definition. This fixes cases where the compiler generates type check for the wrong types (ie. checks where generated for an int-derived type but it's actually implemented as an uint instead). * tools/kochdocs: welcome posix_haiku to the blacklist
* move tinyc to a separate repo and allow installing external dependencency ↵Timothee Cour2020-04-031-0/+22
| | | | | | | (eg tinyc) from koch / library code (#13850) * remove tinyc * installDeps * update tinyc paths
* Add arm/arm64 for FreeBSD (#13822)lbartoletti2020-03-311-2/+2
| | | | | * Add arm and arm64 for FreeBSD * Add arm64 with aarch64 and reorder to avoid conflict with arm
* DrNim (Nim compiler with Z3 integration) (#13743)Andreas Rumpf2020-03-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * code cleanups and feature additions * added basic test and koch/CI integration * make it build on Unix * DrNim: now buildable on Unix, only takes 10 minutes, enjoy * added basic documentation for DrNim which can also be seen as the RFC we're following * drnim: change the build setup so that drnim.exe ends up in bin/ * makes simple floating point ranges work * added basic float range check * drnim: teach Z3 about Nim's range types plus code refactoring * drnim: make unsigned numbers work * added and fixed index checking under setLen * first implementation of .ensures, .invariant and .assume (.requires still missing and so is proc type compatibility checking * drnim: .requires checking implemented * drnim: implemented .ensures properly * more impressive test involving min() * drnim: check for proc type compatibility and base method compatibility wrt .requires and .ensures * testament: support for 'pattern <directory> * koch: uses new <directory> feature of testament * drnim: added tiny musings about 'old' * Make testament work with old SSL versions * koch: add support for 'koch drnim -d:release' * drnim: preparations for the param.old notation
* Remove 2 old deprecated files (#13702)Juan Carlos2020-03-201-3/+1
|
* fix #13218: avoid some irrelevant warnings for nim doc,rst2html,--app:lib, + ↵Timothee Cour2020-03-131-1/+3
| | | | | | | | other fixes (#13550) * fix #13218: avoid some irrelevant warnings for nim doc,rst2html * suppress warnRedefinitionOfLabel for nim doc * lots of fixes for UnusedImport warnings
* `koch --nim:pathto/nim boot` and `koch boot --hint:cc:off` now work (#13516)Timothee Cour2020-03-111-7/+11
| | | | | * `koch boot --hint:cc:off` now works * `koch --nim:pathto/nim boot` now works; code cleanup
* fix nightlies builds on Windows (#13587)Varriount2020-03-041-4/+4
| | | | Before the files that should have been ignored weren't ignored because of different dir separator ('\' vs '/') on Windows.
* fix #13528 nimgrep --word now works better with operators (#13537)Timothee Cour2020-03-021-1/+2
|
* docgen: don't create compiler's docs + cleanup (#13509)Miran2020-02-261-95/+12
|
* only enable linenoise for -d:nimUseLinenoise (#13478)Timothee Cour2020-02-241-1/+2
| | | | | | * only enable linenoise for -d:nimUseLinenoise * fixup
* add more files to the ignore list, hopefully fixes nightlies on windows (#13474)Miran2020-02-241-7/+13
|
* fix linenoise regression (#13395)Timothee Cour2020-02-121-11/+19
| | | | | | * fix nightlies linenoise regression * fix other installers
* Make vccexe parse response files (#13329)Fredrik Høisæther Rasch2020-02-111-23/+43
|
* miscellaneous bug fixes (part 3) (#13304)Timothee Cour2020-02-071-1/+1
| | | | | | | | | | * fix deprecation; fix indentation * git clone: use -q * fix Warning: pragma before generic parameter list is deprecated; fix typo * bugfix: sysTypeFromName("float64") was never cached
* fix #13150 `nim doc --project` now works reliably (#13223)Timothee Cour2020-02-061-3/+5
| | | | | | | | | | * fix #13150 `nim doc --project` works with duplicate names and with imports below main project file * add to help; fixup after #13212 isRelativeTo got merged * fix test tests/compilerapi/tcompilerapi.nim * remove nimblePkg field; compute on the fly instead * kochdocs: compiler docs now under compiler/ * --docRoot now has smart default: best among @pkg, @path
* Quote nim executable before executing. (#13316) [backport]Fredrik Høisæther Rasch2020-02-021-8/+8
| | | | | In case nim executable is located in PATH containing spaces. fixes #13311
* kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; ↵Timothee Cour2020-01-231-145/+138
| | | | | | | bugfixes (#13221) * kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes * fixup after #13212 isRelativeTo got merged
* maybe: allows optional chaining of field access and indexing when LHS i snil ↵Timothee Cour2020-01-181-0/+1
| | | | | | | | | (#13023) * maybe: allows optional chaining * fix tools/kochdocs.nim * improve semantics to distinguish valid from invalid values * for now, wrapnil, isValid, unwrap are not exported
* fixes #12998 nim doc regression (#13117)Timothee Cour2020-01-161-6/+3
|
* fixes #10665 (#13141) [backport]Andreas Rumpf2020-01-141-0/+47
|
* Fix single match output (#12920)genotrance2019-12-171-0/+2
|
* add $nimeq for gdb (#12909)Arne Döring2019-12-171-0/+29
|
* feature dracula themed doc (#12816)Andreas Rumpf2019-12-101-1/+9
| | | | | | | | | | * Implement gorgeous Dracula themed Nim documentation * Add color for escape sequences * fixes the test cases * the big CSS cleanup
* nimgrep improvements (#12779)Andrey Makarov2019-12-051-97/+394
| | | | | | | | | | | | | | | | | | * fix sticky colors in styledWrite * nimgrep: context printing, colorthemes and other * add context printing (lines after and before a match) * nimgrep: add exclude/include options * nimgrep: improve error printing & symlink handling * nimgrep: rename dangerous `-r` argument * add a `--newLine` style option for starting matching/context lines from a new line * add color themes: 3 new themes besides default `simple` * enable printing of multi-line matches with line numbers * proper display of replace when there was another match replaced at the same line / context block * improve cmdline arguments error reporting
* [backport] Fix style issues in lib/, tools/, and testament/. Fixes #12687. ↵3n-k12019-11-281-4/+4
| | | | (#12754)
* fixes #12319 - change exception handling for finish.exe (#12413)Gampol T2019-11-151-0/+2
| | | | | | * documented behaviour of recv on bufferd socket * fixes #12319- check exception using errorCode
* remove unused imports from testsnarimiran2019-11-061-1/+1
|
* remove unused importsnarimiran2019-11-062-6/+3
|
* Switch mingw links (#12561)genotrance2019-10-313-3/+3
|
* Refactor json macro (#12391)Arne Döring2019-10-171-4/+4
| | | | | | | | * closes #12316 * make tjsonmacro work at js target * closes #12289 * closes #11988 * also fixed gdb related stuff
* different fix for #12279 [backport]Araq2019-09-301-1/+0
|
* fixes #12279 [backport]Araq2019-09-301-0/+1
|
* fix nimgrep color on posix #7591 (#12288)Andrey Makarov2019-09-281-4/+12
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-275-11/+11
|
* Add build support for Linux/hppa (#12271)John Paul Adrian Glaubitz2019-09-261-0/+2
| | | | | | * build.sh: Enable CPU detection for hppa * compiler: Add hppa as target architecture on Linux * lib/system: Add platform support for hppa
* last stdlib cleanupsAraq2019-09-211-0/+1
|
* rename cast opcodes, fix for 32bit cast, fix python pretty printer (#12207)Arne Döring2019-09-181-4/+4
|
* Fix to int to biggest int (#12066)Arne Döring2019-08-271-8/+8
| | | | | * fix to(Biggest)Int * kill toFloat magics as well
* Add build support for FreeBSD PowerPC64lenoil982019-08-231-0/+5
|
* Add build support for FreeBSD PowerPC64lenoil982019-08-231-1/+8
|
* fixes #11770Araq2019-08-161-8/+16
|
* added destructors.rst spec to the build documentationAraq2019-08-161-0/+1
|
* Add build support for Linux/ia64 (#11880) [feature]John Paul Adrian Glaubitz2019-08-041-0/+2
| | | | | * compiler: Add ia64 as target architecture on Linux * build.sh: Enable CPU detection for ia64
* nimgrep: introduce the --rex optionAndreas Rumpf2019-07-271-5/+12
|
* nimgrep: fixes the -w optionAndreas Rumpf2019-07-271-1/+1
|