Bug 248479

Summary: multimedia/x265: fails to build with SVTHEVC on
Product: Ports & Packages Reporter: Vladimir Druzenko <vvd>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: diizzy, mfburdett, mi, mi, osidorkin, rhurlin, rozhuk.im, sdalu, swills
Priority: --- Flags: bugzilla: maintainer-feedback? (mi)
vvd: maintainer-feedback?
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
log file
none
Make compatible with svt-hevc 1.5.x none

Description Vladimir Druzenko freebsd_committer freebsd_triage 2020-08-05 08:05:50 UTC
12.1 amd64:

FAILED: encoder/CMakeFiles/encoder.dir/api.cpp.o 
/usr/bin/c++  -DENABLE_HDR10_PLUS -DEXPORT_C_API=1 -DHAVE_INT_TYPES_H=1 -DHIGH_BIT_DEPTH=0 -DSVT_HEVC -DX265_ARCH_X86=1 -DX265_DEPTH=8 -DX265_NS=x265 -DX86_64=1 -D__STDC_LIMIT_MACROS=1 -I/tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/. -I/tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/dynamicHDR10 -I. -I/usr/local/include/svt-hevc -I/tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/common -I/tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/encoder -O2 -pipe -DNDEBUG -O3 -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -DNDEBUG -O3 -fstack-protector-strong -fno-strict-aliasing   -Wall -Wextra -Wshadow -std=gnu++11 -fPIC -Wno-array-bounds -ffast-math -mstackrealign -fno-exceptions -Wno-uninitialized -DLINKED_10BIT=1 -DLINKED_12BIT=1 -MD -MT encoder/CMakeFiles/encoder.dir/api.cpp.o -MF encoder/CMakeFiles/encoder.dir/api.cpp.o.d -o encoder/CMakeFiles/encoder.dir/api.cpp.o -c /tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/encoder/api.cpp
/tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/encoder/api.cpp:408:55: error: array type 'unsigned char [1024]' is not assignable
                    inputData->dolbyVisionRpu.payload = X265_MALLOC(uint8_t, 1024);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/encoder/api.cpp:415:55: error: array type 'unsigned char [1024]' is not assignable
                    inputData->dolbyVisionRpu.payload = NULL;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/encoder/api.cpp:653:43: warning: address of array 'inputData->dolbyVisionRpu.payload' will always evaluate to 'true' [-Wpointer-bool-conversion]
            if (inputData->dolbyVisionRpu.payload) X265_FREE(inputData->dolbyVisionRpu.payload);
            ~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/tmp/work/usr/ports/multimedia/x265/work/x265_3.2.1/source/encoder/api.cpp:1986:39: error: array type 'unsigned char [1024]' is not assignable
    inputData->dolbyVisionRpu.payload = NULL;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
1 warning and 3 errors generated.
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2020-08-05 08:19:00 UTC
Before update multimedia/svt-hevc from 1.4.3 to 1.5.0 it build fine.
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2020-08-05 08:41:49 UTC
Please test https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247035
Comment 3 Steve Wills freebsd_committer freebsd_triage 2020-08-05 13:32:40 UTC
Created attachment 217027 [details]
log file

here's my log of the build error
Comment 4 Oleg Sidorkin 2020-08-05 15:50:30 UTC
That's an upstream problem due to svt-hevc API changes. It's still present in 3.4.
Comment 5 Mikhail Teterin freebsd_committer freebsd_triage 2020-08-07 02:58:54 UTC
Created attachment 217060 [details]
Make compatible with svt-hevc 1.5.x

Please, try this patch. I prepared it for x265-3.4, but it should apply -- even if with some effort -- to 3.2 as well.

