Vargol / ffmpeg-apple-arm64-build

Build script for ffmpeg targeting the latest open source video codecs running on macOS using Apple's M1 processor.
235 stars 42 forks source link

check failed: installation of brotli failed #20

Closed kristallizer closed 10 months ago

kristallizer commented 1 year ago

Trying to build this on an Apple M1 Pro running macOS 13.4.1 (Ventura). Does the build command need to be run as sudo?

./build.sh
No action set, all failures wil stop the script
base directory is /Users/username/ffmpeg-apple-arm64-build
script directory is /Users/username/ffmpeg-apple-arm64-build/build
test directory is /Users/username/ffmpeg-apple-arm64-build/test
working directory is /Users/username/ffmpeg-apple-arm64-build
tool directory is /Users/username/ffmpeg-apple-arm64-build/tool
output directory is /Users/username/ffmpeg-apple-arm64-build/out

prepare workspace
use 8 cpu threads

compile cmake
took 158s

compile pkg-config
took 53s

compile FriBidi
took 6s

compile zlib
took 2s

compile libpng
took 4s

compile brotli
check failed: build brotli

build-brotli.log:

cat build-brotli.log
Cloning into 'brotli'...
-- The C compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Build type is 'Release'
-- Performing Test BROTLI_EMSCRIPTEN
-- Performing Test BROTLI_EMSCRIPTEN - Failed
-- Compiler is not EMSCRIPTEN
-- Looking for log2
-- Looking for log2 - found
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    INSTALL_PKGCONFIG_DIR

-- Build files have been written to: /Users/username/ffmpeg-apple-arm64-build/brotli/build-brotli
[  5%] Building C object CMakeFiles/brotlicommon.dir/c/common/constants.c.o
[  5%] Building C object CMakeFiles/brotlicommon.dir/c/common/context.c.o
[  8%] Building C object CMakeFiles/brotlicommon.dir/c/common/platform.c.o
[ 16%] Building C object CMakeFiles/brotlicommon.dir/c/common/dictionary.c.o
[ 16%] Building C object CMakeFiles/brotlicommon.dir/c/common/transform.c.o
[ 16%] Building C object CMakeFiles/brotlicommon.dir/c/common/shared_dictionary.c.o
[ 19%] Linking C static library libbrotlicommon.a
[ 19%] Built target brotlicommon
[ 22%] Building C object CMakeFiles/brotlienc.dir/c/enc/backward_references_hq.c.o
[ 27%] Building C object CMakeFiles/brotlidec.dir/c/dec/bit_reader.c.o
[ 27%] Building C object CMakeFiles/brotlidec.dir/c/dec/state.c.o
[ 33%] Building C object CMakeFiles/brotlienc.dir/c/enc/block_splitter.c.o
[ 33%] Building C object CMakeFiles/brotlidec.dir/c/dec/decode.c.o
[ 36%] Building C object CMakeFiles/brotlidec.dir/c/dec/huffman.c.o
[ 41%] Building C object CMakeFiles/brotlienc.dir/c/enc/backward_references.c.o
[ 41%] Building C object CMakeFiles/brotlienc.dir/c/enc/bit_cost.c.o
[ 44%] Building C object CMakeFiles/brotlienc.dir/c/enc/cluster.c.o
[ 47%] Building C object CMakeFiles/brotlienc.dir/c/enc/brotli_bit_stream.c.o
[ 50%] Building C object CMakeFiles/brotlienc.dir/c/enc/command.c.o
[ 52%] Building C object CMakeFiles/brotlienc.dir/c/enc/compound_dictionary.c.o
[ 55%] Building C object CMakeFiles/brotlienc.dir/c/enc/compress_fragment.c.o
[ 58%] Building C object CMakeFiles/brotlienc.dir/c/enc/compress_fragment_two_pass.c.o
[ 61%] Building C object CMakeFiles/brotlienc.dir/c/enc/dictionary_hash.c.o
[ 63%] Building C object CMakeFiles/brotlienc.dir/c/enc/encode.c.o
[ 66%] Building C object CMakeFiles/brotlienc.dir/c/enc/encoder_dict.c.o
[ 69%] Building C object CMakeFiles/brotlienc.dir/c/enc/entropy_encode.c.o
[ 72%] Linking C static library libbrotlidec.a
[ 75%] Building C object CMakeFiles/brotlienc.dir/c/enc/fast_log.c.o
[ 75%] Built target brotlidec
[ 77%] Building C object CMakeFiles/brotlienc.dir/c/enc/histogram.c.o
[ 80%] Building C object CMakeFiles/brotlienc.dir/c/enc/literal_cost.c.o
[ 83%] Building C object CMakeFiles/brotlienc.dir/c/enc/memory.c.o
[ 86%] Building C object CMakeFiles/brotlienc.dir/c/enc/metablock.c.o
[ 88%] Building C object CMakeFiles/brotlienc.dir/c/enc/static_dict.c.o
[ 91%] Building C object CMakeFiles/brotlienc.dir/c/enc/utf8_util.c.o
[ 94%] Linking C static library libbrotlienc.a
[ 94%] Built target brotlienc
[ 97%] Building C object CMakeFiles/brotli.dir/c/tools/brotli.c.o
[100%] Linking C executable brotli
[100%] Built target brotli
Consolidate compiler generated dependencies of target brotlicommon
[ 19%] Built target brotlicommon
Consolidate compiler generated dependencies of target brotlienc
[ 80%] Built target brotlienc
Consolidate compiler generated dependencies of target brotlidec
[ 94%] Built target brotlidec
Consolidate compiler generated dependencies of target brotli
[100%] Built target brotli
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/bin/brotli
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/lib/libbrotlienc.a
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/lib/libbrotlidec.a
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/lib/libbrotlicommon.a
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/include/brotli
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/include/brotli/shared_dictionary.h
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/include/brotli/port.h
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/include/brotli/types.h
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/include/brotli/encode.h
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/include/brotli/decode.h
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/lib/pkgconfig/libbrotlicommon.pc
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/lib/pkgconfig/libbrotlidec.pc
-- Installing: /Users/username/ffmpeg-apple-arm64-build/tool/lib/pkgconfig/libbrotlienc.pc
CMake Error at cmake_install.cmake:99 (file):
  file cannot create directory: /man/man1.  Maybe need administrative
  privileges.

make: *** [install] Error 1
check failed: installation of brotli failed
Vargol commented 1 year ago

No it does need to be sudo. I'm guessing brotli have broken their build again. I'll try and have a look see if it happens to me. the man files should be going into the tools/man directory where you're running the build script from not /man

Vargol commented 1 year ago

Okay, yes they've broken the build, I've raised an issue, you'd think they'd notice they've made there build require root access ?!?!?! I'll try and knock up a temporary patch in the mean time incase they come back with a 'WONT FIX'

Vargol commented 1 year ago

I've but a patch to 'fix' the brotli build.

simonwestenholz commented 1 year ago

Still fails for me, with the same error. Do I manually need to apply the patch?

edit: nvm, wrong branch

Vargol commented 1 year ago

Nope, it's applied by the build script, how did you download it ?

simonwestenholz commented 1 year ago

I downloaded the x265_from_master branch, which didn't work. Master seems to compile fine, as we speak.

Vargol commented 1 year ago

Yep.. I really need to get rid of the other branches, I've made them unnecessary by making the build from master optional in the main branch.

Spidley2 commented 10 months ago

Still having issues with brotli.. (using the .zip download)

No action set, all failures wil stop the script base directory is /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master script directory is /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/build test directory is /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/test working directory is /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install tool directory is /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool output directory is /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/out

prepare workspace use 8 cpu threads

compile cmake took 213s

compile pkg-config took 63s

compile FriBidi took 9s

compile zlib took 3s

compile libpng took 9s

compile brotli check failed: build brotli


Cloning into 'brotli'... -- The C compiler identification is AppleClang 15.0.0.15000040 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Build type is 'Release' -- Performing Test BROTLI_EMSCRIPTEN -- Performing Test BROTLI_EMSCRIPTEN - Failed -- Compiler is not EMSCRIPTEN -- Looking for log2 -- Looking for log2 - found -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project:

INSTALL_PKGCONFIG_DIR

-- Build files have been written to: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/brotli/build-brotli [ 2%] Building C object CMakeFiles/brotlicommon.dir/c/common/transform.c.o [ 5%] Building C object CMakeFiles/brotlicommon.dir/c/common/constants.c.o [ 8%] Building C object CMakeFiles/brotlicommon.dir/c/common/platform.c.o [ 11%] Building C object CMakeFiles/brotlicommon.dir/c/common/dictionary.c.o [ 13%] Building C object CMakeFiles/brotlicommon.dir/c/common/shared_dictionary.c.o [ 16%] Building C object CMakeFiles/brotlicommon.dir/c/common/context.c.o [ 19%] Linking C static library libbrotlicommon.a [ 19%] Built target brotlicommon [ 25%] Building C object CMakeFiles/brotlidec.dir/c/dec/state.c.o [ 25%] Building C object CMakeFiles/brotlidec.dir/c/dec/decode.c.o [ 27%] Building C object CMakeFiles/brotlienc.dir/c/enc/backward_references.c.o [ 30%] Building C object CMakeFiles/brotlidec.dir/c/dec/huffman.c.o [ 33%] Building C object CMakeFiles/brotlienc.dir/c/enc/block_splitter.c.o [ 36%] Building C object CMakeFiles/brotlidec.dir/c/dec/bit_reader.c.o [ 38%] Building C object CMakeFiles/brotlienc.dir/c/enc/backward_references_hq.c.o [ 41%] Building C object CMakeFiles/brotlienc.dir/c/enc/bit_cost.c.o [ 44%] Building C object CMakeFiles/brotlienc.dir/c/enc/brotli_bit_stream.c.o [ 47%] Building C object CMakeFiles/brotlienc.dir/c/enc/cluster.c.o [ 50%] Building C object CMakeFiles/brotlienc.dir/c/enc/command.c.o [ 52%] Building C object CMakeFiles/brotlienc.dir/c/enc/compound_dictionary.c.o [ 55%] Building C object CMakeFiles/brotlienc.dir/c/enc/compress_fragment.c.o [ 58%] Building C object CMakeFiles/brotlienc.dir/c/enc/compress_fragment_two_pass.c.o [ 61%] Building C object CMakeFiles/brotlienc.dir/c/enc/dictionary_hash.c.o [ 63%] Building C object CMakeFiles/brotlienc.dir/c/enc/encode.c.o [ 66%] Building C object CMakeFiles/brotlienc.dir/c/enc/encoder_dict.c.o [ 69%] Linking C static library libbrotlidec.a [ 69%] Built target brotlidec [ 72%] Building C object CMakeFiles/brotlienc.dir/c/enc/entropy_encode.c.o [ 75%] Building C object CMakeFiles/brotlienc.dir/c/enc/fast_log.c.o [ 77%] Building C object CMakeFiles/brotlienc.dir/c/enc/histogram.c.o [ 80%] Building C object CMakeFiles/brotlienc.dir/c/enc/literal_cost.c.o [ 83%] Building C object CMakeFiles/brotlienc.dir/c/enc/memory.c.o [ 86%] Building C object CMakeFiles/brotlienc.dir/c/enc/metablock.c.o [ 88%] Building C object CMakeFiles/brotlienc.dir/c/enc/static_dict.c.o [ 91%] Building C object CMakeFiles/brotlienc.dir/c/enc/utf8_util.c.o [ 94%] Linking C static library libbrotlienc.a [ 94%] Built target brotlienc [ 97%] Building C object CMakeFiles/brotli.dir/c/tools/brotli.c.o [100%] Linking C executable brotli [100%] Built target brotli Consolidate compiler generated dependencies of target brotlicommon [ 19%] Built target brotlicommon Consolidate compiler generated dependencies of target brotlienc [ 80%] Built target brotlienc Consolidate compiler generated dependencies of target brotlidec [ 94%] Built target brotlidec Consolidate compiler generated dependencies of target brotli [100%] Built target brotli Install the project... -- Install configuration: "Release" -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/bin/brotli -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/lib/libbrotlienc.a -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/lib/libbrotlidec.a -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/lib/libbrotlicommon.a -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/include/brotli -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/include/brotli/shared_dictionary.h -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/include/brotli/port.h -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/include/brotli/types.h -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/include/brotli/encode.h -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/include/brotli/decode.h -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/lib/pkgconfig/libbrotlicommon.pc -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/lib/pkgconfig/libbrotlidec.pc -- Installing: /Users/admin/Downloads/ffmpeg-apple-arm64-build-x265_from_master/ffmpeg_install/tool/lib/pkgconfig/libbrotlienc.pc CMake Error at cmake_install.cmake:99 (file): file cannot create directory: /man/man1. Maybe need administrative privileges.

make: *** [install] Error 1 check failed: installation of brotli failed

Vargol commented 10 months ago

Hi, this is a replacement for the message where I thought to was using the wrong brnch, I'd forgotten he Zip download had a different name to the directory git creates. I'll have a look, it look like they've changed something and broke the patch gang by the error message. Sometime I think the brotli devs have got it in for MacOS, they're Google FFS sake they can afford a Mac to test on.

Spidley2 commented 10 months ago

Hah they hate us.. thanks for all your work :)

Vargol commented 10 months ago

Okay, it worked without issue for me (part from SVT-AV1 build breaking ffmpeg at this moment in time, I guess I'd better quickly sort that as the SVT-AV1 devs have got to chase down a broken CI test to fix it). Can you check the build-brotli.sh file and check the following lines are in there

  git apply $1/brotli_man_fix.patch
  checkStatus $? "git apply patch failed"
Spidley2 commented 10 months ago

Neither of those lines are in my version of build-brotli.sh ?

My version:

!/bin/sh

$1 = script directory

$2 = working directory

$3 = tool directory

$4 = CPUs

$5 = vorbis version - unused get heads from git

load functions

. $1/functions.sh

SOFTWARE=brotli

make_directories() {

start in working directory

cd "$2" checkStatus $? "change directory failed" mkdir ${SOFTWARE} checkStatus $? "create directory failed" cd ${SOFTWARE} checkStatus $? "change directory failed" mkdir build-${SOFTWARE} checkStatus $? "create directory failed" cd build-${SOFTWARE} checkStatus $? "change directory failed"

}

download_code () {

cd "$2/${SOFTWARE}" checkStatus $? "change directory failed"

download source

git clone https://github.com/google/brotli.git checkStatus $? "download of ${SOFTWARE} failed"

}

configure_build () {

cd "$2/${SOFTWARE}/build-${SOFTWARE}/" checkStatus $? "change directory failed"

cmake -DCMAKE_INSTALL_PREFIX:PATH=$3 -DINSTALL_PKGCONFIG_DIR=$3/lib/pkgconfig -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF ../${SOFTWARE} checkStatus $? "configuration of ${SOFTWARE} failed"

}

make_clean() {

cd "$2/${SOFTWARE}/build-${SOFTWARE}/" checkStatus $? "change directory failed" make clean checkStatus $? "make clean for $SOFTWARE failed"

}

make_compile () {

cd "$2/${SOFTWARE}/build-${SOFTWARE}/" checkStatus $? "change directory failed"

build

make -j $4 checkStatus $? "build of ${SOFTWARE} failed"

install

make install checkStatus $? "installation of ${SOFTWARE} failed"

}

build_main () {

if [[ -d "$2/${SOFTWARE}" && "${ACTION}" == "skip" ]] then return 0 elif [[ -d "$2/${SOFTWARE}" && -z "${ACTION}" ]] then echo "${SOFTWARE} build directory already exists but no action set. Exiting script" exit 0 fi

if [[ ! -d "$2/${SOFTWARE}" ]] then make_directories $@ download_code $@ configure_build $@ fi

make_clean $@ make_compile $@

}

build_main $@

Vargol commented 10 months ago

Okay, somehow you've got an old version of the code. I'm just about to push a fix for svt-av1 breaking the build so wait for that to appear then download the zip from the Download the zip from the green code button and check that to see if its got those lines in

Spidley2 commented 10 months ago

will do, thanks!

Vargol commented 10 months ago

okay, you should be able to download it now

Spidley2 commented 10 months ago

running now.. made it past brotli so far!

Spidley2 commented 10 months ago

Marvellous, all good! Thanks for your help :)

compile ffmpeg took 135s compilation finished successfully took 947s

bundle result adding: ffmpeg (deflated 58%) adding: ffprobe (deflated 58%)

run tests tests executed successfully