Skip to content

compileOption("threads") never be false within NimScript #24833

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

Open
panno8M opened this issue Apr 1, 2025 · 2 comments
Open

compileOption("threads") never be false within NimScript #24833

panno8M opened this issue Apr 1, 2025 · 2 comments

Comments

@panno8M
Copy link
Contributor

panno8M commented Apr 1, 2025

Nim Version

$ nim -v
Nim Compiler Version 2.2.2 [Linux: amd64]
Compiled at 2025-02-06
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 6c34f62785263ad412f662f3e4e4bf8d8751d113
active boot switches: -d:release

Description

The value of compileOption(“threads”) is always true within NimScript even if passing --threads:off.

This may be due to the fact that NimScript is actually running in multi-threaded mode, but it is a little inconvenient for building a build system.

# config.nims
echo compileOption("threads")
$ nim c --threads:off somewhat

Current Output

true

Expected Output

false

Known Workarounds

No response

Additional Information

No response

@Araq
Copy link
Member

Araq commented Apr 1, 2025

Agreed, but it raises the question if --threads:off is a switch worth keeping. Every switch technically creates a new language dialect and that causes problems for everybody and every tool.

@panno8M
Copy link
Contributor Author

panno8M commented Apr 1, 2025

If Nim does not plan to add a new backend in the future, no, I think.
Some potential Nim backends may have unstable multi-threaded support.
No other motive comes to mind for me either.

Context (No need to read):

I noticed this behavior because I was trying to get WebAssembly (wasm) with emscripten as a backend.
I was warned because multi-threading was an experimental feature in emscripten. So I am now trying to switch pipelines depending on the value of threads.

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

No branches or pull requests

2 participants