Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-2801

Use of __FILE__ macro prevents reproducible builds in appfw components

XMLWordPrintable

      dl9pf@elrond:~/AGL/ALL/src> grep -rn __FILE__ app-framework-* | grep ".[h,c]:" 
      app-framework-binder/include/afb/afb-req-x1.h:377: * (see macros __FILE__, __LINE__ and __func__).
      app-framework-binder/include/afb/afb-req-x2.h:574: * (see macros __FILE__, __LINE__ and __func__).
      app-framework-binder/include/afb/afb-req-x2.h:614: * (see macros __FILE__, __LINE__ and __func__).
      app-framework-binder/include/afb/afb-dynapi-legacy.h:119:#define AFB_REQUEST_VERBOSE(req,level,...) afb_req_x2_verbose(req,level,__FILE__,__LINE__,__func__,__VA_ARGS__)
      app-framework-binder/include/afb/afb-dynapi-legacy.h:130:                               afb_dynapi_verbose(dynapi,llevel,__FILE__,__LINE__,__func__,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-dynapi-legacy.h:132:                               afb_dynapi_verbose(dynapi,llevel,__FILE__,__LINE__,NULL,NULL); \
      app-framework-binder/include/afb/afb-dynapi-legacy.h:138:                       afb_request_verbose(request,llevel,__FILE__,__LINE__,NULL,NULL); \
      app-framework-binder/include/afb/afb-dynapi-legacy.h:159:                       afb_dynapi_verbose(dynapi,llevel,__FILE__,__LINE__,__func__,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-dynapi-legacy.h:164:                       afb_request_verbose(request,llevel,__FILE__,__LINE__,__func__,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-binding-v1.h:176:                  afb_daemon_verbose2_v1(itf->daemon,level,__FILE__,__LINE__,NULL,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-binding-v1.h:177:          else afb_daemon_verbose2_v1(itf->daemon,level,__FILE__,__LINE__,NULL); } while(0)
      app-framework-binder/include/afb/afb-binding-v1.h:181:                  afb_req_x1_verbose(req,level,__FILE__,__LINE__,NULL,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-binding-v1.h:182:          else afb_req_x1_verbose(req,level,__FILE__,__LINE__,NULL); } while(0)
      app-framework-binder/include/afb/afb-binding-v1.h:195:                afb_daemon_verbose2_v1(itf->daemon,level,__FILE__,__LINE__,__func__,__VA_ARGS__)
      app-framework-binder/include/afb/afb-binding-v1.h:198:                afb_req_x1_verbose(req,level,__FILE__,__LINE__,__func__,__VA_ARGS__)
      app-framework-binder/include/afb/afb-daemon-v2.h:95: * (see macros __FILE__, __LINE__ and __func__).
      app-framework-binder/include/afb/afb-binding-v3.h:195:                  afb_api_x3_verbose(api,level,__FILE__,__LINE__,NULL,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-binding-v3.h:196:          else afb_api_x3_verbose(api,level,__FILE__,__LINE__,NULL); } while(0)
      app-framework-binder/include/afb/afb-binding-v3.h:200:                  afb_req_x2_verbose(req,level,__FILE__,__LINE__,NULL,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-binding-v3.h:201:          else afb_req_x2_verbose(req,level,__FILE__,__LINE__,NULL); } while(0)
      app-framework-binder/include/afb/afb-binding-v3.h:214:  afb_api_x3_verbose(api,level,__FILE__,__LINE__,__func__,__VA_ARGS__)
      app-framework-binder/include/afb/afb-binding-v3.h:217:  afb_req_x2_verbose(req,level,__FILE__,__LINE__,__func__,__VA_ARGS__)
      app-framework-binder/include/afb/afb-daemon-v1.h:100: * (see macros __FILE__ and __LINE__).
      app-framework-binder/include/afb/afb-daemon-v1.h:130: * (see macros __FILE__, __LINE__ and __func__).
      app-framework-binder/include/afb/afb-binding-v2.h:117:                  afb_daemon_verbose_v2(level,__FILE__,__LINE__,NULL,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-binding-v2.h:118:          else afb_daemon_verbose_v2(level,__FILE__,__LINE__,NULL); } while(0)
      app-framework-binder/include/afb/afb-binding-v2.h:122:                  afb_req_x1_verbose(req,level,__FILE__,__LINE__,NULL,__VA_ARGS__); \
      app-framework-binder/include/afb/afb-binding-v2.h:123:          else afb_req_x1_verbose(req,level,__FILE__,__LINE__,NULL); } while(0)
      app-framework-binder/include/afb/afb-binding-v2.h:136:          afb_daemon_verbose_v2(level,__FILE__,__LINE__,__func__,__VA_ARGS__)
      app-framework-binder/include/afb/afb-binding-v2.h:139:          afb_req_x1_verbose(req,level,__FILE__,__LINE__,__func__,__VA_ARGS__)
      app-framework-binder/include/afb/afb-api-x3.h:106: * (see macros __FILE__, __LINE__ and __func__).
      app-framework-binder/include/afb/afb-api-x3.h:148: * (see macros __FILE__, __LINE__ and __func__).
      app-framework-binder/src/verbose.h:79:# define __VERBOSE__(lvl,...)      do{if((lvl)<=Log_Level_Error) verbose(lvl, __FILE__, __LINE__, NULL, __VA_ARGS__)\
      app-framework-binder/src/verbose.h:80:                                  else verbose(lvl, __FILE__, __LINE__, NULL, NULL);}while(0)
      app-framework-binder/src/verbose.h:84:# define __VERBOSE__(lvl,...)      verbose(lvl, __FILE__, __LINE__, __func__, __VA_ARGS__)
      app-framework-main/src/verbose.h:29:# define ERROR(...)   do{if(verbosity>=0)verbose(3,__FILE__,__LINE__,__VA_ARGS__);}while(0)
      app-framework-main/src/verbose.h:30:# define WARNING(...) do{if(verbosity>=1)verbose(4,__FILE__,__LINE__,__VA_ARGS__);}while(0)
      app-framework-main/src/verbose.h:31:# define NOTICE(...)  do{if(verbosity>=1)verbose(5,__FILE__,__LINE__,__VA_ARGS__);}while(0)
      app-framework-main/src/verbose.h:32:# define INFO(...)    do{if(verbosity>=2)verbose(6,__FILE__,__LINE__,__VA_ARGS__);}while(0)
      app-framework-main/src/verbose.h:33:# define DEBUG(...)   do{if(verbosity>=3)verbose(7,__FILE__,__LINE__,__VA_ARGS__);}while(0)
       

       

      The _FILE_ macro will embed the BUILD path into the binary.

      This leads to non-reproducible builds.

       

      Either we remove the _FILE_ macro or we only use the base filename. There is no default macro for that, but solutions using a cmake define.

       

      Details:

       

      The diffoscope output shows the build-path as part of .rodata of the binary:

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jsmoeller Jan-Simon Moeller
            jsmoeller Jan-Simon Moeller
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: