Page MenuHomePhabricator

Build breakage with EFL-git, e.h should be included before any EFL header
Closed, ResolvedPublic

Description

Hello,

EFL_BETA_API_SUPPORT is defined in e.h, thus one must include it before any EFL header. If not, headers (Eina.h and Efl.h) which transitively should define base types for BETA_APIs won't define those base type and, due to the hearders' guards, those won't be re-evaluated when, after having including e.h, later EFL headers get pulled in.
Following patch fix building issues for me. (Note: with EFL git as of today and since a couple of days)

Index: enlightenment/src/bin/e_uuid_store.c
===================================================================
--- enlightenment.orig/src/bin/e_uuid_store.c	2015-07-01 00:46:33.000000000 +0200
+++ enlightenment/src/bin/e_uuid_store.c	2016-04-06 14:23:18.481890837 +0200
@@ -11,10 +11,10 @@
 #include <fcntl.h>
 #include <unistd.h>

-#include <Eina.h>
-
 #include <e.h>

+#include <Eina.h>
+
 /* Use anonymous mapping if we don't want a persistent file on the disk */
 #define OBJECT_NAME "/e_uuid_store"
 #define TABLE_SIZE 10*eina_cpu_page_size()
Index: enlightenment/src/modules/packagekit/e_mod_packagekit.h
===================================================================
--- enlightenment.orig/src/modules/packagekit/e_mod_packagekit.h	2015-07-01 00:46:33.000000000 +0200
+++ enlightenment/src/modules/packagekit/e_mod_packagekit.h	2016-04-06 14:23:24.642154102 +0200
@@ -1,8 +1,8 @@
 #ifndef PACKAGEKIT_H
 #define PACKAGEKIT_H

-#include <Eldbus.h>
 #include <e.h>
+#include <Eldbus.h>


 #define PKITV07 (ctxt->v_maj == 0) && (ctxt->v_min == 7)
Index: enlightenment/src/modules/temperature/tempget.c
===================================================================
--- enlightenment.orig/src/modules/temperature/tempget.c	2015-07-01 00:46:33.000000000 +0200
+++ enlightenment/src/modules/temperature/tempget.c	2016-04-06 14:23:05.469334766 +0200
@@ -17,10 +17,10 @@
 #include <err.h>
 #endif

+#include "e_mod_main.h"
 #include <Eina.h>
 #include <Ecore.h>
 #include <Ecore_File.h>
-#include "e_mod_main.h"

 static int sensor_type = SENSOR_TYPE_NONE;
 static char *sensor_name = NULL;

Fixes

libtool: link: gcc -g -Og -ggdb3 -pie -Wl,-z -Wl,relro -o src/modules/cpufreq/freqset src/modules/cpufreq/src_modules_cpufreq_freqset-freqset.o  -lpam
gcc -DHAVE_CONFIG_H -I.  -I. -I. -I./src/bin -I./src/bin/efx -I./src/bin -I./src/modules -DUSE_E_CONFIG_H -D_REENTRANT -pthread -I/usr/include/elementary-1 -I/usr/include/efl-1 -I/u
sr/include/ecore-wl2-1 -I/usr/include/efl-1 -I/usr/include/ecore-fb-1 -I/usr/include/elocation-1 -I/usr/include/efl-1 -I/usr/include/efreet-1 -I/usr/include/efl-1 -I/usr/include/efr
eet-1 -I/usr/include/efl-1 -I/usr/include/ethumb-client-1 -I/usr/include/efl-1 -I/usr/include/ethumb-1 -I/usr/include/efl-1 -I/usr/include/edje-1 -I/usr/include/efl-1 -I/usr/include
/ecore-audio-1 -I/usr/include/efl-1 -I/usr/include/ephysics-1 -I/usr/include/bullet -I/usr/include/efl-1 -I/usr/include/efreet-1 -I/usr/include/efl-1 -I/usr/include/ecore-ipc-1 -I/u
sr/include/efl-1 -I/usr/include/embryo-1 -I/usr/include/efl-1 -I/usr/include/ecore-imf-evas-1 -I/usr/include/efl-1 -I/usr/include/ecore-imf-1 -I/usr/include/efl-1 -I/usr/include/eco
re-evas-1 -I/usr/include/efl-1 -I/usr/include/ecore-drm-1 -I/usr/include/libdrm -I/usr/include/efl-1 -I/usr/include/eldbus-1 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus
-1.0/include -I/usr/include/efl-1 -I/usr/include/ecore-input-evas-1 -I/usr/include/efl-1 -I/usr/include/emotion-1 -I/usr/include/efl-1 -I/usr/include/eio-1 -I/usr/include/efl-1 -I/u
sr/include/evas-1 -I/usr/include/evas-1/canvas -I/usr/include/libpng12 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/luajit-2.0 -I/usr/inclu
de/efl-1 -I/usr/include/eeze-1 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/efl-1 -I/usr/include/ecore-file-1 -I/usr/include/efl-1 -I/usr/include/
ecore-con-1 -I/usr/include/efl-1 -I/usr/include/eet-1 -I/usr/include/efl-1 -I/usr/include/emile-1 -I/usr/include/efl-1 -I/usr/include/ecore-x-1 -I/usr/include/efl-1 -I/usr/include/e
core-input-1 -I/usr/include/efl-1 -I/usr/include/ecore-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/efl-1 -I/usr/include/eo-1 -I/usr/include
/efl-1 -I/usr/include/eina-1 -I/usr/include/eina-1/eina -pthread -I/usr/include/efl-1 -I/usr/include/ecore-wl2-1 -I/usr/include/efl-1 -I/usr/include/ecore-input-1 -I/usr/include/efl
-1 -I/usr/include/ecore-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/efl-1 -I/usr/include/eo-1 -I/usr/include/efl-1 -I/usr/include/eina-1 -I
/usr/include/eina-1/eina -I/usr/include/uuid -DE_BINDIR=\"/usr/bin\" -Wdate-time -D_FORTIFY_SOURCE=2  -g -Og -ggdb3 -c -o src/modules/temperature/src_modules_temperature_tempget-tem
pget.o `test -f 'src/modules/temperature/tempget.c' || echo './'`src/modules/temperature/tempget.c
In file included from /usr/include/eldbus-1/Eldbus.h:230:0,
                 from ./src/bin/e.h:128,
                 from src/modules/temperature/e_mod_main.h:4,
                 from src/modules/temperature/tempget.c:23:
