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

improvements to hint:processing: show import stack, distinguish nims, show includes etc #18372

Merged
merged 4 commits into from
Jun 30, 2021

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Jun 28, 2021

hint:processing is very useful during debugging; this PR improves it further:

  • show a (nims) prefix for files processing during nimscript processing to avoid confusion
  • show includes as well
  • show the importing module (or (toplevel)) and the import stack depth (with >); this makes it easy to trace how we got to process a given file by simply lookup up the import stack
  • verboseProcess (which showed a hintProcessing for each top-level statement) wasn't working since a while ago; after this PR it now works again; and you can show those without verbosity:3 (which is very verbose), instead you can use a new hint:processingstmt

example snippet

Hint: (nims)  (toplevel): import: /Users/timothee/git_clone/nim/Nim_prs/lib/system.nim [Processing]
Hint: (nims)  system: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/basic_types.nim [Processing]
Hint: (nims)  system: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/arithmetics.nim [Processing]
Hint: (nims)  system: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/comparisons.nim [Processing]
Hint: (nims)  system: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/inclrtl.nim [Processing]
Hint: (nims)  system: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/exceptions.nim [Processing]
Hint: (nims)  system: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/setops.nim [Processing]
Hint: (nims) > system: import: /Users/timothee/git_clone/nim/Nim_prs/lib/std/private/since.nim [Processing]

...
Hint: > (toplevel): import: /Users/timothee/git_clone/nim/Nim_prs/compiler/nim.nim [Processing]
Hint: >> nim: import: /Users/timothee/git_clone/nim/Nim_prs/lib/pure/os.nim [Processing]
Hint: >> os: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/inclrtl.nim [Processing]
Hint: >>> os: import: /Users/timothee/git_clone/nim/Nim_prs/lib/pure/strutils.nim [Processing]
Hint: >>>> strutils: import: /Users/timothee/git_clone/nim/Nim_prs/lib/pure/parseutils.nim [Processing]
Hint: >>>> parseutils: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/inclrtl.nim [Processing]
Hint: >>>> strutils: import: /Users/timothee/git_clone/nim/Nim_prs/lib/pure/math.nim [Processing]
Hint: >>>>> math: import: /Users/timothee/git_clone/nim/Nim_prs/lib/pure/bitops.nim [Processing]
Hint: >>>>>> bitops: import: /Users/timothee/git_clone/nim/Nim_prs/lib/core/macros.nim [Processing]
Hint: >>>>>> macros: include: /Users/timothee/git_clone/nim/Nim_prs/lib/system/inclrtl.nim [Processing]
Hint: >>>>> math: import: /Users/timothee/git_clone/nim/Nim_prs/lib/pure/fenv.nim [Processing]
Hint: >>>> strutils: import: /Users/timothee/git_clone/nim/Nim_prs/lib/pure/algorithm.nim [Processing]
...

full example

nim c --hint:all:off --warnings:off --processing:filenames --skipusercfg --skipparentcfg compiler/nim

@timotheecour timotheecour force-pushed the pr_hintProcessing_include_etc branch from 9166276 to d72d982 Compare June 28, 2021 04:40
@timotheecour timotheecour marked this pull request as ready for review June 28, 2021 05:44
@timotheecour timotheecour marked this pull request as draft June 28, 2021 06:28
@Araq
Copy link
Member

Araq commented Jun 28, 2021

Very nice.

@timotheecour timotheecour force-pushed the pr_hintProcessing_include_etc branch from e2d09d0 to a41876f Compare June 29, 2021 23:09
@timotheecour timotheecour marked this pull request as ready for review June 30, 2021 00:38
@timotheecour timotheecour added the Ready For Review (please take another look): ready for next review round label Jun 30, 2021
@Araq Araq merged commit 0483a5f into nim-lang:devel Jun 30, 2021
@timotheecour timotheecour deleted the pr_hintProcessing_include_etc branch June 30, 2021 06:12
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
… show includes etc (nim-lang#18372)

* improvements to hint:processing
* fix tests; do not show hintProcessing for nimscript unless given -d:nimHintProcessingNims
* fix trunner and avoid need for -d:nimHintProcessingNims
* fix some tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review (please take another look): ready for next review round
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants