feat(graph_explorer): adopta layout assets/ via fn::asset_path

Junto con el cambio del framework (commit 81d8a7c9), graph_explorer
ahora resuelve enrichers/, runtime Python y gx-cli desde
<exe_dir>/assets/ con fallback a las rutas dev legacy.

- main.cpp: enrichers_dir busca primero <exe_dir>/assets/enrichers/
  (deploy con /compile). Fallback a <app_dir>/enrichers/ del repo
  cuando se ejecuta desde build/ (modo dev).
- jobs.cpp::resolve_python_runtime: incluye
  <exe_dir>/assets/runtime/python/{python.exe|bin/python3} como
  primera opcion de la cadena de fallback. La opcion legacy sin
  assets/ queda como segundo intento.
- chat.cpp: gxcli_path busca <exe_dir>/assets/gx-cli{.exe} con
  fallback a <app_dir>/gx-cli para modo dev.

Tests: 32/32 verde. Build Linux + Windows OK. Deploy fresco a
Desktop con todas las 6 apps confirma layout limpio:
  <app>.exe + (duckdb.dll si aplica) + assets/ + local_files/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-03 00:50:44 +02:00
parent 375573db38
commit 8623732d6d
3 changed files with 55 additions and 16 deletions
+19 -12
View File
@@ -119,25 +119,32 @@ bool file_exists(const std::string& p) {
}
// Cadena de fallback (logged una sola vez al primer uso):
// 1. <exe_dir>/runtime/python/{python.exe|bin/python3} -> kind=embedded
// 2. $FN_PYTHON -> kind=env
// 3. <registry_root>/python/.venv/bin/python3 -> kind=registry_venv
// 4. python3 del PATH -> kind=system
// 1. <exe_dir>/assets/runtime/python/{python.exe|bin/python3} -> kind=embedded
// 2. <exe_dir>/runtime/python/... (legacy, pre-assets/) -> kind=embedded
// 3. $FN_PYTHON -> kind=env
// 4. <registry_root>/python/.venv/bin/python3 -> kind=registry_venv
// 5. python3 del PATH -> kind=system
PyRuntime resolve_python_runtime() {
PyRuntime r;
std::string exe = get_exe_dir();
#ifdef _WIN32
if (!exe.empty()) {
std::string p = exe + "\\runtime\\python\\python.exe";
if (file_exists(p)) { r.path = p; r.kind = "embedded"; return r; }
}
const char* embed_rel[] = {
"\\assets\\runtime\\python\\python.exe",
"\\runtime\\python\\python.exe", // legacy
};
#else
if (!exe.empty()) {
std::string p = exe + "/runtime/python/bin/python3";
if (file_exists(p)) { r.path = p; r.kind = "embedded"; return r; }
}
const char* embed_rel[] = {
"/assets/runtime/python/bin/python3",
"/runtime/python/bin/python3", // legacy
};
#endif
if (!exe.empty()) {
for (const char* rel : embed_rel) {
std::string p = exe + rel;
if (file_exists(p)) { r.path = p; r.kind = "embedded"; return r; }
}
}
if (const char* env = std::getenv("FN_PYTHON"); env && *env) {
if (file_exists(env)) { r.path = env; r.kind = "env"; return r; }