feat: auto-add ~/.pmm/root/lib to LD_LIBRARY_PATH on install

pmm now writes 'export LD_LIBRARY_PATH=$HOME/.pmm/root/lib:...:$LD_LIBRARY_PATH'
to ~/.bashrc (like it already does for PATH), so a shared library installed by
pmm (via a .pdm's lib/ dir) is found at runtime without manually exporting it.
Takes effect in new shells (or after 'source ~/.bashrc').
这个提交包含在:
JGZYES
2026-09-06 15:59:29 +08:00
父节点 adaad8c888
当前提交 26cb5f89f4
+8
查看文件
@@ -435,6 +435,14 @@ void pmm_add_to_path(void) {
if (f) {
fprintf(f, "\n# PMM PATH\n");
for (int i = 0; i < n; i++) if (list[i][0]) fprintf(f, "export PATH=\"%s:$PATH\"\n", list[i]);
/* Shared libraries installed by PMM live under <home>/root/lib;
* make them findable by dynamically-linked tools automatically. */
fprintf(f, "\n# PMM shared library path\n");
if (pmm_flat_mode())
fprintf(f, "export LD_LIBRARY_PATH=\"%s/lib:%LD_LIBRARY_PATH\"\n", home);
else
fprintf(f, "export LD_LIBRARY_PATH=\"%s/root/lib:%s/root/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH\"\n",
home, home);
fclose(f);
}
(void)she;