Conversation
|
I've also run into this, while trying to build ffmpeg with I'm able to get a successful build by letting bazel just select the local c compiler but ideally I would like to use a hermetic llvm + sysroot. |
|
my build fails with errors like this: in |
|
Seems like this bug is probably related: https://trac.ffmpeg.org/ticket/9310 |
|
Adding |
@voxeljorge We have already been setting the Unfortunately, the build still doesn't work (see PR description for instructions on how to reproduce the different errors). |
|
I found that I had similar errors because not only is configure not using |
36e818b to
6814132
Compare
@voxeljorge Could you share your wrapper? I noticed that my build was missing the
|
6814132 to
52caf52
Compare
|
I don't build libvpx or libdav1d at all. The configure wrapper is trivial: #!/bin/bash
# ffmpeg ignores flags like CC/CXX and CFLAGS: https://trac.ffmpeg.org/ticket/9310
# so we have a wrapper which assigns them correctly
exec "$(dirname "$0")"/configure \
--cc="$CC" \
--cxx="$CXX" \
--extra-cflags="$CFLAGS" \
--extra-cxxflags="$CXXFLAGS" \
--extra-ldflags="$LDFLAGS" \
"$@"The wrapper can be installed a couple of ways, you could inject it during the repository creation time what I did was copy the sources with something like this: load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
copy_to_directory(
name = "src",
srcs = [
"configure_wrapper",
"@ffmpeg_7_0_sources",
],
include_external_repositories = ["ffmpeg_7_0_sources"],
)
configure_make(
name = "ffmpeg",
lib_source = "//third_party/ffmpeg:src",
configure_command = "src/configure_wrapper",
)I do have ffmpeg building with a limited set of codecs currently, even with a modern llvm and sysroot. |
This aligns this to what other tools are doing. This is required to fix --sysroot flag even without cross compiling for example when using in combination with a hermetic toolchain.
52caf52 to
9a385b3
Compare
This does not build with the configured hermetic toolchain.
Instructions
(Optional) Run in container
Create container:
docker run -it --rm -v $(pwd):/work -w /work debian:12Setup container:
Build
cd examples/third_party USE_BAZEL_VERSION=7.x bazelisk build --verbose_failures @ffmpeg