summary refs log tree commit diff stats
path: root/changelog.md
Commit message (Collapse)AuthorAgeFilesLines
* Implements RFCs #209 (#13995)cooldome2020-04-161-1/+28
| | | | | * add test * add changelod entry Co-authored-by: cooldome <ariabushenko@bk.ru>
* Add `hashWangYi1` (#13823)c-blake2020-04-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Unwind just the "pseudorandom probing" (whole hash-code-keyed variable stride double hashing) part of recent sets & tables changes (which has still been causing bugs over a month later (e.g., two days ago https://github.com/nim-lang/Nim/issues/13794) as well as still having several "figure this out" implementation question comments in them (see just diffs of this PR). This topic has been discussed in many places: https://github.com/nim-lang/Nim/issues/13393 https://github.com/nim-lang/Nim/pull/13418 https://github.com/nim-lang/Nim/pull/13440 https://github.com/nim-lang/Nim/issues/13794 Alternative/non-mandatory stronger integer hashes (or vice-versa opt-in identity hashes) are a better solution that is more general (no illusion of one hard-coded sequence solving all problems) while retaining the virtues of linear probing such as cache obliviousness and age-less tables under delete-heavy workloads (still untested after a month of this change). The only real solution for truly adversarial keys is a hash keyed off of data unobservable to attackers. That all fits better with a few families of user-pluggable/define-switchable hashes which can be provided in a separate PR more about `hashes.nim`. This PR carefully preserves the better (but still hard coded!) probing of the `intsets` and other recent fixes like `move` annotations, hash order invariant tests, `intsets.missingOrExcl` fixing, and the move of `rightSize` into `hashcommon.nim`. * Fix `data.len` -> `dataLen` problem. * This is an alternate resolution to https://github.com/nim-lang/Nim/issues/13393 (which arguably could be resolved outside the stdlib). Add version1 of Wang Yi's hash specialized to 8 byte integers. This gives simple help to users having trouble with overly colliding hash(key)s. I.e., A) `import hashes; proc hash(x: myInt): Hash = hashWangYi1(int(x))` in the instantiation context of a `HashSet` or `Table` or B) more globally, compile with `nim c -d:hashWangYi1`. No hash can be all things to all use cases, but this one is A) vetted to scramble well by the SMHasher test suite (a necessarily limited but far more thorough test than prior proposals here), B) only a few ALU ops on many common CPUs, and C) possesses an easy via "grade school multi-digit multiplication" fall back for weaker deployment contexts. Some people might want to stampede ahead unbridled, but my view is that a good plan is to A) include this in the stdlib for a release or three to let people try it on various key sets nim-core could realistically never access/test (maybe mentioning it in the changelog so people actually try it out), B) have them report problems (if any), C) if all seems good, make the stdlib more novice friendly by adding `hashIdentity(x)=x` and changing the default `hash() = hashWangYi1` with some `when defined` rearranging so users can `-d:hashIdentity` if they want the old behavior back. This plan is compatible with any number of competing integer hashes if people want to add them. I would strongly recommend they all *at least* pass the SMHasher suite since the idea here is to become more friendly to novices who do not generally understand hashing failure modes. * Re-organize to work around `when nimvm` limitations; Add some tests; Add a changelog.md entry. * Add less than 64-bit CPU when fork. * Fix decl instead of call typo. * First attempt at fixing range error on 32-bit platforms; Still do the arithmetic in doubled up 64-bit, but truncate the hash to the lower 32-bits, but then still return `uint64` to be the same. So, type correct but truncated hash value. Update `thashes.nim` as well. * A second try at making 32-bit mode CI work. * Use a more systematic identifier convention than Wang Yi's code. * Fix test that was wrong for as long as `toHashSet` used `rightSize` (a very long time, I think). `$a`/`$b` depend on iteration order which varies with table range reduced hash order which varies with range for some `hash()`. With 3 elements, 3!=6 is small and we've just gotten lucky with past experimental `hash()` changes. An alternate fix here would be to not stringify but use the HashSet operators, but it is not clear that doesn't alter the "spirit" of the test. * Fix another stringified test depending upon hash order. * Oops - revert the string-keyed test. * Fix another stringify test depending on hash order. * Add a better than always zero `defined(js)` branch. * It turns out to be easy to just work all in `BigInt` inside JS and thus guarantee the same low order bits of output hashes (for `isSafeInteger` input numbers). Since `hashWangYi1` output bits are equally random in all their bits, this means that tables will be safely scrambled for table sizes up to 2**32 or 4 gigaentries which is probably fine, as long as the integer keys are all < 2**53 (also likely fine). (I'm unsure why the infidelity with C/C++ back ends cut off is 32, not 53 bits.) Since HashSet & Table only use the low order bits, a quick corollary of this is that `$` on most int-keyed sets/tables will be the same in all the various back ends which seems a nice-to-have trait. * These string hash tests fail for me locally. Maybe this is what causes the CI hang for testament pcat collections? * Oops. That failure was from me manually patching string hash in hashes. Revert. * Import more test improvements from https://github.com/nim-lang/Nim/pull/13410 * Fix bug where I swapped order when reverting the test. Ack. * Oh, just accept either order like more and more hash tests. * Iterate in the same order. * `return` inside `emit` made us skip `popFrame` causing weird troubles. * Oops - do Windows branch also. * `nimV1hash` -> multiply-mnemonic, type-scoped `nimIntHash1` (mnemonic resolutions are "1 == identity", 1 for Nim Version 1, 1 for first/simplest/fastest in a series of possibilities. Should be very easy to remember.) * Re-organize `when nimvm` logic to be a strict `when`-`else`. * Merge other changes. * Lift constants to a common area. * Fall back to identity hash when `BigInt` is unavailable. * Increase timeout slightly (probably just real-time perturbation of CI system performance).
* Add Data URI Base64, implements RFC-2397 (#13759)Juan Carlos2020-04-131-0/+1
| | | | | | | | | | | | | | | | | * Add Data URI Base64, implements RFC-2397 * Add Data URI Base64, implements RFC-2397 * Add Data URI Base64, implements RFC-2397 * https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420 * https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420 * ReSync changelog * https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420 Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* Add jsdomparser (#13920)Juan Carlos2020-04-131-0/+2
| | | | | | | | | | | | | | | | | * Add jsdomparser * Add jsdomparser * Add jsdomparser * https://github.com/nim-lang/Nim/pull/13920#issuecomment-610727142 * https://github.com/nim-lang/Nim/pull/13920#issuecomment-610727142 * https://github.com/nim-lang/Nim/pull/13920#issuecomment-610727142 * https://github.com/nim-lang/Nim/pull/13920#discussion_r405932909 * https://github.com/nim-lang/Nim/pull/13920#discussion_r406502592
* finally de-deprecate the .define and .undef pragmasAndreas Rumpf2020-04-041-0/+1
|
* new feature: ability to turn specific warnings to errorsAndreas Rumpf2020-04-041-0/+1
|
* create a changelog for v1.2.0narimiran2020-04-021-209/+4
|
* added an .assert pragma and mentioned the pragmas in the changelogAraq2020-04-021-0/+4
|
* feature/count (#13837)Dean Eigenmann2020-04-021-1/+1
|
* renamed new std/pragmas.nim to std/byaddr.nim (#13844)Andreas Rumpf2020-04-021-2/+2
| | | | | * renamed new std/pragmas.nim to std/byaddr.nim * minor code cleanup
* Jsconsole update (#12448)Juan Carlos2020-04-021-0/+1
| | | | | | * Improve jsconsole adding the rest of the stable api as documented on the standard at https://developer.mozilla.org/docs/Web/API/Console * Improve jsconsole, add runnableexamples * Simplify jsconsole
* Add browsers.openDefaultBrowser without URL, implements IETF RFC-6694 ↵Juan Carlos2020-04-011-0/+2
| | | | Section-3 (#13835)
* updated the changelogAraq2020-04-011-1/+1
|
* macros for proc types, macros for types (#13778)Andreas Rumpf2020-03-311-0/+2
| | | | | | | | | * new minor feature: macros for proc types, to be documented * Finished the implementation and added tests * [skip ci] Describe the new custom pragmas in the manual and the changelog Co-authored-by: Zahary Karadjov <zahary@gmail.com>
* stacktraces can now show custom runtime msgs per frame (#13351)Timothee Cour2020-03-301-0/+3
| | | | | | | | * 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
* distinctBase overload for values (#13746)Timothee Cour2020-03-251-1/+1
|
* new syntax for lvalue references: `var b {.byaddr.} = expr` (#13508)Timothee Cour2020-03-231-1/+4
| | | | | | | | * new syntax for lvalue references: `var b {.byaddr.} = expr` * on type mismatch, `???(0, 0)` not shown anymore * * compiler now lowers `var a: {.foo.}: MyType = expr` to foo(a, MyType, expr) * new pragmas.byaddr defined in pure library code exploiting this lowering * skip `template foo() {.pragma.}`
* introduce getPeerCertificates, fixes #13299 (#13650)Christian Ulrich2020-03-221-0/+3
| | | | | | | | | | | | * make i2d_X509 and d2i_X509 always available i2d_X509 and d2i_X509 have been available in all versions of OpenSSL, so make them available even if nimDisableCertificateValidation is set. * introduce getPeerCertificates, fixes #13299 getPeerCertificates retrieves the verified certificate chain of the peer we are connected to through an SSL-wrapped Socket/AsyncSocket. This introduces the new type Certificate which stores a DER-encoded X509 certificate.
* better error messages for Nim's effect systemAraq2020-03-221-0/+1
|
* SSL certificate verify GitHub action (#13697)Federico Ceratto2020-03-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement SSL/TLS certificate checking #782 * SSL: Add nimDisableCertificateValidation Remove NIM_SSL_CERT_VALIDATION env var tests/untestable/thttpclient_ssl.nim ran successfully on Linux with libssl 1.1.1d * SSL: update integ test to skip flapping tests * Revert .travis.yml change * nimDisableCertificateValidation disable imports Prevent loading symbols that are not defined on older SSL libs * SSL: disable verification in net.nim ..when nimDisableCertificateValidation is set * Update changelog * Fix peername type * Add define check for windows * Disable test on windows * Add exprimental GitHub action CI for SSL * Test nimDisableCertificateValidation
* [RFC] 'walkDir' now has a new 'checkDir' flag, to mimic behaviour of other ↵Timothee Cour2020-03-201-3/+9
| | | | | languages (#13642) Co-authored-by: narimiran
* Add Base64 safe (#13672)Juan Carlos2020-03-201-0/+2
| | | | * Implement RFC-4648 Section-7 * https://github.com/nim-lang/Nim/pull/13672#issuecomment-600993466
* fix #11458 oswalkdir (#13689)Timothee Cour2020-03-191-0/+1
| | | | | * fix #11458 oswalkdir * changelog
* added a switch -d:nimEmulateOverflowChecks for broken or old GCC versions ↵Andreas Rumpf2020-03-191-0/+6
| | | | (#13692)
* httpcore: deprecate `==`(string, HttpCode) (#13682)alaviss2020-03-191-0/+3
| | | | | | | | | | According to [RFC7230], the reason phrase attached to the status line is optional and clients should not rely on it. This in turn causes the proc to be practically useless, as clients should only inspect the return code. Ref #13680. [RFC7230]: https://tools.ietf.org/html/rfc7230#section-3.1.2
* catchable defects (#13626)Andreas Rumpf2020-03-121-0/+8
| | | | | | | | | | * 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
* rename `lenTuple` and `lenVarargs` (#13639)Miran2020-03-121-1/+1
| | | | | | | | | | | * rename 'lenTuple' to 'tupleLen' Rationale: `lenTuple` is a tuple consisting of lengths (e.g. `(1, 5, 0)`), `tupleLen` is a length of a tuple (e.g. `tupleLen((1, 5, 0) == 3`) * rename 'lenVarargs' to 'varargsLen' The same rationale as a previous commit. Consistency.
* fixes #13558: toDateTime buggy on 29th, 30th and 31th of each month; ↵Timothee Cour2020-03-111-0/+4
| | | | breaking change: do not use `now` to compute result, was undocumented and non-sensical (#13565)
* fixes #13519Araq2020-03-111-0/+4
|
* add expectIdent to macros (#12778)Arne Döring2020-03-111-1/+1
| | | | | | | | | | | | | | | | * add expectIdent to macros * apply feedback * Update lib/core/macros.nim Co-Authored-By: Clyybber <darkmine956@gmail.com> * Update texpectIdent2.nim * Update texpectIdent1.nim Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #13605 (#13611)Andreas Rumpf2020-03-091-0/+3
|
* Add isValidFilename (#13561)Juan Carlos2020-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add os.isValidFilename * Add os.isValidFilename * Peer Review Feedbacks https://github.com/nim-lang/Nim/pull/13561#discussion_r388013139 * Peer Review Feedbacks https://github.com/nim-lang/Nim/pull/13561#issuecomment-595259568 * Add since to const * Update the documentation comment * Update the changelog * Update lib/pure/os.nim Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com> * Update lib/pure/os.nim Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com> * Peer Review Feedbacks, Add more Tests Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* Revert broken asynchttpserver FutureStream additions.Dominik Picheta2020-03-061-2/+0
| | | | | | | | | | | As discussed in #13394, these changes cannot work. Reverted via ``` git revert --no-commit 5bf571f061d53d35aab727f420afd9f415987723 git revert --no-commit abd660c407d00d0c4f2129ff11bfc69badda8ece git revert --no-commit 955465e5f42b1353f69f3bd884908a7ef91ce13b git commit ```
* 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
* std/compilesettings implementation (#13584)Andreas Rumpf2020-03-041-0/+12
| | | | | | | | * Implement compileSetting() and compileSettingSeq() * Change from magic to vmop * better design for querySetting Co-authored-by: genotrance <dev@genotrance.com>
* Nimpretty Fix negative indent breaks code (#13580)Juan Carlos2020-03-041-0/+1
|
* fixes #13543 and added times.isLeapDay (#13547)Timothee Cour2020-03-011-0/+1
|
* added operateOn to sugar.nim to give Nim the chaining mechanism it de… ↵Andreas Rumpf2020-02-261-1/+13
| | | | | | | | (#13092) * implemented the with stdlib module as specified in https://github.com/nim-lang/RFCs/issues/193 * change sugar.outplace to sugar.dup according to https://github.com/nim-lang/RFCs/issues/193 * changelog update
* xmltree: Make indentation consistent with any num of children nodes (#13482)Kaushal Modi2020-02-261-0/+2
| | | Ref: https://forum.nim-lang.org/t/5972
* fix #13455 ; joinPath(a,b) now honors trailing slashes in b (or a if b = "") ↵Timothee Cour2020-02-261-1/+2
| | | | | | | (#13467) * fix #13455 ; joinPath(a,b) now honors trailing slashes in b (or a if b = "") * fix test windows
* fix 3 minor bugs in joinPath (see #13455) (#13462) [backport]Andrey Makarov2020-02-231-0/+2
|
* relativePath("foo", "foo") is now ".", not "" (#13452)Timothee Cour2020-02-221-1/+3
|
* Consider proc as a pointer type in options (#13460)hlaaftana2020-02-211-0/+2
| | | | | | | | * Consider proc as a pointer type in options * Add version annotation for SomePointer having proc in options * Log procs as pointers for options in changelog
* Add `sequtils.unzip` to complement `sequtils.zip` (#13429)Kaushal Modi2020-02-201-1/+1
|
* manual: documents changes regarding dynlib (#13425)alaviss2020-02-181-1/+3
| | | | | | | | * manual: documents changes regarding dynlib Closes #13416 * manual: clean up sentence phrasing
* Add browsers.osOpen (#12901)Juan Carlos2020-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add osOpen alias for the operating system specific open command * Add `--git.devel` option to the documentation remove unused import (#12900) fix json regression D20191212T144944 (#12902) [backport] Peer Review Feedback https://github.com/nim-lang/Nim/pull/12901#issuecomment-565851680 Merge branch 'devel' of https://github.com/nim-lang/Nim into osopen Peer Review Feedback https://github.com/nim-lang/Nim/pull/12901#issuecomment-565851680 Update lib/pure/browsers.nim Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com> Peer Review Feedback https://github.com/nim-lang/Nim/pull/12901#discussion_r358492316 allow typed/untyped in magic procs (#12911) NaN floatFormat with clang_cl (#12910) * clang_cl nan floatFormat * format add $nimeq for gdb (#12909) ARC: cycle detector (#12823) * first implementation of the =trace and =dispose hooks for the cycle collector * a cycle collector for ARC: progress * manual: the .acyclic pragma is a thing once again * gcbench: adaptations for --gc:arc * enable valgrind tests for the strutils tests * testament: better valgrind support * ARC refactoring: growable jumpstacks * ARC cycle detector: non-recursive algorithm * moved and renamed core/ files back to system/ * refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish Cleanup leftovers of #12911(#12916) Fix single match output (#12920) fixes #12899 (#12921) * fixes #12899 * fixes regression: destroy global variables in reverse declaration order, closureleak test relies on it Implement NixOS distro check (#12914) Better case coverage error message for alias and range enum (#12913) fix error in assertions document (#12925) [backport] fix cmdline bugs affecting nimBetterRun correctness (#12933) [backport] fix #12919 tasyncclosestall flaky: Address already in use (#12934) system.reset is no longer magic (#12937) It has now means setting x to default for new and old runtime alike Fix #12785 (#12943) * Fix #12785 and add test * better variable name update documentation for `closureScope` and `capture` (#12886) fixes #12735 on osx, call dsymutil for debug builds (#12931) * fix #12735 osx: dsymutil needs to be called for debug builds * also write dsymutil command to extraCmds in json build file Auto-initialize deques (#12879) case coverage error message for `char` (#12948) lenVarargs: number of varargs elements (#12907) docs: tiny style improvements added guidelines for evolving Nim's stdlib fixes a bug that kept sugar.collect from working with for loop macros [backport] fixes #12826 fixes a regression a better bugfix fixes a test case fixes a silly regression fixes the distros.nim regression ported channels to ARC ported osproc.nim to ARC ported re.nim to ARC ARC: default to a shared heap with --threads:on osproc: fixes regression fixes another regression fixes #12945 (#12959) minor refactorings Fixes stackoverflow links in readme (#12963) [backport] Allow customize Host header [ci skip] docfix .. < => ..< (#12981) [backport] parsecfg: retain CRLF line breaks, fixes #12970 (#12971) generic stack trace overriding mechanism (#12922) * libbacktrace support * switch to a generic stack trace overriding mechanism When "nimStackTraceOverride" is defined, once of the imported modules can register its own procedure to replace the default stack trace generation by calling `registerStackTraceOverride(myOwnProc)`. Tested with `./koch boot -d:release --debugger:native -d:nimStackTraceOverride --import:libbacktrace` for the compiler itself and `./bin/nim c -r -f --stacktrace:off --debugger:native -d:nimStackTraceOverride --import:libbacktrace foo.nim` for an external program. * make the StackTraceOverrideProc {.noinline.} Added fix for handling TaintedStrings in streams and httpclient (#12969) * Added fix for taint mode in streams and httpclient * Removed taintMode export from system.nim Check pqntuples > 0 in getValue. Fixes #12973 (#12974) c_fflush() the rawWrite() buffer (#12987) Stack traces on an unbuffered stderr get out of sync with line-buffered stdout - usually on Windows terminals or CI logs. This fixes it by calling C's fflush() on the output buffer in the procedure used for printing stack traces. fixes #12989 Revert "fixes #12989" This reverts commit 928c2fee06bd11a0901c5f563b4953788be76ae6. fixes #12965 (#12991) fixes #12989 (#12992) * fixes #12989 * Revert "remove unwanted changes" This reverts commit 501829732a8e44deef2d815c303859efbe452cb5. fixes disruptek/nimph#102 multi-level nim.cfg use (#13001) [backport] --exception:goto switch for deterministic exception handling (#12977) This implements "deterministic" exception handling for Nim based on goto instead of setjmp. This means raising an exception is much cheaper than in C++'s table based implementations. Supports hard realtime systems. Default for --gc:arc and the C target because it's generally a good idea and arc is all about deterministic behavior. Note: This implies that fatal runtime traps are not catchable anymore! This needs to be documented. fix #12985 {.push.} now does not apply to generic instantiations (#12986) Sink to MemMove optimization in injectdestructors (#13002) remove default argument for readLines (#12807) [backport] fixes #12978 (#13012) Fix typo (#13015) [backport] fixes #12961 (#13019) fixes #12956 (#13020) fix #12988 (#13022) fix #12988 Fixes #13026 (#13028) fixes #12964 (#13027) fixes #13032 VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (#12877) * VM: allow certain hardcoded special var variables at CT * VM: allow all importc var, cast[int](ptr) * fix tests tests/vm/tstaticprintseq.nim, tests/cpp/t8241.nim * VM: == works for ptr/pointer nodes * bugfix: ==, cast now also works for pointer, not just ptr * VM supports cast PtrLikeKinds <=> PtrLikeKinds / int * improve cname handling * fixup + bug fix * VM: support cast from ref to int * address comment: opcLdGlobalDeref => opcLdGlobalDerefFFI * defensive check against typ == nil fix enumtostr crash for enum-range (#13035) fixes #13013, reverts previous changes to readLines() (#13036) [backport] * Revert "remove default argument for readLines (#12807) [backport]" This reverts commit c949b81efdeb08b38224e1678ad140b7b7663b15. reprjs: style changes fixes #12996 Rst parser respect `:start-after:` and `:end-before:` in `include` directive (#12972) * [FEATURE] rst parser respect :start-after: in include Rst parser now respects `:start-after:` and `:end-before:` attributes for `include` directive. * [DOC] include directive parsing proc update * [TEST] Added unit tests for include rst directive in `rst` module Allow `-o` option for `buildIndex` (#13037) [backport] Addressing #12771 This is also included in the docgen documentation [here](https://nim-lang.org/docs/docgen.html) but its not respected as reported in the issue. [cleanup] remove disabled (and obsolete) ttypetraits; rename ttypetraits2 => ttypetraits (#13041) * remove disabled (and obsolete) ttypetraits; rename ttypetraits2 => ttypetraits * D20200105T085828 fix super strange bug that causes CI to fail: builds.sr.ht with: `Error: Settle timed out after 120 attempts` Continue #13002 (#13021) testament/important_packages dont run hts (#13052) Modify the test command for nimly (nimble-package) (#13053) clean up deprecated stuff and unused imports in tests (#13059) --styleCheck:hint now works (#13055) [easy] --hint:link:on now shows link cmd instead of nothing (#13056) * --hint:link:on now shows link cmd instead of nothing * update doc for --listCmd add pqserverVersion,pqconnectionNeedsPassword,pqconnectionUsedPassword (#13060) basename supports pragmaexpr (#13045) * basename supports pragmaexpr * update changelog distinctBase type trait for distinct types (#13031) make SuccessX show project file + output file (#13043) * make SuccessX show project file + output file * address comments * fix test and add `result.err = reNimcCrash` otherwise hard to see where reNimcCrash used * address comments move entries from the wrong changelog file [ci skip] fix crash due to errant symbols in nim.cfg (#13073) [backport] Deleted misplaced separator (#13085) [backport] Misplaced separator, which was constantly breaking compilation on Haiku OS, was deleted. take the one good idea from --os:standalone and enable it via -d:StandaloneHeapSize (#13077) remove all remaining warnings when build nim (with -d:nimHasLibFFI) (#13084) * cleanup deprecations in evalffi + elsewhere * remove dead code getOrdValue64 Use '__noinline' instead of 'noinline' for N_NOINLINE gcc attribute, this prevents clashes with systems where 'noinline' might be already defined (#13089) Fix error check code in osproc (#13090) [backport] fixes #13072; no test case because it will be added later with more exception handling related bugfixes fixes #13070 typetraits: fixes #6454; genericParams; added lenTuple; added tuple type get (#13064) [backport] system/io.nim fix wrong documentation comment [ci skip] fixes an asyncftpclient bug; refs #13096 [backport] System cleanup, part 1 (#13069) * system.nim: mark what every .pop does * system.nim: un-nest when statements [backport] fix #12813, fix #13079 (#13099) Correctly remove a key from CountTable when it is set to zero. more arc features (#13098) * config update * ARC now supports 'repr' and 'new' with finalizers is supported Remove some unused/disabled OpenSSL functions (#13106) Add link to posix_utils.html in posix.nim (#13111) VM FFI: write(stderr, msg) and fprintf(cstderr, msg) now work at CT (#13083) fix the ftp store function read the local file bug (#13108) [backport] * Update asyncftpclient.nim When use newStringOfCap function not have assign memory for the string data,so if use this address the fault is rasise. * complelete the bugfix fix rtti sizeof for varargs in global scope (#13125) [backport] fixes #13122 (#13126) * fixes #13122 * moved tests to where they belong fixes #13112 (#13127) * improve line error information * fixes #13112 Expose more openSSL methods. (#13131) fixes #13100 nim doc now treats `export localSymbol` correctly (#13123) [backport] * fix #13100 nim doc now treats `export localSymbol` correctly * use owner instead fixes #13119 (#13128) * fixes #13119 * fixes a regression fixes #13105 (#13138) fixes #10665 (#13141) [backport] pass platform argument only if vccexe is used (#13078) * pass platform only if vccexe is used * fixes #12297 fixes #13104 [backport] (#13142) fixes #9674 [backport] (#13143) Fix typo in doc/destructors.rst (#13148) Added 'ansic' os support for minimal (embedded) targets (#13088) * os:any implementation * os:asny: omit flock/funlock calls in echoBinSafe * Disabled default "unhandled expection" reporting for `--os:any` to reduce code size. Added unhandledExceptionHook instead which can be used to get a notification from Nim and handle it from the application. System cleanup, part 2 (#13155) * create basic_types, arithmetics, exceptions, comparisons * create setops.nim * create memalloc.nim * create gc_interface.nim * create iterators_1.nim export normalizePathEnd (#13152) successX now correctly shows html output for `nim doc`, `nim jsondoc`; fix #13121 (#13116) * successX now correctly shows html output for nim doc * fixes #13121 * fixup hintSuccessX to be less weird ARC: misc bugfixes (#13156) * fixes #13102 * closes #13149 * ARC: fixes a move optimizer bug (there are more left regarding array and tuple indexing) * proper fix; fixes #12957 * fixes yet another case object '=' code generation problem CI fix timeout error (#13134) Remove obsolete code from osalloc (#13158) style fix: change 'JS' to 'js' to make it consistent (#13168) Working towards arc codegen (#13153) fixes #13029 fixes #12998 nim doc regression (#13117) fix tsizeof3 for aarch64 (#13169) Cleanup DFA (#13173) Fix docs (#13176) fixes #13095 (#13181) * fixes #13095 * fix typo make case-object transitions explicit, make unknownLineInfo a const, replace a few magic numbers with consts (#13170) ARC works for async on Windows (#13179) make sink operator optional (#13068) * make sink operator optional * bug fix, add changelog entry * Trigger build * fix one regression * fix test * Trigger build * fix typos Fix docs for subdirs too (#13180) * Fix doc subdirs * Extract to helper proc, and fix on windows followup on #10435 : should be diff, not show (#13162) fixes #13157 refs #13054 correctly handle {.exportc,dynlib.} and {.exportcpp,dynlib.} (#13136) * refs #13054 correctly handle {.exportc,dynlib.} and {.exportcpp,dynlib.} * put back NIM_EXTERNC for N_LIB_EXPORT; causes issues with compilerproc fixes #13144 (#13145) * fixup: genscript now does not copy nimbase.h but uses -I$nim/lib times: toUnixFloat, fromUnixFloat (#13044) maybe: allows optional chaining of field access and indexing when LHS i snil (#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 fix docs + API for fieldPairs, fields (#13189) more on arc codegen (#13178) * arc codegen for union type * add more tests * fix offsetof * fix tsizeof test * fix style Add link to packaging.html (#13194) Fixes #13186 (#13188) fixes #13195 revert last commit Merge branch 'devel' of https://github.com/nim-lang/Nim into devel Revert "fixes #13195" This reverts commit cd7904f2b29e623998a1d32ee726d000f56fc5ce. fixes #13110 (#13197) fixes #13195 (#13198) * fixes #13195 * extra fix * fix typo compiler/ccgtypes: hide exportc proc unless it has dynlib (#13199) This hides most of stdlib's internal functions from resulting binaries/libraries, where they aren't needed on *nix. Static libraries are not affected by this change (visibility doesn't apply to them). fix range[enum] type conversion (#13204) [backport] Idxmin & idxmax, continuation (#13208) * Add idxmin() which returns the index of the minimum value * Add idxmax() which returns the index of the maximum value * Add tests for idxmin() * Add tests for idxmax() * Remove initialization of result = 0 * Adds overloading for arrays (no enums indexed arrays yet) * Add support for enum index arrays * Fix tests with enum * Fix tests for idxmax * Change names of the procedures to minIndex and maxIndex * address Araq's comments: - remove 'array' versions - add .since pragma - return 'int' instead of 'Natural' - add changelog entry Co-authored-by: Federico A. Corazza <20555025+Imperator26@users.noreply.github.com> fix #13211 relativePath("foo", ".") (#13213) fixes a critical times.nim bug reported on IRC [backport] (#13216) httpclient, maxredirects to Natural, newHttpClient/newAsyncHttpClient add headers argument instead of hardcoded empty (#13207) added note to re constructor regarding performance (#13224) Since I was new to regex I did not know that there is a compilation going on with ``re"[abc]"`` constructor and so I followed the other examples in the docs blindly, that is I just put the constructor directly in the arguments of match, find, etc., which was inside a loop and then wondered why my performance was so bad. Of course putting it outside the loop made it vastly more performant. People like me would benefit from the small note I added I would think :) [backport] Documentation Fix #12251 (#13226) [ci skip] [backport] times/getClockStr(): fix mistake in doc (#13229) [ci skip] new os.isRelativeTo (#13212) [backport] Fix typo and improve in code-block of 'lib/pure/parseutils.nim' (#13231) [ci skip] [backport] fix #11440, add docs to isNil for seq types needing nilseq (#13234) [ci skip] VM: allow overriding MaxLoopIterations without rebuilding nim (#13233) kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes (#13221) * kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes * fixup after #13212 isRelativeTo got merged fix lots of bugs with parentDir, refs #8734 (#13236) Unexport even more symbols (#13214) * system/gc: don't export markStackAndRegisters * compiler/cgen: unexport internal symbols As these functions are Nim-specific walkaround against C's optimization schemes, they don't serve any purpose being exported. * compiler/cgen: don't export global var unless marked * compiler/ccgthreadvars: don't export threadvar unless marked * tests/dll/visibility: also check for exports This ensure that these changes don't break manual exports. * compiler/cgen: hide all variables created for constants * compiler/ccgtypes: don't export RTTI variables * compiler/ccgexprs: make all complex const static * nimbase.h: fix export for windows * compiler/cgen, ccgthreadvars: export variables correctly For C/C++ variables, `extern` means that the variable is defined in an another unit. Added a new N_LIB_EXPORT_VAR to correctly export variables. Removed lib/system/allocators.nim. seqs_v2 and strs_v2 now uses allocShared0. (#13190) * Cleanup, remove lib/system/allocators.nim. seqs_v2 and strs_v2 now use allocShared0 by default. * Fixed -d:useMalloc allocShared / reallocShared / deallocShared. These now use the alloc/dealloc/realloc implementation that also takes care of zeroing memory at realloc. * Removed debug printfs * Removed unpairedEnvAllocs() from tests/destructor/tnewruntime_misc * More mmdisp cleanups. The shared allocators do not need to zero memory or throw since the regular ones already do that * Introduced realloc0 and reallocShared0, these procs are now used by strs_v2 and seqs_v2. This also allowed the -d:useMalloc allocator to drop the extra header with allocation length. * Moved strs_v2/seqs_v2 'allocated' flag into 'cap' field * Added 'getAllocStats()' to get low level alloc/dealloc counters. Enable with -d:allocStats * *allocShared implementations for boehm and go allocators now depend on the proper *allocImpl procs [backport] documentation: Add channels examples (#13202) [ci skip] [backport] Make all parseutils examples auto-checking (#13238) - Also fix one example's output (ikString -> ikStr, ikVar instead of ikExpr) Updated 'nim for embedded systems' section to use --os:any and --gc:arc (#13237) * Updated 'nim for embedded systems' section to use --os:any and --gc:arc * Added section about size optimization to embedded systems Remove name attribute from docutils.nimble (#13239) Fixes asyncftpclient multiline reading, fixes #4684 (#13242) Previously, the 4th character of `result` was checked for `'-'` every time, instead of each new line. Also made it work for taint mode. Fix typo for literal `[` (#13243) The literal value for the `tkBracketLe` token was incorrectly set to `]` rather than `[`. I've had a quick glance at the code and it doesn't look like this change will affect anything at all, but I haven't tested yet - let's see if the CI explodes... Add "origin" to window.location (#13251) Add "origin" to window location: https://www.w3schools.com/jsref/prop_loc_origin.asp nim dump: add libpath (#13249) contributing docs: symbols need package prefix; changed allocStats to nimAllocStats (#13247) testament/azure: major rewrite (#13246) This commit features a major rewrite of Azure Pipelines integration, turning the spaghetti it originally was into something maintainable. Key changes: - No longer requires a ton of hooks into testament. - Results are now cached then bulk-uploaded to prevent throttling from Azure Pipelines, avoiding costly timeouts. - A low timeout is also employed to avoid inflated test time. - The integration is now documented. Cleaned up mmdisp.nim, moved implementations into lib/system/mm/ (#13254) make goto based exceptions available for 'nim cpp' (#13244) * make goto based exceptions available for 'nim cpp' * optimize seq.add to be comparable to C++'s emplace_back ARC: remove unnecessary code ARC: optimize complete object constructors to use nimNewObjUninit make nre compile with --gc:arc Rename isNilOrWhitespace to isEmptyOrWhitespace and make it use allCharsInSet (#13258) * Rename isNilOrWhitespace to isEmptyOrWhitespace * Make isEmptyOrWhitespace use allCharsInSet(Whitespace) Clearer final objects error; fixes #13256 (#13257) scrollTop must be settable (#13263) * scrollTop must be assignable Make scrollTop settable * add missing export fixes #13219 (#13272) fixes #13281 (#13282) * fixes ##13281 * add comment to test unittest add resetOutputFormatters proc (#13267) * add resetOutputFormatters * remove space * resolve comments TlSF Alloctor: use less memory for --gc:arc (#13280) Tiny since cleanup (#13286) nimv2 widestring indexing (#13279) Repr v2 progress (#13268) * progress on repr_v2 * repr progress * add ref objects with distrinct * fix failing tests refactor htmldocs; gitignore it removed unused import fix stdout(etc) for emscripten csize => csize_t for sysctl Thread attributes should be destroyed using the pthread_attr_destroy() (#13293) On some OSes (such as FreeBSD or Solaris), pthread_attr_init allocate memory. So it is necessary to deallocate that memory by using pthread_attr_destroy. fix critical bug discovered by #11591 (#13290) [backport] miscellaneous bug fixes (#13291) * fix for emscripten etc * add testcase for #13290 * replace deprecated isNilOrWhitespace CT FFI: fix for windows; fix case transition; error msg shows more useful context (#13292) * evalffi: fix case transition * evalffi: fix for windows * evallffi: `cannot import` errmsg now also shows which library it tried to import symbol from refs #8391 std/os now shows runtime context for raiseOSError exceptions (#13294) * refs #8391: fix errmsg for setCurrentDir * raiseOSError calls for copyFile * refs #8391 std/os now shows runtime context for raiseOSError exceptions build_all.sh: building csources 5X faster thanks to make -j (#13300) * build_all.sh: building csources 5X faster thanks to make -j * fix for freebsd * use OS-dependent formula to get number of logical cores * make is an optional dependency Fix capture for object types (#13315) * Fix capture for object|tuple|... types * Add test case Quote nim executable before executing. (#13316) [backport] In case nim executable is located in PATH containing spaces. fixes #13311 ReSync with devel Make build_all.sh more portable and a bit simpler (#13308) koch: enable checks in the compiler when running CI (#13323) fix #13132 tnetdial (#13318) enable testing -d:nimHasLibFFI mode (#13091) Fix #10717, fix #13284 (#13307) Fixed codegen for constant cstring with --gc:arc (#13326) * Fixed codegen for constant cstring with --gc:arc, fixes #13321 * Added test for #13321 Option to allow the request body to be processed outside the asynchttpserver library. (#13147) Allow the request body to be processed outside the asynchttpserver library to break big files into chunks of data. This change does not break anything. build_all.sh update (#13320) * Don't overload the system, don't crash when you can't determine the CPU count and don't rely on bash * Extract to variable * Limit number of spawned jobs for systems with weak IO * Use proper arithmetic braces contributing.rst: Add a special rule for 'outplace'-like features [backport] -d:danger should imply -d:release (#13336) nim secret: support linenoise when available (#13328) fix #13150 `nim doc --project` now works reliably (#13223) * 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 make monotimes have zero overhead if you don't use it (#13338) [backport] fix #13349 regression: isNamedTuple now works with generic tuples (#13350) fixes #13269 (#13344) adding sqlite3 backup functions (#13346) * adding sqlite3 backup functions * changing sleep to sqlite3_sleep to prevent clashes Added a basic example how to handle a Post request. (#13339) * Added a basic example how to handle a Post request. They were also made minor cosmetic changes. * Minor fixes suggested by Yardanico * Fixed a wrong value in chunkSize constant. * Re-added the request.body for compatibility! replace old problematic isNamedTuple implementation by TypeTrait isNamedTuple in dollars.nim (#13347) * replace old problematic isNamedTuple implementation by TypeTrait isNamedTuple * fix for bootstrap fix #13182: `proc fun(a: varargs[Foo, conv])` now can be overloaded (#13345) [backport] miscellaneous bug fixes (part 3) (#13304) * 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 testament: introduce 'matrix' for testing multiple options (#13343) printing float values will have one more digit. (#13276) [backport] * printing float values will have one more digit. Fixes #13196 [backport] fix #13352 [backport] remove 'CountTable.mget' (#13355) It didn't work, and it was an oversight to be included in v1.0. fix #6736: templates in unittest now show actual value (#13354) Revert "printing float values will have one more digit. (#13276) [backport]" (#13363) This reverts commit b2c6db97f9f477f6999fa9c7aae5e32f10b6b3fe. Add sideEffect pragma to importC procs in posix, winlean and time module (#13370) * Add sideEffect pragma to procs in winlean * Add sideEffect pragma to procs in posix * Add test for #13306 * Add sideEffect pragma to procs in times * Fixes #13306 fixes #3339 by documenting the limitations of case-statement (#13366) fixes #13314 (#13372) testament: this now works: "testament r /abspath/to/test.nim" (#13358) fix `is` with generic types; fix `genericHead(Foo[T])` (#13303) * fix #9855, fix #9855, fix genericHead * render TTypeKind via toHumanStr fix #13255 (#13275) [backport] remove outplace version of 'merge' for CountTables (#13377) * remove outplace version of 'merge' for CountTables * remove 'merge' tests fix #13374 `nim c -r -` now generates $nimcache/stdinfile (#13380) [backport] fix #9634 don't crash on execCmdEx/readLine when inside gdb/lldb (#13232) * fix #9634 debugging a program using execCmdEx now works * only apply EINTR to c_gets for now This reverts commit c0f5305b5a0b46983dfd27e3d77ecbf4f8744dcc. lib.rst: add a link for jsconsole [backport] (#13383) Make vccexe parse response files (#13329) expectLen now shows the length that we got (#13387) fix several bugs with `repr` (#13386) fixes #13378 [backport] (#13392) remove dead code test_nimhcr_integration.(bat,sh) (#13388) * enable test for osx: import tests/dll/nimhcr_integration * re-disable osx test fix linenoise regression (#13395) * fix nightlies linenoise regression * fix other installers Revert "remove dead code test_nimhcr_integration.(bat,sh) (#13388)" (#13396) This reverts commit 90491ea0a98aaca198bebf3ce99a1f86559f18ec. fixes #13368 (#13397) fix bug in int128 (#13403) isolate the build process from external config files (#13411) add ggplotnim to important_packages (#13206) Fix to asynchttpserver form data/body broken with #13147 (#13394) * Fix to asynchttpserver form data/body broken with #13147 * New implementation that use a interator instance of future streams * asynchttpserver now can handle chunks of data. Merge branch 'devel' of https://github.com/nim-lang/Nim into osopen Squash Commits; Peer review feedbacks https://github.com/nim-lang/Nim/pull/12901#discussion_r379694384
* Fix to asynchttpserver form data/body broken with #13147 (#13394)Henrique Dias2020-02-141-1/+2
| | | | | | * Fix to asynchttpserver form data/body broken with #13147 * New implementation that use a interator instance of future streams * asynchttpserver now can handle chunks of data.
* remove outplace version of 'merge' for CountTables (#13377)Miran2020-02-101-0/+4
| | | | | | * remove outplace version of 'merge' for CountTables * remove 'merge' tests
* [backport] remove 'CountTable.mget' (#13355)Miran2020-02-071-4/+9
| | | It didn't work, and it was an oversight to be included in v1.0.
* Option to allow the request body to be processed outside the asynchttpserver ↵Henrique Dias2020-02-041-0/+1
| | | | | | library. (#13147) Allow the request body to be processed outside the asynchttpserver library to break big files into chunks of data. This change does not break anything.