-
Notifications
You must be signed in to change notification settings - Fork 249
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
Add ffmpeg example #1295
base: main
Are you sure you want to change the base?
Add ffmpeg example #1295
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
|
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.
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 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:12
Setup container:
Build
cd examples/third_party USE_BAZEL_VERSION=7.x bazelisk build --verbose_failures @ffmpeg