[geary/wip/engine-header-missing-build-failure] Fix occasional "geary-engine.h: No such file or directory" build errors
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/engine-header-missing-build-failure] Fix occasional "geary-engine.h: No such file or directory" build errors
- Date: Wed, 28 Nov 2018 23:03:54 +0000 (UTC)
commit e6b84d061295f76c7aff3c9aaaa821c62f20a00a
Author: Michael Gratton <mike vee net>
Date: Thu Nov 29 09:56:25 2018 +1100
Fix occasional "geary-engine.h: No such file or directory" build errors
E.g. https://gitlab.gnome.org/GNOME/geary/-/jobs/156541
On a sufficiently (non?) parallel system, targets that depend on
geary-engine.h may get built before the geary_engine_internal_vapi
custom target that fixes its location is executed. This splits that
target in two (one for the publuc header fixup, one for the internal
header/vapi) and ensures that the engine dep depends on the former.
src/engine/meson.build | 43 ++++++++++++++++++++++++++++---------------
1 file changed, 28 insertions(+), 15 deletions(-)
---
diff --git a/src/engine/meson.build b/src/engine/meson.build
index 222a0edc..5810a9ae 100644
--- a/src/engine/meson.build
+++ b/src/engine/meson.build
@@ -356,38 +356,53 @@ geary_engine_vala_options += [
geary_engine_lib = static_library('geary-engine',
geary_engine_sources,
dependencies: geary_engine_dependencies,
- link_with: sqlite3_unicodesn_lib,
include_directories: config_h_dir,
vala_args: geary_engine_vala_options,
c_args: geary_c_options,
)
-geary_engine_dep = declare_dependency(
- link_with: [
- geary_engine_lib,
- sqlite3_unicodesn_lib,
+# Dummy target to fix the location of the public headers given the
+# hack above. Use capture to generate a dummy output instead of
+# specifying geary-engine.h as an output since geary_engine_lib
+# already declares that it generates that.
+geary_engine_header_fixup = custom_target(
+ 'geary_engine_header_fixup',
+ output: ['geary-engine-header-fixup'],
+ capture: true,
+ command: [
+ find_program('cp'),
+ '-v',
+ 'geary-engine.h',
+ '@OUTDIR@',
],
- include_directories: include_directories('.'),
+ depends: geary_engine_lib
)
-# Dummy target to fix the location of the public and internal headers,
-# and tell Meson about the internal VAPI
-geary_engine_internal_vapi = custom_target(
- 'geary-engine-internal-vapi',
- input: geary_engine_sources,
+# Dummy target to fix the location of the internal headers and tell
+# Meson about the internal VAPI, given the hack above.
+geary_engine_internal_header_fixup = custom_target(
+ 'geary_engine_internal_header_fixup',
output: [
'geary-engine-internal.h',
'geary-engine-internal.vapi',
],
command: [
find_program('cp'),
- 'geary-engine.h',
'geary-engine-internal.h',
'@OUTDIR@',
],
depends: geary_engine_lib
)
+geary_engine_dep = declare_dependency(
+ link_with: [
+ geary_engine_lib,
+ sqlite3_unicodesn_lib
+ ],
+ include_directories: include_directories('.'),
+ sources: geary_engine_header_fixup
+)
+
geary_engine_internal_dep = declare_dependency(
# Can't just include geary_engine_lib in link_with since that will
# pull in the public header and we get duplicate symbol errors.
@@ -399,7 +414,5 @@ geary_engine_internal_dep = declare_dependency(
sqlite3_unicodesn_lib,
],
include_directories: include_directories('.'),
- sources: [
- geary_engine_internal_vapi
- ],
+ sources: geary_engine_internal_header_fixup
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]