/usr/include/eldbus-1/eldbus_model_method.eo.h:47:7: error: unknown type name 'Efl_Model_Load_Status'
 EOAPI Efl_Model_Load_Status eldbus_model_method_call(Eo *obj);
       ^
Makefile:14600: recipe for target 'src/modules/temperature/src_modules_temperature_tempget-tempget.o' failed
make[2]: *** [src/modules/temperature/src_modules_temperature_tempget-tempget.o] Error 1

and

gcc -DHAVE_CONFIG_H -I.  -I. -I./src/bin -I. -I./src/bin -I./src/bin/efx -I./src/bin/generated -DUSE_E_CONFIG_H -D_REENTRANT -pthread -I/usr/include/elementary-1 -I/usr/include/efl-
1 -I/usr/include/ecore-wl2-1 -I/usr/include/efl-1 -I/usr/include/ecore-fb-1 -I/usr/include/elocation-1 -I/usr/include/efl-1 -I/usr/include/efreet-1 -I/usr/include/efl-1 -I/usr/inclu
de/efreet-1 -I/usr/include/efl-1 -I/usr/include/ethumb-client-1 -I/usr/include/efl-1 -I/usr/include/ethumb-1 -I/usr/include/efl-1 -I/usr/include/edje-1 -I/usr/include/efl-1 -I/usr/i
nclude/ecore-audio-1 -I/usr/include/efl-1 -I/usr/include/ephysics-1 -I/usr/include/bullet -I/usr/include/efl-1 -I/usr/include/efreet-1 -I/usr/include/efl-1 -I/usr/include/ecore-ipc-
1 -I/usr/include/efl-1 -I/usr/include/embryo-1 -I/usr/include/efl-1 -I/usr/include/ecore-imf-evas-1 -I/usr/include/efl-1 -I/usr/include/ecore-imf-1 -I/usr/include/efl-1 -I/usr/inclu
de/ecore-evas-1 -I/usr/include/efl-1 -I/usr/include/ecore-drm-1 -I/usr/include/libdrm -I/usr/include/efl-1 -I/usr/include/eldbus-1 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gn
u/dbus-1.0/include -I/usr/include/efl-1 -I/usr/include/ecore-input-evas-1 -I/usr/include/efl-1 -I/usr/include/emotion-1 -I/usr/include/efl-1 -I/usr/include/eio-1 -I/usr/include/efl-
1 -I/usr/include/evas-1 -I/usr/include/evas-1/canvas -I/usr/include/libpng12 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/luajit-2.0 -I/usr
/include/efl-1 -I/usr/include/eeze-1 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/efl-1 -I/usr/include/ecore-file-1 -I/usr/include/efl-1 -I/usr/in
clude/ecore-con-1 -I/usr/include/efl-1 -I/usr/include/eet-1 -I/usr/include/efl-1 -I/usr/include/emile-1 -I/usr/include/efl-1 -I/usr/include/ecore-x-1 -I/usr/include/efl-1 -I/usr/inc
lude/ecore-input-1 -I/usr/include/efl-1 -I/usr/include/ecore-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/efl-1 -I/usr/include/eo-1 -I/usr/i
nclude/efl-1 -I/usr/include/eina-1 -I/usr/include/eina-1/eina -DLOWRES_PDA=1 -DMEDIUMRES_PDA=2 -DHIRES_PDA=3 -DSLOW_PC=4 -DMEDIUM_PC=5 -DFAST_PC=6 -DE_PROFILE=SLOW_PC -pthread -I/us
r/include/efl-1 -I/usr/include/ecore-wl2-1 -I/usr/include/efl-1 -I/usr/include/ecore-input-1 -I/usr/include/efl-1 -I/usr/include/ecore-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-li
nux-gnu/glib-2.0/include -I/usr/include/efl-1 -I/usr/include/eo-1 -I/usr/include/efl-1 -I/usr/include/eina-1 -I/usr/include/eina-1/eina -I/usr/include/uuid -I/usr/include/libdrm -DE
_BINDIR=\"/usr/bin\" -DPACKAGE_BIN_DIR=\"/usr/bin\" -DPACKAGE_LIB_DIR=\"/usr/lib/x86_64-linux-gnu\" -DPACKAGE_DATA_DIR=\"/usr/share/enlightenment\" -DLOCALE_DIR=\"/usr/share/locale\
" -DPACKAGE_SYSCONF_DIR=\"/etc\" -DE_LOGGING=1 -pthread -I/usr/include/efl-1 -I/usr/include/ecore-wl2-1 -I/usr/include/efl-1 -I/usr/include/ecore-input-1 -I/usr/include/efl-1 -I/usr
/include/ecore-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/efl-1 -I/usr/include/eo-1 -I/usr/include/efl-1 -I/usr/include/eina-1 -I/usr/incl
ude/eina-1/eina -I/usr/include/uuid -I/usr/include/libdrm -pthread -I/usr/include/efl-1 -I/usr/include/ecore-x-1 -I/usr/include/efl-1 -I/usr/include/ecore-input-1 -I/usr/include/efl
-1 -I/usr/include/ecore-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/efl-1 -I/usr/include/eo-1 -I/usr/include/efl-1 -I/usr/include/eina-1 -I
/usr/include/eina-1/eina -Wdate-time -D_FORTIFY_SOURCE=2  -g -Og -ggdb3 -c -o src/bin/src_bin_enlightenment-e_uuid_store.o `test -f 'src/bin/e_uuid_store.c' || echo './'`src/bin/e_u
uid_store.c
In file included from /usr/include/ecore-1/Ecore.h:354:0,
                 from ./src/bin/e.h:117,
                 from src/bin/e_uuid_store.c:16:
/usr/include/ecore-1/Ecore_Common.h:3099:58: error: unknown type name 'Eina_Promise_Owner'
 typedef void(*Ecore_Thread_Promise_Cb)(const void* data, Eina_Promise_Owner* promise, Ecore_Thread* thread);
                                                          ^
/usr/include/ecore-1/Ecore_Common.h:3105:45: error: unknown type name 'Ecore_Thread_Promise_Cb'
 EAPI Ecore_Thread* ecore_thread_promise_run(Ecore_Thread_Promise_Cb func_heavy,
                                             ^
/usr/include/ecore-1/Ecore_Common.h:3106:45: error: unknown type name 'Ecore_Thread_Promise_Cb'
                                             Ecore_Thread_Promise_Cb func_cancel,
                                             ^
/usr/include/ecore-1/Ecore_Common.h:3108:45: error: unknown type name 'Eina_Promise'
                                             Eina_Promise** promise);
                                             ^
Makefile:14152: recipe for target 'src/bin/src_bin_enlightenment-e_uuid_store.o' failed
make[2]: *** [src/bin/src_bin_enlightenment-e_uuid_store.o] Error 1

and

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -I. -I./src/bin -I./src/bin/efx -I./src/bin -I./src/modules -DUSE_E_CONFIG_H -D_REENTRANT -pthread -I/usr/include/elementary-1 -I/usr/
include/efl-1 -I/usr/include/ecore-wl2-1 -I/usr/include/efl-1 -I/usr/include/ecore-fb-1 -I/usr/include/elocation-1 -I/usr/include/efl-1 -I/usr/include/efreet-1 -I/usr/include/efl-1
-I/usr/include/efreet-1 -I/usr/include/efl-1 -I/usr/include/ethumb-client-1 -I/usr/include/efl-1 -I/usr/include/ethumb-1 -I/usr/include/efl-1 -I/usr/include/edje-1 -I/usr/include/ef
l-1 -I/usr/include/ecore-audio-1 -I/usr/include/efl-1 -I/usr/include/ephysics-1 -I/usr/include/bullet -I/usr/include/efl-1 -I/usr/include/efreet-1 -I/usr/include/efl-1 -I/usr/includ
e/ecore-ipc-1 -I/usr/include/efl-1 -I/usr/include/embryo-1 -I/usr/include/efl-1 -I/usr/include/ecore-imf-evas-1 -I/usr/include/efl-1 -I/usr/include/ecore-imf-1 -I/usr/include/efl-1
-I/usr/include/ecore-evas-1 -I/usr/include/efl-1 -I/usr/include/ecore-drm-1 -I/usr/include/libdrm -I/usr/include/efl-1 -I/usr/include/eldbus-1 -I/usr/include/dbus-1.0 -I/usr/lib/x86
_64-linux-gnu/dbus-1.0/include -I/usr/include/efl-1 -I/usr/include/ecore-input-evas-1 -I/usr/include/efl-1 -I/usr/include/emotion-1 -I/usr/include/efl-1 -I/usr/include/eio-1 -I/usr/
include/efl-1 -I/usr/include/evas-1 -I/usr/include/evas-1/canvas -I/usr/include/libpng12 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/luaji
t-2.0 -I/usr/include/efl-1 -I/usr/include/eeze-1 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/efl-1 -I/usr/include/ecore-file-1 -I/usr/include/efl
-1 -I/usr/include/ecore-con-1 -I/usr/include/efl-1 -I/usr/include/eet-1 -I/usr/include/efl-1 -I/usr/include/emile-1 -I/usr/include/efl-1 -I/usr/include/ecore-x-1 -I/usr/include/efl-
1 -I/usr/include/ecore-input-1 -I/usr/include/efl-1 -I/usr/include/ecore-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/efl-1 -I/usr/include/e
o-1 -I/usr/include/efl-1 -I/usr/include/eina-1 -I/usr/include/eina-1/eina -pthread -I/usr/include/efl-1 -I/usr/include/ecore-wl2-1 -I/usr/include/efl-1 -I/usr/include/ecore-input-1
-I/usr/include/efl-1 -I/usr/include/ecore-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/efl-1 -I/usr/include/eo-1 -I/usr/include/efl-1 -I/usr
/include/eina-1 -I/usr/include/eina-1/eina -I/usr/include/uuid -DE_BINDIR=\"/usr/bin\" -Wdate-time -D_FORTIFY_SOURCE=2 -g -Og -ggdb3 -c src/modules/packagekit/e_mod_config.c  -fPIC
-DPIC -o src/modules/packagekit/.libs/src_modules_packagekit_module_la-e_mod_config.o
In file included from /usr/include/ecore-1/Ecore.h:354:0,
                 from ./src/bin/e.h:117,
                 from src/modules/packagekit/e_mod_packagekit.h:5,
                 from src/modules/packagekit/e_mod_config.h:4,
                 from src/modules/packagekit/e_mod_config.c:1:
/usr/include/ecore-1/Ecore_Common.h:3099:58: error: unknown type name 'Eina_Promise_Owner'
 typedef void(*Ecore_Thread_Promise_Cb)(const void* data, Eina_Promise_Owner* promise, Ecore_Thread* thread);
                                                          ^
/usr/include/ecore-1/Ecore_Common.h:3105:45: error: unknown type name 'Ecore_Thread_Promise_Cb'
 EAPI Ecore_Thread* ecore_thread_promise_run(Ecore_Thread_Promise_Cb func_heavy,
                                             ^
/usr/include/ecore-1/Ecore_Common.h:3106:45: error: unknown type name 'Ecore_Thread_Promise_Cb'
                                             Ecore_Thread_Promise_Cb func_cancel,
                                             ^
/usr/include/ecore-1/Ecore_Common.h:3108:45: error: unknown type name 'Eina_Promise'
                                             Eina_Promise** promise);
                                             ^
Makefile:11009: recipe for target 'src/modules/packagekit/src_modules_packagekit_module_la-e_mod_config.lo' failed
make[2]: *** [src/modules/packagekit/src_modules_packagekit_module_la-e_mod_config.lo] Error 1
aerodynamik renamed this task from Build breakage, e.h should be included before any EFL header to Build breakage with EFL-git, e.h should be included before any EFL header.Apr 6 2016, 5:46 AM
aerodynamik updated the task description. (Show Details)
zmike added a comment.Apr 6 2016, 7:36 AM

Need you to either submit through arcanist or attach as a raw patch with authorship/attribution info.

I'm not willing to have attribution :-) Sorry I'll mention it right away the next time.