Skip to content

Fix: Match OS packages for stdlib #1309

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

Merged
merged 6 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Contents of data directory and their purpose.
| wrapdb-releases.json | Database of all available meson wraps. Generated using contrib/wrapdb.py. |
| frameworks-list.json | List of string fragments to categorize components into frameworks |
| crypto-oid.json | Peter Gutmann's crypto oid [mapping](https://www.cs.auckland.ac.nz/~pgut001). GPL, BSD, or CC BY license |
| glibc-stdlib.json | Standard libraries that can be filtered out in C++ |
93 changes: 93 additions & 0 deletions data/glibc-stdlib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[
"algorithm",
"iomanip",
"list",
"ostream",
"streambuf",
"bitset",
"ios",
"locale",
"queue",
"string",
"complex",
"iosfwd",
"map",
"set",
"typeinfo",
"deque",
"iostream",
"memory",
"sstream",
"utility",
"exception",
"istream",
"new",
"stack",
"valarray",
"fstream",
"iterator",
"numeric",
"stdexcept",
"vector",
"functional",
"limits",
"debugging",
"inplace_vector",
"linalg",
"rcu",
"text_encoding",
"hazard_pointer",
"expected",
"flat_set",
"mdspan",
"spanstream",
"stdfloat",
"flat_map",
"generator",
"print",
"stacktrace",
"barrier",
"concepts",
"latch",
"semaphore",
"stop_token",
"bit",
"coroutine",
"numbers",
"source_location",
"syncstream",
"compare",
"format",
"ranges",
"span",
"version",
"any",
"execution",
"memory_resource",
"string_view",
"variant",
"charconv",
"filesystem",
"optional",
"shared_mutex",
"array",
"condition_variable",
"mutex",
"scoped_allocator",
"type_traits",
"atomic",
"forward_list",
"random",
"system_error",
"typeindex",
"chrono",
"future",
"ratio",
"thread",
"unordered_map",
"codecvt",
"initializer_list",
"regex",
"tuple",
"unordered_set"
]
11 changes: 11 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export const frameworksList = JSON.parse(
const selfPJson = JSON.parse(
readFileSync(join(dirNameStr, "package.json"), "utf-8"),
);

const CPP_STD_MODULES = JSON.parse(
readFileSync(join(dirNameStr, "data", "glibc-stdlib.json"), "utf-8"),
);
const _version = selfPJson.version;

// Refer to contrib/py-modules.py for a script to generate this list
Expand Down Expand Up @@ -11045,6 +11049,7 @@ export function getCppModules(src, options, osPkgsList, epkgList) {
const epkgMap = {};
let parentComponent = undefined;
const dependsOn = [];

(epkgList || []).forEach((p) => {
epkgMap[`${p.group}/${p.name}`] = p;
});
Expand Down Expand Up @@ -11193,6 +11198,12 @@ export function getCppModules(src, options, osPkgsList, epkgList) {
const version = "";
// We need to resolve the name to an os package here
const name = fileName.replace(extn, "");
// Logic here if name matches the standard library of cpp
// we skip it
// Load the glibc-stdlib.json file, which contains std lib for cpp
if (CPP_STD_MODULES.includes(name)) {
continue;
}
let apkg = getOSPackageForFile(afile, osPkgsList) ||
epkgMap[`${group}/${name}`] || {
name,
Expand Down
Loading