packages.biu/hpcstat: fix build

This commit is contained in:
2025-08-15 13:17:32 +08:00
parent f39285ff0e
commit 66111e1dec
4 changed files with 13 additions and 10 deletions

View File

@@ -34,9 +34,10 @@ namespace biu::process
if constexpr (Mode.ModifyEnv)
{
auto current = bp::environment::current();
std::unordered_map<bp::environment::key, bp::environment::value> env
(current.begin(), current.end());
std::unordered_map<bp::environment::key, bp::environment::value> env;
for (const auto& e : current) env[e.key()] = e.value();
for (const auto& [key, value] : input.ExtraEnv) env[key] = value;
return env;
}
else return bp::environment::current();
}();

View File

@@ -53,7 +53,7 @@ namespace hpcstat::disk
{
if
(
auto result = biu::exec
auto result = biu::exec<{.Stdout = biu::IoType::String}>
({
// duc ls -d ./duc.db -b -D /data/gpfs01/jykang/linwei/xxx
"{}/duc"_f(*ducbindir),
@@ -86,7 +86,7 @@ namespace hpcstat::disk
if
(
// duc info -d ./duc.db
auto result = biu::exec
auto result = biu::exec<{.Stdout = biu::IoType::String}>
({"{}/duc"_f(*ducbindir), { "info", "-d", "{}/duc.db"_f(*datadir) }});
!result
)

View File

@@ -27,7 +27,8 @@ namespace hpcstat::lfs
}
else break;
}
if (auto result = biu::exec({*bsub, args}); !result) return std::nullopt;
if (auto result = biu::exec<{.Stdout = biu::IoType::String}>({*bsub, args}); !result)
return std::nullopt;
else
{
// Job <462270> is submitted to queue <normal_1day>.
@@ -44,7 +45,7 @@ namespace hpcstat::lfs
{
if
(
auto result = biu::exec<{.SearchPath = true, .ModifyEnv = true}>
auto result = biu::exec<{.SearchPath = true, .ModifyEnv = true, .Stdout = biu::IoType::String}>
({
.Program="bjobs",
.Args={ "-a", "-o", "jobid submit_time stat cpu_used job_name", "-json" },
@@ -82,7 +83,8 @@ namespace hpcstat::lfs
{
if
(
auto result = biu::exec<{.SearchPath = true}>({"bjobs", { "-l", "{}"_f(jobid) }});
auto result = biu::exec<{.SearchPath = true, .Stdout = biu::IoType::String}>
({"bjobs", { "-l", "{}"_f(jobid) }});
!result
)
return std::nullopt;

View File

@@ -12,7 +12,7 @@ namespace hpcstat::ssh
return std::nullopt;
else if
(
auto output = biu::exec<{.Timeout = true}>
auto output = biu::exec<{.Timeout = true, .Stdout = biu::IoType::String}>
({.Program=std::filesystem::path(*sshbindir) / "ssh-add", .Args{ "-l" }, .Timeout=10s});
!output
)
@@ -41,7 +41,7 @@ namespace hpcstat::ssh
return std::nullopt;
else if
(
auto output = biu::exec<.Stdin = biu::IoType::String, .Timeout = true>
auto output = biu::exec<{.Timeout = true, .Stdin = biu::IoType::String, .Stdout = biu::IoType::String}>
({
.Program=std::filesystem::path(*sshbindir) / "ssh-keygen",
.Args={
@@ -69,7 +69,7 @@ namespace hpcstat::ssh
bf::create_directories(tempdir);
auto signaturefile = tempdir / "signature";
std::ofstream(signaturefile) << signature;
auto result = biu::exec<.Stdin = biu::IoType::String, .Timeout = true>
auto result = biu::exec<{.Timeout = true, .Stdin = biu::IoType::String}>
({
.Program=std::filesystem::path(*sshbindir) / "ssh-keygen",
.Args={