Amend platform repo paths with version specific path#9503
Conversation
|
|
||
| // 2. XDG data path ($HOME/.local/share) is also a candidate | ||
| if (const char* xdg = std::getenv("XDG_DATA_HOME"); xdg && *xdg) | ||
| if (const char* xdg = std::getenv("XDG_DATA_HOME"); xdg && *xdg) { |
There was a problem hiding this comment.
warning: function is not thread safe [concurrency-mt-unsafe]
if (const char* xdg = std::getenv("XDG_DATA_HOME"); xdg && *xdg) {
^| // 2. XDG data path ($HOME/.local/share) is also a candidate | ||
| if (const char* xdg = std::getenv("XDG_DATA_HOME"); xdg && *xdg) | ||
| if (const char* xdg = std::getenv("XDG_DATA_HOME"); xdg && *xdg) { | ||
| paths.push_back(sfs::path(xdg) / xrt / XRT_VERSION_STRING); |
There was a problem hiding this comment.
warning: use of undeclared identifier 'XRT_VERSION_STRING' [clang-diagnostic-error]
paths.push_back(sfs::path(xdg) / xrt / XRT_VERSION_STRING);
^| paths.push_back(sfs::path(xdg) / "xrt"); | ||
| else if (const char* home = std::getenv("HOME"); home && *home) | ||
| } | ||
| else if (const char* home = std::getenv("HOME"); home && *home) { |
There was a problem hiding this comment.
warning: function is not thread safe [concurrency-mt-unsafe]
else if (const char* home = std::getenv("HOME"); home && *home) {
^| else if (const char* home = std::getenv("HOME"); home && *home) | ||
| } | ||
| else if (const char* home = std::getenv("HOME"); home && *home) { | ||
| paths.push_back(sfs::path(home) / ".local/share/xrt" / XRT_VERSION_STRING); |
There was a problem hiding this comment.
warning: use of undeclared identifier 'XRT_VERSION_STRING' [clang-diagnostic-error]
paths.push_back(sfs::path(home) / ".local/share/xrt" / XRT_VERSION_STRING);
^Under XDG_DATA_DIR use XRT_VERSION_STRING for application data dir directory. Make sure version specific directory is searched prior to non-versioned directory. This is facilitating xrt-smi in its search for validation artifact archives, such that the search can be specific to an XRT version. Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
| @@ -14,6 +19,10 @@ | |||
| # error "XRT_INSTALL_PREFIX is undefined" | |||
There was a problem hiding this comment.
warning: "XRT_INSTALL_PREFIX is undefined" [clang-diagnostic-error]
# error "XRT_INSTALL_PREFIX is undefined"
^| #endif | ||
|
|
||
| #ifndef XRT_VERSION_STRING | ||
| # error "XRT_VERSION_STRING is undefined" |
There was a problem hiding this comment.
warning: "XRT_VERSION_STRING is undefined" [clang-diagnostic-error]
# error "XRT_VERSION_STRING is undefined"
^| @@ -29,11 +38,36 @@ xilinx_xrt() | |||
| if (std::string(info.dli_fname).find("libxrt_coreutil") == std::string::npos) | |||
| return sfs::path(XRT_INSTALL_PREFIX); | |||
There was a problem hiding this comment.
warning: use of undeclared identifier 'XRT_INSTALL_PREFIX' [clang-diagnostic-error]
return sfs::path(XRT_INSTALL_PREFIX);
^| return so_path.parent_path().parent_path(); | ||
| } | ||
| catch (const std::exception&) { | ||
| return sfs::path(XRT_INSTALL_PREFIX); |
There was a problem hiding this comment.
warning: use of undeclared identifier 'XRT_INSTALL_PREFIX' [clang-diagnostic-error]
return sfs::path(XRT_INSTALL_PREFIX);
^| // 2. XDG data path ($HOME/.local/share) is also a candidate | ||
| if (const char* xdg = std::getenv("XDG_DATA_HOME"); xdg && *xdg) | ||
| if (const char* xdg = std::getenv("XDG_DATA_HOME"); xdg && *xdg) { | ||
| paths.push_back(sfs::path(xdg) / "xrt" / XRT_VERSION_STRING); |
There was a problem hiding this comment.
warning: use of undeclared identifier 'XRT_VERSION_STRING' [clang-diagnostic-error]
paths.push_back(sfs::path(xdg) / "xrt" / XRT_VERSION_STRING);
^
Problem solved by the commit
Under XDG_DATA_DIR use XRT_VERSION_STRING for application data dir directory. Make sure version specific directory is searched prior to non-versioned directory.
This is facilitating xrt-smi in its search for validation artifact archives, such that the search can be specific to an XRT version.