diff options
author | Ross Burton <ross@burtonini.com> | 2020-09-08 14:57:17 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-08 16:43:40 +0100 |
commit | 1a99396ed5aaa4e7c5365beac4b9b857ec926ce5 (patch) | |
tree | ef5b8eb546e0d5403cb620efd93293b4d4f5bfa8 /meta/recipes-graphics/harfbuzz | |
parent | fc1d63c017387121b36e8a12c45a04752ca6ab10 (diff) | |
download | poky-1a99396ed5aaa4e7c5365beac4b9b857ec926ce5.tar.gz |
harfbuzz: fix a build race around hb-version.h
(From OE-Core rev: e7cbfd0573b77d7debab3fbf4b05565ac8b33f3a)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/harfbuzz')
-rw-r--r-- | meta/recipes-graphics/harfbuzz/harfbuzz/version-race.patch | 121 | ||||
-rw-r--r-- | meta/recipes-graphics/harfbuzz/harfbuzz_2.7.2.bb | 1 |
2 files changed, 122 insertions, 0 deletions
diff --git a/meta/recipes-graphics/harfbuzz/harfbuzz/version-race.patch b/meta/recipes-graphics/harfbuzz/harfbuzz/version-race.patch new file mode 100644 index 0000000000..2d692f36b5 --- /dev/null +++ b/meta/recipes-graphics/harfbuzz/harfbuzz/version-race.patch | |||
@@ -0,0 +1,121 @@ | |||
1 | Upstream-Status: Backport [https://github.com/harfbuzz/harfbuzz/commit/5aff83104e03d6d2617987d24a51e490ab7a5cd1] | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From bc1c93fbe04459a4b12c76c713ba1b750d2d9108 Mon Sep 17 00:00:00 2001 | ||
5 | From: Ross Burton <ross.burton@arm.com> | ||
6 | Date: Mon, 7 Sep 2020 17:11:17 +0100 | ||
7 | Subject: [PATCH 1/2] [build] No need to pass source directory to | ||
8 | gen-hb-version | ||
9 | |||
10 | The input file is by definition in the source directory, so dirname() | ||
11 | that instead of needing the directory to be passed. | ||
12 | |||
13 | Needed because a follow-up commit will change when this is called, and the | ||
14 | source directory isn't trivially available at that point. | ||
15 | --- | ||
16 | src/gen-hb-version.py | 6 +++--- | ||
17 | src/meson.build | 2 +- | ||
18 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
19 | |||
20 | diff --git a/src/gen-hb-version.py b/src/gen-hb-version.py | ||
21 | index 15e56b93..bf16f88a 100755 | ||
22 | --- a/src/gen-hb-version.py | ||
23 | +++ b/src/gen-hb-version.py | ||
24 | @@ -4,15 +4,15 @@ | ||
25 | |||
26 | import os, sys, shutil | ||
27 | |||
28 | -if len (sys.argv) < 5: | ||
29 | +if len (sys.argv) < 4: | ||
30 | sys.exit(__doc__) | ||
31 | |||
32 | version = sys.argv[1] | ||
33 | major, minor, micro = version.split (".") | ||
34 | |||
35 | OUTPUT = sys.argv[2] | ||
36 | -CURRENT_SOURCE_DIR = sys.argv[3] | ||
37 | -INPUT = sys.argv[4] | ||
38 | +INPUT = sys.argv[3] | ||
39 | +CURRENT_SOURCE_DIR = os.path.dirname(INPUT) | ||
40 | |||
41 | with open (INPUT, "r", encoding='utf-8') as template: | ||
42 | with open (OUTPUT, "wb") as output: | ||
43 | diff --git a/src/meson.build b/src/meson.build | ||
44 | index 5d7cd578..2d78c992 100644 | ||
45 | --- a/src/meson.build | ||
46 | +++ b/src/meson.build | ||
47 | @@ -286,7 +286,7 @@ custom_target('hb-version.h', | ||
48 | input: 'hb-version.h.in', | ||
49 | output: 'hb-version.h', | ||
50 | command: [find_program('gen-hb-version.py'), meson.project_version(), | ||
51 | - '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], | ||
52 | + '@OUTPUT@', '@INPUT@'], | ||
53 | ) | ||
54 | |||
55 | ragel = find_program('ragel', required: false) | ||
56 | -- | ||
57 | 2.28.0 | ||
58 | |||
59 | |||
60 | From 5aff83104e03d6d2617987d24a51e490ab7a5cd1 Mon Sep 17 00:00:00 2001 | ||
61 | From: Ross Burton <ross.burton@arm.com> | ||
62 | Date: Mon, 7 Sep 2020 10:55:33 +0100 | ||
63 | Subject: [PATCH 2/2] [build] generate hb-version.h once at configure time with | ||
64 | Meson | ||
65 | |||
66 | Currently with Meson hb-version.h is generated during the build without | ||
67 | any explicit dependencies which can result in build failures due races | ||
68 | over the file. | ||
69 | |||
70 | Change this to be generated at configure time, so that the file is always | ||
71 | generated once before the build itself. | ||
72 | |||
73 | Closes #2667 | ||
74 | --- | ||
75 | src/meson.build | 17 ++++++++--------- | ||
76 | 1 file changed, 8 insertions(+), 9 deletions(-) | ||
77 | |||
78 | diff --git a/src/meson.build b/src/meson.build | ||
79 | index 2d78c992..19290245 100644 | ||
80 | --- a/src/meson.build | ||
81 | +++ b/src/meson.build | ||
82 | @@ -1,3 +1,10 @@ | ||
83 | +hb_version_h = configure_file( | ||
84 | + command: [find_program('gen-hb-version.py'), meson.project_version(), '@OUTPUT@', '@INPUT@'], | ||
85 | + input: 'hb-version.h.in', | ||
86 | + output: 'hb-version.h', | ||
87 | + install: true, | ||
88 | + install_dir: join_paths(get_option('includedir'), meson.project_name())) | ||
89 | + | ||
90 | # Base and default-included sources and headers | ||
91 | hb_base_sources = files( | ||
92 | 'hb-aat-layout-ankr-table.hh', | ||
93 | @@ -214,9 +221,9 @@ hb_base_headers = files( | ||
94 | 'hb-shape.h', | ||
95 | 'hb-style.h', | ||
96 | 'hb-unicode.h', | ||
97 | - 'hb-version.h', | ||
98 | 'hb.h', | ||
99 | ) | ||
100 | +hb_base_headers += hb_version_h | ||
101 | |||
102 | # Optional Sources and Headers with external deps | ||
103 | |||
104 | @@ -281,14 +288,6 @@ hb_gobject_headers = files( | ||
105 | 'hb-gobject-structs.h', | ||
106 | ) | ||
107 | |||
108 | -custom_target('hb-version.h', | ||
109 | - build_by_default: true, | ||
110 | - input: 'hb-version.h.in', | ||
111 | - output: 'hb-version.h', | ||
112 | - command: [find_program('gen-hb-version.py'), meson.project_version(), | ||
113 | - '@OUTPUT@', '@INPUT@'], | ||
114 | -) | ||
115 | - | ||
116 | ragel = find_program('ragel', required: false) | ||
117 | if not ragel.found() | ||
118 | warning('You have to install ragel if you are going to develop HarfBuzz itself') | ||
119 | -- | ||
120 | 2.28.0 | ||
121 | |||
diff --git a/meta/recipes-graphics/harfbuzz/harfbuzz_2.7.2.bb b/meta/recipes-graphics/harfbuzz/harfbuzz_2.7.2.bb index 8416eb93d8..f95273f686 100644 --- a/meta/recipes-graphics/harfbuzz/harfbuzz_2.7.2.bb +++ b/meta/recipes-graphics/harfbuzz/harfbuzz_2.7.2.bb | |||
@@ -13,6 +13,7 @@ UPSTREAM_CHECK_REGEX = "harfbuzz-(?P<pver>\d+(\.\d+)+).tar" | |||
13 | SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.xz \ | 13 | SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.xz \ |
14 | file://0001-Do-not-disable-introspection-in-cross-builds.patch \ | 14 | file://0001-Do-not-disable-introspection-in-cross-builds.patch \ |
15 | file://0001-src-hb-gobject-enums.cc.tmpl-write-out-only-the-file.patch \ | 15 | file://0001-src-hb-gobject-enums.cc.tmpl-write-out-only-the-file.patch \ |
16 | file://version-race.patch \ | ||
16 | " | 17 | " |
17 | SRC_URI[sha256sum] = "b8c048d7c2964a12f2c80deb6634dfc836b603dd12bf0d0a3df1627698e220ce" | 18 | SRC_URI[sha256sum] = "b8c048d7c2964a12f2c80deb6634dfc836b603dd12bf0d0a3df1627698e220ce" |
18 | 19 | ||