paleolimbot commented on code in PR #2918:
URL: https://github.com/apache/arrow-adbc/pull/2918#discussion_r2132411129


##########
c/driver_manager/adbc_driver_manager.cc:
##########
@@ -114,7 +125,187 @@ struct OwnedError {
   }
 };
 
+std::filesystem::path UserConfigDir() {
+  std::filesystem::path config_dir;
+#if defined(_WIN32)
+  auto dir = std::getenv("AppData");
+  if (dir) {
+    config_dir = std::filesystem::path(dir);
+    config_dir /= "ADBC/drivers";
+  }
+#elif defined(__APPLE__)
+  auto dir = std::getenv("HOME");
+  if (dir) {
+    config_dir = std::filesystem::path(dir);
+    config_dir /= "Library/Application Support/ADBC";
+  }
+#elif defined(__linux__)
+  auto dir = std::getenv("XDG_CONFIG_HOME");
+  if (!dir) {
+    dir = std::getenv("HOME");
+    if (dir) {
+      config_dir = std::filesystem::path(dir);
+    }
+  } else {
+    config_dir = std::filesystem::path(dir);
+  }
+
+  if (!config_dir.empty()) {
+    config_dir /= "adbc";
+  }
+#endif
+
+  return config_dir;

Review Comment:
   Thank you for humouring me (and Windows R people generally) here 😬 
   
   The manifest is a great way to do this...the main issue is how to name the 
architectures? We could use:
   
   - Rust's convention: (e.g., x86_64-pc-windows-gnu)
   - vcpkg's convention: (e.g., x64-mingw-dynamic)
   - DuckDB's [supported 
platform](https://duckdb.org/docs/stable/dev/building/overview.html#platforms-with-full-support)
 name: (e.g., windows_amd64_mingw)
   - Make up our own?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to