-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement resolve-system-dependencies in C++ #1030
Conversation
static auto cacheDir = Path{}; | ||
|
||
Path resolveCacheFile(const Path & lib) { | ||
Path lib2 = Path(lib); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a const reference parameter and doing explicit copying, you could directly accept the lib argument via value.
At the highest level, I'd suggest using |
(not that I'd block merging this because you didn't use |
dylc.dylib.name.offset - (sizeof(uint32_t) * 2) + pos, | ||
SEEK_SET); | ||
fread(dylib_name, sizeof(char), cmd.cmdsize, obj_file); | ||
fseek(obj_file, pos, SEEK_SET); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lacks error checking. I would use C++ <iostream>
, or read the whole file into memory using readFile()
for simplicity.
Also relevant is #786 |
@domenkozar #941 will no longer apply because @edolstra @copumpkin I have rewritten the script to use |
Instead of serializing a hashmap to a file as Perl does (which would require an external library dependency), this script stores the dependency list for each lib separately in a cache directory. This should be faster than the old implementation because no resolving is done after the first time the script runs.
Accepting code review as my C++ is not very clean.