Bug 1721876 - YafaRay: FTBFS in Fedora rawhide
Summary: YafaRay: FTBFS in Fedora rawhide
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: opencv
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nicolas Chauvet (kwizart)
QA Contact: Fedora Extras Quality Assurance
URL: http://apps.fedoraproject.org/koschei...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-19 08:06 UTC by Jitka Plesnikova
Modified: 2019-06-26 23:02 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-06-26 23:02:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jitka Plesnikova 2019-06-19 08:06:15 UTC
Description of problem:
Package YafaRay fails to build from source in Fedora rawhide with a following error:

Searching for Python 3.5
Python wasn't found, please install it to build python bindings
fatal: not a git repository (or any of the parent directories): .git
CMake Error in src/yafraycore/CMakeLists.txt:
  Imported target "opencv_core" includes non-existent path

    "//include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error in src/yafraycore/CMakeLists.txt:
  Imported target "opencv_core" includes non-existent path

    "//include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.


Dependency changes from the last successful build:
https://apps.fedoraproject.org/koschei/build/6568405

Additional info:
This package is tracked by Koschei. See:
http://apps.fedoraproject.org/koschei/package/YafaRay

Comment 1 Luya Tshimbalanga 2019-06-22 10:24:02 UTC
It looks like a bug from opencv detected by YafaRay according to that line.
I am able to reproduce the issue via scratch build:

https://koji.fedoraproject.org/koji/taskinfo?taskID=35715146

Assigning to the right component.

Comment 2 Rich Mattes 2019-06-23 19:01:44 UTC
The problem is in /usr/lib64/cmake/OpenCV/OpenCVConfig.cmake, where OpenCV is trying to determine OpenCV_INSTALL_PATH:

> # Extract the directory where *this* file has been installed (determined at cmake run-time)
> # Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
> set(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}")
> get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../../../" REALPATH)


The relative path is going up one too many levels, resolving to / instead of /usr.  Then, it tries to set OpenCV_INCLUDE_DIRS using this base path:

> set(OpenCV_INCLUDE_DIRS "${OpenCV_INSTALL_PATH}/include" "${OpenCV_INSTALL_PATH}/include/opencv")

which results in "//include" instead of "/usr/include"

It looks like the number of levels up for the relative path is computed at build time[1], is determined by some CMake scripts[2]. I'm not sure why it suddenly stopped working.

[1] https://github.com/opencv/opencv/blob/c024edb9a80ebc2bef788f5946c851eb8a3aa76b/cmake/templates/OpenCVConfig.cmake.in#L80
[2] https://github.com/opencv/opencv/blob/73959fed4581556d8e6b770987c819adfacceb87/cmake/OpenCVGenConfig.cmake#L86

Comment 3 Sergio Basto 2019-06-25 04:26:21 UTC
(In reply to Rich Mattes from comment #2)
> The problem is in /usr/lib64/cmake/OpenCV/OpenCVConfig.cmake, where OpenCV
> is trying to determine OpenCV_INSTALL_PATH:
> 
> > # Extract the directory where *this* file has been installed (determined at cmake run-time)
> > # Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
> > set(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}")
> > get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../../../" REALPATH)

ya , thanks for the tip [1] , I'm still investigating why 


[1] 
diff /home/var/lib/mock/fedora-29-x86_64/root/usr/lib64/OpenCV/ /usr/lib64/cmake/OpenCV/OpenCVConfig.cmake 
< #      - OpenCV_VERSION                  : The version of this OpenCV build: "3.4.1"
---
> #      - OpenCV_VERSION                  : The version of this OpenCV build: "3.4.6"

< get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../" REALPATH)
---
> get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../../../" REALPATH)

Comment 4 Sergio Basto 2019-06-26 23:02:21 UTC
It should be fixed with opencv-3.4.6-4.fc31 [1] we need to wait for arms that finish the builds .
Commit [2] had break the builds for YafaRay and [3] should fix , for some reason setting OPENCV_CONFIG_INSTALL_PATH needs to be the relative path of prefix . 
I wonder if new OPENCV_JAR_INSTALL_PATH=%{_jnidir} also must be relative , other discover is a fix for arch linux [4], seems related but in Fedora case seems that don't change anything ... 

Feel free to reopen this bug is we need fix more things . 

[1]
https://koji.fedoraproject.org/koji/taskinfo?taskID=35849364

[2]
https://src.fedoraproject.org/rpms/opencv/c/dd2b657bf316fe05ea8dbef1118ec87c4ef0534e?branch=master

[3]
https://src.fedoraproject.org/rpms/opencv/c/f1638db7ab71d806181e0561eac2216b8b3c34ea?branch=master

[4]
https://github.com/opencv/opencv/commit/246733382f8558c7ea2eafda82f8bf28380fd455#diff-4af27f21119151996d341e3c87c6a93c


Note You need to log in before you can comment on or make changes to this bug.