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

Recognize include directories in package file contents #9

Open
nightlark opened this issue Dec 5, 2024 · 1 comment
Open

Recognize include directories in package file contents #9

nightlark opened this issue Dec 5, 2024 · 1 comment
Assignees

Comments

@nightlark
Copy link
Collaborator

One of the main sources of false positives/ambiguity comes from packages that vendor a copy of a header file.

Adding an ability to recognize include standard/sysroot include directories in package contents will help significantly, though to recognize some very commonly used libraries like libstdc++ there are some multiarch and common compiler subfolders that need recognizing:

  • Directly under usr/include, maybe with one subfolder being omitted as allowed? (e.g. if they included a vendored copy but left out a subfolder from the include path)
  • Multiarch triplet include folders: usr/x86_64-linux-gnu/include (Support for multiarch include paths: https://wiki.debian.org/Multiarch)
  • Nested subfolders specific to libstdc++/compilers: usr/x86_64-linux-gnu/include/c++/11/, usr/lib/llvm-16/lib/clang/16/include/stdarg.h, usr/lib/gcc-cross/x86_64-linux-gnux32/12/include/stdbool.h, etc
  • Encountered many matches for anything in libstdc++, libc++, and libc across versions (e.g. bits/ and c++/9/ and c++/10/) and architectures need to be collapsed into one (include file name is not enough to determine version): "universe/devel/libstdc++-10-dev-arm64-cross", "usr/aarch64-linux-gnu/include/c++/10/valarray", etc

Examples:

  • r-cran packages
  • ASIO... Include: asio.hpp -> Packages: [("universe/devel/libasio-dev", "usr/include/asio.hpp"), ("libdevel/libboost1.83-dev,universe/libdevel/libboost1.74-dev", "usr/include/boost/asio.hpp"), ("universe/libdevel/libwebsocketpp-dev", "usr/include/websocketpp/common/asio.hpp"), ("universe/libdevel/libwebsocketpp-dev", "usr/include/websocketpp/config/asio.hpp")]
@nightlark nightlark self-assigned this Dec 22, 2024
@nightlark
Copy link
Collaborator Author

nightlark commented Jan 23, 2025

1/23 - Steven: has something that works using regex, working on refactoring to do regex on individual path components

  • could reuse the individual path component regex code to implement full path normalization and path comparison functions

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

No branches or pull requests

2 participants