summary refs log tree commit diff stats
path: root/lib/system
Commit message (Collapse)AuthorAgeFilesLines
* Document that proc named fooTask is created for every foo task [backport] ↵Kaushal Modi2020-05-021-0/+15
| | | | | (#14187) Ref: https://irclogs.nim-lang.org/01-05-2020.html#15:18:03
* change 'iff' to 'if' to stop "corrections" once and for all (#14182)Miran2020-05-012-5/+5
|
* fixes #13698 [backport:1.2] (#14175)Andreas Rumpf2020-04-301-2/+2
|
* fixes the regression #12860 caused; hotfixAraq2020-04-301-0/+3
|
* JS unittest stacktrace fix, cleanup js repr and inclrtl includes (#14168)hlaaftana2020-04-301-34/+12
|
* many bugfixes for js (#14158)hlaaftana2020-04-292-23/+16
| | | | | | | | | | | | | * many bugfixes for js fixes #12672, fixes #14153, closes #14123, closes #11331, fixes #11783, fixes #13966, fixes #14087, fixes #14117, closes #12256. mostly fixes the fact that it was allowed to assign to newly created temp variables. additionally attempts to get rid of null initialized seqs/strings (though they might pop up here and there); this simplifies a lot of things and makes code size smaller. even if null seqs/strings pop up here and there it's still better than all those bugs existing. * formatting fixes * CI fixes * more CI fixes
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-2814-78/+101
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* StringStream & more stdlib modules support for JS/NimScript (#14095)hlaaftana2020-04-281-1/+1
| | | | | * StringStream & more stdlib modules support for JS/NimScript * change back pegs test in line with #14134
* Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims (#12860)Neelesh Chandola2020-04-271-8/+0
| | | | | | | * Remove `paramStr` and `paramCount` from implicitly imported nimscript.nim * Update changelog.md * Update stable nimble commit hash Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* `$` now works for unsigned intergers with `nim js` (#14122)Timothee Cour2020-04-271-0/+17
| | | | * $(unsigned) now works for js * move NimMajor+friends closer to NimVersion according as per reviewer feedback
* `$(a: float)` now works consistently in nim js, avoiding printing floats as ↵Timothee Cour2020-04-271-0/+15
| | | | | | | | | ints (#14134) * fix https://github.com/timotheecour/Nim/issues/133; $(a: float) works in nim js like in other backends * fix tests * fix test for windows that prints 1.1e17 differently than other OS
* new implementations for --gc:orc (#14121)Andreas Rumpf2020-04-276-19/+418
| | | | | | | | | * cycle collector: new implementation * cycle collector: make self-adaptive based on its previous effectiveness * cycle collector: added Lins's jump stack to improve traversal from 3*N to 2*N * cycle collector: make tests green * API extensions and bugfixes * code cleanup and use --gc:orc for tasyncawait
* since now takes an optional patch, eg: `since: (1, 3, 1)` (#14124)Timothee Cour2020-04-261-2/+14
| | | add tests for tinclrtl
* changed type() to typeof() in docs and error messages (#14084)hlaaftana2020-04-241-3/+3
|
* cycle collector (#14071)Andreas Rumpf2020-04-223-106/+74
| | | | * figured out the wrong cycle trace proc problem * cycle collector/break refactorings and minor improvements
* Treat zig like clang/gcc wrt integer arithmetic. (#13957)Hessam Mehr2020-04-221-1/+1
|
* fixes #14038Andreas Rumpf2020-04-201-1/+1
|
* Make file descriptors from stdlib non-inheritable by default (#13201)alaviss2020-04-201-5/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* refactor system.$ for objects a little; refs #13398Araq2020-04-201-9/+3
|
* fixes #14001 (#14004)Andreas Rumpf2020-04-191-5/+5
|
* forward type alignment information to seqs (#12430)Arne Döring2020-04-1917-84/+93
|
* Fix unused warning for `$` for empty tuple/objects (#13991)hlaaftana2020-04-181-1/+2
|
* added extended msg for failed library loads w/ incorrect DLL formats (#13950)awr12020-04-162-12/+30
| | | | | | | | | | | | | | | * added extended msg for failed library loads w/ incorrect DLL formats * missing colon * fix GetLastError() * make GetLastError() available for windows console apps * remove premature nullchar if outputting extra message * if-protect nullchar detection * better fix for message box code
* Fix #13872 (#13898)Clyybber2020-04-061-0/+5
|
* doc: fix comment for repr*(x: char): string (#13873)Hiroki Noda2020-04-051-1/+1
| | | replace `$` with `repr`.
* Deprecate PHP (#13838)Juan Carlos2020-04-021-16/+1
|
* Documentation, add more examples (#13825)Juan Carlos2020-04-011-2/+2
|
* fix #13829 (#13831)Timothee Cour2020-04-011-1/+1
|
* DrNim (Nim compiler with Z3 integration) (#13743)Andreas Rumpf2020-03-311-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* Add Documentation (#13811)Juan Carlos2020-03-311-0/+6
| | | | * Add more Docs and runnableExamples
* stacktraces can now show custom runtime msgs per frame (#13351)Timothee Cour2020-03-302-2/+31
| | | | | | | | * stacktraces can now show custom runtime msgs * improve tests/stdlib/tstackframes.nim * fix test for --gc:arc * test --stacktraceMsgs:on and --stacktraceMsgs:off * --stacktracemsgs:off by default
* __stderrp and friends are only on FreeBSD & DragonFlyBSD. (#13735)Euan2020-03-232-2/+2
|
* fix #13731, ambiguous repr of pointers (#13732)Miran2020-03-231-6/+2
|
* [RFC] 'walkDir' now has a new 'checkDir' flag, to mimic behaviour of other ↵Timothee Cour2020-03-201-3/+3
| | | | | languages (#13642) Co-authored-by: narimiran
* cycle breaker (#13593)Andreas Rumpf2020-03-193-11/+243
| | | | * cycle breaking as an alternative to cycle detection
* Attempt to finish off araq cpp exceptions (#13695)cooldome2020-03-192-32/+6
| | | | | | | | | | | | | | | * config update * disable a questionable test * remove c++ exception handling IDs, new impl doesn't require it anymore * C++ based exceptions finally work * fixes bootstrapping problem in C++ mode * teach GCC it's 2020 now * more bugfixes for C++ based exception handling * apply cooldome's patch * another attempt to enable C++11 * bug fix Co-authored-by: Araq <rumpf_a@web.de> Co-authored-by: cooldome <ariabushenko@bk.ru>
* added a switch -d:nimEmulateOverflowChecks for broken or old GCC versions ↵Andreas Rumpf2020-03-191-1/+1
| | | | (#13692)
* enable --tlsEmulation:on for --gc:arc (#13685)Andreas Rumpf2020-03-183-7/+4
| | | | * enable --tlsEmulation:on for --gc:arc * make -d:useMalloc work with --gc:arc --threads:on
* rewritten goto based exception handling; much cleaner implementation;… ↵Andreas Rumpf2020-03-171-3/+3
| | | | | | (#13677) * rewritten goto based exception handling; much cleaner implementation; fixes #13668
* catchable defects (#13626)Andreas Rumpf2020-03-1211-32/+178
| | | | | | | | | | * allow defects to be caught even for --exceptions:goto (WIP) * implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180 * new implementation for integer overflow checking * produce a warning if a user-defined exception type inherits from Exception directly * applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic' * fixes #13627 * don't inherit from Exception directly
* Fix #12676 (#13634)genotrance2020-03-121-7/+15
|
* fixes #13519Araq2020-03-111-1/+1
|
* fix operators containing percent for VM usage (#13536)Arne Döring2020-03-112-59/+77
| | | | * fixes #13513 * merge tarithmetics in tarithm
* sink parameter inference for types that have destructors (#13544)Andreas Rumpf2020-03-041-1/+3
| | | | | | | | | | | | | | * ensure capitalize doesn't take an inferred sink parameter * sink parameter inference: first version, for now disabled. Changed that sink parameters can be consumed multiple times in order to adhere to our spec. * sink inference can now be disabled with .nosinks; sometimes for proc type interop this is required * fixes yet another critical DFA bug * better implementation that also understands if expressions etc * document sink parameter inference and allow for global disabling
* Fix docgen snippet numbering (#13507)genotrance2020-03-031-1/+1
|
* Remove dead magics (#13551)Arne Döring2020-03-031-11/+11
|
* cleanup Ordinal (#13501)Timothee Cour2020-02-272-7/+3
|
* fixes #13457 (#13458)Andreas Rumpf2020-02-211-10/+11
|
* fix #9634 don't crash on execCmdEx/readLine when inside gdb/lldb (#13232)Timothee Cour2020-02-111-2/+15
| | | | | | | | * fix #9634 debugging a program using execCmdEx now works * only apply EINTR to c_gets for now This reverts commit c0f5305b5a0b46983dfd27e3d77ecbf4f8744dcc.
* Revert "printing float values will have one more digit. (#13276) [backport]" ↵Timothee Cour2020-02-081-1/+1
| | | | | (#13363) This reverts commit b2c6db97f9f477f6999fa9c7aae5e32f10b6b3fe.