1. Even when specifying '-fPIC' in the copts, bazel tries to do a non PIC build. So we end up building each source file twice, but they are in fact the same. Once bazel includes it's own '-fPIC', and once it doesn't, but since it's included as part of the copts, it is always passed to the compiler.
2. There is some sort of fun dependency issue, where including '-fPIC' causes the rules to become non-deterministic somehow. Haven't narrowed it down to a small repro yet, but the general steps are adding a comment like '# testing' to the BUILD file for ffmpeg, and then it rebuilds the entire thing. When analyzing the dependencies, we see something very strange, the include files are ordered differently. eg.
before adding comment:
863 Declared include source: third_party/ffmpeg/libavformat/yuv4mpeg.h
864 Declared include source: third_party/ffmpeg/libavutil/aarch64/bswap.h
865 Declared include source: third_party/ffmpeg/libavutil/aarch64/cpu.h
866 Declared include source: third_party/ffmpeg/libavutil/aarch64/neontest.h
867 Declared include source: third_party/ffmpeg/libavutil/adler32.h
after adding comment:
862 Declared include source: third_party/ffmpeg/libavformat/yuv4mpeg.h
863 Declared include source: third_party/ffmpeg/libavutil/adler32.h
864 Declared include source: third_party/ffmpeg/libavutil/aes.h
865 Declared include source: third_party/ffmpeg/libavutil/atomic.h
866 Declared include source: third_party/ffmpeg/libavutil/atomic_gcc.h
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/e7be46e4-1887-4952-9191-b8671de5623d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/0db0cf07-d556-480b-ac13-5d435560053b%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/0db0cf07-d556-480b-ac13-5d435560053b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.