Skip to content

fix(tools): reject non-file compilation inventories - #25972

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
cookie42073-cmd:fix/compilation-inventory-regular-input-upstream
Nov 23, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
cookie42073-cmd:fix/compilation-inventory-regular-input-upstream

Conversation

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

What

Check that the compilation database is a regular file before reading it. Passing a named pipe or another special file now produces a diagnostic instead of waiting on it.

Tested

Linux with Python unittest. Ran all five compilation database inventory tests, including a named-pipe regression that verifies the reader never opens it. The project conventions check passed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The change rejects non-regular compilation database inputs before reading them, and the inspected implementation and regression test support the stated behavior.

What I ran

Reviewed head 89cc19c8226da38dee3eb9c70199cf806bcced3f and the prepared diff. No tests or other commands were run.

Results

Check Result Note
Diff and changed code passed Both changed files read
Tests not run Author reports five tests and conventions check passed

Findings

Blocking

None.

Non-blocking

None.

Sources

The regular-file check precedes reading the database, and the added named-pipe test verifies read_text is not reached: implementation, regression test.

Not verified

Tests and conventions check reported in the PR description were not run independently. No base merge check was performed. Read tools/compile_database_inventory.py, tools/tests/test_compile_database_inventory.py, and the relevant tools/check_compile.py parser function. No files were excluded by the prepared manifest.

To get this to a good state

Nothing is required.

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.

4 participants