m-ab-s / media-autobuild_suite

This Windows Batchscript helps setup a Mingw-w64 compiler environment for building ffmpeg and other media tools under Windows.
GNU General Public License v3.0
1.49k stars 256 forks source link

libmediainfo failed after fresh build #2707

Closed ASopH closed 3 weeks ago

ASopH commented 1 month ago

09:30:38 Running git update for hdr10plus_tool... 09:30:39 hdr10plus_tool git ............................... [Up-to-date] 09:30:41 Running git update for libzen... 09:30:43 libzen git ....................................... [Up-to-date] 09:30:46 Running git update for libmediainfo... 09:31:02 ┌ libmediainfo git ......................... [Recently updated] 09:31:02 ├ Running cmake... Likely error (tail of the failed operation logfile):

but not all the files it references.

Call Stack (most recent call first): F:/m-a-s/msys64/mingw32/lib/cmake/CURL/CURLConfig.cmake:58 (include) F:/m-a-s/msys64/mingw32/share/cmake/Modules/FindCURL.cmake:80 (find_package) CMakeLists.txt:89 (find_package)

-- Configuring incomplete, errors occurred! cmake failed. Check F:/m-a-s/build/libmediainfo-git/build-32bit/ab-suite.cmake.log This is required for other packages, so this script will exit. 09:31:23 Creating diagnostics file...

logs.zip

Fishman0919 commented 1 month ago

Same.

logs.zip

ycwan commented 4 weeks ago

Same issue

Running git update for libmediainfo... ┌ libmediainfo git ...................................... [Updates found] ├ Running uninstall... ├ Running cmake... Likely error (tail of the failed operation logfile):

but not all the files it references.

Call Stack (most recent call first): C:/MABS/msys64/mingw64/lib/cmake/CURL/CURLConfig.cmake:58 (include) C:/MABS/msys64/mingw64/share/cmake/Modules/FindCURL.cmake:80 (find_package) CMakeLists.txt:89 (find_package)

-- Configuring incomplete, errors occurred! cmake failed. Check C:/MABS/build/libmediainfo-git/build-64bit/ab-suite.cmake.log This is required for other packages, so this script will exit. Creating diagnostics file...

Attach C:\MABS\build\logs.zip to the GitHub issue. Make sure the suite is up-to-date before reporting an issue. It might've been fixed already.

Try running the build again at a later time.

logs.zip ab-suite.cmake.log

L4cache commented 4 weeks ago

It or the FindCURL.cmake is looking for shared version of libcurl and ultimately fails because M-AB-S hides libcurl.dll.a by renaming it with additional ".dyn" suffix.

If the file is renamed back to original name before libmediainfo build, then it can pass the check. I thought this would make mediainfo.exe to link to shared curl but it seems not the case.

So why the heck would it look for shared curl since we (or M-AB-S) only want static linking and have the static library?

Selur commented 4 weeks ago

logs.zip Same here.

Murmur commented 4 weeks ago

TinyXML2 is not found and raises an error? But file is inside the libmediainfo-git/Source/ThirdParty/tinyxml2/tinyxml2.cpp so I don't know how to resolve this problem.

-- Checking for module 'tinyxml2'
--   Package 'tinyxml2' not found
-- Could NOT find TinyXML (missing: TinyXML_LIBRARIES) 
CMake Error at C:/media-ab/msys64/mingw64/lib/cmake/CURL/CURLTargets.cmake:86 (message):
  The imported target "CURL::libcurl_shared" references the file

EDIT As L4cache actually gave a comment it's libcurl.dll.a.dyn file magic, I put a cp(copy) before cmake and libmediainfo and mediainfo.exe was compiled fine.

file: media-ab\build\media-suite_compile.sh
    _check=(libmediainfo.{a,pc})
    _deps=(lib{zen,curl}.a)
    if do_vcs "$SOURCE_REPO_LIBMEDIAINFO" libmediainfo; then
        do_uninstall include/MediaInfo{,DLL} bin-global/libmediainfo-config \
            "${_check[@]}" libmediainfo.la lib/cmake/mediainfolib
        cp "/C/media-ab/msys64/mingw64/lib/libcurl.dll.a.dyn" "/C/media-ab/msys64/mingw64/lib/libcurl.dll.a"
        CFLAGS+=" $($PKG_CONFIG --cflags libzen)" \
        LDFLAGS+=" $($PKG_CONFIG --cflags --libs libzen)" \
            do_cmakeinstall Project/CMake -DBUILD_ZLIB=off -DBUILD_ZENLIB=off
        do_checkIfExist
    fi
    fix_cmake_crap_exports "$LOCALDESTDIR/lib/cmake/mediainfolib"
Biswa96 commented 3 weeks ago

I put a cp(copy) before cmake and libmediainfo and mediainfo.exe was compiled fine.

Then libmedinfo will link with shared curl library.

diegocr commented 3 weeks ago

Why does MediaInfo requires cURL anyway? After all, it's just a tool / library to extract metadata out of local files...

Biswa96 commented 3 weeks ago

Why does MediaInfo requires cURL anyway?

https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Reader/Reader_libcurl.cpp

diegocr commented 3 weeks ago

Yeah, sorry, i know.

Was a rhetorical question implying we could have an additional option in mabs to turn network-readers off :-)

diegocr commented 3 weeks ago

Meanwhile, if someone is interested in such a build, this libmediainfo_extra.sh should do it:


_pre_cmake(){

    sed -i 's!find_package(CURL)!!' ${REPO_DIR}/Project/CMake/CMakeLists.txt
    sed -i 's!"ZenLib/Conf.h"!&\n#define MEDIAINFO_LIBMMS_NO\n#define MEDIAINFO_LIBCURL_NO!' ${REPO_DIR}/Source/MediaInfo/Setup.h
}

_post_install(){
    cd "${REPO_DIR}" && git restore ./Source/MediaInfo/Setup.h ./Project/CMake/CMakeLists.txt
}
L4cache commented 3 weeks ago

Uhh, so no cmake option to disable it easier?

diegocr commented 3 weeks ago

Probably there is, but i didn't bothered wasting time looking for it, creating that *_extra.sh file was easier / faster :)

Ultimately, this is something we should do through media-suite_compile.sh since we could also prevent having to compile libcurl which takes ages.

PR(s) welcome ;)

Murmur commented 3 weeks ago

@diegocr Thanks for your things-done-properly script. My variation cp "msys64/mingw64/lib/libcurl.dll.a.dyn" "msys64/mingw64/lib/libcurl.dll.a" was to get things compile without knowing anything about mediainfo. Executable works for an offline files mediainfo.exe --full somevideo.ts but I will take your _extra.sh script and recompile.