Skip to contentSkip to conversation

chromium: don't pass is_official_build=true when doing a component-build

PATCH In review Rasmus Villemoes 3 participants 4 messages Aug 9, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 chromium: don't pass is_official_build=true when doing a component-build

When setting the PACKAGECONFIG component-build, the build breaks immediately due to this from the toplevel BUILD.gn:

if (is_official_build) {
# An official (maximally optimized!) component (optimized for build times)

  # build doesn't make sense and usually doesn't work.
  assert(!is_component_build)
}

So we must make is_official_build the negative of component-build.

---
 recipes-browser/chromium/chromium-gn.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-browser/chromium/chromium-gn.inc +2 -1
index d5258c0..d9735ab 100644
@@ -138,7 +138,8 @@ GN_ARGS += 'host_pkg_config="pkg-config-native"'
 # (debug, release, official) but for historical reasons there are two
 # separate flags.
 # See also: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/hkcb6AOX5gE/PPT1ukWoBwAJ
-GN_ARGS += "is_debug=false is_official_build=true"
+GN_ARGS += "is_debug=false"
+GN_ARGS += "is_official_build=${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'false', 'true', d)}"
 
 # Starting with M61, Chromium defaults to building with its own copy of libc++
 # instead of the system's libstdc++. Explicitly disable this behavior.
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 chromium: add patch to fix build of native tool make_top_domain_list_for_edit_distance

Inside the source_set("net_deps"), one finds

  if (!is_nacl) {
    public_deps += [
      "//base/third_party/dynamic_annotations",
      "//third_party/zlib",
    ]

and the recipe explicitly sets enable_nacl=false. So one should think that this was already ok, but without it, the build fails. I don't really understand the gn config language, but perhaps the above has no effect because the :net_deps is only pulled into deps.

---
 recipes-browser/chromium/chromium-gn.inc      |  1 +
 ...-third_party-zlib-to-public-dependen.patch | 29 +++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 recipes-browser/chromium/files/net-BUILD.gn-add-third_party-zlib-to-public-dependen.patch
recipes-browser/chromium/chromium-gn.inc +1 -0
index d9735ab..2c8cd20 100644
@@ -14,6 +14,7 @@ SRC_URI += " \
         file://wrapper-extra-flags.patch \
         file://do-not-specify-march-on-arm.patch \
         file://add_internal_define_armv7ve.patch \
+        file://net-BUILD.gn-add-third_party-zlib-to-public-dependen.patch \
 "
 
 SRC_URI_append_libc-musl = "\
recipes-browser/chromium/files/net-BUILD.gn-add-third_party-zlib-to-public-dependen.patch new file +29 -0
new file mode 100644
index 0000000..bffd65d
@@ -0,0 +1,29 @@
+From 141ffd4e77d1142461cca86065695433acd0914a Mon Sep 17 00:00:00 2001
+From: Rasmus Villemoes <[email protected]>
+Date: Wed, 7 Aug 2019 13:02:36 +0200
+Subject: [PATCH] net/BUILD.gn: add third_party/zlib to public dependencies
+
+Without this, the build of yocto_native/make_top_domain_list_for_edit_distance fails
+(libchrome_zlib.so, needed by yocto_native/libnet.so, not found).
+
+Upstream-Status: pending
+
+---
+ net/BUILD.gn | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/net/BUILD.gn b/net/BUILD.gn
+index b3d97f6a0a67..d4f1800c74d4 100644
+--- a/net/BUILD.gn
++++ b/net/BUILD.gn
+@@ -2337,6 +2337,7 @@ source_set("net_public_deps") {
+     "//crypto:platform",
+     "//net/traffic_annotation",
+     "//third_party/boringssl",
++    "//third_party/zlib",
+     "//url",
+   ]
+ 
+-- 
+2.20.1
+
Signature · 1 line
2.20.1
#2 lore raw
In reply to Rasmus Villemoes
Quoted 22 lines · Rasmus Villemoes

When setting the PACKAGECONFIG component-build, the build breaks immediately due to this from the toplevel BUILD.gn:

if (is_official_build) {
# An official (maximally optimized!) component (optimized for build times)

  # build doesn't make sense and usually doesn't work.
  assert(!is_component_build)
}

So we must make is_official_build the negative of component-build.

---
 recipes-browser/chromium/chromium-gn.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-browser/chromium/chromium-gn.inc +0 -0
index d5258c0..d9735ab 100644

recipes-browser/chromium/chromium-gn.inc GN_ARGS += 'host_pkg_config="pkg-config-native"' · line 143

Quoted 7 lines
recipes-browser/chromium/chromium-gn.inc +2 -1
@@ -138,7 +138,8 @@ GN_ARGS += 'host_pkg_config="pkg-config-native"'
 # (debug, release, official) but for historical reasons there are two
 # separate flags.
 # See also: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/hkcb6AOX5gE/PPT1ukWoBwAJ
-GN_ARGS += "is_debug=false is_official_build=true"
+GN_ARGS += "is_debug=false"
+GN_ARGS += "is_official_build=${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'false', 'true', d)}"
 

this looks good.

Quoted 5 lines
recipes-browser/chromium/chromium-gn.inc +0 -1
 # Starting with M61, Chromium defaults to building with its own copy of libc++
 # instead of the system's libstdc++. Explicitly disable this behavior.
--

2.20.1

#3 lore raw
In reply to Rasmus Villemoes
Quoted 6 lines · Rasmus Villemoes

When setting the PACKAGECONFIG component-build, the build breaks immediately due to this from the toplevel BUILD.gn:

if (is_official_build) {
# An official (maximally optimized!) component (optimized for build times)

Quoted 7 lines
  # build doesn't make sense and usually doesn't work.
  assert(!is_component_build)
}

So we must make is_official_build the negative of component-build.

Good, please open a PR on GitHub so we can merge it :-)

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750