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

default threads on #19368

Merged
merged 19 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ becomes an alias for `addr`.

- The `gc:v2` option is removed.

- The `threads:on` option becomes the default.

## Standard library additions and changes

[//]: # "Changes:"
Expand Down
2 changes: 2 additions & 0 deletions config/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ cc = gcc
hint[LineTooLong]=off
#hint[XDeclaredButNotUsed]=off

threads:on

# Examples of how to setup a cross-compiler:
# Nim can target architectures and OSes different than the local host
# Syntax: <arch>.<os>.gcc.exe = "<compiler executable>"
Expand Down
10 changes: 5 additions & 5 deletions testament/categories.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) =
var test2 = makeTest("tests/dll/server.nim", options & " --threads:on" & rpath, cat)
test2.spec.action = actionCompile
testSpec c, test2
var test3 = makeTest("lib/nimhcr.nim", options & " --outdir:tests/dll" & rpath, cat)
var test3 = makeTest("lib/nimhcr.nim", options & " --threads:off --outdir:tests/dll" & rpath, cat)
test3.spec.action = actionCompile
testSpec c, test3
var test4 = makeTest("tests/dll/visibility.nim", options & " --app:lib" & rpath, cat)
var test4 = makeTest("tests/dll/visibility.nim", options & " --threads:off --app:lib" & rpath, cat)
test4.spec.action = actionCompile
testSpec c, test4

Expand All @@ -77,13 +77,13 @@ proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) =
defer: putEnv(libpathenv, libpath)

testSpec r, makeTest("tests/dll/client.nim", options & " --threads:on" & rpath, cat)
testSpec r, makeTest("tests/dll/nimhcr_unit.nim", options & rpath, cat)
testSpec r, makeTest("tests/dll/visibility.nim", options & rpath, cat)
testSpec r, makeTest("tests/dll/nimhcr_unit.nim", options & " --threads:off" & rpath, cat)
testSpec r, makeTest("tests/dll/visibility.nim", options & " --threads:off" & rpath, cat)

if "boehm" notin options:
# force build required - see the comments in the .nim file for more details
var hcri = makeTest("tests/dll/nimhcr_integration.nim",
options & " --forceBuild --hotCodeReloading:on" & rpath, cat)
options & " --threads:off --forceBuild --hotCodeReloading:on" & rpath, cat)
let nimcache = nimcacheDir(hcri.name, hcri.options, getTestSpecTarget())
let cmd = prepareTestCmd(hcri.spec.getCmd, hcri.name,
hcri.options, nimcache, getTestSpecTarget())
Expand Down
2 changes: 1 addition & 1 deletion tests/avr/thello.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
discard """
cmd: "nim c --compileOnly --os:standalone --exceptions:quirky -d:noSignalHandler -d:danger $file"
cmd: "nim c --compileOnly --os:standalone --exceptions:quirky -d:noSignalHandler -d:danger --threads:off $file"
action: "compile"
"""

Expand Down
2 changes: 1 addition & 1 deletion tests/destructor/trecursive.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ proc `=destroy`(x: var MyObject) =
proc `=`(x: var MyObject, y: MyObject) {.error.}

proc newMyObject(i: int): MyObject =
result.p = create(int)
result.p = createShared(int)
result.p[] = i

proc test: seq[MyObject] =
Expand Down
2 changes: 2 additions & 0 deletions tests/ic/config.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
when defined(windows):
--threads:off
1 change: 1 addition & 0 deletions tests/manyloc/standalone2/tavr.nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
--cpu:avr
--os:standalone
--compileOnly
--threads:off
1 change: 1 addition & 0 deletions tests/niminaction/Chapter7/Tweeter/src/tweeter.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
discard """
action: compile
matrix: "--threads:off"
"""

import asyncdispatch, times
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/ttasks.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
discard """
targets: "c cpp"
matrix: "--gc:orc"
matrix: "--gc:orc --threads:off"
"""

import std/[tasks, strformat]
Expand Down
2 changes: 1 addition & 1 deletion tests/system/tgcnone.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
discard """
matrix: "--gc:none -d:useMalloc"
matrix: "--gc:none -d:useMalloc --threads:off"
"""
# bug #15617
let x = 4
Expand Down