From a6a76cc15a2c46a0741f88d3b794c407b314052a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 21 May 2025 16:19:38 +0200 Subject: just-mr: Fix wrong setup root being picked up This fixes a bug in which the setup root was falsely being changed by unconditionally searching early for a default configuration files, despite one being explicitly provided at the command line. --- src/buildtool/common/user_structs.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/buildtool/common/user_structs.hpp') diff --git a/src/buildtool/common/user_structs.hpp b/src/buildtool/common/user_structs.hpp index 9f67ed45..34101e89 100644 --- a/src/buildtool/common/user_structs.hpp +++ b/src/buildtool/common/user_structs.hpp @@ -28,10 +28,13 @@ /* Structures populated exclusively from command line with user-defined data */ +static inline const std::filesystem::path kDefaultSetupRoot = + FileSystemManager::GetCurrentDirectory(); + struct LocalPaths { // user-defined locations std::optional root{std::nullopt}; - std::filesystem::path setup_root{FileSystemManager::GetCurrentDirectory()}; + std::filesystem::path setup_root = kDefaultSetupRoot; std::optional workspace_root{ // find workspace root []() -> std::optional { @@ -45,7 +48,7 @@ struct LocalPaths { }); }; // default path to current dir - auto path = FileSystemManager::GetCurrentDirectory(); + auto path = kDefaultSetupRoot; auto root_path = path.root_path(); while (true) { if (is_workspace_root(path)) { -- cgit v1.2.3