[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#985187: ffmpeg: reproducible builds: Embeds build path in binaries generated with cl2c



Control: tags -1 upstream

Hi Vagrant

On 2021-03-13 20:05:47 -0800, Vagrant Cascadian wrote:
> Source: ffmpeg
> Severity: normal
> Tags: patch
> User: reproducible-builds@lists.alioth.debian.org
> Usertags: buildpath
> X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org
> 
> The build path is embedded in various files generated with tools/cl2c:
> 
>   https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/ffmpeg.html
> 
>   avgblur.o (shipped in libavfilter.a)
> 
>   #line·1·"/build/1st/ffmpeg-4.3.2/libavfilter/opencl/avgblur.cl"
>   vs.
>   #line·1·"/build/2/ffmpeg-4.3.2/2nd/libavfilter/opencl/avgblur.cl"
> 
> 
> The attached patch fixes this by patching tools/cl2c to use a basename
> in the generated file rather than the full path.
> 
> 
> It builds fine with this patch applied, but someone more familiar with
> ffmpeg should ensure ffmpeg still functions correctly with the patch
> applied.

As this patch touches upstream's build system, please submit it
upstream:

https://ffmpeg.org/developer.html#Contributing

Thanks

Cheers

> 
> 
> Thanks for maintaining ffmpeg!
> 
> live well,
>   vagrant

> From ec49e459797d6e112358566ae083c3bfae801023 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant@reproducible-builds.org>
> Date: Sat, 13 Mar 2021 03:52:51 +0000
> Subject: [PATCH] tools/cl2c: Strip full path from input file in embedded
>  output.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Without this patch, the full build path gets embedded into various
> binaries shipped in the package, for example, libavfilter.a contains
> a references to:
> 
>   #line·1·"/build/1st/ffmpeg-4.3.2/libavfilter/opencl/avgblur.cl"
> 
> https://tests.reproducible-builds.org/debian/issues/unstable/captures_build_path_issue.html
> ---
>  tools/cl2c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/cl2c b/tools/cl2c
> index e3f92bab..48444e61 100755
> --- a/tools/cl2c
> +++ b/tools/cl2c
> @@ -23,11 +23,13 @@ input="$1"
>  output="$2"
>  
>  name=$(basename "$input" | sed 's/.cl$//')
> +# Avoid embedded the build path, using only the basename of the input file.
> +base_input=$(basename "$input")
>  
>  cat >$output <<EOF
>  // Generated from $input
>  const char *ff_opencl_source_$name =
> -"#line 1 \"$input\"\n"
> +"#line 1 \"$base_input\"\n"
>  EOF
>  
>  # Convert \ to \\ and " to \", then add " to the start and end of the line.
> -- 
> 2.20.1
> 




-- 
Sebastian Ramacher

Attachment: signature.asc
Description: PGP signature


Reply to: