LLNL / Surfactant

Modular framework for file information extraction and dependency analysis to generate accurate SBOMs
MIT License
24 stars 16 forks source link

Extract info hooks run multiple times on files #215

Closed nightlark closed 3 months ago

nightlark commented 5 months ago

File info extraction hooks run multiple times on a file, which causes problems for plugins that write extra output files having duplicate info.

The underlying issue is around here: https://github.com/LLNL/Surfactant/blob/main/surfactant/cmd/generate.py#L367 From what I recall, get_software_entry is called to get the hash of the underlying file for tracking what symlinks point to that file -- which also gives plugins an opportunity to run. This should be changed so that if the file is a symlink it computes the file hash without trying to reuse get_software_entry.

This should also simplify the control flow some by not needing the file_is_symlink flag.