]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph-dencoder: register dencoders in "lib" in dev env 47336/head
authorKefu Chai <tchaikov@gmail.com>
Thu, 28 Jul 2022 15:11:08 +0000 (23:11 +0800)
committerKefu Chai <tchaikov@gmail.com>
Thu, 28 Jul 2022 15:13:39 +0000 (23:13 +0800)
if "CMakeCache.txt" is found in current directory, try to load
dencoder shared libraries  from ./lib. this heuristics is used by
`ceph.in` also for relaunching itself to get access to python
bindings.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/tools/ceph-dencoder/ceph_dencoder.cc

index af039bdf4627ea02c0823c324fe372853ad46f46..a278e08629f5f30d557d8353d3d7419b8501b5e0 100644 (file)
@@ -67,6 +67,8 @@ vector<DencoderPlugin> load_plugins()
   fs::path mod_dir{CEPH_DENC_MOD_DIR};
   if (auto ceph_lib = getenv("CEPH_LIB"); ceph_lib) {
     mod_dir = ceph_lib;
+  } else if (fs::is_regular_file("CMakeCache.txt")) {
+    mod_dir = std::filesystem::canonical("lib");
   }
   if (!fs::is_directory(mod_dir)) {
     std::cerr << "unable to load dencoders from "