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.
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.
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 |
the cgroups experimental feature does not work properly without this because we do not stop subdaemons when the main daemon is shut down. systemd needs the assigned cgroups to be empty to restart the daemon and thus cannot cleanly restart the daemon if any connections exist. starting a fresh unit for each connection creates a new cgroup every time instead of sharing any delegations and thus solves the problem. fixes NixOS#1030 Change-Id: Id6c458aad30eaa08c3609ac8280a7dde8e8f3cf9
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.