docs(flows): DoD obligatorio con user-facing surface + abrir issues 0100-0103 (taxonomia, frontmatter migration, dev_console, work dashboard)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+31
-2
@@ -68,6 +68,9 @@ std::string py_resolve_interpreter() {
|
||||
#ifdef _WIN32
|
||||
std::string venv_py = root + "\\python\\.venv\\Scripts\\python.exe";
|
||||
if (file_exists(venv_py)) return venv_py;
|
||||
// Windows venv no encontrado — intentar via WSL si FN_REGISTRY_ROOT_WSL existe.
|
||||
std::string wsl_root = getenv_str("FN_REGISTRY_ROOT_WSL");
|
||||
if (!wsl_root.empty()) return "wsl.exe"; // sentinel; py_run lo expande
|
||||
#else
|
||||
std::string venv_py = root + "/python/.venv/bin/python3";
|
||||
if (file_exists(venv_py)) return venv_py;
|
||||
@@ -108,10 +111,36 @@ PyResult py_run(const std::vector<std::string>& argv, int timeout_ms) {
|
||||
PyResult res;
|
||||
if (argv.empty()) { res.error = "argv empty"; return res; }
|
||||
|
||||
// Si argv[0] es el sentinel "wsl.exe", reescribir el comando para invocar
|
||||
// el python del venv WSL con el contexto Linux correcto:
|
||||
// wsl.exe --cd <linux_root> -- env FN_REGISTRY_ROOT=<linux_root> python3 -c "..." <args>
|
||||
// Esto garantiza que el script Python recibe FN_REGISTRY_ROOT como path Linux,
|
||||
// puede importar funciones del registry y resuelve deps del venv WSL.
|
||||
std::vector<std::string> final_argv;
|
||||
if (argv[0] == "wsl.exe") {
|
||||
std::string wsl_root = getenv_str("FN_REGISTRY_ROOT_WSL");
|
||||
if (wsl_root.empty()) {
|
||||
res.error = "wsl.exe sentinel but FN_REGISTRY_ROOT_WSL not set";
|
||||
return res;
|
||||
}
|
||||
std::string python3 = wsl_root + "/python/.venv/bin/python3";
|
||||
final_argv.push_back("wsl.exe");
|
||||
final_argv.push_back("--cd");
|
||||
final_argv.push_back(wsl_root);
|
||||
final_argv.push_back("--");
|
||||
final_argv.push_back("env");
|
||||
final_argv.push_back("FN_REGISTRY_ROOT=" + wsl_root);
|
||||
final_argv.push_back(python3);
|
||||
// Append rest of original argv (skip argv[0] = "wsl.exe")
|
||||
for (size_t i = 1; i < argv.size(); ++i) final_argv.push_back(argv[i]);
|
||||
} else {
|
||||
final_argv = argv;
|
||||
}
|
||||
|
||||
std::string cmd;
|
||||
for (size_t i = 0; i < argv.size(); ++i) {
|
||||
for (size_t i = 0; i < final_argv.size(); ++i) {
|
||||
if (i) cmd += ' ';
|
||||
cmd += quote_arg_win(argv[i]);
|
||||
cmd += quote_arg_win(final_argv[i]);
|
||||
}
|
||||
|
||||
HANDLE r_pipe = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user