From b7a13f7e23420d7037eb75e4666043da824d144e Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 26 Feb 2026 16:27:31 -0400 Subject: [PATCH] Improve indexing logs around absolute paths Signed-off-by: Juan Cruz Viotti --- src/index/index.cc | 23 ++++++++++++------ test/cli/index/common/rebuild-cache.sh | 32 +++++++++++++------------- test/cli/index/common/verbose-long.sh | 6 ++--- test/cli/index/common/verbose-short.sh | 6 ++--- 4 files changed, 38 insertions(+), 29 deletions(-) diff --git a/src/index/index.cc b/src/index/index.cc index d91ceeeb..cbc109ed 100644 --- a/src/index/index.cc +++ b/src/index/index.cc @@ -207,6 +207,8 @@ static auto index_main(const std::string_view &program, ///////////////////////////////////////////////////////////////////////////// const auto schemas_path{output.path() / "schemas"}; + const auto display_schemas_path{ + std::filesystem::relative(schemas_path, output.path())}; sourcemeta::one::BuildAdapterFilesystem adapter{output.path()}; // Mainly to not screw up the logs std::mutex mutex; @@ -245,6 +247,8 @@ static auto index_main(const std::string_view &program, constexpr auto THREAD_STACK_SIZE{8 * 1024 * 1024}; const auto explorer_path{output.path() / "explorer"}; + const auto display_explorer_path{ + std::filesystem::relative(explorer_path, output.path())}; sourcemeta::core::parallel_for_each( resolver.begin(), resolver.end(), [&output, &schemas_path, &explorer_path, &resolver, &mutex, &adapter, @@ -328,7 +332,8 @@ static auto index_main(const std::string_view &program, // This is a pretty fast step that will be useful for us to properly declare // dependencies for HTML and navigational targets - print_progress(mutex, concurrency, "Reviewing", schemas_path.string(), 1, 2); + print_progress(mutex, concurrency, "Reviewing", display_schemas_path.string(), + 1, 2); std::vector directories; // The top-level is itself a directory directories.emplace_back(schemas_path); @@ -377,10 +382,12 @@ static auto index_main(const std::string_view &program, }); } - print_progress(mutex, concurrency, "Reviewing", schemas_path.string(), 2, 2); + print_progress(mutex, concurrency, "Reviewing", display_schemas_path.string(), + 2, 2); DISPATCH( output.path() / "dependency-tree.metapack", dependencies, resolver, mutex, - "Reviewing", schemas_path.string(), "dependencies", adapter, output); + "Reviewing", display_schemas_path.string(), "dependencies", adapter, + output); ///////////////////////////////////////////////////////////////////////////// // (10) A further pass on the schemas after review @@ -405,11 +412,11 @@ static auto index_main(const std::string_view &program, // (11) Generate the JSON-based explorer ///////////////////////////////////////////////////////////////////////////// - print_progress(mutex, concurrency, "Producing", explorer_path.string(), 0, - 100); + print_progress(mutex, concurrency, "Producing", + display_explorer_path.string(), 0, 100); DISPATCH( explorer_path / SENTINEL / "search.metapack", summaries, nullptr, mutex, - "Producing", explorer_path.string(), "search", adapter, output); + "Producing", display_explorer_path.string(), "search", adapter, output); // Directory generation depends on the configuration for metadata summaries.emplace_back(mark_configuration_path); @@ -549,9 +556,11 @@ static auto index_main(const std::string_view &program, } const auto routes_path{output.path() / "routes.bin"}; + const auto display_routes_path{ + std::filesystem::relative(routes_path, output.path())}; DISPATCH( routes_path, {mark_configuration_path, mark_version_path}, router, mutex, - "Producing", routes_path.string(), "routes", adapter, output); + "Producing", display_routes_path.string(), "routes", adapter, output); ///////////////////////////////////////////////////////////////////////////// // Finish generation diff --git a/test/cli/index/common/rebuild-cache.sh b/test/cli/index/common/rebuild-cache.sh index 146a174b..0cd99bba 100755 --- a/test/cli/index/common/rebuild-cache.sh +++ b/test/cli/index/common/rebuild-cache.sh @@ -49,10 +49,10 @@ Using configuration: $(realpath "$TMP")/one.json Detecting: $(realpath "$TMP")/schemas/foo.json (#1) (100%) Ingesting: https://sourcemeta.com/example/schemas/foo (100%) Analysing: https://sourcemeta.com/example/schemas/foo -( 50%) Reviewing: $(realpath "$TMP")/output/schemas -(100%) Reviewing: $(realpath "$TMP")/output/schemas +( 50%) Reviewing: schemas +(100%) Reviewing: schemas (100%) Reworking: https://sourcemeta.com/example/schemas/foo -( 0%) Producing: $(realpath "$TMP")/output/explorer +( 0%) Producing: explorer ( 33%) Producing: example/schemas ( 66%) Producing: example (100%) Producing: . @@ -84,13 +84,13 @@ Detecting: $(realpath "$TMP")/schemas/foo.json (#1) (skip) Analysing: https://sourcemeta.com/example/schemas/foo [blaze-exhaustive] (skip) Analysing: https://sourcemeta.com/example/schemas/foo [blaze-fast] (skip) Analysing: https://sourcemeta.com/example/schemas/foo [metadata] -( 50%) Reviewing: $(realpath "$TMP")/output/schemas -(100%) Reviewing: $(realpath "$TMP")/output/schemas -(skip) Reviewing: $(realpath "$TMP")/output/schemas [dependencies] +( 50%) Reviewing: schemas +(100%) Reviewing: schemas +(skip) Reviewing: schemas [dependencies] (100%) Reworking: https://sourcemeta.com/example/schemas/foo (skip) Reworking: https://sourcemeta.com/example/schemas/foo [dependents] -( 0%) Producing: $(realpath "$TMP")/output/explorer -(skip) Producing: $(realpath "$TMP")/output/explorer [search] +( 0%) Producing: explorer +(skip) Producing: explorer [search] ( 33%) Producing: example/schemas (skip) Producing: example/schemas [directory] ( 66%) Producing: example @@ -106,7 +106,7 @@ Detecting: $(realpath "$TMP")/schemas/foo.json (#1) (skip) Rendering: . [not-found] (100%) Rendering: example/schemas/foo (skip) Rendering: example/schemas/foo [schema] -(skip) Producing: $(realpath "$TMP")/output/routes.bin [routes] +(skip) Producing: routes.bin [routes] EOF diff "$TMP/output.txt" "$TMP/expected.txt" @@ -126,10 +126,10 @@ Using configuration: $(realpath "$TMP")/one.json Detecting: $(realpath "$TMP")/schemas/foo.json (#1) (100%) Ingesting: https://sourcemeta.com/example/schemas/foo (100%) Analysing: https://sourcemeta.com/example/schemas/foo -( 50%) Reviewing: $(realpath "$TMP")/output/schemas -(100%) Reviewing: $(realpath "$TMP")/output/schemas +( 50%) Reviewing: schemas +(100%) Reviewing: schemas (100%) Reworking: https://sourcemeta.com/example/schemas/foo -( 0%) Producing: $(realpath "$TMP")/output/explorer +( 0%) Producing: explorer ( 33%) Producing: example/schemas ( 66%) Producing: example (100%) Producing: . @@ -138,7 +138,7 @@ Detecting: $(realpath "$TMP")/schemas/foo.json (#1) ( 75%) Rendering: . (skip) Rendering: . [not-found] (100%) Rendering: example/schemas/foo -(skip) Producing: $(realpath "$TMP")/output/routes.bin [routes] +(skip) Producing: routes.bin [routes] EOF diff "$TMP/output.txt" "$TMP/expected.txt" @@ -152,10 +152,10 @@ Using configuration: $(realpath "$TMP")/one.json Detecting: $(realpath "$TMP")/schemas/foo.json (#1) (100%) Ingesting: https://sourcemeta.com/example/schemas/foo (100%) Analysing: https://sourcemeta.com/example/schemas/foo -( 50%) Reviewing: $(realpath "$TMP")/output/schemas -(100%) Reviewing: $(realpath "$TMP")/output/schemas +( 50%) Reviewing: schemas +(100%) Reviewing: schemas (100%) Reworking: https://sourcemeta.com/example/schemas/foo -( 0%) Producing: $(realpath "$TMP")/output/explorer +( 0%) Producing: explorer ( 33%) Producing: example/schemas ( 66%) Producing: example (100%) Producing: . diff --git a/test/cli/index/common/verbose-long.sh b/test/cli/index/common/verbose-long.sh index d1af779e..489437fe 100755 --- a/test/cli/index/common/verbose-long.sh +++ b/test/cli/index/common/verbose-long.sh @@ -50,10 +50,10 @@ Detecting: $(realpath "$TMP")/schemas/foo.json (#1) https://example.com/foo => https://sourcemeta.com/example/schemas/foo (100%) Ingesting: https://sourcemeta.com/example/schemas/foo (100%) Analysing: https://sourcemeta.com/example/schemas/foo -( 50%) Reviewing: $(realpath "$TMP")/output/schemas -(100%) Reviewing: $(realpath "$TMP")/output/schemas +( 50%) Reviewing: schemas +(100%) Reviewing: schemas (100%) Reworking: https://sourcemeta.com/example/schemas/foo -( 0%) Producing: $(realpath "$TMP")/output/explorer +( 0%) Producing: explorer ( 33%) Producing: example/schemas ( 66%) Producing: example (100%) Producing: . diff --git a/test/cli/index/common/verbose-short.sh b/test/cli/index/common/verbose-short.sh index 787282a3..d50ba68d 100755 --- a/test/cli/index/common/verbose-short.sh +++ b/test/cli/index/common/verbose-short.sh @@ -50,10 +50,10 @@ Detecting: $(realpath "$TMP")/schemas/foo.json (#1) https://example.com/foo => https://sourcemeta.com/example/schemas/foo (100%) Ingesting: https://sourcemeta.com/example/schemas/foo (100%) Analysing: https://sourcemeta.com/example/schemas/foo -( 50%) Reviewing: $(realpath "$TMP")/output/schemas -(100%) Reviewing: $(realpath "$TMP")/output/schemas +( 50%) Reviewing: schemas +(100%) Reviewing: schemas (100%) Reworking: https://sourcemeta.com/example/schemas/foo -( 0%) Producing: $(realpath "$TMP")/output/explorer +( 0%) Producing: explorer ( 33%) Producing: example/schemas ( 66%) Producing: example (100%) Producing: .