Commits on Jul 3, 2024

  1. Update mimetypes.nim; added avif & avifs (#23786)

    Added avif and avifs to mimetypes
    enthus1ast authored Jul 3, 2024
    Configuration menu
    Copy the full SHA
    eaf0e7f View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2024

  1. bump NimVersion to 2.0.9

    narimiran committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    22896b3 View commit details
    Browse the repository at this point in the history
  2. fixes #23790; roll back instCounter properly in case of exceptions (#…

    …23802)
    
    fixes #23790
    
    (cherry picked from commit 841d30a)
    alex65536 authored and narimiran committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    ecc7e3d View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. Adjust the correct chunk's free space in allocator (#23795)

    Fixes #23788
    
    (cherry picked from commit 3f5016f)
    SirOlaf authored and narimiran committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    e4db9bf View commit details
    Browse the repository at this point in the history
  2. Bumps nimble so the next Nim release includes the latest changes (#23808

    )
    
    (cherry picked from commit 14f86b3)
    jmgomez authored and narimiran committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    cbcf6c5 View commit details
    Browse the repository at this point in the history
  3. fixes #22286; enforce Non-var T destructors by `nimPreviewNonVarDestr…

    …uctor` (#22975)
    
    fixes #22286
    ref https://forum.nim-lang.org/t/10642
    
    For backwards compatibilities, we might need to keep the changes under a
    preview compiler flag. Let's see how many packags it break.
    
    **TODO** in the following PRs
    
    - [ ] Turn the `var T` destructors warning into an error with
    `nimPreviewNonVarDestructor`
    
    ---------
    
    Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
    (cherry picked from commit 379299a)
    2 people authored and narimiran committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    be99f2f View commit details
    Browse the repository at this point in the history
  4. fixes #23129; fixes generated hooks raise unlisted Exception, which n…

    …ever raise (#23195)
    
    fixes #23129
    
    (cherry picked from commit 62c5b8b)
    ringabout authored and narimiran committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    83455cf View commit details
    Browse the repository at this point in the history
  5. patches for #23129 (#23198)

    fixes it in the normal situation
    
    (cherry picked from commit 30cb682)
    ringabout authored and narimiran committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    76e6130 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2024

  1. make routine implicitly gensym when other gensym symbol exists again (#…

    …23842)
    
    fixes #23813, partially reverts #23392
    
    Before #23392, if a `gensym` symbol was defined before a proc with the
    same name in a template even with an `inject` annotation, the proc would
    be `gensym`. After #23392 the proc was instead changed to be `inject` as
    long as no `gensym` annotation was given. Now, to keep compatibility
    with the old behavior, the behavior is changed back to infer the proc as
    `gensym` when no `inject` annotation is given, however an explicit
    `inject` annotation will still inject the proc. This is also documented
    in the manual as the old behavior was undocumented and the new behavior
    is slightly different.
    
    (cherry picked from commit cd94608)
    metagn authored and narimiran committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    1ce954a View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. bump NimVersion to 2.0.10

    narimiran committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    92e5055 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2024

  1. bump nimble to 0.16.0 (#23883)

    (cherry picked from commit ccf90f5)
    jmgomez authored and narimiran committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    702f834 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. fixes #22510 (#23100)

    (cherry picked from commit 69d0b73)
    Araq authored and narimiran committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    ff1881a View commit details
    Browse the repository at this point in the history
  2. make -d:debugHeapLinks compile again (#23126)

    I have made `realloc` absorb unused adjacent memory, which improves the
    performance. I'm investigating whether `deallocOsPages` can be used to
    improve memory comsumption.
    
    (cherry picked from commit 53855a9)
    ringabout authored and narimiran committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    5d87232 View commit details
    Browse the repository at this point in the history
  3. Allocator: Track number of foreign cells a small chunk has access to (#…

    …23856)
    
    Ref: #23788
    
    There was a small leak in the above issue even after fixing the
    segfault. The sizes of `free` and `acc` were changed to 32bit because
    adding the `foreignCells` field will drastically increase the memory
    usage for programs that hold onto memory for a long time if they stay as
    64bit.
    
    (cherry picked from commit fd1e62a)
    SirOlaf authored and narimiran committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    179ae26 View commit details
    Browse the repository at this point in the history
  4. Allocator: Always place free cells into the active chunk and add docu…

    …mentation (#23871)
    
    Lets single threaded applications benefit from tracking foreign cells as
    well.
    After this, `SmallChunk` technically doesn't need to act as a linked
    list anymore I think, gotta investigate that more though.
    The likelihood of overflowing `chunk.free` also rises, so to work around
    that it might make sense to check `foreignCells` instead of adjusting
    free space or replace free with a counter for the local capacity.
    
    For Nim compile I can observe a ~10mb reduction, and smaller ones for
    other projects.
    
    (cherry picked from commit 881fbb8)
    SirOlaf authored and narimiran committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    7b834b9 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. make expressions opt in to symchoices (#22716)

    refs #22605
    
    Sym choice nodes are now only allowed to pass through semchecking if
    contexts ask for them to (with `efAllowSymChoice`). Otherwise they are
    resolved or treated as ambiguous. The contexts that can receive
    symchoices in this PR are:
    
    * Call operands and addresses and emulations of such, which will subject
    them to overload resolution which will resolve them or fail.
    * Type conversion operands only for routine symchoices for type
    disambiguation syntax (like `(proc (x: int): int)(foo)`), which will
    resolve them or fail.
    * Proc parameter default values both at the declaration and during
    generic instantiation, which undergo type narrowing and so will resolve
    them or fail.
    
    This means unless these contexts mess up sym choice nodes should never
    leave the semchecking stage. This serves as a blueprint for future
    improvements to intermediate symbol resolution.
    
    Some tangential changes are also in this PR:
    
    1. The `AmbiguousEnum` hint is removed, it was always disabled by
    default and since #22606 it only started getting emitted after the
    symchoice was soundly resolved.
    2. Proc setter syntax (`a.b = c` becoming `` `b=`(a, c) ``) used to
    fully type check the RHS before passing the transformed call node to
    proc overloading. Now it just passes the original node directly so proc
    overloading can deal with its typechecking.
    
    (cherry picked from commit 5f9038a)
    metagn authored and narimiran committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    8a4ee2b View commit details
    Browse the repository at this point in the history
  2. adapt semOpAux to opt-in symchoices (#23750)

    fixes #23749, refs #22716
    
    `semIndirectOp` is used here because of the callback expressions, in
    this case `db.getProc(...)`, and `semIndirectOp` calls `semOpAux` to
    type its arguments before overloading starts. Hence it can opt in to
    symchoices since overloading will resolve them.
    
    (cherry picked from commit 948fc29)
    metagn authored and narimiran committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    a88bce6 View commit details
    Browse the repository at this point in the history
  3. implement genericsOpenSym for symchoices (#23873)

    fixes #23865
    
    The node flag `nfOpenSym` implemented in #23091 for sym nodes is now
    also implemented for open symchoices. This means the intended behavior
    is still achieved when multiple overloads are in scope to be captured,
    so the issue is fixed. The code for the flag is documented and moved
    into a helper proc and the experimental switch is now enabled for the
    compiler test suite.
    
    (cherry picked from commit 469a604)
    metagn authored and narimiran committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    dd37bb8 View commit details
    Browse the repository at this point in the history
  4. don't treat template/macro/module as overloaded for opensym (#23939)

    actually fixes #23865 following up #23873
    
    In the handling of `nkIdent` in `semExpr`, the compiler looks for the
    closest symbol with the name and [checks the symbol
    kind](https://github.com/nim-lang/Nim/blob/6126a0bf46f4e29a368b8baefea69a2bcae54e93/compiler/semexprs.nim#L3171)
    to also consider the overloads if the symbol kind is overloadable. But
    it treats the normally overloadable template/macro/module sym kinds the
    same as non-overloadable symbols, just calling `semSym` on it. We need
    to mirror this behavior in `semOpenSym`; we treat the captured symchoice
    as a fresh identifier, so if the symbol we find is a
    template/macro/module, we use that symbol immediately as opposed to
    waiting for overloads.
    
    (cherry picked from commit a64aa51)
    metagn authored and narimiran committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    1cc1451 View commit details
    Browse the repository at this point in the history
  5. opensym as node kind + fixed experimental switch (#23892)

    refs #23873 (comment),
    fixes #23386, fixes #23385, supersedes #23572
    
    Turns the `nfOpenSym` node flag implemented in #23091 and extended in
    containing either `nkSym` or `nkOpenSymChoice`. Since this affects
    macros working on generic proc AST, the node kind is now only generated
    when the experimental switch `genericsOpenSym` is enabled, and a new
    node flag `nfDisabledOpenSym` is set to the `nkSym` or `nkOpenSymChoice`
    when the switch is not enabled so that we can give a warning.
    
    Now that the experimental switch has more reasonable semantics, we
    define `nimHasGenericsOpenSym2`.
    
    (cherry picked from commit 0c890ff)
    metagn authored and narimiran committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    796aa78 View commit details
    Browse the repository at this point in the history
  6. bump nimble to include the fix to nimble dump (#23918)

    (cherry picked from commit 6126a0b)
    jmgomez authored and narimiran committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    02eb396 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. [backport] fixes #23796; remove extra indirection for args in importc…

    …'ed functions in cpp (#23800)
    
    fixes #23796
    
    (cherry picked from commit 1dcc364)
    alex65536 authored and narimiran committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    1100f55 View commit details
    Browse the repository at this point in the history
  2. fixes #23936; opcParseFloat accepts the wrong register as the first p…

    …aram [backport] (#23941)
    
    fixes #23936
    follow up #20527
    
    (cherry picked from commit b215ec3)
    ringabout authored and narimiran committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    3f183f6 View commit details
    Browse the repository at this point in the history
  3. Revert "bump NimVersion to 2.0.10"

    This reverts commit 92e5055.
    narimiran committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    3e8dfde View commit details
    Browse the repository at this point in the history
  4. disable presto (#23958)

    (cherry picked from commit 06b25bd)
    ringabout authored and narimiran committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    d6f7625 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2024

  1. fixes LineTooLong hints on old compilers (#22412)

    * fixes LineTooLong hints on old compilers
    
    * fixes config/nim.cfg
    
    (cherry picked from commit bf5d173)
    ringabout authored and narimiran committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    2214942 View commit details
    Browse the repository at this point in the history
  2. Try to revert "disable presto" (#23987)

    Reverts #23958
    
    follow up #23981
    
    ref #23958 (comment)
    
    (cherry picked from commit eed9cb0)
    ringabout authored and narimiran committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    352c82a View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2024

  1. Param match relax (#23033)

    ---------
    
    Co-authored-by: Nikolay Nikolov <nickysn@gmail.com>
    Co-authored-by: Pylgos <43234674+Pylgos@users.noreply.github.com>
    Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
    Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
    Co-authored-by: Jason Beetham <beefers331@gmail.com>
    (cherry picked from commit 94f7e96)
    6 people authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    d1aa568 View commit details
    Browse the repository at this point in the history
  2. ambiguous identifier resolution (#23123)

    fixes #23002, fixes #22841, refs comments in #23097
    
    When an identifier is ambiguous in scope (i.e. multiple imports contain
    symbols with the same name), attempt resolving it through type inference
    (by creating a symchoice). To do this efficiently, `qualifiedLookUp` had
    to be broken up so that `semExpr` can access the ambiguous candidates
    directly (now obtained directly via `lookUpCandidates`).
    
    This fixes the linked issues, but an example like:
    
    ```nim
    let on = 123
    
    {.warning[ProveInit]: on.}
    ```
    
    will still fail, since `on` is unambiguously the local `let` symbol here
    (this is also true for `proc on` but `proc` symbols generate symchoices
    anyway).
    
    Type symbols are not considered to not confuse the type inference. This
    includes the change in sigmatch, up to this point symchoices with
    nonoverloadable symbols could be created, they just wouldn't be
    considered during disambiguation. Now every proper symbol except types
    are considered in disambiguation, so the correct symbols must be picked
    during the creation of the symchoice node. I remember there being a
    violating case of this in the compiler, but this was very likely fixed
    by excluding type symbols as CI seems to have found no issues.
    
    The pure enum ambiguity test was disabled because ambiguous pure enums
    now behave like overloadable enums with this behavior, so we get a
    longer error message for `echo amb` like `type mismatch: got <MyEnum |
    OtherEnum> but expected T`
    
    (cherry picked from commit b280100)
    metagn authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    c18e599 View commit details
    Browse the repository at this point in the history
  3. typRel and sumGeneric adjustments (#23137)

    Filling in some more logic in `typeRel` that I came across when poking
    the compiler in another PR. Some of the cases where `typeRel` returns an
    "incorrect" result are actually common, but `sumGeneric` ends up
    breaking the tie correctly. There isn't anything wrong with that
    necessarily, but I assume that it's preferred these functions behave
    just as well in isolation as they do when integrated.
    
    I will be following up this description with specific examples.
    
    (cherry picked from commit ccc7c45)
    Graveflo authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    87ab9b8 View commit details
    Browse the repository at this point in the history
  4. fix wrong subtype relation in tuples & infer some conversions (#23228)

    fixes #18125
    
    Previously a tuple type like `(T, int)` would match an expected tuple
    type `(U, int)` if `T` is a subtype of `U`. This is wrong since the
    codegen does not handle type conversions of individual tuple elements in
    a type conversion of an entire tuple. For this reason the compiler
    already does not accept `(float, int)` for a matched type `(int, int)`,
    however the code that checked for which relations are unacceptable
    checked for `< isSubtype` rather than `<= isSubtype`, so subtypes were
    not included in the unacceptable relations.
    
    Update: Now only considered unacceptable when inheritance is used, as in
    [`paramTypesMatch`](https://github.com/nim-lang/Nim/blob/3379d26629f30e6be8d303a36e220d1039eb4551/compiler/sigmatch.nim#L2252-L2254).
    Ideally subtype relations that don't need conversions, like `nil`,
    `seq[empty]`, `range[0..5]` etc would be their own relation
    `isConcreteSubtype` (which would also allow us to differentiate with
    `openArray[T]`), but this is too big of a refactor for now.
    
    To compensate for this making things like `let x: (Parent, int) =
    (Child(), 0)` not compile (they would crash codegen before anyway but
    should still work in principle), type inference for tuple constructors
    is updated such that they call `fitNode` on the fields and their
    expected types, so a type conversion is generated for the individual
    subtype element.
    
    (cherry picked from commit cfd69ba)
    metagn authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    b1e5dd6 View commit details
    Browse the repository at this point in the history
  5. remove bad type inference behavior for enum identifiers (#23588)

    refs
    #23586 (comment)
    
    In #20091 a bad kind of type inference was mistakenly left in where if
    an identifier `abc` had an expected type of an enum type `Enum`, and
    `Enum` had a member called `abc`, the identifier would change to be that
    enum member. This causes bugs where a local symbol can have the same
    name as an enum member but have a different value. I had assumed this
    behavior was removed since but it wasn't, and CI seems to pass having it
    removed.
    
    A separate PR needs to be made for the 2.0 branch because these lines
    were moved around during a refactoring in #23123 which is not in 2.0.
    
    (cherry picked from commit c101490)
    metagn authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    7821aa9 View commit details
    Browse the repository at this point in the history
  6. fix noreturn/implicit discard check logic (#23681)

    fixes #10440, fixes #13871, fixes #14665, fixes #19672, fixes #23677
    
    The false positive in #23677 was caused by behavior in
    `implicitlyDiscardable` where only the last node of `if`/`case`/`try`
    etc expressions were considered, as in the final node of the final
    branch (in this case `else`). To fix this we use the same iteration in
    `implicitlyDiscardable` that we use in `endsInNoReturn`, with the
    difference that for an `if`/`case`/`try` statement to be implicitly
    discardable, all of its branches must be implicitly discardable.
    `noreturn` calls are also considered implicitly discardable for this
    reason, otherwise stuff like `if true: discardableCall() else: error()`
    doesn't compile.
    
    However `endsInNoReturn` also had bugs, one where `finally` was
    considered in noreturn checking when it shouldn't, another where only
    `nkIfStmt` was checked and not `nkIfExpr`, and the node given for the
    error message was bad. So `endsInNoReturn` now skips over
    `skipForDiscardable` which no longer contains
    `nkIfStmt`/`nkCaseStmt`/`nkTryStmt`, stores the first encountered
    returning node in a var parameter for the error message, and handles
    `finally` and `nkIfExpr`.
    
    Fixing #23677 already broke a line in `syncio` so some package code
    might be affected.
    
    (cherry picked from commit 42e8472)
    metagn authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    d0a8637 View commit details
    Browse the repository at this point in the history
  7. Overload resultion with generic variables an inheritance (#23870)

    The test case diff is self explanatory
    
    (cherry picked from commit c1f91c2)
    Graveflo authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    a5237a5 View commit details
    Browse the repository at this point in the history
  8. fixes regression; block can have arbitrary exit points; too hard for …

    …a simple analysis (#23839)
    
    follow up #23681
    
    ref https://forum.nim-lang.org/t/11987
    ref #23836 (comment)
    
    (cherry picked from commit b7a275d)
    ringabout authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    8b421d2 View commit details
    Browse the repository at this point in the history
  9. fixes semi-regression; discard check now skips nkHiddenSubConv (#23840

    )
    
    follow up #23681
    
    ref https://forum.nim-lang.org/t/11987
    
    (cherry picked from commit 648f82c)
    ringabout authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    568a637 View commit details
    Browse the repository at this point in the history
  10. fixes #23973; fixes #23974; Memory corruption with lent and ORC (#23981)

    fixes #23973;
    fixes #23974
    
    (cherry picked from commit 26107e9)
    ringabout authored and narimiran committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    4856bea View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2024

  1. fixes #24053; fixes #18288; relax reorder with push/pop pragmas restr…

    …ictions; no crossing push/pop barriers (#24061)
    
    fixes #24053;
    fixes #18288
    
    makes push pragmas depend on each node before it and nodes after it
    depend on it
    
    (cherry picked from commit c10f84b)
    ringabout authored and narimiran committed Sep 8, 2024
    Configuration menu
    Copy the full SHA
    8d254a5 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. fixes reifiedOpenArray; nkHiddenStdConv is PathKinds1 not PathKin…

    …ds0 (#23633)
    
    (cherry picked from commit 5cd141c)
    ringabout authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    c2b4d8a View commit details
    Browse the repository at this point in the history
  2. Handle arbitrarily long symlink target in expandSymlinks() (#23650)

    For now, `expandSymlinks()` can handle only symlinks with lengths up to
    1024.
    
    We can improve this logic and retry inside a loop with increasing
    lengths until we succeed.
    
    The same approach is used in
    [Go](https://github.com/golang/go/blob/377646589d5fb0224014683e0d1f1db35e60c3ac/src/os/file_unix.go#L446),
    [Rust](https://github.com/rust-lang/rust/blob/785eb65377e5d7f8d8e8b82ede044212bbd2d76e/library/std/src/sys/pal/unix/fs.rs#L1700)
    and [Nim's
    `getCurrentDir()`](https://github.com/nim-lang/Nim/blob/devel/lib/std/private/ospaths2.nim#L877),
    so maybe it's a good idea to use the same logic in `expandSymlinks()`
    also.
    
    (cherry picked from commit 3bda5fc)
    alex65536 authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    37965bd View commit details
    Browse the repository at this point in the history
  3. fixes #22852; fixes #23435; fixes #23645; SIGSEGV when slicing string…

    … or seq[T] with index out of range (#23279)
    
    follow up #23013
    
    fixes #22852
    fixes #23435
    fixes #23645
    
    reports rangeDefect correctly
    
    ```nim
    /workspaces/Nim/test9.nim(1) test9
    /workspaces/Nim/lib/system/indices.nim(116) []
    /workspaces/Nim/lib/system/fatal.nim(53) sysFatal
    Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeDefect]
    ```
    
    (cherry picked from commit c615828)
    ringabout authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    b6a8dcd View commit details
    Browse the repository at this point in the history
  4. fixes #23635; tasks.toTask Doesn't Expect a Dot Expression (#23641)

    fixes #23635
    
    ---------
    
    Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
    (cherry picked from commit cc5ce72)
    2 people authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    dc62ee0 View commit details
    Browse the repository at this point in the history
  5. fixes #22798; Duplicate libraries linker warning (i.e., '-lm') on mac…

    …OS (#23292)
    
    fixes #22798
    
    Per
    https://stackoverflow.com/questions/33675638/gcc-link-the-math-library-by-default-in-c-on-mac-os-x
    and
    https://stackoverflow.com/questions/30694042/c-std-library-dont-appear-to-be-linked-in-object-file
    
    > There's no separate math library on OSX. While a lot of systems ship
    functions in the standard C math.h header in a separate math library,
    OSX does not do that, it's part of the libSystem library, which is
    always linked in.
    
    required by #23290
    
    (cherry picked from commit de4c7df)
    ringabout authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    b5ef14c View commit details
    Browse the repository at this point in the history
  6. Fix non-exported memfiles.setFileSize to be able to shrink files on…

    … posix via `memfiles.resize` (#23717)
    
    Fix non-exported `setFileSize` to take optional `oldSize` to (on posix)
    shrink differently than it grows (`ftruncate` not `posix_fallocate`)
    since it makes sense to assume the higher address space has already been
    allocated there and include the old file size in the `proc resize` call.
    Also, do not even try `setFileSize` in the first place unless the `open`
    itself works by moving the call into the `if newFileSize != -1` branch.
    
    Just cosmetics, also improve some old 2011 comments, note a logic diff
    for callers using both `mappedSize` & `newFileSize` from windows branch
    in case someone wants to fix that & simplify code formatting a little.
    
    (cherry picked from commit 8037bbe)
    c-blake authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    da2ba43 View commit details
    Browse the repository at this point in the history
  7. ref #20653; fixes chronos empty case branches (#23706)

    ref #20653
    
    ```nim
      Error* = object
        case kind*: ErrorType
        of ErrorA:
          discard
        of ErrorB:
          discard
    ```
    For an object variants without fields, it shouldn't generate empty
    brackets for default values since there are no fields at all in case
    branches.
    
    (cherry picked from commit 948bb38)
    ringabout authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    b79e603 View commit details
    Browse the repository at this point in the history
  8. fixes #23732, os.sleep(-1) now returns immediately (#23734)

    fixes #23732
    
    (cherry picked from commit 2a658c6)
    litlighilit authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    ae117bd View commit details
    Browse the repository at this point in the history
  9. fixes #5091; Ensure we don't wait on an exited process on Linux (#23743)

    Fixes #5091.
    
    Ensure we don't wait on an exited process on Linux
    
    (cherry picked from commit 288d5c4)
    maleyva1 authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    7d0cdfc View commit details
    Browse the repository at this point in the history
  10. fixes #20865; fixes #20987; Missing bounds check in array slicing (#2…

    …3814)
    
    fixes #20865
    fixes #20987
    
    (cherry picked from commit e53a2ed)
    ringabout authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    f09b612 View commit details
    Browse the repository at this point in the history
  11. fix generics treating symchoice symbols as uninstantiated (#23860)

    fixes #23853
    
    Since #22610 generics turns the `Name` in the `GT.Name` expression in
    the test code into a sym choice. The problem is when the compiler tries
    to instantiate `GT.Name` it also instantiates the sym choice symbols.
    `Name` has type `template (E: type ExtensionField)` which contains the
    unresolved generic type `ExtensionField`, which the compiler mistakes as
    an uninstantiated node, when it's just part of the type of the template.
    The compilation of the node itself and hence overloading will handle the
    instantiation of the proc, so we avoid instantiating it in `semtypinst`,
    similar to how the first nodes of call nodes aren't instantiated.
    
    (cherry picked from commit 97f5474)
    metagn authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    baa8af9 View commit details
    Browse the repository at this point in the history
  12. fixes #19171; have openArray converted from ptr UncheckedArray be…

    … mutable (#23882)
    
    Makes `toOpenArray(x: ptr UncheckedArray)` always return a `var
    openArray` regardless of if `x` is mutable.
    
    (cherry picked from commit 925dc5c)
    Buldram authored and narimiran committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    06d00df View commit details
    Browse the repository at this point in the history