Bug#1128055: highs.pc has incorrect libdir and includedir paths (double usr prefix)

衷 琛鑫 Chenxin.Zhong at outlook.com
Sun Feb 15 12:06:49 GMT 2026


Package: highs
Version: 1.12.0+ds1-3
Severity: important
Tags: patch

The installed highs.pc pkg-config file contains incorrect libdir and
includedir paths with a duplicated "usr" prefix, causing compilation and
linking failures for any project using pkg-config to locate HiGHS.

Current (broken) highs.pc:

  prefix=/usr
  libdir=/usr/usr/lib/x86_64-linux-gnu
  includedir=/usr/usr/include/highs

The correct paths should be:

  libdir=/usr/lib/x86_64-linux-gnu
  includedir=/usr/include/highs

Impact: Any software using "pkg-config --cflags highs" or
"pkg-config --libs highs" gets non-existent paths and fails to
compile or link.

Root cause:

In debian/rules, CMAKE_INSTALL_PREFIX is set to the relative path "usr",
while CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR are also set to
paths starting with "usr/":

  TARGET_PREFIX = usr
  TARGET_LIBDIR = $(TARGET_PREFIX)/lib/$(DEB_HOST_MULTIARCH)

  SKBUILD_ARGS = \
    -C skbuild.cmake.args=-DCMAKE_INSTALL_PREFIX=$(TARGET_PREFIX) \
    -C skbuild.cmake.args=-DCMAKE_INSTALL_LIBDIR=$(TARGET_LIBDIR) \
    -C skbuild.cmake.args=-DCMAKE_INSTALL_INCLUDEDIR=$(TARGET_PREFIX)/include

The upstream highs.pc.in template uses CMAKE_INSTALL_FULL_LIBDIR and
CMAKE_INSTALL_FULL_INCLUDEDIR:

  prefix=@CMAKE_INSTALL_PREFIX@
  libdir=@CMAKE_INSTALL_FULL_LIBDIR@
  includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/highs

CMake's GNUInstallDirs computes the FULL_ variants by prepending the
prefix to relative paths. Since both the prefix ("usr") and the dir
variables ("usr/lib/...") are relative, CMake concatenates them:

  CMAKE_INSTALL_FULL_LIBDIR = usr/usr/lib/x86_64-linux-gnu
  CMAKE_INSTALL_FULL_INCLUDEDIR = usr/usr/include

The post-build sed command only strips $(CURDIR) but does not fix the
double "usr" issue:

  sed -i "s|$(CURDIR)||g" $(TARGET_LIBDIR)/pkgconfig/highs.pc

Suggested fix:

Pass CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR as paths relative
to the prefix (without the leading "usr/"):

  -C skbuild.cmake.args=-DCMAKE_INSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
  -C skbuild.cmake.args=-DCMAKE_INSTALL_INCLUDEDIR=include

Since TARGET_LIBDIR is also used elsewhere in debian/rules (BUILD_LIBDIR,
execute_after_dh_auto_install, dh_link), a safer approach is to introduce
a separate variable for the cmake args:

  TARGET_PREFIX = usr
  TARGET_LIBDIR = $(TARGET_PREFIX)/lib/$(DEB_HOST_MULTIARCH)
  CMAKE_LIBDIR = lib/$(DEB_HOST_MULTIARCH)
  CMAKE_INCLUDEDIR = include

And use CMAKE_LIBDIR / CMAKE_INCLUDEDIR only in the skbuild cmake args.

How to reproduce:

  apt install libhighs-dev
  cat /usr/lib/x86_64-linux-gnu/pkgconfig/highs.pc
  # Observe libdir=/usr/usr/lib/... and includedir=/usr/usr/include/...
  pkg-config --cflags highs
  # Returns -I/usr/usr/include/highs (wrong path)

Both 1.12.0+ds1-2 (Ubuntu resolute) and 1.12.0+ds1-3 (Debian sid)
are affected.


-- System Information:
Debian Release: forky/sid
  APT prefers resolute
  APT policy: (500, 'resolute')
Architecture: amd64 (x86_64)

Kernel: Linux 6.6.87.2-microsoft-standard-WSL2 (SMP w/24 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20260215/607f49e9/attachment-0001.htm>


More information about the debian-science-maintainers mailing list