conda-forge / gstreamer-feedstock

A conda-smithy repository for gstreamer.
BSD 3-Clause "New" or "Revised" License
9 stars 28 forks source link

missing dependency on glib #67

Closed kuepe-sl closed 2 years ago

kuepe-sl commented 2 years ago

I'm building a tool that uses GStreamer. However it fails to build unless I explicitly add glib into the meta.yaml host section.

My meta.yaml requirements are:

requirements:
  build:
    - {{ compiler("c") }}
    - {{ compiler("cxx") }}
    - cmake
    - make  # [unix]
    - pkg-config
  host:
    - gstreamer
    - gst-plugins-base
    - ffmpeg
  run:
    # none

Conda environments (Linux):

base environment:
    boa                       0.6.2            py39hf3d152e_0    conda-forge
    conda                     4.11.0           py39hf3d152e_0    conda-forge
    conda-build               3.21.8           py39hf3d152e_0    conda-forge
    mamba                     0.15.3           py39h951de11_0    conda-forge

build environment:
    cmake:                    3.22.3-h5432695_0       conda-forge
    gcc_impl_linux-64:        9.4.0-h03d3576_13       conda-forge
    gcc_linux-64:             9.4.0-h391b98a_6        conda-forge
    gxx_impl_linux-64:        9.4.0-h03d3576_13       conda-forge
    gxx_linux-64:             9.4.0-h0316aca_6        conda-forge
    pkg-config:               0.29.2-h36c2ea0_1008    conda-forge

host environment:
    gst-plugins-base:      1.20.0-hf529b03_0                      conda-forge
    gstreamer:             1.20.0-h9f60fe5_0                      conda-forge

CMake Configure results, Linux:

-- Found PkgConfig: $BUILD_PREFIX/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'gstreamer-1.0'
--   Found gstreamer-1.0, version 1.20.0
-- Checking for module 'gstreamer-app-1.0'
--   Found gstreamer-app-1.0, version 1.20.0
-- Configuring done
CMake Error in CMakeLists.txt:
  Imported target "PkgConfig::GSTREAMER" includes non-existent path
    "/builds/project_1646665920883/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include/glib-2.0"
  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.
-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

CMake Configure results, Windows:

-- Found PkgConfig: C:/builds/project_1646665546978/_build_env/Library/bin/pkg-config.exe (found version "0.29.2") 
-- Checking for module 'gstreamer-1.0'
--   Package 'glib-2.0', required by 'gstreamer-1.0', not found
-- Configuring incomplete, errors occurred!
kuepe-sl commented 2 years ago

Apparently this issue seems to be the source of a problem with GStreamer and Qt as well: https://github.com/conda-forge/qt-feedstock/issues/226

relevant excerpt from the Qt build log on linux-64:

2022-01-20T06:15:53.4450196Z Checking for GStreamer 1.0... 
2022-01-20T06:15:53.4455355Z Trying source 0 (type pkgConfig) of library gstreamer_1_0 ...
2022-01-20T06:15:53.4461786Z + /home/conda/feedstock_root/build_artifacts/qt_1642658749304/_build_env/bin/pkg-config --exists --silence-errors gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0
2022-01-20T06:15:53.4698106Z + /home/conda/feedstock_root/build_artifacts/qt_1642658749304/_build_env/bin/pkg-config --modversion gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0
2022-01-20T06:15:53.4902702Z > 1.18.5
2022-01-20T06:15:53.4903362Z > 1.18.5
2022-01-20T06:15:53.4903732Z > 1.18.5
2022-01-20T06:15:53.4904057Z > 1.18.5
2022-01-20T06:15:53.4904361Z > 1.18.5
2022-01-20T06:15:53.4911921Z + /home/conda/feedstock_root/build_artifacts/qt_1642658749304/_build_env/bin/pkg-config --libs-only-L gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0
2022-01-20T06:15:53.5122272Z > -L/home/conda/feedstock_root/build_artifacts/qt_1642658749304/_h_env_placehol/lib
2022-01-20T06:15:53.5124085Z + /home/conda/feedstock_root/build_artifacts/qt_1642658749304/_build_env/bin/pkg-config --libs-only-l gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0
2022-01-20T06:15:53.5332696Z > -lgstpbutils-1.0 -lgstaudio-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgsttag-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0
2022-01-20T06:15:53.5358977Z + /home/conda/feedstock_root/build_artifacts/qt_1642658749304/_build_env/bin/pkg-config --cflags gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0
2022-01-20T06:15:53.5571915Z > -pthread -I/home/conda/feedstock_root/build_artifacts/qt_1642658749304/_h_env_placehol/include/gstreamer-1.0 -I/home/conda/feedstock_root/build_artifacts/qt_1642658749304/_h_env_placehol/include -I/home/conda/feedstock_root/build_artifacts/qt_1642658749304/_h_env_placehol/include/glib-2.0 -I/home/conda/feedstock_root/build_artifacts/qt_1642658749304/_h_env_placehol/lib/glib-2.0/include -I/home/conda/feedstock_root/build_artifacts/qt_1642658749304/_h_env_placehol/include
2022-01-20T06:15:53.5579576Z Note: Dropped compiler flags '-pthread'.
2022-01-20T06:15:53.5585996Z Include path /home/conda/feedstock_root/build_artifacts/qt_1642658749304/_h_env_placehol/include/glib-2.0 is invalid.
2022-01-20T06:15:53.5588165Z Include path /home/conda/feedstock_root/build_artifacts/qt_1642658749304/_h_env_placehol/lib/glib-2.0/include is invalid.
2022-01-20T06:15:53.5590551Z   => source produced no result.
2022-01-20T06:15:53.5593360Z test config.qtmultimedia_multimedia.libraries.gstreamer_1_0 FAILED

@andfoy Any idea on how I could fix this in a clean way?

andfoy commented 2 years ago

According to my local builds, GStreamer is being picked up correctly:

Qt Multimedia:
  ALSA ................................... yes
  GStreamer 1.0 .......................... yes
  GStreamer 0.10 ......................... no
  Video for Linux ........................ yes
  OpenAL ................................. no
  PulseAudio ............................. yes
  Resource Policy (libresourceqt5) ....... no
  Windows Audio Services ................. no
  DirectShow ............................. no
  Windows Media Foundation ............... no
andfoy commented 2 years ago

According to the glib-feedstock, the name of the exported package is libglib: https://github.com/conda-forge/glib-feedstock/blob/757c9fd62adacb868d55f05889b07c79b550afd5/recipe/meta.yaml#L135, maybe we should depend on that one

kuepe-sl commented 2 years ago

It isn't picked up in the official Conda Forge builds. This is where it fails in the most recent commit of qt-feedstock: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=478704&view=logs&j=656edd35-690f-5c53-9ba3-09c10d0bea97&t=e5c8ab1d-8ff9-5cae-b332-e15ae582ed2d&l=3376

kuepe-sl commented 2 years ago

Okay - thanks! I'll make a fork where I build against libglib. Let's see if that fixes it.

andfoy commented 2 years ago

The idea would be see if including libglib in the host section fixes this problem

kuepe-sl commented 2 years ago

libglib was unfortunately not the solution. GStreamer doesn't build when only libglib is specified in the host section.

During the build stage, all the things in bold are required. That is the case for both, building GStreamer itself and applications that use the GStreamer library. (like Qt) So putting glib into the "host" section is correct.


There are two solutions I can imagine: