[4/4] webkitgtk: Add reproducibility fix

Message ID 20220104141625.1369719-4-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 4d561c98f4d2e68d595aae4b03df1420cb01c3f7
Headers show
Series [1/4] package_deb/ipk/rpm: Add more minimal do_build dependencies back | expand

Commit Message

Richard Purdie Jan. 4, 2022, 2:16 p.m. UTC
When the date rolled from one year to another this highlighted a reproducibility
issue. This could be better fixed by using SOURCE_DATE_EPOCH from the environment
but I'm not sure how you do that in ruby. Help from someone with that knowledge
to submit that upstream very welcome.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../webkit/webkitgtk/reproducibility.patch    | 22 +++++++++++++++++++
 meta/recipes-sato/webkit/webkitgtk_2.34.2.bb  |  1 +
 2 files changed, 23 insertions(+)
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/reproducibility.patch

Comments

Quentin Schulz Jan. 4, 2022, 3:44 p.m. UTC | #1
Hi Richard,

On 1/4/22 15:16, Richard Purdie wrote:
> When the date rolled from one year to another this highlighted a reproducibility
> issue. This could be better fixed by using SOURCE_DATE_EPOCH from the environment
> but I'm not sure how you do that in ruby. Help from someone with that knowledge
> to submit that upstream very welcome.
> 

Small side note, it seems like "copyright years" aren't actually any 
useful, see https://hynek.me/til/copyright-years/ and 
https://www.linuxfoundation.org/blog/copyright-notices-in-open-source-software-projects/.

I guess we can just notify the project to stop using the date entirely 
in the copyright to avoid those issues and hope they'll just agree :)

Cheers,
Quentin
Khem Raj Jan. 4, 2022, 4:25 p.m. UTC | #2
On Tue, Jan 4, 2022 at 6:16 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> When the date rolled from one year to another this highlighted a reproducibility
> issue. This could be better fixed by using SOURCE_DATE_EPOCH from the environment
> but I'm not sure how you do that in ruby. Help from someone with that knowledge
> to submit that upstream very welcome.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  .../webkit/webkitgtk/reproducibility.patch    | 22 +++++++++++++++++++
>  meta/recipes-sato/webkit/webkitgtk_2.34.2.bb  |  1 +
>  2 files changed, 23 insertions(+)
>  create mode 100644 meta/recipes-sato/webkit/webkitgtk/reproducibility.patch
>
> diff --git a/meta/recipes-sato/webkit/webkitgtk/reproducibility.patch b/meta/recipes-sato/webkit/webkitgtk/reproducibility.patch
> new file mode 100644
> index 00000000000..e866a1a193a
> --- /dev/null
> +++ b/meta/recipes-sato/webkit/webkitgtk/reproducibility.patch
> @@ -0,0 +1,22 @@
> +Injection a year based on the current date isn't reproducible. Hack this
> +to a specific year for now for reproducibilty and to avoid autobuilder failures.
> +
> +The correct fix would be to use SOURCE_DATE_EPOCH from the environment and
> +then this could be submitted upstream, sadly my ruby isn't up to that.
> +
> +Upstream-Status: Pending [could be reworked]
> +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> +
> +Index: webkitgtk-2.34.2/Source/JavaScriptCore/generator/GeneratedFile.rb
> +===================================================================
> +--- webkitgtk-2.34.2.orig/Source/JavaScriptCore/generator/GeneratedFile.rb
> ++++ webkitgtk-2.34.2/Source/JavaScriptCore/generator/GeneratedFile.rb
> +@@ -25,7 +25,7 @@ require 'date'
> + require 'digest'
> +
> + $LICENSE = <<-EOF
> +-Copyright (C) #{Date.today.year} Apple Inc. All rights reserved.
> ++Copyright (C) 2021 Apple Inc. All rights reserved.

perhaps eliminating the year completely is better.

> +
> + Redistribution and use in source and binary forms, with or without
> + modification, are permitted provided that the following conditions
> diff --git a/meta/recipes-sato/webkit/webkitgtk_2.34.2.bb b/meta/recipes-sato/webkit/webkitgtk_2.34.2.bb
> index a9b151e3c3c..aa071395227 100644
> --- a/meta/recipes-sato/webkit/webkitgtk_2.34.2.bb
> +++ b/meta/recipes-sato/webkit/webkitgtk_2.34.2.bb
> @@ -18,6 +18,7 @@ SRC_URI = "https://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
>             file://reduce-memory-overheads.patch \
>             file://musl-lower-stack-usage.patch \
>             file://0001-Fix-build-without-opengl-or-es.patch \
> +           file://reproducibility.patch \
>             "
>
>  SRC_URI[sha256sum] = "584677d6e7cae12e27cdcc8e05b4cf73b54849a24afc3d7a40cec91016deff00"
> --
> 2.32.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#160165): https://lists.openembedded.org/g/openembedded-core/message/160165
> Mute This Topic: https://lists.openembedded.org/mt/88190252/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

Patch

diff --git a/meta/recipes-sato/webkit/webkitgtk/reproducibility.patch b/meta/recipes-sato/webkit/webkitgtk/reproducibility.patch
new file mode 100644
index 00000000000..e866a1a193a
--- /dev/null
+++ b/meta/recipes-sato/webkit/webkitgtk/reproducibility.patch
@@ -0,0 +1,22 @@ 
+Injection a year based on the current date isn't reproducible. Hack this
+to a specific year for now for reproducibilty and to avoid autobuilder failures.
+
+The correct fix would be to use SOURCE_DATE_EPOCH from the environment and
+then this could be submitted upstream, sadly my ruby isn't up to that.
+
+Upstream-Status: Pending [could be reworked]
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: webkitgtk-2.34.2/Source/JavaScriptCore/generator/GeneratedFile.rb
+===================================================================
+--- webkitgtk-2.34.2.orig/Source/JavaScriptCore/generator/GeneratedFile.rb
++++ webkitgtk-2.34.2/Source/JavaScriptCore/generator/GeneratedFile.rb
+@@ -25,7 +25,7 @@ require 'date'
+ require 'digest'
+ 
+ $LICENSE = <<-EOF
+-Copyright (C) #{Date.today.year} Apple Inc. All rights reserved.
++Copyright (C) 2021 Apple Inc. All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.34.2.bb b/meta/recipes-sato/webkit/webkitgtk_2.34.2.bb
index a9b151e3c3c..aa071395227 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.34.2.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.34.2.bb
@@ -18,6 +18,7 @@  SRC_URI = "https://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
            file://reduce-memory-overheads.patch \
            file://musl-lower-stack-usage.patch \
            file://0001-Fix-build-without-opengl-or-es.patch \
+           file://reproducibility.patch \
            "
 
 SRC_URI[sha256sum] = "584677d6e7cae12e27cdcc8e05b4cf73b54849a24afc3d7a40cec91016deff00"