Hi László,

Thanks for approving fix-expat-noconfig.patch for #995907.

On 2021-10-16 22:32, László Böszörményi (GCS) wrote:
>  As I see, fix-expat-cmake.patch is a no-op. It duplicates a single
> line for no purpose. _IMPORT_PREFIX is deleted from
> expat-noconfig.cmake in the other patch making it useless.
> As I see, using that alone caused this (incorrect path) bug for you.

fix-expat-cmake.patch is needed to fix #996612, and Matteo's build log
[1] confirms that it does. I will try to explain what it does.

The patch indeed duplicates a single line, affecting _IMPORT_PREFIX
variable. It is also true that fix-expat-noconfig.patch removes
_IMPORT_PREFIX from expat-noconfig.cmake, but _IMPORT_PREFIX is still
used in expat.cmake to set the value for INTERFACE_INCLUDE_DIRECTORIES.

As far as I know, CMake's get_filename_component() function call strips
last component of a path just like 'dirname' program from coreutils. At
line 45 of expat/cmake/autotools/expat.cmake, value of
CMAKE_CURRENT_LIST_FILE is /usr/lib/${DEB_HOST_MULTIARCH} is
'/usr/lib/x86_64-linux-gnu/cmake/expat-2.4.1/expat.cmake'. Four
subsequent calls to get_filename_component() in the unpatched file
results in _IMPORT_PREFIX being equal to '/usr/lib', thus
INTERFACE_INCLUDE_DIRECTORIES on line 57 becomes '/usr/lib/include',
which is clearly an incorrect path.

fix-expat-cmake.patch introduces yet another call to
get_filename_component(), resulting in _IMPORT_PREFIX being evaluated to
'/usr'. As a result, INTERFACE_INCLUDE_DIRECTORIES becomes
'/usr/include' which is the correct include path for Expat.

I hope this makes it clear that fix-expat-cmake.patch is needed to fix
#996612. Let me know should you need further information.

[1]
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=996612;filename=opencolorio_2.1.0%2Bdfsg0-1_amd64-2021-10-16T17%3A13%3A37Z.build;msg=22

Best wishes,
Andrius

Reply via email to