aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-02-14 15:17:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-02-14 15:17:56 +0200
commit568aab7f19cc9bbb42c7fb4afef541a79459d657 (patch)
treedb9324f02442bb82fadfc14da7f57feded9deab0
parent4e665067ff264c55086fdfb776a95b0fbb4d432c (diff)
Revert back to only cleaning targets in subdirectories
Cleaning everything as long as it is in the same strong amalgamation had some undesirable side effects. For example, in bpkg, upgrading a package (which requires clean/reconfigure) led to all its prerequisite being cleaned as well and then rebuilt. That was very surprising.
-rw-r--r--build2/algorithm.ixx8
-rw-r--r--build2/cxx/compile.cxx9
-rw-r--r--build2/cxx/link.cxx13
3 files changed, 8 insertions, 22 deletions
diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx
index 19eb7e7..a405c30 100644
--- a/build2/algorithm.ixx
+++ b/build2/algorithm.ixx
@@ -101,11 +101,7 @@ namespace build2
search_and_match_prerequisites (action a, target& t)
{
search_and_match_prerequisites (
- a,
- t,
- a.operation () != clean_id
- ? dir_path ()
- : t.strong_scope ().out_path ());
+ a, t, a.operation () != clean_id ? dir_path () : t.dir);
}
inline void
@@ -118,7 +114,7 @@ namespace build2
// through groups since the group target should clean eveything
// up. A bit of an optimization.
//
- search_and_match_prerequisites (a, t, t.strong_scope ().out_path ());
+ search_and_match_prerequisites (a, t, t.dir);
}
target_state
diff --git a/build2/cxx/compile.cxx b/build2/cxx/compile.cxx
index a1abfcb..22a25cb 100644
--- a/build2/cxx/compile.cxx
+++ b/build2/cxx/compile.cxx
@@ -78,13 +78,8 @@ namespace build2
// code (below) takes care of the ones it is adding.
//
// When cleaning, ignore prerequisites that are not in the same
- // or a subdirectory of our strong amalgamation.
+ // or a subdirectory of ours.
//
- const dir_path* amlg (
- a.operation () != clean_id
- ? nullptr
- : &t.strong_scope ().out_path ());
-
link::search_paths_cache lib_paths; // Extract lazily.
for (prerequisite_member p: group_prerequisite_members (a, t))
@@ -117,7 +112,7 @@ namespace build2
target& pt (p.search ());
- if (a.operation () == clean_id && !pt.dir.sub (*amlg))
+ if (a.operation () == clean_id && !pt.dir.sub (t.dir))
continue;
build2::match (a, pt);
diff --git a/build2/cxx/link.cxx b/build2/cxx/link.cxx
index 42b2235..3b5b857 100644
--- a/build2/cxx/link.cxx
+++ b/build2/cxx/link.cxx
@@ -545,13 +545,8 @@ namespace build2
// files as well as search and match.
//
// When cleaning, ignore prerequisites that are not in the same
- // or a subdirectory of our strong amalgamation.
+ // or a subdirectory of ours.
//
- const dir_path* amlg (
- a.operation () != clean_id
- ? nullptr
- : &t.strong_scope ().out_path ());
-
for (prerequisite_member p: group_prerequisite_members (a, t))
{
bool group (!p.prerequisite.belongs (t)); // Group's prerequisite.
@@ -569,7 +564,7 @@ namespace build2
if (pt == nullptr)
pt = &p.search ();
- if (a.operation () == clean_id && !pt->dir.sub (*amlg))
+ if (a.operation () == clean_id && !pt->dir.sub (t.dir))
continue; // Skip.
// If this is the obj{} or lib{} target group, then pick the
@@ -631,9 +626,9 @@ namespace build2
target& ot (search (o_type, d, *cp.tk.name, nullptr, cp.scope));
// If we are cleaning, check that this target is in the same or
- // a subdirectory of our strong amalgamation.
+ // a subdirectory of ours.
//
- if (a.operation () == clean_id && !ot.dir.sub (*amlg))
+ if (a.operation () == clean_id && !ot.dir.sub (t.dir))
{
// If we shouldn't clean obj{}, then it is fair to assume
// we shouldn't clean cxx{} either (generated source will