Skip to content

Amend platform repo paths with version specific path#9503

Merged
stsoe merged 1 commit into
Xilinx:masterfrom
stsoe:patch
Dec 12, 2025
Merged

Amend platform repo paths with version specific path#9503
stsoe merged 1 commit into
Xilinx:masterfrom
stsoe:patch

Conversation

@stsoe
Copy link
Copy Markdown
Collaborator

@stsoe stsoe commented Dec 11, 2025

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.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


// 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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -14,6 +19,10 @@
# error "XRT_INSTALL_PREFIX is undefined"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'XRT_VERSION_STRING' [clang-diagnostic-error]

    paths.push_back(sfs::path(xdg) / "xrt" / XRT_VERSION_STRING);
                                             ^

@stsoe stsoe merged commit 5c6def2 into Xilinx:master Dec 12, 2025
25 checks passed
@stsoe stsoe deleted the patch branch December 12, 2025 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant