summary refs log tree commit diff stats
path: root/changelog.md
Commit message (Collapse)AuthorAgeFilesLines
* fixes #14054 [backport:1.2] (#14061)Andreas Rumpf2020-04-301-0/+4
| | | | | | | | | * fixes #14054 * make tests green again * more tests are green * maybe now
* StringStream & more stdlib modules support for JS/NimScript (#14095)hlaaftana2020-04-281-0/+11
| | | | | * 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-0/+1
| | | | | | | * 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/+2
| | | | * $(unsigned) now works for js * move NimMajor+friends closer to NimVersion according as per reviewer feedback
* added high level sendTo and recvFrom to std/asyncnet (UDP functionality) ↵rockcavera2020-04-261-0/+2
| | | | | | | | | (#14109) * added high level sendTo and recvFrom to std/asyncnet; tests were also added. * add .since annotation, a changelog entry and fixed to standard library style guide. * Improved asserts msgs and added notes for use with UDP sockets
* Faster readStr() (#14099)Christopher Dunn2020-04-251-0/+3
| | | | | | | | | * Faster readStr() * https://github.com/nim-lang/Nim/issues/13857 * Add .since annotation and add to changelog * Private, un-sinced proc for csource bootstrapping
* Add critbits.commonPrefixLen (#14072)Phil Krylov2020-04-241-0/+1
| | | | | | | * Add critbits.commonPrefixLen * add inline and since annotations, as well as a changelog entry Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* new cmd: `nim r main [args...]` to compile & run, saving binary under ↵Timothee Cour2020-04-231-0/+11
| | | | | | $nimcache/main (#13382) * implement `nim r main` to compile and run, saving binary to $nimcache * remove outFileAbs for now
* fix #14064 xmltree should allow create text node with raw text(non-es… ↵Bung2020-04-221-1/+1
| | | | | | | | | | | | | (#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>
* fix #13222: make relativePath more robust and flexible (#13451)Timothee Cour2020-04-211-0/+6
| | | | | | | | | * * 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-211-3/+3
|
* Add deques.peekFirst/Last(var Deque[T]) -> var T (#13542)hlaaftana2020-04-211-0/+1
| | | | | | | * 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>
* Replace enum fields idents with syms (#14048)cooldome2020-04-211-0/+4
| | | | | | * replace enum fields idents with syms * Trigger build Co-authored-by: cooldome <ariabushenko@bk.ru>
* Make file descriptors from stdlib non-inheritable by default (#13201)alaviss2020-04-201-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* 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
|