Commits on Oct 4, 2024

  1. bump NimVersion to 2.0.11

    narimiran committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    ff46fcf View commit details
    Browse the repository at this point in the history
  2. Changing generic weight of tyGenericParam (#22143)

    This is in reference to a [feature
    request](#22142) that I posted.
    
    I'm making this PR to demonstrate the suggested change and expect that
    this should be scrutinized
    
    ---------
    
    Co-authored-by: Bung <crc32@qq.com>
    Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
    (cherry picked from commit 74fa8ed)
    3 people authored and narimiran committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    3c66401 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2024

  1. fixes #24173; always bundle checksums (#24189)

    fixes #24173
    
    `cloneDependency` always has its logic to use existing deps
    
    (cherry picked from commit 62a5bb4)
    ringabout authored and narimiran committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    c809417 View commit details
    Browse the repository at this point in the history
  2. fixes #23755; array static inference during overload resolution (#23760)

    ---------
    
    Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
    (cherry picked from commit 27abcdd)
    2 people authored and narimiran committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    acd09ce View commit details
    Browse the repository at this point in the history
  3. fixes 23823; array static overload - again (#23824)

    #23823
    
    (cherry picked from commit 22ba5ab)
    Graveflo authored and narimiran committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    cc887c2 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. delay markUsed for converters until call is resolved (#24243)

    fixes #24241
    
    (cherry picked from commit 09043f4)
    metagn authored and narimiran committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    4fe17a2 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2024

  1. update CI to macos 13 (#24157)

    Followup to #24154, packages aren't ready for macos 14 (M1/ARM CPU) yet
    and it seems to be preview on azure, so upgrade to macos 13 for now.
    
    Macos 12 gives a warning:
    
    ```
    You are using macOS 12.
    We (and Apple) do not provide support for this old version.
    It is expected behaviour that some formulae will fail to build in this old version.
    It is expected behaviour that Homebrew will be buggy and slow.
    Do not create any issues about this on Homebrew's GitHub repositories.
    Do not create any issues even if you think this message is unrelated.
    Any opened issues will be immediately closed without response.
    Do not ask for help from Homebrew or its maintainers on social media.
    You may ask for help in Homebrew's discussions but are unlikely to receive a response.
    Try to figure out the problem yourself and submit a fix as a pull request.
    We will review it but may or may not accept it.
    ```
    
    (cherry picked from commit 4a63186)
    metagn authored and narimiran committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    e2ef322 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2024

  1. test more Status' packages, refs #24266 (#24275)

    This adds several new Status packages to the CIs:
    
    - confutils
    - eth
    - metrics
    - nat_traversal
    - toml_serialization
    
    Other packages mentioned in #24266
    are currently not ready to test with `devel` for various reasons.
    
    ----
    
    This also enables `criterion`, and removes other packages that had been
    in the `allowFailure` category — even without them we have plenty of
    packages (145) that we test, there's no point in spending CI time on
    them just to see them fail every time.
    If/when the authors of those packages make them work with Nim devel, we
    can re-introduce them then.
    
    (cherry picked from commit 2747626)
    narimiran committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    8754469 View commit details
    Browse the repository at this point in the history
  2. Bumps nimble to v0.16.2 (#24283)

    (cherry picked from commit af23bc2)
    jmgomez authored and narimiran committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    cc4c925 View commit details
    Browse the repository at this point in the history
  3. make linter use lineinfo to check originating package (#24270)

    fixes #24269, refs #20095
    
    Instead of checking the package of the *used sym* to determine whether a
    stylecheck should trigger, we check the package of the lineinfo instead.
    Before #20095 this checked for the current compilation context module
    instead which caused issues with generic procs, but the lineinfo should
    more closely match the AST.
    
    I figured this might cause issues with includes etc but the foreign
    package test specifically tests for an include and passes, so maybe the
    package determining logic accounts for this already. This still might
    not be the correct logic, I'm not too familiar with the package handling
    in the compiler.
    
    Package PRs, both merged:
    
    - json_rpc: status-im/nim-json-rpc#226
    - json_serialization:
    status-im/nim-json-serialization#99
    
    (cherry picked from commit aaf6c40)
    metagn authored and narimiran committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    206bbbd View commit details
    Browse the repository at this point in the history
  4. make package testing faster (#24284)

    There's no need to run benchmarks for cow- and sso-strings: they take 15
    minutes each to run.
    
    (cherry picked from commit f5cb392)
    narimiran committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    67d7a7c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e334aad View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2024

  1. reset inTypeofContext in generic instantiations (#24229)

    fixes #24228, refs #22022
    
    As described in
    #24228 (comment),
    instantiating generic routines inside `typeof` causes all code inside to
    be treated as being in a typeof context, and thus preventing compile
    time proc folding, causing issues when code is generated for the
    instantiated routine. Now, instantiated generic procs are treated as
    never being inside a `typeof` context.
    
    This is probably an arbitrary special case and more issues with the
    `typeof` behavior from #22022 are likely. Ideally this behavior would be
    removed but it's necessary to accomodate the current [proc `declval` in
    the package `stew`](status-im/nim-stew#190), at
    least without changes to `compileTime` that would either break other
    code (making it not eagerly fold by default) or still require a change
    in stew (adding an option to disable the eager folding).
    
    Alternatively we could also make the eager folding opt-in only for
    generic compileTime procs so that #22022 breaks nothing whatsoever, but
    a universal solution would be better. Edit: Done in #24230 via
    experimental switch
    
    (cherry picked from commit ea9811a)
    metagn authored and narimiran committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    4acc7a5 View commit details
    Browse the repository at this point in the history
  2. fix type of reconstructed kind field node in field checking analysis …

    …[backport] (#24290)
    
    fixes #24021
    
    The field checking for case object branches at some point generates a
    negated set `contains` check for the object discriminator. For enum
    types, this tries to generate a complement set and convert to a
    `contains` check in that instead. It obtains this type from the type of
    the element node in the `contains` check.
    
    `buildProperFieldCheck` creates the element node by changing a field
    access expression like `foo.z` into `foo.kind`. In order to do this, it
    copies the node `foo.z` and sets the field name in the node to the
    symbol `kind`. But when copying the node, the type of the original
    `foo.z` is retained. This means that the complement is performed on the
    type of the accessed field rather than the type of the discriminator,
    which causes problems when the accessed field is also an enum.
    
    To fix this, we properly set the type of the copied node to the type of
    the kind field. An alternative is just to make a new node instead.
    
    A lot of text for a single line change, I know, but this part of the
    codebase could use more explanation.
    
    (cherry picked from commit 1bebc23)
    metagn authored and narimiran committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    d3f7fb3 View commit details
    Browse the repository at this point in the history
  3. templates/macros use no expected types when return types are specified (

    #24298)
    
    fixes #24296
    fixes #24295
    
    Templates use `expectedType` for type inference. It's justified that
    when templates don't have an actual return type, i.e., `untyped` etc.
    
    When the return type of templates is specified, we should not infer the
    type
    
    ```nim
    template g(): string = ""
    
    let c: cstring = g()
    ```
    In this example, it is not reasonable to annotate the templates
    expression with the `cstring` type before the `fitNode` check with its
    specified return type.
    
    (cherry picked from commit 80e6b35)
    ringabout authored and narimiran committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    fd9d2f5 View commit details
    Browse the repository at this point in the history
  4. wrap fields iterations in if true scope [backport] (#24343)

    fixes #24338
    
    When unrolling each iteration of a `fields` iterator, the compiler only
    opens a new scope for semchecking, but doesn't generate a node that
    signals to the codegen that a new scope should be created. This causes
    issues for reused template instantiations that reuse variable symbols
    between each iteration, which causes the codegen to generate multiple
    declarations for them in the same scope (regardless of `inject` or
    `gensym`). To fix this, we wrap the unrolled iterations in an `if true:
    body` node, which both opens a new scope and doesn't interfere with
    `break`.
    
    (cherry picked from commit ca5df9a)
    metagn authored and narimiran committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    72fcda1 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2024

  1. fixes #24258; compiler crash on len of varargs[untyped] (#24307)

    fixes #24258
    
    It uses conditionals to guard against ill formed AST to produce better
    error messages, rather than crashing
    
    (cherry picked from commit 8b39b2d)
    ringabout authored and narimiran committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    76d834c View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. fixes #24359; VM problem: dest register is not set with const-bound p…

    …roc (#24364)
    
    fixes #24359
    
    follow up #11076
    
    It should not try to evaluate the const proc if the proc doesn't have a
    return value.
    
    (cherry picked from commit 031ad95)
    ringabout authored and narimiran committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    a70b471 View commit details
    Browse the repository at this point in the history
  2. fixes addr/hiddenAddr in strictdefs (#23477)

    (cherry picked from commit 9b37829)
    (cherry picked from commit 744b241e4b7cb8c8d9e21e8a7f078d17d9ef90d4)
    ringabout authored and narimiran committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    fe72db9 View commit details
    Browse the repository at this point in the history
  3. fixes #22389; fixes #19840; don't fold paths containing addr (#23807)

    fixes #22389;
    fixes #19840
    
    (cherry picked from commit 5c5e7a9)
    (cherry picked from commit 00e39185f1d59597d17b69bbccf8879e3427f928)
    ringabout authored and narimiran committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    eedfcbe View commit details
    Browse the repository at this point in the history
  4. shallow fold prevention for addr, nkHiddenAddr (#24322)

    fixes #24305, refs #23807
    
    Since #23014 `nkHiddenAddr` is produced to fast assign array elements in
    iterators. However the array access inside this `nkHiddenAddr` can get
    folded at compile time, generating invalid code. In #23807, compile time
    folding of regular `addr` expressions was changed to be prevented in
    `transf` but `nkHiddenAddr` was not updated alongside it.
    
    The method for preventing folding in `addr` in #23807 was also faulty,
    it should only trigger on the immediate child node of the address rather
    than all nodes nested inside it. This caused a regression as outlined in
    [this
    comment](#24322 (comment)).
    
    To fix both issues, `addr` and `nkHiddenAddr` now both shallowly prevent
    constant folding for their immediate children.
    
    (cherry picked from commit 52cf7df)
    (cherry picked from commit 7ad7ee03e5c0adb6832cbae10a62de7b68ef6fa5)
    metagn authored and narimiran committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    75bd2d0 View commit details
    Browse the repository at this point in the history
  5. two 2.0-specific fixes

    narimiran committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    3713994 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2024

  1. fixes #24379; better error messages for ill-formed type symbols from …

    …macros (#24380)
    
    fixes #24379
    
    (cherry picked from commit d618974)
    ringabout authored and narimiran committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    b007412 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2024

  1. bump NimVersion to 2.0.12

    narimiran committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    ce7c6f4 View commit details
    Browse the repository at this point in the history