Bash

git add builder/src/build_index.cpp && git commit --amend --no-edit 2>&1 | tail -2 && cat builder/src/build_index.cpp | ssh node3 "cat > /tmp/traccar-geocoder/builder/src/build_index.cpp" && ssh node3 "cd /tmp/traccar-geocoder/builder/build && make -j\$(nproc) 2>&1 | tail -3" 2>&1

Fix scope, amend, rebuild


 Date: Sun Mar 22 18:28:39 2026 +0000
 1 file changed, 156 insertions(+), 45 deletions(-)
make[2]: *** [CMakeFiles/build-index.dir/build.make:79: CMakeFiles/build-index.dir/src/build_index.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/build-index.dir/all] Error 2
make: *** [Makefile:91: all] Error 2


ssh node3 "cd /tmp/traccar-geocoder/builder/build && make 2>&1 | grep 'error:' | head -5" 2>&1

Check errors


/tmp/traccar-geocoder/builder/src/build_index.cpp:122:43: error: ‘_phase_t’ was not declared in this scope


ssh node3 "cd /tmp/traccar-geocoder/builder/build && make 2>&1 | grep 'build_index.cpp.*error' | head -5" 2>&1

Full error lines


Line 122 is the PHASE_LOG macro definition itself! Let me check:


   120→}
   121→#define PHASE_START auto _phase_t = std::chrono::steady_clock::now()
   122→#define PHASE_LOG(name) log_elapsed(name, _phase_t); _phase_t = std::chrono::steady_clock::now()
   123→
   124→// --- Deferred S2 work items (computed in parallel after PBF read) ---

}
#define PHASE_START auto _phase_t = std::chrono::steady_clock::now()
#define PHASE_LOG(name) log_elapsed(name, _phase_t); _phase_t = std::chrono::steady_clock::now()

// --- Deferred S2 work items (computed in parallel after PBF read) ---


The macro is fine — the error is at the expansion site. Let me check which PHASE_LOG is at the wrong scope:


ssh node3 "cd /tmp/traccar-geocoder/builder/build && make 2>&1 | grep 'note:\|error:' | head -10" 2>&1

Full error context


/tmp/traccar-geocoder/builder/src/build_index.cpp:122:43: error: ‘_phase_t’ was not declared in this scope
/tmp/traccar-geocoder/builder/src/build_index.cpp:3000:5: note: in expansion of macro ‘PHASE_LOG’


Line 3000 is outside the `for (const auto& input_file : input_files)` loop. The `PHASE_START` is inside the loop but PHASE_LOG at line 3000 is outside. Let me check the structure.


  2975→            std::cerr << "S2 cell computation complete." << std::endl;
  2976→        }
  2977→
  2978→        // Resolve interpolation endpoints
  2979→        std::cerr << "Resolving interpolation endpoints..." << std::endl;
  2980→        resolve_interpolation_endpoints(data);
  2981→
  2982→        // Deduplicate all cell maps (in parallel)
  2983→        PHASE_LOG("S2 cell computation");
  2984→        std::cerr << "Deduplicating..." << std::endl;

            std::cerr << "S2 cell computation complete." << std::endl;
        }

        // Resolve interpolation endpoints
        std::cerr << "Resolving interpolation endpoints..." << std::endl;
        resolve_interpolation_endpoints(data);

        // Deduplicate all cell maps (in parallel)
        PHASE_LOG("S2 cell computation");
        std::cerr << "Deduplicating..." << std::endl;


The `}` at line 2976 closes the `for (input_file)` loop — but wait, the PHASE_START is now outside the loop. Let me check if the closing brace structure is correct.


grep -n 'PHASE_START\|PHASE_LOG' /root/traccar-geocoder/builder/src/build_index.cpp

All phase markers


121:#define PHASE_START auto _phase_t = std::chrono::steady_clock::now()
122:#define PHASE_LOG(name) log_elapsed(name, _phase_t); _phase_t = std::chrono::steady_clock::now()
2148:        PHASE_START;
2178:            PHASE_LOG("Pass 1: relation scanning");
2302:            PHASE_LOG("Pass 2: node processing");
2719:                    PHASE_LOG("Pass 3: way processing + merge");
2884:            PHASE_LOG("Admin assembly");
2983:        PHASE_LOG("S2 cell computation");
3000:    PHASE_LOG("Deduplication");
3046:    PHASE_LOG("Index file writing");


Line 2148 has PHASE_START at 8-space indent (inside `if (load_cache_path.empty())`). Line 3000 is at 4-space indent (outside that block). Let me move PHASE_START to the function level.


Edit

        PHASE_START;
        for (const auto& input_file : input_files) {

for (const auto& input_file : input_files) {