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

warningaserror doesn't respect package boundaries (foreign package notes) #16762

Closed
timotheecour opened this issue Jan 20, 2021 · 2 comments · Fixed by #20151
Closed

warningaserror doesn't respect package boundaries (foreign package notes) #16762

timotheecour opened this issue Jan 20, 2021 · 2 comments · Fixed by #20151

Comments

@timotheecour
Copy link
Member

timotheecour commented Jan 20, 2021

Example 1

import os

Current Output

XDG_CONFIG_HOME= nim r --warningaserror:deprecated main
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(143, 30) Error: NimIdent is deprecated [Deprecated]

Expected Output

works because macros is a foreign package wrt main

Example 2

import os
echo existsDir(".")

XDG_CONFIG_HOME= nim r --warningaserror:deprecated main2

the relevant error appears only with --errormax:50

/Users/timothee/git_clone/nim/timn/tests/nim/all/t11723.nim(6, 6) Error: use dirExists; existsDir is deprecated [Deprecated]

and there are some strange errors, eg:

times.nim(2019, 28) Error: can raise an unlisted exception: ref TimeFormatParseError

XDG_CONFIG_HOME= nim r --warningaserror:deprecated --errormax:50 --skipparentcfg $timn_D/tests/nim/all/t11723.nim
Hint: used config file '/Users/timothee/git_clone/nim/Nim_devel/config/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/Nim_devel/config/config.nims' [Conf]
..........
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(143, 30) Error: NimIdent is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(147, 18) Error: NimIdent is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(155, 18) Error: NimSym is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(234, 26) Error: NimIdent is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(237, 27) Error: NimSym is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(240, 18) Error: NimSym is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(252, 16) Error: NimIdent is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(256, 16) Error: NimSym is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(387, 34) Error: NimSym is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(390, 33) Error: NimIdent is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(450, 23) Error: NimIdent is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(453, 16) Error: Deprecated since version 0.18.1; Generate a new 'NimNode' with 'ident(string)' instead.; ident= is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(687, 24) Error: NimIdent is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/core/macros.nim(692, 14) Error: newIdentNode is deprecated [Deprecated]
........
/Users/timothee/git_clone/nim/Nim_devel/lib/posix/posix.nim(879, 23) Error: use `csize_t` instead; csize is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/posix/posix.nim(879, 31) Error: use `csize_t` instead; csize is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/posix/posix.nim(885, 21) Error: use `csize_t` instead; csize is deprecated [Deprecated]
/Users/timothee/git_clone/nim/Nim_devel/lib/posix/posix.nim(885, 29) Error: use `csize_t` instead; csize is deprecated [Deprecated]
...
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2024, 20) template/generic instantiation of `format` from here
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2017, 65) template/generic instantiation from here
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2019, 28) Error: can raise an unlisted exception: ref TimeFormatParseError
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2038, 20) template/generic instantiation of `format` from here
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2017, 65) template/generic instantiation from here
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2019, 28) Error: can raise an unlisted exception: ref TimeFormatParseError
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2125, 8) template/generic instantiation of `parse` from here
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2110, 22) template/generic instantiation from here
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2112, 28) Error: can raise an unlisted exception: ref TimeFormatParseError
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2143, 20) template/generic instantiation of `format` from here
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2017, 65) template/generic instantiation from here
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2019, 28) Error: can raise an unlisted exception: ref TimeFormatParseError
/Users/timothee/git_clone/nim/timn/tests/nim/all/t11723.nim(6, 6) Error: use dirExists; existsDir is deprecated [Deprecated]

Additional Information

@narimiran
Copy link
Member

Current Output
XDG_CONFIG_HOME= nim r --warningaserror:deprecated main

What is this? I've seen it in your other issue reports and I have no idea what XDG_CONFIG_HOME= does, how it is related to Nim, and how to (automatically) reproduce it.
And what Nim command produces XDG_CONFIG_HOME= as output (as this is reported under "Current Output")?

@timotheecour
Copy link
Member Author

timotheecour commented Jan 26, 2021

What is this? I've seen it in your other issue reports and I have no idea what XDG_CONFIG_HOME= does

FOO= cmd sets environment variable FOO to empty for the call to cmd (and applies to child processes), so i this case XDG_CONFIG_HOME= nim r --warningaserror:deprecated main has effect of ignoring user config (eg ~/.config/nim/) in the call to nim r --warningaserror:deprecated main as well as child processes in cases main calls into nim itself. --skipusercfg would by contrast not apply to child processes, and would also not be available for other invocations, for eg nim r testament/testament all. In short, XDG_CONFIG_HOME= cmd prevents your custom environment from interference.

capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
…Error now ignore foreign packages (nim-lang#20151)

* fixes nim-lang#20149;  hintAsError/warningAsError ignores foreign packages

* add changelog

* fixes the test

* remove

* fixes tests again

* fix

* I'm careless

Co-authored-by: xflywind <[email protected]>
narimiran pushed a commit that referenced this issue Apr 24, 2023
… foreign packages (#20151)

* fixes #20149;  hintAsError/warningAsError ignores foreign packages

* add changelog

* fixes the test

* remove

* fixes tests again

* fix

* I'm careless

Co-authored-by: xflywind <[email protected]>
(cherry picked from commit 641381e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants