obsproject / obsproject/obs-studio

Garbage in pkg-config on FreeBSD

Open
#7,990 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Other

Other OS

FreeBSD

OBS Studio Version

28.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

N/A

OBS Studio Crash Log URL

No response

Expected Behavior
$ pkg-config libobs --cflags
-I/usr/local/include/obs -DHAVE_OBSCONFIG_H -mmmx -msse -msse2 -pthread
Current Behavior
$ pkg-config libobs --cflags
-I/usr/local/include/obs -DHAVE_OBSCONFIG_H -mmmx -msse -msse2 $\<$\<COMPILE_LANG_AND_ID:CUDA,NVIDIA\>:SHELL:-Xcompiler -pthread\> $\<$\<NOT:$\<COMPILE_LANG_AND_ID:CUDA,NVIDIA\>\>:-pthread\> 
Steps to Reproduce
  1. pkg install obs-studio mercurial meson pkgconf
  2. hg clone https://hg.sr.ht/~scoopta/wlrobs
  3. cd wlrobs
  4. hg checkout v1.0
  5. meson setup _build
  6. meson compile -C _build
cc: error: unknown argument '-pthread>'; did you mean '-pthreads'?
cc: error: no such file or directory: '$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler'
cc: error: no such file or directory: '$<$<NOT:$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>>:-pthread>'
Anything else we should know?

Regressed by #6746 due to not sanitizing INTERFACE_COMPILE_OPTIONS. CC @PatTheMav, @yurivict

--- /usr/local/libdata/pkgconfig/libobs.pc	before
+++ /usr/local/libdata/pkgconfig/libobs.pc	after
@@ -1,10 +1,10 @@ Version: 28.1.2
 prefix=/usr/local
 exec_prefix=${prefix}
 libdir=/usr/local/lib
 includedir=/usr/local/include/obs
 
 Name: libobs
 Description: OBS Studio Library
 Version: 28.1.2
-Cflags: -I${includedir} -DHAVE_OBSCONFIG_H  
-Libs: -L${libdir} -lpthread
+Cflags: -I${includedir} -DHAVE_OBSCONFIG_H -mmmx -msse -msse2  $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler -pthread> $<$<NOT:$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>>:-pthread>
+Libs: -L${libdir} -lobs -lpthread

Note, COMPILE_LANG_AND_ID:CUDA,NVIDIA comes from Threads::Threads

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the FreeBSD build with Meson and pkgconf, then inspect how OBS exports INTERFACE_COMPILE_OPTIONS into the generated libobs.pc file. Focus on the CMake integration around Threads::Threads and the reported #6746 regression; done means pkg-config --cflags emits valid flags without unevaluated generator expressions and the wlrobs build succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.