You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user on Discord reported the wallet produced an error that it could not find the BOINC data directory. This was on Ubuntu 22.04.
After investigation, I determined that both the native and flatpak BOINC was installed.
The current wallet BOINC data directory resolution code in boinc.cpp reads as follows:
fs::path GRC::GetBoincDataDir()
{
std::string path = gArgs.GetArg("-boincdatadir", "");
if (!path.empty()) {
return fs::path(path);
}
#ifdef WIN32
HKEY hKey;
if (RegOpenKeyEx(
HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Setup\\",
0,
KEY_READ|KEY_WOW64_64KEY,
&hKey) == ERROR_SUCCESS)
{
wchar_t szPath[MAX_PATH];
DWORD dwSize = sizeof(szPath);
if (RegQueryValueEx(
hKey,
L"DATADIR",
nullptr,
nullptr,
(LPBYTE)&szPath,
&dwSize) == ERROR_SUCCESS)
{
RegCloseKey(hKey);
fs::path path = std::wstring(szPath);
if (fs::exists(path)){
return path;
} else {
LogPrintf("Cannot find BOINC data dir %s.", path.string());
}
}
RegCloseKey(hKey);
}
if (fs::exists("C:\\ProgramData\\BOINC\\")){
return "C:\\ProgramData\\BOINC\\";
} else if(fs::exists("C:\\Documents and Settings\\All Users\\Application Data\\BOINC\\")) {
return "C:\\Documents and Settings\\All Users\\Application Data\\BOINC\\";
}
#endif
#ifdef __linux__
// For Linux, native first, then flatpack...
if (fs::exists("/var/lib/boinc-client/")) {
return "/var/lib/boinc-client/";
} else if (fs::exists("/var/lib/boinc/")) {
return "/var/lib/boinc/";
}
// This is for flatpack path resolution
char* pszHome = getenv("HOME");
// If there is a home path then try the flatpack path.
if (pszHome && strlen(pszHome) > 0) {
fs::path flatpack_path = fs::path(pszHome) / ".var/app/edu.berkeley.BOINC/";
if (fs::exists(flatpack_path)) {
return flatpack_path;
}
}
#endif
#ifdef __APPLE__
if (fs::exists("/Library/Application Support/BOINC Data/")) {
return "/Library/Application Support/BOINC Data/";
}
#endif
error("%s: Cannot find BOINC data directory. You may need to manually specify in the gridcoinresearch.conf file "
"the data directory location by using boincdatadir=<data directory location>.", __func__);
return "";
}
In particular note that the fs::exists tests for the native paths do NOT check for the existence of the client_state.xml file, only the path. This means a native package installation, even if never actually run, will be sufficient to prevent the resolver to continue on to the flatpak part.
We need to consider doing the fs::exists on the client_state.xml file. There may be problems with that though, because someone could start the wallet for the first time AFTER installing the native package but before running BOINC, in which case the wallet will fail to load if we require the client_state.xml file to be there at that time.
We may have to do something more sophisticated.
The text was updated successfully, but these errors were encountered:
A user on Discord reported the wallet produced an error that it could not find the BOINC data directory. This was on Ubuntu 22.04.
After investigation, I determined that both the native and flatpak BOINC was installed.
The current wallet BOINC data directory resolution code in boinc.cpp reads as follows:
In particular note that the fs::exists tests for the native paths do NOT check for the existence of the client_state.xml file, only the path. This means a native package installation, even if never actually run, will be sufficient to prevent the resolver to continue on to the flatpak part.
We need to consider doing the fs::exists on the client_state.xml file. There may be problems with that though, because someone could start the wallet for the first time AFTER installing the native package but before running BOINC, in which case the wallet will fail to load if we require the client_state.xml file to be there at that time.
We may have to do something more sophisticated.
The text was updated successfully, but these errors were encountered: