Skip to content

[package] ffmpeg/7.1.1: fails to find zlib under specific conditions on Windows #27438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kambala-decapitator opened this issue May 16, 2025 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@kambala-decapitator
Copy link
Contributor

Description

Sorry, not sure if it's better to post here or in Conan issues.

I'm seeing quite a strange behavior. Building dependencies for my project using Github Actions, it fails on FFmpeg with message

zlib requested but not found

What is more strange that when building just ffmpeg separately doesn't produce this issue, builds ok - either on GhA or on local machine. Checking configure logs I found this:

check_pkg_config zlib zlib zlib.h zlibVersion
test_pkg_config zlib zlib zlib.h zlibVersion
/c/users/runneradmin/.conan2/p/pkgcoe6fcefd89afdc/p/bin/pkgconf.exe --exists --print-errors zlib
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'virtual:world', not found
check_lib zlib zlib.h zlibVersion -lz
check_func_headers zlib.h zlibVersion -lz
test_ld cc -lz
test_cc
BEGIN ./ffconf.wruO54Vg/test.c
    1	#include <zlib.h>
    2	#include <stdint.h>
    3	long check_zlibVersion(void) { return (long) zlibVersion; }
    4	int main(void) { int ret = 0;
    5	 ret |= ((intptr_t)check_zlibVersion) & 0xFFFF;
    6	return ret; }
END ./ffconf.wruO54Vg/test.c
cl.exe -DNDEBUG -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -DNTDDI_VERSION=0x06010000 -I/c/users/runneradmin/.conan2/p/zlib811245753b339/p/include -I/c/users/runneradmin/.conan2/p/bzip2c5b94e53fe701/p/include -I/c/users/runneradmin/.conan2/p/xz_ut4879ee3db4010/p/include -I/c/users/runneradmin/.conan2/p/opusc70290b9efaed/p/include -I/c/users/runneradmin/.conan2/p/opusc70290b9efaed/p/include/opus -D_ISOC11_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -DPIC -MD -O2 -Ob2 -FS -nologo -MD -O2 -Ob2 -FS /std:c17 -c -Fo./ffconf.wruO54Vg/test.o ./ffconf.wruO54Vg/test.c
test.c
./ffconf.wruO54Vg/test.c(3): warning C4311: 'type cast': pointer truncation from 'const char *(__cdecl *)(void)' to 'long'
/c/users/runneradmin/.conan2/p/b/ffmpe4606eecd4ad97/b/src/compat/windows/mslink -LIBPATH:/c/users/runneradmin/.conan2/p/zlib811245753b339/p/lib -LIBPATH:/c/users/runneradmin/.conan2/p/bzip2c5b94e53fe701/p/lib -LIBPATH:/c/users/runneradmin/.conan2/p/xz_ut4879ee3db4010/p/lib -LIBPATH:/c/users/runneradmin/.conan2/p/opusc70290b9efaed/p/lib -nologo -out:./ffconf.wruO54Vg/test.exe ./ffconf.wruO54Vg/test.o zlib.lib
LINK : fatal error LNK1181: cannot open input file 'zlib.lib'

the most important line is in the beginning - pkgconf is unable to find zlib, but I've double checked everything: the pc file is correct and points to correct location, zlib package is also correct, no differences between working case and broken.

After banging my head for a few days I found the difference: in the failing case I'm using Conan Action with default params, but as soon as I switch to manual installation using pipx the error goes away! I haven't dug further to check if it's python 3.10 (default version that's installed by the action) vs 3.13 (default version on the public runners) making the difference or something else.

Package and Environment Details

  • Package Name/Version: ffmpeg/7.1.1
  • Operating System+version: Windows Server 2022 from GitHub Actions
  • Compiler+version: msvc 194
  • Conan version: conan 2.16.1
  • Python version: Python 3.10.11 as installed by Conan Action

Conan profile

Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=194
os=Windows

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=194
os=Windows

Steps to reproduce

conan install --requires ffmpeg/7.1.1 --build="ffmpeg/*" -of 1

Logs

GhA runs:

Wanted to show the cleanest possible failing run from the same test repo, but it failed not with zlib but with other library - aom :) https://github.com/kambala-decapitator/workflow-test/actions/runs/15066717888

@uilianries
Copy link
Member

@kambala-decapitator Hello! Thank you for reporting your scenario. I more or less was able to reproduce your case. I opened the PR conan-io/setup-conan#4 to fix your case.

Could please try using the action:

- name: Install Conan
  uses: uilianries/setup-conan@fix-env

It avoids keeping the pkg-config from the setup-python installed with Conan.

@kambala-decapitator
Copy link
Contributor Author

Hi @uilianries

Thanks a lot! Just tried it, but run step fails with "command conan not found", tried in bash and powershell. See https://github.com/kambala-decapitator/workflow-test/actions/runs/15180733120 and the run before it.

@uilianries
Copy link
Member

uilianries commented May 22, 2025

@kambala-decapitator I'm Sorry. I made some changes to that branch this morning. Could you please try it again?

@kambala-decapitator
Copy link
Contributor Author

@uilianries yes, re-running those 2 builds succeeded this time! Thanks!

@uilianries
Copy link
Member

@kambala-decapitator Thank you for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants