From 988fd0eec5d88bf6534fb1f645777350c20d4723 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 30 Jul 2016 11:41:48 +0200 Subject: Actualize project root directories This solves the problem of changing path spelling on platforms with case- insensitive filesystems. For example, you may build a project in the current working directory without specifying any paths. This means the current working directory will be used as the project's root. On Windows this could be C:\x. Now you are building another project that imports the above project and you specify config.import.x variable pointing to the above build. But you are lazy to type capital C so you spell it as config.import.x=c:\x. What happens now is the value from config.import.x is used as the project root. And now it is a different spelling compared to your original build. This is not a problem when the build system itself is concerned -- it is smart enough to use case-insensitive comparison. However, we often use roots to derive other things, say, -I options that we pass to compilers. And these options are normally no longer treated as (case-insensitive) paths. If they are hashed and the result stored in depdb, then we end up with rebuilds that are triggered by changes from C:\ to c:\. --- build2/file.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'build2/file.cxx') diff --git a/build2/file.cxx b/build2/file.cxx index 155c8e6..a70c97a 100644 --- a/build2/file.cxx +++ b/build2/file.cxx @@ -664,7 +664,7 @@ namespace build2 const dir_path& d (cast (l)); dir_path out_root (root.out_path () / d); - out_root.normalize (); + out_root.normalize (); // No need to actualize (d is a bunch of ..) // src_root is a bit more complicated. Here we have three cases: // @@ -692,7 +692,7 @@ namespace build2 else // #1 { dir_path src_root (root.src_path () / d); - src_root.normalize (); + src_root.normalize (); // No need to actualize (as above). v = move (src_root); } } @@ -855,7 +855,7 @@ namespace build2 if (auto l = iroot[var]) { - out_root = cast (l); + out_root = cast (l); // Normalized and actualized. config::save_variable (iroot, var); // Mark as part of configuration. } else -- cgit v1.1