File: 0005.patch

package info (click to toggle)
firefox 146.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,653,260 kB
  • sloc: cpp: 7,587,892; javascript: 6,509,455; ansic: 3,755,295; python: 1,410,813; xml: 629,201; asm: 438,677; java: 186,096; sh: 62,697; makefile: 18,086; objc: 13,087; perl: 12,811; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (83 lines) | stat: -rw-r--r-- 2,748 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From: Michael Froman <mfroman@mozilla.com>
Date: Thu, 10 Oct 2024 13:42:00 +0000
Subject: Bug 1921707 - absl.gni - filter dep paths from
 '//third_party/abseil-cpp/' to '//' r=ng

Differential Revision: https://phabricator.services.mozilla.com/D224080
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/afc78fbdb5666ffa9c87da7427cc7249220f4908
---
 abseil-cpp/absl.gni | 54 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/abseil-cpp/absl.gni b/abseil-cpp/absl.gni
index ff2ff91cfa4..1213d0e0bb0 100644
--- a/abseil-cpp/absl.gni
+++ b/abseil-cpp/absl.gni
@@ -79,8 +79,45 @@ template("absl_source_set") {
           visibility = [ "*" ]
         }
       }
+      visibility += [ "//abseil-cpp/*" ]
+
+      # Now that abseil-cpp lives under Mozilla's third_party instead
+      # of under libwebrtc's third_party and is built as a stand-alone
+      # library, we need to "re-root" the dependency paths.  We can
+      # modify the dependencies here to avoid modifying most, if not
+      # all, of the BUILD.gn files.
+      if (defined(deps)) {
+        modified_deps = []
+        foreach (dep, deps) {
+          newdep = string_replace(dep, "//third_party/abseil-cpp/", "//")
+          modified_deps += [ newdep ]
+        }
+        deps = []
+        deps = modified_deps
+      }
+
+      # Same for public_deps
+      if (defined(public_deps)) {
+        modified_deps = []
+        foreach (dep, public_deps) {
+          newdep = string_replace(dep, "//third_party/abseil-cpp/", "//")
+          modified_deps += [ newdep ]
+        }
+        public_deps = []
+        public_deps = modified_deps
+      }
+
+      # Same for visibility
+      if (defined(visibility)) {
+        modified_deps = []
+        foreach (dep, visibility) {
+          newdep = string_replace(dep, "//third_party/abseil-cpp/", "//")
+          modified_deps += [ newdep ]
+        }
+        visibility = []
+        visibility = modified_deps
+      }
     }
-    visibility += [ "//abseil-cpp/*" ]
   }
 }
 
@@ -110,5 +147,20 @@ template("absl_test") {
         "//third_party/googletest:gtest",
       ]
     }
+
+    # Now that abseil-cpp lives under Mozilla's third_party instead
+    # of under libwebrtc's third_party and is built as a stand-alone
+    # library, we need to "re-root" the dependency paths.  We can
+    # modify the dependencies here to avoid modifying most, if not
+    # all, of the BUILD.gn files.
+    if (defined(deps)) {
+      modified_deps = []
+      foreach (dep, deps) {
+        newdep = string_replace(dep, "//third_party/abseil-cpp/", "//")
+        modified_deps += [ newdep ]
+      }
+      deps = []
+      deps = modified_deps
+    }
   }
 }