yaml-cpp-config.cmake has incorrect path to yaml-cpp include directory

Bug #1880419 reported by Ted Steiner
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
yaml-cpp (Ubuntu)
Fix Released
Undecided
Chris Halse Rogers

Bug Description

Package yaml-cpp installs a CMake package config file. This package config file sets variable "YAML_CPP_INCLUDE_DIR" incorrectly.

Line 8 of this file is currently:
set(YAML_CPP_INCLUDE_DIR "${YAML_CPP_CMAKE_DIR}/../../../../../include")
This resolves to path "/include", which is invalid.

The line should instead be:
set(YAML_CPP_INCLUDE_DIR "${YAML_CPP_CMAKE_DIR}/../../../../include")
Which resolves to path "/lib/include".

I encountered this bug on Ubuntu 20.04 with version 0.6.2-4ubuntu1. The package versions in Ubuntu 16.04 and 18.04 have the correct file path.

Michał Sawicz (saviq)
Changed in yaml-cpp (Ubuntu):
assignee: nobody → Chris Halse Rogers (raof)
Revision history for this message
Chris Halse Rogers (raof) wrote :

Hm. I'm having trouble coming up with an actual test case for this. What sort of usage does this break?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package yaml-cpp - 0.6.3-9

---------------
yaml-cpp (0.6.3-9) unstable; urgency=medium

  * Fix pkg-config and cmake wrong files and paths. LP: #1880419

 -- Gianfranco Costamagna <email address hidden> Tue, 26 May 2020 17:56:33 +0200

Changed in yaml-cpp (Ubuntu):
status: New → Fix Released
Revision history for this message
Ted Steiner (tsteiner2) wrote :

Would it be possible to get this fix applied to Ubuntu 20.04 as well?

Revision history for this message
Chris Halse Rogers (raof) wrote :

Abosulety! However, it'll require an actual test case. I've been unable to come up with a build that's broken by this, but since you noticed it presumably you have?

If you've got an example of what's broken by this, could you please attach it and we can turn it into the SRU test case.

Revision history for this message
Dennis Klein (dklein222) wrote :

> Abosulety! However, it'll require an actual test case.

```
#!/bin/bash
cleanup() {
  rm -rf "$1"
}
set -e
testdir="$(mktemp -d)"
trap "cleanup ${testdir}" EXIT
pushd "${testdir}"
cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(yaml-cpp-test LANGUAGES CXX)
find_package(yaml-cpp)
get_filename_component(YAML_CPP_INCLUDE_DIR
  "\${YAML_CPP_INCLUDE_DIR}" REALPATH BASE_DIR "/")
message(STATUS "YAML_CPP_INCLUDE_DIR: \${YAML_CPP_INCLUDE_DIR}")
if(NOT YAML_CPP_INCLUDE_DIR STREQUAL "/usr/include")
  message(FATAL_ERROR "Wrong value exported in YAML_CPP_INCLUDE_DIR")
endif()
EOF
cmake -S. -Bbuild
```

You may run this bash script as a test.

Our users are also affected by this bug, +1 for fixing it in 20.04 LTS. Thx!

Revision history for this message
Dennis Klein (dklein222) wrote :

On a side note, Debian 10 is also affected by this bug. If you could trigger a backport of the fix there, too, this would be aweseome! Thank you very much!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.