[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: Thu, 29 Nov 2018 09:59:39 +0000 (UTC)
commit 1dd36d846a1c78d4527a7d58793bfba419a825b2
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 removes the
workaround for b.g.o #731322 since that was fixed in 0.40, and updates
workaround for the internal VAPI to be minimally intrusive.
src/engine/meson.build | 61 ++++++++++++++++++++++----------------------------
1 file changed, 27 insertions(+), 34 deletions(-)
---
diff --git a/src/engine/meson.build b/src/engine/meson.build
index 222a0edc..a0762bcd 100644
--- a/src/engine/meson.build
+++ b/src/engine/meson.build
@@ -337,69 +337,62 @@ geary_engine_dependencies = [
sqlite
]
+build_dir = meson.current_build_dir()
+
+# Generate internal VAPI for unit testing. See Meson issue
+# https://github.com/mesonbuild/meson/issues/1781 for official
+# internal VAPI support.
geary_engine_vala_options = geary_vala_options
geary_engine_vala_options += [
- # Nasty hack to make sure engine internal VAPI is generated. See
- # Meson issue https://github.com/mesonbuild/meson/issues/1781 for
- # official internal VAPI support. See Vala Bug 731322 about the
- # specifics of the arguments used below to generate the internal
- # VAPI. In particular, the header filenames must not contain any
- # paths or else the internal vapi will use the public header, not
- # the internal header. Of course these paths breaks the build, so we
- # fix it up using cp below. The internal VAPI is correctly put in
- # Meson's base working directory,
- '--header=geary-engine.h',
- '--internal-vapi=../geary-engine-internal.vapi',
- '--internal-header=geary-engine-internal.h'
+ '--internal-header=@0@/geary-engine-internal.h'.format(build_dir),
+ '--internal-vapi=@0@/geary-engine-internal.vapi'.format(build_dir)
]
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,
- ],
- include_directories: include_directories('.'),
-)
-
-# 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 tell Meson about the internal VAPI given the
+# workaround above, and fix the VAPI header to work around
+# GNOME/vala#358
+geary_engine_internal_header_fixup = custom_target(
+ 'geary_engine_internal_header_fixup',
+ source: geary_engine_sources,
output: [
'geary-engine-internal.h',
'geary-engine-internal.vapi',
],
command: [
- find_program('cp'),
- 'geary-engine.h',
- 'geary-engine-internal.h',
- '@OUTDIR@',
+ find_program('sed'),
+ '-i',
+ 's/geary-engine.h/geary-engine-internal.h/g',
+ '@OUTDIR@/geary-engine-internal.vapi',
],
depends: geary_engine_lib
)
+geary_engine_dep = declare_dependency(
+ link_with: [
+ geary_engine_lib,
+ sqlite3_unicodesn_lib
+ ],
+ include_directories: include_directories('.')
+)
+
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.
link_args: [
- '-L' + meson.build_root() + '/src/engine',
+ '-L' + build_dir,
'-lgeary-engine'
],
link_with: [
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]