With it, 3.4 compiles here -- and passes its own tests -- but I'm not sure, how comprehensive they are...
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2020-08-07 10:34:33 UTC
(In reply to Mikhail Teterin from comment #5)
> Please, try this patch. I prepared it for x265-3.4, but it should apply -- even if with some effort -- to 3.2 as well.
Build fine for me.

But file multimedia/x265/files/patch-source_encoder_api.cpp have other patch - don't forget this during prepare patch for multimedia/x265.
Comment 7 Mikhail Teterin freebsd_committer freebsd_triage 2020-08-07 18:23:36 UTC
(In reply to VVD from comment #6)
> Build fine for me.

Does it work, though? Can you test the SVT functionality?

> But file multimedia/x265/files/patch-source_encoder_api.cpp have other patch

Thanks, that older patch is not, actually, necessary for the 3.4.
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-09-20 22:18:04 UTC
A commit references this bug:

Author: mi
Date: Sun Sep 20 22:17:54 UTC 2020
New revision: 549401
URL: https://svnweb.freebsd.org/changeset/ports/549401

Log:
  Upgrade from 3.2 to 3.4. Resolve incompatibilities with newer
  SVTHEVC.

  PR:		247035, 248479
  Sponsored by:	United Marsupials

Changes:
  head/multimedia/x265/Makefile
  head/multimedia/x265/distinfo
  head/multimedia/x265/files/patch-source_CMakeLists.txt
  head/multimedia/x265/files/patch-source_abrEncApp.cpp
  head/multimedia/x265/files/patch-source_cmake_Findsvthevc.cmake
  head/multimedia/x265/files/patch-source_common_version.cpp
  head/multimedia/x265/files/patch-source_dynamicHDR10_CMakeLists.txt
  head/multimedia/x265/files/patch-source_encoder_api.cpp
  head/multimedia/x265/files/patch-source_encoder_svt.h
  head/multimedia/x265/pkg-plist
Comment 9 Ivan Rozhuk 2020-09-21 06:11:30 UTC
FAILED: encoder/CMakeFiles/encoder.dir/api.cpp.o 
/usr/local/libexec/ccache/c++ -DENABLE_HDR10_PLUS -DEXPORT_C_API=1 -DHAVE_INT_TYPES_H=1 -DHIGH_BIT_DEPTH=0 -DSVT_HEVC -DX265_ARCH_X86=1 -DX265_DEPTH=8 -DX265_NS=x265 -DX86_64=1 -D__STDC_LIMIT_MACROS=1 -I/tmp/ports/usr/ports/multimedia/x265/work/source/. -I/tmp/ports/usr/ports/multimedia/x265/work/source/dynamicHDR10 -I. -I/usr/local/include/svt-hevc -I/tmp/ports/usr/ports/multimedia/x265/work/source/common -I/tmp/ports/usr/ports/multimedia/x265/work/source/encoder -O2 -pipe -O3 -pipe -funroll-loops -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline -DNDEBUG -O3 -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/multimedia/x265/work/source=. -O3 -funroll-loops -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline -O2 -pipe -O3 -pipe -funroll-loops -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline -DNDEBUG -O3 -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/multimedia/x265/work/source=. -O3 -funroll-loops -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline   -Wall -Wextra -Wshadow -std=gnu++11 -fPIC -Wno-array-bounds -ffast-math -mstackrealign -fno-exceptions -Wno-uninitialized -DLINKED_10BIT=1 -DLINKED_12BIT=1 -MD -MT encoder/CMakeFiles/encoder.dir/api.cpp.o -MF encoder/CMakeFiles/encoder.dir/api.cpp.o.d -o encoder/CMakeFiles/encoder.dir/api.cpp.o -c /tmp/ports/usr/ports/multimedia/x265/work/source/encoder/api.cpp
../source/encoder/api.cpp:453:55: error: array type 'unsigned char [1024]' is not assignable
                    inputData->dolbyVisionRpu.payload = X265_MALLOC(uint8_t, 1024);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
../source/encoder/api.cpp:460:55: error: array type 'unsigned char [1024]' is not assignable
                    inputData->dolbyVisionRpu.payload = NULL;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
../source/encoder/api.cpp:698:43: warning: address of array 'inputData->dolbyVisionRpu.payload' will always evaluate to 'true' [-Wpointer-bool-conversion]
            if (inputData->dolbyVisionRpu.payload) X265_FREE(inputData->dolbyVisionRpu.payload);
            ~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../source/encoder/api.cpp:2054:39: error: array type 'unsigned char [1024]' is not assignable
    inputData->dolbyVisionRpu.payload = NULL;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
1 warning and 3 errors generated.
Comment 10 commit-hook freebsd_committer freebsd_triage 2020-09-21 17:16:29 UTC
A commit references this bug:

Author: mi
Date: Mon Sep 21 17:15:50 UTC 2020
New revision: 549462
URL: https://svnweb.freebsd.org/changeset/ports/549462

Log:
  Actually commit the SVT-HEVC patch carelessly ommitted previously.

  PR:		247035, 248479
  Reported by:	VVD
  Sponsored by:	United Marsupials

Changes:
  head/multimedia/x265/files/patch-source_encoder_api.cpp
Comment 11 Ivan Rozhuk 2020-09-21 21:03:47 UTC
Build ok, thanks!
Comment 12 Vladimir Druzenko freebsd_committer freebsd_triage 2020-09-21 21:52:29 UTC
For me too.