Skip to content

fix: suppress compiler output and support external requires in extractRequiresInfoFromContent - #1765

Open
Voctl wants to merge 2 commits into
nim-lang:masterfrom
Voctl:fix/extract-requires-silence
Open

fix: suppress compiler output and support external requires in extractRequiresInfoFromContent#1765
Voctl wants to merge 2 commits into
nim-lang:masterfrom
Voctl:fix/extract-requires-silence

Conversation

@Voctl

@Voctl Voctl commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

This PR addresses inconsistent error handling and missing features in extractRequiresInfoFromContent compared to extractRequiresInfo.

Changes:

  1. Error Suppression: Implemented conf.structuredErrorHook inside extractRequiresInfoFromContent to increment the error counter without leaking raw compiler/parser error messages to stderr. This ensures parse errors are properly silenced when extracting information from content (e.g., via git show).
  2. External Requires Support: Added logic to extract additional requirements from an external requires file using extractRequiresFromFile(nimbleDir) and append them directly to result.requires.

How Has This Been Tested?

  • Verified that parsing nimble file content strings correctly populates requirements without dumping unintended diagnostics to the terminal.

Related Issue

Closes #1717


P.S. This is my second PR here. I'm really excited about the Nim ecosystem and look forward to contributing more regularly. Even though I'm just 15, I've been spending my nights diving deep into Nim's repositories because I'm genuinely fascinated by the language and its design. I'm highly motivated to keep learning from this codebase and helping the project grow!

@Voctl

Voctl commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

Why There is no one

@jmgomez

jmgomez commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Issue was fixed via d87747e
In case you are interested in why you approach was lacking

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

Successfully merging this pull request may close these issues.

nimble dump leaking errors from other packages

2 participants