Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic stack trace overriding mechanism #12922

Merged
merged 3 commits into from
Dec 29, 2019
Merged

generic stack trace overriding mechanism #12922

merged 3 commits into from
Dec 29, 2019

Conversation

stefantalpalaru
Copy link
Contributor

Lightweight stack traces using an external libbacktrace wrapper: https://github.com/status-im/nim-libbacktrace

This addresses #12702 and will be helped by #12735 (on macOS)

These stack traces require --debuger:native for debugging symbols and look the same as Nim's default ones: https://travis-ci.org/status-im/nim-libbacktrace/jobs/626489399

This small PR adds support for libbacktrace both in the compiler itself (try it with ./koch boot -d:libbacktrace --debugger:native -d:release) and in external programs that import libbacktrace.

This last requirement is unfortunate. Is there some stdlib module, besides "system", where I can plug this instead of asking users to import it?

Also, any elegant way of showing an error message if the external Nim package is not installed on the system?

@Araq
Copy link
Member

Araq commented Dec 18, 2019

Have you considered to add a var stackTraceHook: proc () {.nimcall.} to excpt.nim instead?

compiler/nim.nim Outdated
@@ -33,6 +33,9 @@ when defined(profiler) or defined(memProfiler):
{.hint: "Profiling support is turned on!".}
import nimprof

when defined(libbacktrace):
Copy link
Member

@timotheecour timotheecour Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO every new defined symbol in nim repository sources should be prefixed with nim => nimlibbacktrace; this prevents clashes with user defined symbols (but what'd be even better is supporting namespace, eg defined(nim.libbacktrace))

# This is a Nim procedure, but we can't import the "libbacktrace" module in
# here, so we {.exportc.} it in there and {.importc.} it in here. We rely on
# "libbacktrace" being imported somewhere else, or this will cause a linker error.
proc getBacktrace*(): string {.importc.}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exportc names are global so, again, should be prefixed to prevent potential clashes with user exportc code (including C code in this case!) => nimGetBacktrace()

@timotheecour
Copy link
Member

timotheecour commented Dec 18, 2019

@stefantalpalaru I'm trying to test this PR, please help and let me know which steps / flags are superfluous/wrong

on OSX here:

test.nim:

import pkg/libbacktrace
proc main() = doAssert false
main()
git clone https://github.com/status-im/nim-libbacktrace && cd nim-libbacktrace && nimble develop && nimble install

cd $nim_prs_D
git fetch origin pull/12922/head
git checkout FETCH_HEAD
./koch boot -d:libbacktrace --debugger:native -d:release
./bin/nim c --skipUserCfg --skipParentCfg -d:release -d:libbacktrace --debugger:native -g $timn_D/tests/nim/all/t0842.nim
dsymutil $timn_D/tests/nim/all/t0842
$timn_D/tests/nim/all/t0842
Traceback (most recent call last)
Error: unhandled exception: t0842.nim(7, 24) `false`  [AssertionError]

=> no stacktrace...

@stefantalpalaru
Copy link
Contributor Author

Have you considered to add a var stackTraceHook: proc () {.nimcall.} to excpt.nim instead?

Yes, @Araq, but I didn't know how to implement such a hook. I see some in "lib/system/gc_hooks.nim". Anything else I can look at?

Remember that I need this to also run inside the compiler, so I still have to enable the conditional importing of the external module. It would be nice to do that with a single custom define, say -d:stacktraceHook:mymodule and then I hardcode the proc's name inside that external module.

Can you think of any nicer way?

@timotheecour, you probably have to also dsymutil the compiler binary, since the exception stack trace starts inside it. Also, --debugger:native and -g are the same thing and you can use koch temp instead of koch boot for a quicker iteration.

@Araq
Copy link
Member

Araq commented Dec 18, 2019

Well these hooks have all pretty much the same problems:

  • You still need to import the overriding modules explicitly. (Though I consider this superior to yet more command line options or configuration setttings.)
  • Overhead of an indirect function call that optimizers struggle with.
  • Until the import statement that sets the hook to something is in effect, the old behaviour remains. (!) And that's the real nasty one...

@timotheecour
Copy link
Member

timotheecour commented Dec 18, 2019

@stefantalpalaru

you probably have to also dsymutil the compiler binary, since the exception stack trace starts inside it

I tried but didn't change, and I don't think the exception stack trace starts inside it makes sense, eg as you can see from lldb backtrace the only binary involved is t0842, not nim

after investigating, the problem for me was -d:release which, in this example, due to aggressive inlining, was stripping ALL stackframes (the remaining unskipped ones were filtered out by libstacktrace as it's the boilerplate stack beginning NimMain etc and ending raiseExceptionAux etc which don't contain useful debug info)

it did work without -d:release, or if we change clang.options.speed = "-O3" to the rather useless clang.options.speed = "-O0" in nim.cfg

but here's a working example demoing stacktrace WITH -d:release:

  import std/json
  type
    Foo* = ref object
      z1*: string
    Baz* = ref object
      foo2*: Foo
  proc testAll*()=
    let s = """{"foo": {"z1": "hi"}}"""
    let j = parseJson(s)
    discard j.to(Baz)
  testAll()
./bin/nim c -d:release --skipUserCfg --skipParentCfg -d:libbacktrace --debugger:native --stacktrace:off -g $timn_D/tests/nim/all/t0842.nim
dsymutil $timn_D/tests/nim/all/t0842
$timn_D/tests/nim/all/t0842
Traceback (most recent call last)
lib/pure/json.nim(1229) to
lib/pure/json.nim(1063) initFromJson
lib/pure/json.nim(1122) initFromJson
lib/pure/json.nim(944) initFromJson
Error: unhandled exception: key not found: .foo2 [KeyError]

more frames would show without -d:release:

Traceback (most recent call last v2)
/Users/timothee/git_clone/nim/timn/tests/nim/all/t0842.nim(61) t0842
/Users/timothee/git_clone/nim/timn/tests/nim/all/t0842.nim(59) testAll
lib/pure/json.nim(1229) to
lib/pure/json.nim(1063) initFromJson
lib/pure/json.nim(1122) initFromJson
lib/pure/json.nim(944) initFromJson
Error: unhandled exception: key not found: .foo2 [KeyError]

@timotheecour
Copy link
Member

timotheecour commented Dec 18, 2019

@Araq @stefantalpalaru

This last requirement is unfortunate. Is there some stdlib module, besides "system", where I can plug this instead of asking users to import it?
Well these hooks have all pretty much the same problems:

here's a better approach: the following works, I tried:
step 1: in nimble install libbacktrace, also do: nim c --app:lib -o:install/usr/lib/libbacktrace3.dylib ./libbacktrace.nim (1 time)
step 2: add -d:libbacktrace:/Users/timothee/git_clone/nim/nim-libbacktrace/install/usr/lib/libbacktrace3.dylib to your config.nims or nim.cfg etc or to cmd line and update ur PR as follows:

when defined(libbacktrace):
  const libbacktrace {.strdefine.} = ""
  {.passL: libbacktrace.}
  proc getBacktrace*(): string {.importc.}

./bin/nim c -d:release --skipUserCfg --skipParentCfg -d:libbacktrace:/Users/timothee/git_clone/nim/nim-libbacktrace/install/usr/lib/libbacktrace3.dylib --debugger:native --stacktrace:off -g $timn_D/tests/nim/all/t0842.nim

proc getBacktrace*(): string {.importc, dynlib: "/Users/timothee/git_clone/nim/nim-libbacktrace/install/usr/lib/libbacktrace3.dylib2".}

note: as another benefit, it is more lightweight (no implicit compile step inside libbacktrace.nim when u import since u don't need to import that anymore)

Also, any elegant way of showing an error message if the external Nim package is not installed on the system?

if provided /Users/timothee/git_clone/nim/nim-libbacktrace/install/usr/lib/libbacktrace3.dylib doesn't exist, it'll give a reasonable err msg at runtime (as intended, instead of compile time; since we need that dylib at RT)

note

this did NOT work, and seems like a new nim compiler bug: EDIT: => #12929

when defined(libbacktrace):
  const libbacktrace {.strdefine.} = ""
  proc getBacktrace*(): string {.importc, dynlib: libbacktrace.}  # this acts as if libbacktrace = "", which is a BUG

EDIT: but this workaround does work:

when defined(libbacktrace):
  const libbacktrace {.strdefine.} = ""
  const libbacktrace2 = libbacktrace
  proc getBacktrace*(): string {.importc, dynlib: libbacktrace2.}

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.
@stefantalpalaru
Copy link
Contributor Author

I think I found a better way of doing it. When "nimStackTraceOverride" is defined, a new registration mechanism appears in the system module: registerStackTraceOverride().

Now all that's left to do is for an imported module to use it. With the latest modifications in nim-libbacktrace, we have this:

when defined(nimStackTraceOverride):
  registerStackTraceOverride(getBacktrace)

Applying the override to the compiler itself: ./koch boot -d:release --debugger:native -d:nimStackTraceOverride --import:libbacktrace (throw in a -d:debug to see it dump a stack trace in compiler.msgs.quit() when you nim c -r ... something with a non-zero exit)

Applying it to an external program: ./bin/nim c -r -f --stacktrace:off --debugger:native -d:nimStackTraceOverride --import:libbacktrace foo.nim

Stack trace header changed to "Traceback (most recent call last, using override)" to avoid confusion.

As you can see, this is a generic overriding system that's no longer tied to nim-libbacktrace. Let the competition begin :-)

@stefantalpalaru stefantalpalaru changed the title libbacktrace support generic stack trace overriding mechanism Dec 18, 2019
@timotheecour
Copy link
Member

timotheecour commented Dec 19, 2019

I think I found a better way of doing it

I don't think that's a better way:

  • --import:libbacktrace is much more intrusive than what I suggested above, it creates an implicit import in each module; now each module implicitly depends on libbacktrace as well as libbacktrace's own (recursive) dependencies, which includes libbacktrace_wrapper, os, system/ansi_c; so even the smallest hello world would now drag a bunch of dependencies. This affects compile times and has other unwanted effects.

  • because of lack of cyclic imports, this would make backtraces unavailable in modules that are in dependency list of libbacktrace.nim, eg try this:

  import std/os
  proc main*()=
    setCurrentDir("/nonexistant")
  main()

with your approach you'd get:

Traceback (most recent call last, using override)
Stack trace override procedure not registered.
Error: unhandled exception: No such file or directory [OSError]

with the approach I suggested above in #12922 (comment) I get:

Traceback (most recent call last, using override)
/Users/timothee/git_clone/nim/timn/tests/nim/all/t0842.nim(78) t0842
/Users/timothee/git_clone/nim/timn/tests/nim/all/t0842.nim(77) testAll
lib/pure/os.nim(1304) setCurrentDir
lib/pure/includes/oserr.nim(94) raiseOSError
Error: unhandled exception: No such file or directory [OSError]

likewise with other modules eg those in system/*.nim etc
(in both cases, without -d:release to avoid inlining frames)

The approach from #12922 (comment) has none of those drawbacks, is non-intrusive, and doesn't require anything in user code apart from compilining with a compilation flag (which could be in user config.nims); all it boils down to at the end of the day is some dlopen/(or its windows equivalent) call that gets automatically called during nim's module initialization

@stefantalpalaru
Copy link
Contributor Author

--import:libbacktrace is much more intrusive than what I suggested above, it creates an implicit import in each module

No, it doesn't. It's only imported once per project. Verify it by adding static: echo "importing libbacktrace" to "nim-libbacktrace/libbacktrace.nim".

Also, how can you write that with a straight face after proposing -d:libbacktrace:/Users/timothee/git_clone/nim/nim-libbacktrace/install/usr/lib/libbacktrace3.dylib? That looks good to you?

try this:

  import std/os
  proc main*()=
    setCurrentDir("/nonexistant")
  main()

with your approach you'd get:

Traceback (most recent call last, using override)
Stack trace override procedure not registered.
Error: unhandled exception: No such file or directory [OSError]

You're holding it wrong.

./bin/nim c -r -f --verbosity:0 --hints:off --stacktrace:off --debugger:native -d:nimStackTraceOverride --import:libbacktrace ../../nim/test/t0843.nim:

Traceback (most recent call last, using override)
/mnt/sda3/storage/CODE/nim/test/t0843.nim(4) t0843
/mnt/sda3/storage/CODE/nim/test/t0843.nim(3) main
/mnt/sda3/storage/CODE/00_github/Nim/lib/pure/os.nim(1304) setCurrentDir
/mnt/sda3/storage/CODE/00_github/Nim/lib/pure/includes/oserr.nim(94) raiseOSError
Error: unhandled exception: No such file or directory [OSError]
Error: execution of an external program failed: '/mnt/sda3/storage/CODE/nim/test/t0843 '
Traceback (most recent call last, using override)
/mnt/sda3/storage/CODE/00_github/Nim/compiler/nim.nim(106) nim
/mnt/sda3/storage/CODE/00_github/Nim/compiler/nim.nim(95) handleCmdLine
/mnt/sda3/storage/CODE/00_github/Nim/compiler/msgs.nim(443) rawMessage
/mnt/sda3/storage/CODE/00_github/Nim/compiler/msgs.nim(440) rawMessage
/mnt/sda3/storage/CODE/00_github/Nim/compiler/msgs.nim(361) handleError
/mnt/sda3/storage/CODE/00_github/Nim/compiler/msgs.nim(346) quit

The approach from #12922 (comment) has none of those drawbacks, is non-intrusive, and doesn't require anything in user code apart from compilining with a compilation flag (which could be in user config.nims)

You want the user to point you to a dynamic library so you can dlopen a hardcoded symbol from it and you think this is easier and more flexible than importing a Nim module. Am I reading this right?

@stefantalpalaru
Copy link
Contributor Author

BTW, the proposed overriding mechanism is flexible enough for you to implement your preferred dlopen() strategy (or even direct linking to a shared/static library) outside the compiler. Put it into a "libbacktrace_dlopen.nim" file and import that.

@timotheecour
Copy link
Member

timotheecour commented Dec 19, 2019

--import:libbacktrace is much more intrusive than what I suggested above, it creates an implicit import in each module

No, it doesn't. It's only imported once per project. Verify it by adding static: echo "importing libbacktrace" to "nim-libbacktrace/libbacktrace.nim".

it does create an implicit import in each module, check the nim compiler source code, as well as this example:
nim c -r --import:os main.nim

# main.nim: implicitly imports os
import ./main2
echo ExtSep
# main2.nim: implicitly imports os
echo ExtSep

adding static: echo "importing libbacktrace" doesn't disprove this: imported modules are processed once, even if imported multiple times from different modules.

You're holding it wrong.

my bad, I had forgotten to git pull your other repo https://github.com/status-im/nim-libbacktrace since your last commit; indeed the example I had does work; a contrived example where my point would still hold would be to add a top-level expression that would fail at runtime (eg adding doAssert falseyCondition in std/os or any module recursively imported from libbacktrace.nim); I'm suspecting there could be real cases where this could be an issue but can't think of one right now.

Also, how can you write that with a straight face after proposing -d:libbacktrace:/Users/timothee/git_clone/nim/nim-libbacktrace/install/usr/lib/libbacktrace3.dylib? That looks good to you?

yes, that approach looks good: that explicit path was just an example to make it work; if that lib is installed in a OS-specific standard location (say via nimble install), that path doesn't need to be given explicitly and can be guessed, so that -d:libbacktrace would be sufficient for auto-guessing, and easily over-rideable with -d:libbacktrace:explicitpath (which can be put in ~/.config/nim/config.nims once and then forgotten).

Nim compiler/standard library relies heavily on this feature to load symbols, see all the dynlib: instances in nim sources (eg pcre.nim)

All you need is: proc getBacktrace*(): string {.importc, dynlib: guessLibbacktrace().}

You want the user to point you to a dynamic library so you can dlopen a hardcoded symbol from it and you think this is easier and more flexible than importing a Nim module. Am I reading this right?

yes this is better, for same reasons as already mentioned. nim compiler / stdlib heavily relies on dlopen-ing symbols already (see all the {.dynlib.}).

hopefully convincing example

main.nim:

echo "ok1"

with the approach i suggested:

Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: t0842 [Processing]
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: t0842.nim
Hint:  [Link]
Hint: operation successful (21970 lines compiled; 0.342 sec total; 19.871MiB peakmem; Debug Build) [SuccessX]
ls t0842 => 91K

with your approach --import:libbacktrace:

Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: t0842 [Processing]
Hint: libbacktrace [Processing]
Hint: libbacktrace_wrapper [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: bitops [Processing]
Hint: macros [Processing]
Hint: algorithm [Processing]
Hint: unicode [Processing]
Hint: pathnorm [Processing]
Hint: osseps [Processing]
Hint: posix [Processing]
Hint: times [Processing]
Hint: options [Processing]
Hint: typetraits [Processing]
CC: libbacktrace_wrapper
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: stdlib_posix.nim
CC: stdlib_times.nim
CC: stdlib_os.nim
CC: ../../../../nim-libbacktrace/libbacktrace.nim
CC: t0842.nim
Hint:  [Link]
Hint: operation successful (43783 lines compiled; 0.745 sec total; 58.344MiB peakmem; Debug Build) [SuccessX]
ls t0842 => 155K

as you can see, this is worse in all dimensions: binary size, compile time, number of depdencies involved, memory consumed.

("small files" do occur in practice eg for inim (interactivity matters), for creating shared libraries etc; there's no reason to un-necessarily add un-needed module dependencies )

btw: just wanted to mention your PR is much appreciated

@Araq
Copy link
Member

Araq commented Dec 19, 2019

We might need a better override mechanism for system.nim related functionality.

@stefantalpalaru
Copy link
Contributor Author

stefantalpalaru commented Dec 19, 2019

btw: just wanted to mention your PR is much appreciated

Thanks! I'm sure it will become even better as a result of our technical arguments.

it does create an implicit import in each module

OK, but I can't measure the overhead in practice. I added an ugly macro to "compiler/nim.nim" that imports the module defined with -d:nimStackTraceOverride=libbacktrace so I could drop --import:libbacktrace from the ./koch boot ... command line. No difference in compilation time or peak memory usage, which convinces me that this importing overhead is negligible.

Yes, importing a module that imports "os" in a "hello world" program increases compilation time and memory usage. Should we really rewrite currentSourcePath and parentDir() just to have cheap stack traces in toy programs?

Now, I can save you from having to compile a C or C++ file by giving you static libraries instead of those {.compile.} pragmas in "libbacktrace.nim", but don't expect to shave more than a few milliseconds from that.

What you're asking for, with your dlopen and dynamic lib strategy is incredibly ugly from a system administrator's perspective. You want the language-specific package manager abomination to install libraries in "/usr/local/lib" or something, without the ability to uninstall them (or deal with file collisions with other packages) and create hidden dependencies for all Nim programs built this way, even the statically linked ones that some unsuspecting user might think are ready for shipping. Alternatively, you might want to hardcode library search paths with -rpath which is just as bad.

We can do better than resort to these ugly hacks borne out of the lack of sysadmin experience on OSs without official package managers. Think Linux, think discipline, think package hygiene. Dynamic libraries should be linked to, by default, not dlopen-ed, while static libraries are what you use when you don't want to compile the same files more than once, but you want those objects in your binary.

@stefantalpalaru
Copy link
Contributor Author

stefantalpalaru commented Dec 20, 2019

I've replaced the "compile" pragmas with static libs in nim-libbacktrace and, more importantly, I got it to work on 64-bit Windows, after figuring out that the problem was the libunwind shipped by the Mingw-w64 version of GCC. Getting LLVM's libunwind to compile in that environment was not trivial.

We might need a better override mechanism for system.nim related functionality.

How are other projects doing it?

@stefantalpalaru
Copy link
Contributor Author

I've added some debugging support: you see all trace lines when you export NIM_LIBBACKTRACE_DEBUG=1.

Since returning an empty stack trace when NimMainModule() is inlined due to -d:release is ugly, I'm now showing a couple of useless lines. What I would really need is __attribute__((noinline)) or the MSVC equivalent on that function.

t0843.nim:

import os
proc main*()=
  setCurrentDir("/nonexistent")
main()

./bin/nim c -r -f --verbosity:0 --hints:off -d:release --debugger:native -d:nimStackTraceOverride --import:libbacktrace ../../nim/test/t0843.nim:

Traceback (most recent call last, using override)
/mnt/sda3/storage/CODE/00_github/Nim/lib/system.nim(3636) main
/mnt/sda3/storage/CODE/00_github/Nim/lib/system.nim(3629) NimMain
Error: unhandled exception: No such file or directory [OSError]
Error: execution of an external program failed: '/mnt/sda3/storage/CODE/nim/test/t0843 '

@timotheecour
Copy link
Member

timotheecour commented Dec 26, 2019

I've added some debugging support: you see all trace lines when you export NIM_LIBBACKTRACE_DEBUG=1.

depending on environment variable is not very nim-esque, eg, it has global effects; such customizations would be best replaced by, for example, an api call

ISince returning an empty stack trace when NimMainModule() is inlined due to -d:release is ugly, I'm now showing a couple of useless lines.

instead of adding useless lines, you can make it clear with:

Traceback (most recent call last) [empty due to inlining]

What I would really need is attribute((noinline)) or the MSVC equivalent on that function.

this works for me: nim c -r -d:release --passC:-fno-inline ... (on OSX but probably same on linux/gcc) and shows full stacktrace

@stefantalpalaru
Copy link
Contributor Author

depending on environment variable is not very nim-esque, eg, it has global effects; such customizations would be best replaced by, for example, an api call

Good thing it's not language dependent, then. Environment variables for debugging are an established practice: https://github.com/jemalloc/jemalloc/wiki/Use-Case%3A-Heap-Profiling

Traceback (most recent call last) [empty due to inlining]

That lacks the minimal info that it happened in the main function.

--passC:-fno-inline

Does not work on my system, with -d:release and GCC. I reduced it down to --passC:"-O1 -fno-inline -foptimize-sibling-calls" (with -Og removed from gcc.options.debug, so it doesn't override -O1). This "sibling calls" optimisation makes NimMainInner(), NimMainModule() and main__ggjB1fzBf7f45c3gvw3ZbA() disappear in here:

N_LIB_PRIVATE N_NIMCALL(void, main__ggjB1fzBf7f45c3gvw3ZbA)(void) {
	setCurrentDir__gH49bWY7pApxazoTIU6NIpwos(((NimStringDesc*) &TM__G9ciTsqXW32ZKpy9cO3Nf6ag_2));
}

N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
	main__ggjB1fzBf7f45c3gvw3ZbA();
}
}

N_CDECL(void, NimMainInner)(void) {
	NimMainModule();
}

@stefantalpalaru
Copy link
Contributor Author

This works with -d:release: --passC:"-fno-inline -fno-optimize-sibling-calls"

@Araq
Copy link
Member

Araq commented Dec 29, 2019

Good thing it's not language dependent, then. Environment variables for debugging are an established practice: https://github.com/jemalloc/jemalloc/wiki/Use-Case%3A-Heap-Profiling

Not related to this PR but env vars are quite in conflict with "reproducible" builds, established practice or not is irrelevant.

@Araq Araq merged commit ee9ee29 into nim-lang:devel Dec 29, 2019
@stefantalpalaru
Copy link
Contributor Author

env vars are quite in conflict with "reproducible" builds

You control the environment in which the build is reproduced and that includes environment variables: https://www.debian.org/doc/debian-policy/ch-source.html#reproducibility

@stefantalpalaru stefantalpalaru deleted the libbacktrace branch December 29, 2019 15:16
@Araq
Copy link
Member

Araq commented Dec 30, 2019

Fair enough I guess... Still terrible to rely on interprocess global state for anything.

narimiran pushed a commit that referenced this pull request Jan 23, 2020
* 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.}

(cherry picked from commit ee9ee29)
dom96 pushed a commit that referenced this pull request Feb 15, 2020
* 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 #12901 (comment)

Merge branch 'devel' of https://github.com/nim-lang/Nim into osopen

Peer Review Feedback #12901 (comment)

Update lib/pure/browsers.nim

Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com>
Peer Review Feedback #12901 (comment)

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 928c2fe.

fixes #12965 (#12991)

fixes #12989 (#12992)

* fixes #12989
* Revert "remove unwanted changes"

This reverts commit 5018297.

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 c949b81.

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 cd7904f.

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 b2c6db9.
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 c0f5305.

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 90491ea.
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 #12901 (comment)
narimiran pushed a commit to narimiran/Nim that referenced this pull request Feb 19, 2020
* Add osOpen alias for the operating system specific open command

* Add `--git.devel` option to the documentation
remove unused import (nim-lang#12900)

fix json regression D20191212T144944 (nim-lang#12902) [backport]

Peer Review Feedback nim-lang#12901 (comment)

Merge branch 'devel' of https://github.com/nim-lang/Nim into osopen

Peer Review Feedback nim-lang#12901 (comment)

Update lib/pure/browsers.nim

Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com>
Peer Review Feedback nim-lang#12901 (comment)

allow typed/untyped in magic procs (nim-lang#12911)

NaN floatFormat with clang_cl  (nim-lang#12910)

* clang_cl nan floatFormat

* format

add $nimeq for gdb (nim-lang#12909)

ARC: cycle detector (nim-lang#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 nim-lang#12911(nim-lang#12916)

Fix single match output (nim-lang#12920)

fixes nim-lang#12899 (nim-lang#12921)

* fixes nim-lang#12899

* fixes regression: destroy global variables in reverse declaration order, closureleak test relies on it

Implement NixOS distro check (nim-lang#12914)

Better case coverage error message for alias and range enum (nim-lang#12913)

fix error in assertions document (nim-lang#12925) [backport]

fix cmdline bugs affecting nimBetterRun correctness (nim-lang#12933) [backport]

fix nim-lang#12919 tasyncclosestall flaky: Address already in use (nim-lang#12934)

system.reset is no longer magic (nim-lang#12937)

It has now means setting x to default for new and old runtime alike
Fix nim-lang#12785 (nim-lang#12943)

* Fix nim-lang#12785 and add test

* better variable name

update documentation for `closureScope` and `capture` (nim-lang#12886)

fixes nim-lang#12735 on osx, call dsymutil for debug builds (nim-lang#12931)

* fix nim-lang#12735 osx: dsymutil needs to be called for debug builds
* also write dsymutil command to extraCmds in json build file

Auto-initialize deques (nim-lang#12879)

case coverage error message for `char` (nim-lang#12948)

lenVarargs: number of varargs elements (nim-lang#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 nim-lang#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 nim-lang#12945 (nim-lang#12959)

minor refactorings

Fixes stackoverflow links in readme (nim-lang#12963) [backport]

Allow customize Host header
[ci skip] docfix .. < => ..< (nim-lang#12981) [backport]

parsecfg: retain CRLF line breaks, fixes nim-lang#12970 (nim-lang#12971)

generic stack trace overriding mechanism (nim-lang#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 (nim-lang#12969)

* Added fix for taint mode in streams and httpclient

* Removed taintMode export from system.nim

Check pqntuples > 0 in getValue. Fixes nim-lang#12973 (nim-lang#12974)

c_fflush() the rawWrite() buffer (nim-lang#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 nim-lang#12989

Revert "fixes nim-lang#12989"

This reverts commit 928c2fe.

fixes nim-lang#12965 (nim-lang#12991)

fixes nim-lang#12989 (nim-lang#12992)

* fixes nim-lang#12989
* Revert "remove unwanted changes"

This reverts commit 5018297.

fixes disruptek/nimph#102 multi-level nim.cfg use (nim-lang#13001) [backport]

--exception:goto switch for deterministic exception handling (nim-lang#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 nim-lang#12985 {.push.} now does not apply to generic instantiations (nim-lang#12986)

Sink to MemMove optimization in injectdestructors (nim-lang#13002)

remove default argument for readLines (nim-lang#12807) [backport]

fixes nim-lang#12978 (nim-lang#13012)

Fix typo (nim-lang#13015) [backport]

fixes nim-lang#12961 (nim-lang#13019)

fixes nim-lang#12956 (nim-lang#13020)

fix nim-lang#12988 (nim-lang#13022)

fix nim-lang#12988
Fixes nim-lang#13026 (nim-lang#13028)

fixes nim-lang#12964 (nim-lang#13027)

fixes nim-lang#13032

VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (nim-lang#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 (nim-lang#13035)

fixes nim-lang#13013, reverts previous changes to readLines() (nim-lang#13036) [backport]

* Revert "remove default argument for readLines (nim-lang#12807) [backport]"

This reverts commit c949b81.

reprjs: style changes

fixes nim-lang#12996

Rst parser respect `:start-after:` and `:end-before:` in `include` directive (nim-lang#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` (nim-lang#13037) [backport]

Addressing nim-lang#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 (nim-lang#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 nim-lang#13002 (nim-lang#13021)

testament/important_packages dont run hts (nim-lang#13052)

Modify the test command for nimly (nimble-package) (nim-lang#13053)

clean up deprecated stuff and unused imports in tests (nim-lang#13059)

--styleCheck:hint now works (nim-lang#13055)

[easy] --hint:link:on now shows link cmd instead of nothing (nim-lang#13056)

* --hint:link:on now shows link cmd instead of nothing

* update doc for --listCmd

add pqserverVersion,pqconnectionNeedsPassword,pqconnectionUsedPassword (nim-lang#13060)

basename supports pragmaexpr (nim-lang#13045)

* basename supports pragmaexpr

* update changelog

distinctBase type trait for distinct types (nim-lang#13031)

make SuccessX show project file + output file (nim-lang#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 (nim-lang#13073) [backport]

Deleted misplaced separator (nim-lang#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 (nim-lang#13077)

remove all remaining warnings when build nim (with -d:nimHasLibFFI) (nim-lang#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 (nim-lang#13089)

Fix error check code in osproc (nim-lang#13090) [backport]

fixes nim-lang#13072; no test case because it will be added later with more exception handling related bugfixes

fixes nim-lang#13070

typetraits: fixes nim-lang#6454; genericParams; added lenTuple; added tuple type get (nim-lang#13064)

[backport] system/io.nim fix wrong documentation comment [ci skip]

fixes an asyncftpclient bug; refs nim-lang#13096 [backport]

System cleanup, part 1 (nim-lang#13069)

* system.nim: mark what every .pop does

* system.nim: un-nest when statements

[backport] fix nim-lang#12813, fix nim-lang#13079 (nim-lang#13099)

Correctly remove a key from CountTable when it is set to zero.
more arc features (nim-lang#13098)

* config update
* ARC now supports 'repr' and 'new' with finalizers is supported

Remove some unused/disabled OpenSSL functions (nim-lang#13106)

Add link to posix_utils.html in posix.nim (nim-lang#13111)

VM FFI: write(stderr, msg) and fprintf(cstderr, msg) now work at CT (nim-lang#13083)

fix the ftp store function read the local file bug (nim-lang#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 (nim-lang#13125) [backport]

fixes nim-lang#13122 (nim-lang#13126)

* fixes nim-lang#13122

* moved tests to where they belong

fixes nim-lang#13112 (nim-lang#13127)

* improve line error information

* fixes nim-lang#13112

Expose more openSSL methods. (nim-lang#13131)

fixes nim-lang#13100 nim doc now treats `export localSymbol` correctly (nim-lang#13123) [backport]

* fix nim-lang#13100 nim doc now treats `export localSymbol` correctly
* use owner instead

fixes nim-lang#13119 (nim-lang#13128)

* fixes nim-lang#13119
* fixes a regression

fixes nim-lang#13105 (nim-lang#13138)

fixes nim-lang#10665 (nim-lang#13141) [backport]

pass platform argument only if vccexe is used (nim-lang#13078)

* pass platform only if vccexe is used
* fixes nim-lang#12297

fixes nim-lang#13104 [backport] (nim-lang#13142)

fixes nim-lang#9674 [backport] (nim-lang#13143)

Fix typo in doc/destructors.rst (nim-lang#13148)

Added 'ansic' os support for minimal (embedded) targets (nim-lang#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 (nim-lang#13155)

* create basic_types, arithmetics, exceptions, comparisons
* create setops.nim
* create memalloc.nim
* create gc_interface.nim
* create iterators_1.nim

export normalizePathEnd (nim-lang#13152)

successX now correctly shows html output for `nim doc`, `nim jsondoc`; fix nim-lang#13121 (nim-lang#13116)

* successX now correctly shows html output for nim doc
* fixes nim-lang#13121
* fixup hintSuccessX to be less weird

ARC: misc bugfixes (nim-lang#13156)

* fixes nim-lang#13102
* closes nim-lang#13149
* ARC: fixes a move optimizer bug (there are more left regarding array and tuple indexing)
* proper fix; fixes nim-lang#12957
* fixes yet another case object '=' code generation problem

CI fix timeout error (nim-lang#13134)

Remove obsolete code from osalloc (nim-lang#13158)

style fix: change 'JS' to 'js' to make it consistent (nim-lang#13168)

Working towards arc codegen (nim-lang#13153)

fixes nim-lang#13029
fixes nim-lang#12998 nim doc regression (nim-lang#13117)

fix tsizeof3 for aarch64 (nim-lang#13169)

Cleanup DFA (nim-lang#13173)

Fix docs (nim-lang#13176)

fixes nim-lang#13095 (nim-lang#13181)

* fixes nim-lang#13095

* fix typo

make case-object transitions explicit, make unknownLineInfo a const, replace a few magic numbers with consts (nim-lang#13170)

ARC works for async on Windows (nim-lang#13179)

make sink operator optional (nim-lang#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 (nim-lang#13180)

* Fix doc subdirs
* Extract to helper proc, and fix on windows

followup on nim-lang#10435 : should be diff, not show (nim-lang#13162)

fixes nim-lang#13157

refs nim-lang#13054 correctly handle {.exportc,dynlib.} and {.exportcpp,dynlib.}  (nim-lang#13136)

* refs nim-lang#13054 correctly handle {.exportc,dynlib.} and {.exportcpp,dynlib.}
* put back NIM_EXTERNC for N_LIB_EXPORT; causes issues with compilerproc

fixes nim-lang#13144 (nim-lang#13145)

* fixup: genscript now does not copy nimbase.h but uses -I$nim/lib

times: toUnixFloat, fromUnixFloat (nim-lang#13044)

maybe: allows optional chaining of field access and indexing when LHS i snil (nim-lang#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 (nim-lang#13189)

more on arc codegen (nim-lang#13178)

* arc codegen for union type

* add more tests

* fix offsetof

* fix tsizeof test

* fix style

Add link to packaging.html (nim-lang#13194)

Fixes nim-lang#13186 (nim-lang#13188)

fixes nim-lang#13195

revert last commit

Merge branch 'devel' of https://github.com/nim-lang/Nim into devel

Revert "fixes nim-lang#13195"

This reverts commit cd7904f.

fixes nim-lang#13110 (nim-lang#13197)

fixes nim-lang#13195 (nim-lang#13198)

* fixes nim-lang#13195

* extra fix

* fix typo

compiler/ccgtypes: hide exportc proc unless it has dynlib (nim-lang#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 (nim-lang#13204) [backport]

Idxmin & idxmax, continuation (nim-lang#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 nim-lang#13211 relativePath("foo", ".") (nim-lang#13213)

fixes a critical times.nim bug reported on IRC [backport] (nim-lang#13216)

httpclient, maxredirects to Natural, newHttpClient/newAsyncHttpClient add headers argument instead of hardcoded empty (nim-lang#13207)

added note to re constructor regarding performance (nim-lang#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 nim-lang#12251 (nim-lang#13226) [ci skip]

[backport] times/getClockStr(): fix mistake in doc (nim-lang#13229) [ci skip]

new os.isRelativeTo (nim-lang#13212)

[backport] Fix typo and improve in code-block of 'lib/pure/parseutils.nim' (nim-lang#13231) [ci skip]

[backport] fix nim-lang#11440, add docs to isNil for seq types needing nilseq (nim-lang#13234) [ci skip]

VM: allow overriding MaxLoopIterations without rebuilding nim (nim-lang#13233)

kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes (nim-lang#13221)

* kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes
* fixup after nim-lang#13212 isRelativeTo got merged

fix lots of bugs with parentDir, refs nim-lang#8734 (nim-lang#13236)

Unexport even more symbols (nim-lang#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. (nim-lang#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 (nim-lang#13202) [ci skip]

[backport] Make all parseutils examples auto-checking (nim-lang#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 (nim-lang#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 (nim-lang#13239)

Fixes asyncftpclient multiline reading, fixes nim-lang#4684 (nim-lang#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 `[` (nim-lang#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 (nim-lang#13251)

Add "origin" to window location: https://www.w3schools.com/jsref/prop_loc_origin.asp
nim dump: add libpath (nim-lang#13249)

contributing docs: symbols need package prefix; changed allocStats to nimAllocStats (nim-lang#13247)

testament/azure: major rewrite (nim-lang#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/ (nim-lang#13254)

make goto based exceptions available for 'nim cpp' (nim-lang#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 (nim-lang#13258)

* Rename isNilOrWhitespace to isEmptyOrWhitespace

* Make isEmptyOrWhitespace use allCharsInSet(Whitespace)

Clearer final objects error; fixes nim-lang#13256 (nim-lang#13257)

scrollTop must be settable (nim-lang#13263)

* scrollTop must be assignable

Make scrollTop settable

* add missing export

fixes nim-lang#13219 (nim-lang#13272)

fixes nim-lang#13281 (nim-lang#13282)

* fixes #nim-lang#13281

* add comment to test

unittest add resetOutputFormatters proc (nim-lang#13267)

* add resetOutputFormatters

* remove space

* resolve comments

TlSF Alloctor: use less memory for --gc:arc (nim-lang#13280)

Tiny since cleanup (nim-lang#13286)

nimv2 widestring indexing (nim-lang#13279)

Repr v2 progress (nim-lang#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() (nim-lang#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 nim-lang#11591 (nim-lang#13290) [backport]

miscellaneous bug fixes (nim-lang#13291)

* fix for emscripten etc

* add testcase for nim-lang#13290

* replace deprecated isNilOrWhitespace

CT FFI: fix for windows; fix case transition; error msg shows more useful context (nim-lang#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 nim-lang#8391 std/os now shows runtime context for raiseOSError exceptions (nim-lang#13294)

* refs nim-lang#8391: fix errmsg for setCurrentDir

* raiseOSError calls for copyFile

* refs nim-lang#8391 std/os now shows runtime context for raiseOSError exceptions

build_all.sh: building csources 5X faster thanks to make -j (nim-lang#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 (nim-lang#13315)

* Fix capture for object|tuple|... types

* Add test case

Quote nim executable before executing. (nim-lang#13316) [backport]

In case nim executable is located in PATH containing spaces.

fixes nim-lang#13311
ReSync with devel

Make build_all.sh more portable and a bit simpler (nim-lang#13308)

koch: enable checks in the compiler when running CI (nim-lang#13323)

fix nim-lang#13132 tnetdial (nim-lang#13318)

enable testing -d:nimHasLibFFI mode (nim-lang#13091)

Fix nim-lang#10717, fix nim-lang#13284 (nim-lang#13307)

Fixed codegen for constant cstring with --gc:arc (nim-lang#13326)

* Fixed codegen for constant cstring with --gc:arc, fixes  nim-lang#13321

* Added test for nim-lang#13321

Option to allow the request body to be processed outside the asynchttpserver library. (nim-lang#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 (nim-lang#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 (nim-lang#13336)

nim secret: support linenoise when available (nim-lang#13328)

fix nim-lang#13150 `nim doc --project` now works reliably (nim-lang#13223)

* fix nim-lang#13150 `nim doc --project` works with duplicate names and with imports below main project file

* add to help; fixup after nim-lang#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 (nim-lang#13338) [backport]

fix nim-lang#13349 regression: isNamedTuple now works with generic tuples (nim-lang#13350)

fixes nim-lang#13269 (nim-lang#13344)

adding sqlite3 backup functions (nim-lang#13346)

* adding sqlite3 backup functions

* changing sleep to sqlite3_sleep to prevent clashes

Added a basic example how to handle a Post request. (nim-lang#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 (nim-lang#13347)

* replace old problematic isNamedTuple implementation by TypeTrait isNamedTuple

* fix for bootstrap

fix nim-lang#13182: `proc fun(a: varargs[Foo, conv])` now can be overloaded (nim-lang#13345) [backport]

miscellaneous bug fixes (part 3) (nim-lang#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 (nim-lang#13343)

printing float values will have one more digit. (nim-lang#13276) [backport]

* printing float values will have one more digit. Fixes nim-lang#13196

[backport] fix nim-lang#13352

[backport] remove 'CountTable.mget' (nim-lang#13355)

It didn't work, and it was an oversight to be included in v1.0.
fix nim-lang#6736: templates in unittest now show actual value (nim-lang#13354)

Revert "printing float values will have one more digit. (nim-lang#13276) [backport]" (nim-lang#13363)

This reverts commit b2c6db9.
Add sideEffect pragma to importC procs in posix, winlean and time module (nim-lang#13370)

* Add sideEffect pragma to procs in winlean
* Add sideEffect pragma to procs in posix
* Add test for nim-lang#13306
* Add sideEffect pragma to procs in times
* Fixes nim-lang#13306
fixes nim-lang#3339 by documenting the limitations of case-statement (nim-lang#13366)

fixes nim-lang#13314 (nim-lang#13372)

testament: this now works: "testament r /abspath/to/test.nim" (nim-lang#13358)

fix `is` with generic types; fix `genericHead(Foo[T])` (nim-lang#13303)

* fix nim-lang#9855, fix nim-lang#9855, fix genericHead
* render TTypeKind via toHumanStr

fix nim-lang#13255 (nim-lang#13275) [backport]

remove outplace version of 'merge' for CountTables (nim-lang#13377)

* remove outplace version of 'merge' for CountTables

* remove 'merge' tests

fix nim-lang#13374 `nim c -r -` now generates $nimcache/stdinfile (nim-lang#13380) [backport]

fix nim-lang#9634 don't crash on execCmdEx/readLine when inside gdb/lldb (nim-lang#13232)

* fix nim-lang#9634 debugging a program using execCmdEx now works

* only apply EINTR to c_gets for now

This reverts commit c0f5305.

lib.rst: add a link for jsconsole [backport] (nim-lang#13383)

Make vccexe parse response files (nim-lang#13329)

expectLen now shows the length that we got (nim-lang#13387)

fix several bugs with `repr`  (nim-lang#13386)

fixes nim-lang#13378 [backport] (nim-lang#13392)

remove dead code test_nimhcr_integration.(bat,sh) (nim-lang#13388)

* enable test for osx: import tests/dll/nimhcr_integration

* re-disable osx test

fix linenoise regression (nim-lang#13395)

* fix nightlies linenoise regression

* fix other installers

Revert "remove dead code test_nimhcr_integration.(bat,sh) (nim-lang#13388)" (nim-lang#13396)

This reverts commit 90491ea.
fixes nim-lang#13368 (nim-lang#13397)

fix bug in int128 (nim-lang#13403)

isolate the build process from external config files (nim-lang#13411)

add ggplotnim to important_packages (nim-lang#13206)

Fix to asynchttpserver form data/body broken with nim-lang#13147 (nim-lang#13394)

* Fix to asynchttpserver form data/body broken with nim-lang#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 nim-lang#12901 (comment)

(cherry picked from commit ba25f84)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants