summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* add CI badges for azure-pipelines for devel, 1.0, 1.2 branches (#14101)Timothee Cour2020-04-241-1/+3
|
* Add tests for #8481, #6490 and #4061 (#14083)Clyybber2020-04-233-0/+45
|
* CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static ↵Timothee Cour2020-04-2314-39/+221
| | | | | | | | | | | checks (#13926) * -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper * cleanups * import sizeof at CT for {.completeType.} * address comments; revert default enabling of -d:checkAbi for now * mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor * all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
* new cmd: `nim r main [args...]` to compile & run, saving binary under ↵Timothee Cour2020-04-235-16/+39
| | | | | | $nimcache/main (#13382) * implement `nim r main` to compile and run, saving binary to $nimcache * remove outFileAbs for now
* testament: don't rely on Nim source structure [backport:1.2] (#14077)alaviss2020-04-231-1/+1
| | | | It's also just faster to get the current file name instead of scanning the PATH.
* Ref #14075 - enable two tests which seem to now be passing locally on ↵Euan2020-04-222-2/+0
| | | | FreeBSD. (#14076)
* Add LTO support for most compilers and do some VCC fixes (#14013)Keithcat12020-04-222-6/+37
| | | | | | | | | * Added LTO in nim.cfg, added /link in extccomp.nim and other fixes * Fix line endings * Fix line endings, for real this time. Almost certainly. Like, 95% certain. * Removed /MD from extccom.nim VCC comiler
* Set O_NONBLOCK flag atomically (#13934)Hiroki Noda2020-04-221-8/+4
| | | | These flags were added in Linux 2.6.27, I'm not sure Nim's minimal support Linux version.
* fix #14064 xmltree should allow create text node with raw text(non-es… ↵Bung2020-04-223-3/+12
| | | | | | | | | | | | | (#14070) * fix #14064 xmltree should allow create text node with raw text(non-escaped) eg. html style element's text * change xnRawText to VerbatimText,newRawText to newVerbatimText ,add since anotation * change changelog_1_2_0.md latest date * move change log Co-authored-by: bung87 <crc32@qq.com>
* Make debugSend/debugRecv procs public. Fixes #12189 (#12190)Chris Heller2020-04-221-3/+37
| | | | | | | * Make debugSend/debugRecv procs public. Fixes #12189 * Make checkReply proc public. Part of #12189 * Add doc comments for debugSend,debugRecv and checkReply
* Add the ability to pass title case headers to an HTTP server (#13968)wonderix2020-04-221-12/+38
| | | | | | | | | * Add the ability to pass title case headers to an HTTP server * Remove unnecessary type spec of titleCase * Replace convert member proc by isTitleCase Co-authored-by: wonderix <wonderix@googlemail.com>
* cycle collector (#14071)Andreas Rumpf2020-04-226-110/+262
| | | | * figured out the wrong cycle trace proc problem * cycle collector/break refactorings and minor improvements
* change some Exceptions to CatchableError or Defect, fixes #10288 (#14069)hlaaftana2020-04-224-5/+5
|
* use newer nodejs on Azure Pipelines (#14065)Miran2020-04-221-2/+2
|
* base `parseEnum` on a case statement, fixes #14030 (#14046)Vindaar2020-04-223-11/+171
| | | | | | | | | | | | | | | | | | | | * base `parseEnum` on a case statement, fixes #14030 * apply simplifactions / clean up, remove `norm` node, use strVal * export `normalize` in json.nim * cmp using nimIdentNormalize, error at CT if ambiguous enum found `nimIdentNormalize` provided by @cooldome. We track all names of the branches we have created so far and error if a duplicate is found. Dummy change to make github react... * fix docstring of `nimIdentNormalize` * make `typ` arg `typedesc`, add lineinfo, call norm. only once
* Treat zig like clang/gcc wrt integer arithmetic. (#13957)Hessam Mehr2020-04-221-1/+1
|
* 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.
* fix globalOptions (#14059)Timothee Cour2020-04-220-0/+0
|
* Fix OS detection in a docker container (#13172)Arnaud Moura2020-04-222-32/+67
| | | | | | | * Support detection in docker container. * Get only ID information in os-release. * Add test to distros module. * Fix Linux OS detection in Windows. * Fix OS detection for FreeBSD and OpenBSD.
* fix typo (#14063)Andy Davidoff2020-04-211-1/+1
|
* fix #13222: make relativePath more robust and flexible (#13451)Timothee Cour2020-04-214-68/+113
| | | | | | | | | * * relativePath(foo) now works * relativePath(rel, abs) and relativePath(abs, rel) now work (fixes #13222) * relativePath, absolutePath, getCurrentDir now available in more targets (eg: vm, nodejs etc) * fix bug: isAbsolutePath now works with -d:js; add tests * workaround https://github.com/nim-lang/Nim/issues/13469 * remove `relativePath(path)` overload for now * add back changelog after rebase
* cleanup PR #14048Araq2020-04-212-5/+5
|
* fixes #14052 [backport:1.2] (#14055)Andreas Rumpf2020-04-211-1/+2
|
* Add deques.peekFirst/Last(var Deque[T]) -> var T (#13542)hlaaftana2020-04-212-0/+42
| | | | | | | * Add deques.peekFirst/Last(var Deque[T]) -> var T * Add changelog entry for deques.peekFirst/Last var T overloads * Add since annotation to peekFirst/peekLast Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Add package install command for FreeBSD and OpenBSD. (#14051)Arnaud Moura2020-04-211-1/+3
|
* Replace enum fields idents with syms (#14048)cooldome2020-04-212-1/+13
| | | | | | * replace enum fields idents with syms * Trigger build Co-authored-by: cooldome <ariabushenko@bk.ru>
* Times refactorings (#13949)Oscar Nihlgård2020-04-211-753/+778
|
* #12103 - CI for OpenBSD (#12105)Euan2020-04-2120-15/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Working on OpenBSD CI * Condense steps into 2 steps to make output easier to follow. * Move up one directory after csources build. * Remove FreeBSD build manifest and add OpenBSD test ignores for coroutines and hot code reloading. * If runCI fails, run the test results script. * Add email trigger for build failure * Remove .git from repository URL * Disable SFML test on OpenBSD * Disable tgetaddrinfo on OpenBSD as only UDP and TCP protocols are supported. * Remove getFilePermissions as it causes CI test failures with NimScript. * Set clang as cc in nim.cfg and use gmake to build csources. * Add getCurrentDir to nimscript. * Remove duplicate getCurrentDir and check for not weirdTarget. * Add CI badge for OpenBSD. * Disable tests which allocate lots of memory for OpenBSD. * Use `CORO_BACKEND_SETJMP` on OpenBSD rather than ucontext. * Simplify building of koch * Disable t8657 on OpenBSD. See issue #13760. * Fix #12142 - tarray_of_channels fails on OpenBSD * Disable thhtpclient_ssl and tosprocterminate on OpenBSD. These tests can be enabled at a later date after fixing them. * Install libffi. * Set path to libc for openbsd. * Disable tevalffi for now. * Remove tevalffi.nim. * Use ncpuonline sysctl rather than ncpu. * Disable tacceptcloserace and tasynchttpserver on OpenBSD. * Enable tacceptcloserace and tasynchttpserver. * Fix #13775 as suggested by @alaviss - use /bin/cat on OpenBSD rather than /bin/sh. * Enable test on OpenBSD. * Disable tflowvar on OpenBSD.
* Fix the getSelection method. (#13632)treeform2020-04-211-1/+8
|
* docs: move `not nil` to the experimental page (#14027)Rory O’Kane2020-04-212-26/+30
| | | | | When I heard that this feature existed, and found the 2018 changelog entry that said `not nil` was made experimental (https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_0_19_0.md#changes-affecting-backwards-compatibility), I looked for `not nil` documentation in https://nim-lang.org/docs/manual_experimental.html. When I didn’t find it there, I initially assumed the feature had no documentation. This change moves the documentation to where readers will expect it. As well as moving the text to another file, I added instructions for enabling the experimental feature and tweaked some wording.
* fix mapIt issues #12625 & #12639 (#14041)Judd2020-04-212-14/+39
| | | | | | | | | | | | * fix mapIt issues #12625 & #12639: 1. fallback to call `map` when the result of `op` is a closure; 2. use `items(s)` in the for loop. * fix test errors. * add comments and InType is moved. * fix ident.
* New runnableExample for `newAsyncHttpClient()` (#14045)Tristram Oaten2020-04-211-0/+11
|
* asyncdispatch: export Callback (#14042) [backport]alaviss2020-04-211-2/+2
| | | | | | This let us see the definition of `Callback` in docs, which is required to even make use of asyncdispatch. Ref #13539.
* clarify tuples and objects in manual, fixes #12486 (#14044)hlaaftana2020-04-211-7/+20
|
* Fix broken async httpclient exampleTristram Oaten2020-04-211-3/+7
| | | | | | | | | | | | | | | | | As the async httpclient is almost certainly the first async example beginners will want to try, we OWE it to them to give them a real example. Example repeated here for clarity: ```nim import asyncdispatch, httpclient proc asyncProc(): Future[string] {.async.} = var client = newAsyncHttpClient() return await client.getContent("http://example.com") echo waitFor asyncProc() ``` This is my first Nim contribution, please let me know if the code is right. (it runs on my machine, but may not be the best example)
* fixes #14038Andreas Rumpf2020-04-201-1/+1
|
* Make file descriptors from stdlib non-inheritable by default (#13201)alaviss2020-04-2017-44/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix #13972 (#14034)Clyybber2020-04-201-2/+2
|
* Fixes #14014 (#14029)cooldome2020-04-202-3/+41
| | | | | | | | | | | | | * add test * improve test * progress * fix #14014 * fix bug Co-authored-by: cooldome <ariabushenko@bk.ru>
* allow generic typedesc field access (#12220)Jasper Jenkins2020-04-202-57/+62
| | | Co-authored-by: Clyybber <darkmine956@gmail.com>
* Update code example to match new sdl2.nim syntax (#13924)Lưu Danh, Hiếu2020-04-201-25/+43
| | | | | | | | | | | | | | | | | * Update code example to match new sdl2.nim syntax Signed-off-by: Hieu Luu Danh <hieu@vivu.asia> * Modify on recommendation of @alaviss - Removed trailing whitespaces - Detailed how to compile libnimhcr and libnimrtl - Fixed some logic in example code * Modify following recommendations of @alaviss - Rewording so that it conforms to Windows/Linux/MacOS Signed-off-by: Hieu Luu Danh <hieu@vivu.asia>
* Make bitand, bitor, bitxor varargs-friendly (#13985)awr12020-04-202-9/+34
| | | | | | | | * made bitand, bitor, bitxor varargs friendly * changed new bitops to macros * changed macro signature for consistency (this technically doesn't matter) * added tests * removed redundant assert * fix literal
* remove the nilChecks switch; refs #11570Araq2020-04-205-9/+5
|
* fix for asm statement; refs #12650Araq2020-04-201-1/+1
|
* refactor system.$ for objects a little; refs #13398Araq2020-04-201-9/+3
|
* add `--experimental:vmopsDanger`; add generic conversion for vmops (#13813)Timothee Cour2020-04-203-9/+66
| | | * add --experimental:vmopsDanger; vmops cleanups
* compiler/suggest: highlight squashed operators (#11796)alaviss2020-04-202-3/+18
| | | | | | The operator fetching proc is greedy, so operators such as `%*` in expression `%*{}` can't be highlighted. This commit fixes that.
* unicode: minor documention improvementAraq2020-04-201-0/+1
|
* fixes #12834 (#14017)Andreas Rumpf2020-04-191-3/+3
|
* fixes #12741 (#14005)Andreas Rumpf2020-04-194-49/+57
| | | | * fixes #12741 * updated tests