One user-space repair task per eligible HWE debug-diag / compile-deploy base ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content filter. Each ships a public spec with a check-to-basis table, at least two defects with single-fix fixtures, a symptom-masking fixture and an alternative correct implementation. Claude re-checked all 320: structure, the HWE quality items and trace6 Docker calibration receipts against current digests (320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120 ad-hoc family names; the next batch maps them to the canonical list. The batch's 1,256-line progress log stays in its factory report and the 36-local branch batch15-hwe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
1.9 KiB
C++
66 lines
1.9 KiB
C++
#include "route.hpp"
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace route {
|
|
namespace {
|
|
|
|
bool nonempty(const std::vector<std::string>& values) {
|
|
for (const std::string& value : values) {
|
|
if (value.empty()) return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
bool config_ready(const Config& config) {
|
|
if (config.host_machine.empty() || config.target_machine.empty()) return false;
|
|
if (config.cross) {
|
|
if (config.host_machine == config.target_machine) return false;
|
|
if (config.exe_wrapper.empty() || config.runtime_root.empty()) return false;
|
|
if (!nonempty(config.exe_wrapper)) return false;
|
|
} else if (config.host_machine != config.target_machine) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
bool command_for(const Config& config, const Artifact& artifact,
|
|
const Test& test, std::vector<std::string>& argv,
|
|
std::string& error) {
|
|
if (!config_ready(config)) {
|
|
error = "configuration";
|
|
return false;
|
|
}
|
|
if (artifact.path.empty() || artifact.machine != config.target_machine) {
|
|
error = "artifact";
|
|
return false;
|
|
}
|
|
if (!nonempty(test.arguments)) {
|
|
error = "argument";
|
|
return false;
|
|
}
|
|
std::vector<std::string> command;
|
|
if (config.cross) {
|
|
if (config.runtime_root == "/usr/aarch64-linux-gnu") {
|
|
command.push_back(artifact.path);
|
|
} else {
|
|
command.insert(command.end(), config.exe_wrapper.begin(),
|
|
config.exe_wrapper.end());
|
|
command.push_back("-L");
|
|
command.push_back(config.runtime_root);
|
|
command.push_back(artifact.path);
|
|
}
|
|
} else {
|
|
command.push_back(artifact.path);
|
|
}
|
|
command.insert(command.end(), test.arguments.begin(), test.arguments.end());
|
|
argv = std::move(command);
|
|
error.clear();
|
|
return true;
|
|
}
|
|
|
|
} // namespace route
|