Compare commits

..

10 Commits

Author SHA1 Message Date
narimiran
336dc9d827 more removing of failing packages 2026-05-22 11:22:54 +02:00
narimiran
3fe329dbd1 remove failing packages 2026-05-22 10:02:48 +02:00
Juan Carlos
9ef34c3589 Fix Bisect (#25218)
- Nim requires `SSL_library_init`, OpenSSL 3.x removed
`SSL_library_init`, Windows defaults to OpenSSL 3.x, then install
OpenSSL 1.x on Windows.
- Keep `jiro4989/setup-nim-action` at `v1`, because `v2` uses a YAML
"hardcoded" matrix of Nim versions, but this Bisect "dynamically" finds
the Nim version with a bug, therefore we cant hardcode Nim versions in
the YAML, the Bisect programmatically installs required Nim versions as
it goes bisecting commit-by-commit.
- Update `actions/checkout` from `v4` to `v5`.
- Add support for Nim `2.2.4`.

@ringabout

(cherry picked from commit 1ef81f4190)
2026-05-22 09:24:05 +02:00
dependabot[bot]
fda07a76fd update actions' versions 2026-05-22 09:19:52 +02:00
ringabout
19dc02e1bb updates to macos-15 (#25278)
ref https://github.com/actions/runner-images/issues/13046

(cherry picked from commit d5549a3c65)
2026-05-22 09:15:01 +02:00
Andreas Rumpf
0a6f1b44dc fixes DOS via malformed HTTP protocol (#25793)
refs https://github.com/nim-lang/Nim/pull/25568

(cherry picked from commit f0077a12b2)
2026-05-22 08:55:39 +02:00
Miran
a837ee7800 replace outdated macos-13 runner (#25155)
(cherry picked from commit c49fb5ac5f)
2025-09-17 08:59:09 +02:00
ringabout
2fbb793f4e fixes #25173; SinglyLinkedList.remove broken / AssertionDefect (#25175)
fixes #25173

(cherry picked from commit 51a9ada043)
2025-09-16 20:13:12 +02:00
ringabout
edeac84e47 fixes #24725; Invalid =sink generated for pure inheritable object (#24726)
fixes #24725

`lacksMTypeField` doesn't take the base types into consideration. And
for ` {.inheritable, pure.}`, it shouldn't generate a `m_type` field.

(cherry picked from commit e449813c61)
2025-08-05 08:33:50 +02:00
Juan M Gómez
d2b8c3c0d5 Bumps nimble 0.20.1 (#25062)
(cherry picked from commit cd806f9dbe)
2025-07-19 11:49:25 +02:00
17 changed files with 105 additions and 45 deletions

View File

@@ -8,12 +8,18 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
# nimrun-action requires Nim installed.
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: 'devel'
- name: Install OpenSSL (Windows)
if: |
runner.os == 'Windows'
run: choco install openssl.light --version=1.1.1.0 # OpenSSL 3.x removed SSL_library_init
shell: 'powershell'
# v2 wont work here, because uses "hardcoded" nim versions, action "dynamically" finds version with bug.
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: 'devel'
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends -yq valgrind

View File

@@ -47,7 +47,7 @@ jobs:
- target: windows
os: windows-2019
- target: osx
os: macos-13
os: macos-15
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
@@ -55,7 +55,7 @@ jobs:
steps:
- name: 'Checkout'
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 2
@@ -111,7 +111,7 @@ jobs:
if: |
github.event_name == 'push' && github.ref == 'refs/heads/devel' &&
matrix.target == 'linux'
uses: crazy-max/ghaction-github-pages@v3
uses: crazy-max/ghaction-github-pages@v5
with:
build_dir: doc/html
env:

View File

@@ -17,9 +17,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13]
cpu: [amd64]
os: [ubuntu-latest, macos-14]
batch: ["allowed_failures", "0_3", "1_3", "2_3"] # list of `index_num`
include:
- os: ubuntu-latest
cpu: amd64
- os: macos-14
cpu: arm64
name: '${{ matrix.os }} (batch: ${{ matrix.batch }})'
runs-on: ${{ matrix.os }}
timeout-minutes: 60 # refs bug #18178
@@ -28,23 +32,23 @@ jobs:
NIM_TESTAMENT_BATCH: ${{ matrix.batch }}
steps:
- name: 'Checkout'
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: 'Install node.js 20.x'
uses: actions/setup-node@v4
- name: 'Install node.js'
uses: actions/setup-node@v6
with:
node-version: '20.x'
node-version: 24
- name: 'Install dependencies (Linux amd64)'
if: runner.os == 'Linux' && matrix.cpu == 'amd64'
run: |
sudo apt-fast update -qq
sudo apt-get update -qq
DEBIAN_FRONTEND='noninteractive' \
sudo apt-fast install --no-install-recommends -yq \
sudo apt-get install --no-install-recommends -yq \
libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \
valgrind libc6-dbg libblas-dev xorg-dev
valgrind libc6-dbg libblas-dev liblapack-dev libpcre3 xorg-dev
- name: 'Install dependencies (macOS)'
if: runner.os == 'macOS'
run: brew install boehmgc make sfml gtk+3

View File

@@ -17,14 +17,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: 'Checkout'
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: 'Install node.js'
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ''
node-version: 24
- name: 'Install dependencies (Linux amd64)'
if: runner.os == 'Linux' && matrix.cpu == 'amd64'
@@ -60,7 +60,7 @@ jobs:
run: nim c -r -d:release ci/action.nim
- name: 'Comment'
uses: actions/github-script@v6
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
@@ -76,4 +76,3 @@ jobs:
} catch (err) {
console.error(err);
}

View File

@@ -9,7 +9,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v10
with:
days-before-pr-stale: 365
days-before-pr-close: 30

View File

@@ -28,12 +28,12 @@ jobs:
# # g++-multilib : Depends: gcc-multilib (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
# vmImage: 'ubuntu-18.04'
# CPU: i386
OSX_amd64:
vmImage: 'macOS-13'
CPU: amd64
OSX_amd64_cpp:
vmImage: 'macOS-13'
CPU: amd64
OSX_arm64:
vmImage: 'macos-15'
CPU: arm64
OSX_arm64_cpp:
vmImage: 'macos-15'
CPU: arm64
NIM_COMPILE_TO_CPP: true
Windows_amd64_batch0_3:
vmImage: 'windows-2025'

View File

@@ -1188,7 +1188,7 @@ proc produceSym(g: ModuleGraph; c: PContext; typ: PType; kind: TTypeAttachedOp;
fillStrOp(a, typ, result.ast[bodyPos], d, src)
else:
fillBody(a, typ, result.ast[bodyPos], d, src)
if tk == tyObject and a.kind in {attachedAsgn, attachedSink, attachedDeepCopy, attachedDup} and not lacksMTypeField(typ):
if tk == tyObject and a.kind in {attachedAsgn, attachedSink, attachedDeepCopy, attachedDup} and not isObjLackingTypeField(typ):
# bug #19205: Do not forget to also copy the hidden type field:
genTypeFieldCopy(a, typ, result.ast[bodyPos], d, src)

View File

@@ -1425,6 +1425,17 @@ proc matchType*(a: PType, pattern: openArray[tuple[k:TTypeKind, i:int]],
a = a[i]
result = a.kind == last
proc lacksMTypeField*(typ: PType): bool {.inline.} =
## Returns true if the type is an object that lacks a m_type field.
## It doesn't check base classes.
(typ.sym != nil and sfPure in typ.sym.flags) or tfFinal in typ.flags
proc isObjLackingTypeField*(typ: PType): bool {.inline.} =
## Returns true if the type is an object that lacks a type field.
## Object types that store type headers are not final or pure and
## have inheritable root types, which are not pure, neither.
result = (typ.kind == tyObject) and ((tfFinal in typ.flags) and
(typ.baseClass == nil) or isPureObject(typ))
include sizealignoffsetimpl
@@ -1867,6 +1878,3 @@ proc isCharArrayPtr*(t: PType; allowPointerToChar: bool): bool =
result = allowPointerToChar
else:
discard
proc lacksMTypeField*(typ: PType): bool {.inline.} =
(typ.sym != nil and sfPure in typ.sym.flags) or tfFinal in typ.flags

View File

@@ -11,7 +11,7 @@
const
# examples of possible values for repos: Head, ea82b54
NimbleStableCommit = "6a2486b597132340ea7422b078c769b58f21d16d" # 0.20.0
NimbleStableCommit = "9207e8b2bbdf66b5a4d1020214cff44d2d30df92" # 0.20.1
AtlasStableCommit = "5faec3e9a33afe99a7d22377dd1b45a5391f5504"
ChecksumsStableCommit = "f8f6bd34bfa3fe12c64b919059ad856a96efcba0" # 2.0.1
SatStableCommit = "faf1617f44d7632ee9601ebc13887644925dcc01"

View File

@@ -152,7 +152,7 @@ proc parseProtocol(protocol: string): tuple[orig: string, major, minor: int] =
protocol)
result.orig = protocol
i.inc protocol.parseSaturatedNatural(result.major, i)
i.inc # Skip .
if i < protocol.len: inc i # Skip .
i.inc protocol.parseSaturatedNatural(result.minor, i)
proc sendStatus(client: AsyncSocket, status: string): Future[void] =

View File

@@ -710,6 +710,8 @@ proc remove*[T](L: var SinglyLinkedList[T], n: SinglyLinkedNode[T]): bool {.disc
L.head = n.next
if L.tail.next == n:
L.tail.next = L.head # restore cycle
if L.tail == n:
L.tail = nil # reset tail if we removed the last node
else:
var prev = L.head
while prev.next != n and prev.next != nil:

View File

@@ -38,7 +38,8 @@ pkg "argparse"
pkg "arraymancer", "nimble install -y; nimble uninstall -i -y nimcuda; nimble install nimcuda@0.2.1; nim c tests/tests_cpu.nim"
pkg "ast_pattern_matching", "nim c -r tests/test1.nim"
pkg "asyncftpclient", "nimble compileExample"
pkg "asyncthreadpool", "nimble test --mm:refc"
when not defined(arm64):
pkg "asyncthreadpool", "nimble test --mm:refc"
pkg "awk"
pkg "bigints"
pkg "binaryheap", "nim c -r binaryheap.nim"
@@ -57,8 +58,9 @@ pkg "combparser", "nimble test --mm:orc"
pkg "compactdict"
pkg "comprehension", "nimble test", "https://github.com/alehander92/comprehension"
pkg "confutils", "nimble install -y toml_serialization json_serialization unittest2; nimble test"
pkg "constantine", "nimble make_lib"
pkg "criterion"
# pkg "constantine", "nimble make_lib"
when not defined(arm64):
pkg "criterion"
pkg "dashing", "nim c tests/functional.nim"
pkg "delaunay"
pkg "docopt"
@@ -85,11 +87,11 @@ pkg "json_serialization"
pkg "jstin"
pkg "karax", "nim c -r tests/tester.nim"
pkg "kdtree", "nimble test -d:nimLegacyRandomInitRand", "https://github.com/jblindsay/kdtree"
pkg "lockfreequeues"
# pkg "lockfreequeues"
pkg "loopfusion"
pkg "macroutils"
pkg "manu"
pkg "markdown"
# pkg "markdown"
pkg "measuremancer", "nimble testDeps; nimble -y test"
# when unchained is version 0.3.7 or higher, use `nimble testDeps;`
pkg "memo"
@@ -112,15 +114,16 @@ pkg "nimes", "nim c src/nimes.nim"
pkg "nimfp", "nim c -o:nfp -r src/fp.nim"
pkg "nimgame2", "nim c --mm:refc nimgame2/nimgame.nim"
pkg "nimgen", "nim c -o:nimgenn -r src/nimgen/runcfg.nim"
pkg "nimib"
# pkg "nimib"
pkg "nimlsp"
pkg "nimly", "nim c -r tests/test_readme_example.nim"
pkg "nimPNG", useHead = true
pkg "nimpy", "nim c -r tests/nimfrompy.nim"
pkg "nimquery"
pkg "nimsl"
# pkg "nimsl"
pkg "nimsvg"
pkg "nimterop", "nimble minitest", url = "https://github.com/nim-lang/nimterop"
when not defined(arm64):
pkg "nimterop", "nimble minitest", url = "https://github.com/nim-lang/nimterop"
pkg "nimwc", "nim c nimwc.nim"
pkg "nitter", "nim c src/nitter.nim", "https://github.com/zedeus/nitter"
pkg "norm", "testament r tests/common/tmodel.nim"
@@ -131,7 +134,8 @@ pkg "optionsutils"
pkg "ormin", "nim c -o:orminn ormin.nim"
pkg "parsetoml"
pkg "patty"
pkg "pixie"
when not defined(arm64):
pkg "pixie"
pkg "plotly", "nim c examples/all.nim"
pkg "pnm"
pkg "polypbren"
@@ -174,7 +178,8 @@ pkg "unicodeplus", "nim c -d:release -r tests/tests.nim"
pkg "union", "nim c -r tests/treadme.nim", url = "https://github.com/alaviss/union"
pkg "unittest2"
pkg "unpack"
pkg "weave", "nimble test_gc_arc", useHead = true
when not defined(arm64):
pkg "weave", "nimble install -y cligen@#HEAD; nimble test_gc_arc", useHead = true
pkg "websock", "nim c -d:chronosStrictException -d:chronicles_log_level=INFO --mm:refc tests/all_tests.nim"
pkg "websocket", "nim c websocket.nim"
pkg "with"

View File

@@ -161,3 +161,21 @@ typedef struct { int base; } S;
var t = newT()
doAssert t.s.base == 1
type QObject* {.inheritable, pure.} = object
h*: pointer
proc `=destroy`(self: var QObject) =discard
proc `=copy`(dest: var QObject, source: QObject) {.error.}
type QAbstractItemModel* = object of QObject
type VTable = ref object
inst: QAbstractItemModel
proc g() =
var x: VTable = VTable()
x.inst = QAbstractItemModel()
g()

View File

@@ -1,3 +1,7 @@
discard """
disabled: "osx"
"""
proc testAsm() =
let src = 41
var dst = 0

View File

@@ -1,6 +1,7 @@
discard """
matrix: "--mm:refc; --mm:orc"
targets: "c cpp js"
disabled: "osx"
"""
import std/assertions
# TODO: in future work move existing arithmetic tests (tests/arithm/*) into this file

View File

@@ -3,6 +3,7 @@ discard """
disabled: "openbsd"
disabled: "freebsd"
disabled: "windows"
disabled: "osx"
"""
#[

View File

@@ -273,5 +273,17 @@ template main =
list.add(n4)
doAssert list.toSeq == @["sonic", "the", "hedgehog"]
block:
var list = initSinglyLinkedList[int]()
list.add(4)
list.remove(list.head)
list.add(5)
list.remove(list.head)
list.add(6)
static: main()
main()