Skip to contentSkip to conversation

librsvg: Fix build reproducibility

PATCH In review Joshua Watt 2 participants 4 messages Nov 21, 2019 – Nov 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 librsvg: Fix build reproducibility

librsvg was encoding the path to the build directory in order to find a font file for testing. This wouldn't work in OE anyway since the build directory isn't present at that exact location on the target, so remove the offending path to make the build reproducible.

---
 .../0001-Remove-non-reproducible-SRCDIR.patch | 30 +++++++++++++++++++
 meta/recipes-gnome/librsvg/librsvg_2.40.20.bb |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-gnome/librsvg/librsvg/0001-Remove-non-reproducible-SRCDIR.patch
meta/recipes-gnome/librsvg/librsvg/0001-Remove-non-reproducible-SRCDIR.patch new file +30 -0
new file mode 100644
index 00000000000..75fc7f9d0b9
@@ -0,0 +1,30 @@
+From bea5156cd7e7122715b26c769c35928141a1da2c Mon Sep 17 00:00:00 2001
+From: Joshua Watt <[email protected]>
+Date: Mon, 18 Nov 2019 14:46:34 -0600
+Subject: [PATCH] Remove non-reproducible SRCDIR
+
+Removes SRCDIR as the prefix for finding the test font. This wouldn't
+work anyway, since that path is not present on the target.
+
+This patch is specific to OE, since it appears that this entire method
+of testing was removed when upstream was re-written in rust
+
+Upstream-Status: Inappropriate [OE-specific, no longer present upstream]
+Signed-off-by: Joshua Watt <[email protected]>
+---
+ rsvg-cairo-draw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
+index caa9104..cfb7ed2 100644
+--- a/rsvg-cairo-draw.c
++++ b/rsvg-cairo-draw.c
+@@ -398,7 +398,7 @@ set_font_options_for_testing (PangoContext *context)
+ static void
+ create_font_config_for_testing (RsvgCairoRender *render)
+ {
+-    const char *font_path = SRCDIR "/tests/resources/LiberationSans-Regular.ttf";
++    const char *font_path = "/tests/resources/LiberationSans-Regular.ttf";
+ 
+     if (render->font_config_for_testing != NULL)
+         return;
meta/recipes-gnome/librsvg/librsvg_2.40.20.bb +1 -0
index 7f98127fd01..6dd0533a5de 100644
@@ -20,6 +20,7 @@ inherit gnomebase gtk-doc pixbufcache upstream-version-is-even gobject-introspec
 
 SRC_URI += "file://gtk-option.patch \
             file://0001-Auto-detect-Bsymbolic-fixes-configure-on-macOS.patch \
+            file://0001-Remove-non-reproducible-SRCDIR.patch \
 "
 
 SRC_URI[archive.md5sum] = "4949d313b0c5d9161a5c259104af5568"
Signature · 1 line
2.23.0
#1 lore raw
Quoted 41 lines · Joshua Watt

librsvg was encoding the path to the build directory in order to find a
font file for testing. This wouldn't work in OE anyway since the build
directory isn't present at that exact location on the target, so remove
the offending path to make the build reproducible.

---
 .../0001-Remove-non-reproducible-SRCDIR.patch | 30
+++++++++++++++++++
 meta/recipes-gnome/librsvg/librsvg_2.40.20.bb |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-gnome/librsvg/librsvg/0001-Remove-

non-reproducible-SRCDIR.patch

(quoted diff) +0 -0

reproducible-SRCDIR.patch b/meta/recipes-gnome/librsvg/librsvg/0001- Remove-non-reproducible-SRCDIR.patch
new file mode 100644
index 00000000000..75fc7f9d0b9

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +0 -0

reproducible-SRCDIR.patch

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +1 -0
@@ -0,0 +1,30 @@
+From bea5156cd7e7122715b26c769c35928141a1da2c Mon Sep 17 00:00:00

2001

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +5 -0
+From: Joshua Watt <[email protected]>
+Date: Mon, 18 Nov 2019 14:46:34 -0600
+Subject: [PATCH] Remove non-reproducible SRCDIR
+
+Removes SRCDIR as the prefix for finding the test font. This

wouldn't

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +3 -0
+work anyway, since that path is not present on the target.
+
+This patch is specific to OE, since it appears that this entire

method

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +3 -0
+of testing was removed when upstream was re-written in rust
+
+Upstream-Status: Inappropriate [OE-specific, no longer present
Quoted 1 line

upstream]

what replaced it ( just curious ), can we backport the fix that removed it or made obsolete ?

Quoted 39 lines
meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +10 -0
+Signed-off-by: Joshua Watt <[email protected]>
+---
+ rsvg-cairo-draw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
+index caa9104..cfb7ed2 100644
+--- a/rsvg-cairo-draw.c
++++ b/rsvg-cairo-draw.c
+@@ -398,7 +398,7 @@ set_font_options_for_testing (PangoContext

*context)
+ static void
+ create_font_config_for_testing (RsvgCairoRender *render)
+ {
+- const char *font_path = SRCDIR
"/tests/resources/LiberationSans-Regular.ttf";
++ const char *font_path = "/tests/resources/LiberationSans-
Regular.ttf";
+

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +2 -0
+     if (render->font_config_for_testing != NULL)
+         return;
meta/recipes-gnome/librsvg/librsvg_2.40.20.bb +0 -0
index 7f98127fd01..6dd0533a5de 100644
@@ -20,6 +20,7 @@ inherit gnomebase gtk-doc pixbufcache upstream-

version-is-even gobject-introspec

 SRC_URI += "file://gtk-option.patch \
             file://0001-Auto-detect-Bsymbolic-fixes-configure-on-

macOS.patch \
+ file://0001-Remove-non-reproducible-SRCDIR.patch \
"

SRC_URI[archive.md5sum] = "4949d313b0c5d9161a5c259104af5568"

Signature · 1 line
2.23.0
#2 lore raw
Quoted 39 lines · Khem Raj
Quoted 37 lines · Joshua Watt

librsvg was encoding the path to the build directory in order to find a
font file for testing. This wouldn't work in OE anyway since the build
directory isn't present at that exact location on the target, so remove
the offending path to make the build reproducible.

---
 .../0001-Remove-non-reproducible-SRCDIR.patch | 30
+++++++++++++++++++
 meta/recipes-gnome/librsvg/librsvg_2.40.20.bb |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-gnome/librsvg/librsvg/0001-Remove-

non-reproducible-SRCDIR.patch

(quoted diff) +0 -0

reproducible-SRCDIR.patch b/meta/recipes-gnome/librsvg/librsvg/0001- Remove-non-reproducible-SRCDIR.patch
new file mode 100644
index 00000000000..75fc7f9d0b9

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +0 -0

reproducible-SRCDIR.patch

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +1 -0
@@ -0,0 +1,30 @@
+From bea5156cd7e7122715b26c769c35928141a1da2c Mon Sep 17 00:00:00

2001

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +5 -0
+From: Joshua Watt <[email protected]>
+Date: Mon, 18 Nov 2019 14:46:34 -0600
+Subject: [PATCH] Remove non-reproducible SRCDIR
+
+Removes SRCDIR as the prefix for finding the test font. This

wouldn't

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +3 -0
+work anyway, since that path is not present on the target.
+
+This patch is specific to OE, since it appears that this entire
Quoted 8 lines
Quoted 5 lines

method

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +3 -0
+of testing was removed when upstream was re-written in rust
+
+Upstream-Status: Inappropriate [OE-specific, no longer present

upstream]

what replaced it ( just curious ), can we backport the fix that removed it or made obsolete ?

A significant portion of the library was re-written in rust. This code appears to be only for internal testing and wasn't preserved when it was re-written (at least I couldn't find it in my cursory inspection). We haven't been able to upgrade the library due to lack of rust support in oe-core.

Quoted 41 lines
Quoted 40 lines
meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +10 -0
+Signed-off-by: Joshua Watt <[email protected]>
+---
+ rsvg-cairo-draw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
+index caa9104..cfb7ed2 100644
+--- a/rsvg-cairo-draw.c
++++ b/rsvg-cairo-draw.c
+@@ -398,7 +398,7 @@ set_font_options_for_testing (PangoContext

*context)
+ static void
+ create_font_config_for_testing (RsvgCairoRender *render)
+ {
+- const char *font_path = SRCDIR
"/tests/resources/LiberationSans-Regular.ttf";
++ const char *font_path = "/tests/resources/LiberationSans-
Regular.ttf";

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +3 -0
+
+     if (render->font_config_for_testing != NULL)
+         return;
meta/recipes-gnome/librsvg/librsvg_2.40.20.bb +0 -0
index 7f98127fd01..6dd0533a5de 100644
@@ -20,6 +20,7 @@ inherit gnomebase gtk-doc pixbufcache upstream-

version-is-even gobject-introspec

 SRC_URI += "file://gtk-option.patch \
             file://0001-Auto-detect-Bsymbolic-fixes-configure-on-

macOS.patch \
+ file://0001-Remove-non-reproducible-SRCDIR.patch \
"

SRC_URI[archive.md5sum] = "4949d313b0c5d9161a5c259104af5568"
--
2.23.0

#3 lore raw
Quoted 50 lines · Joshua Watt
Quoted 39 lines · Khem Raj
Quoted 37 lines · Joshua Watt

librsvg was encoding the path to the build directory in order to find a
font file for testing. This wouldn't work in OE anyway since the build
directory isn't present at that exact location on the target, so remove
the offending path to make the build reproducible.

---
 .../0001-Remove-non-reproducible-SRCDIR.patch | 30
+++++++++++++++++++
 meta/recipes-gnome/librsvg/librsvg_2.40.20.bb |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-gnome/librsvg/librsvg/0001-Remove-

non-reproducible-SRCDIR.patch

(quoted diff) +0 -0

reproducible-SRCDIR.patch b/meta/recipes-gnome/librsvg/librsvg/0001- Remove-non-reproducible-SRCDIR.patch
new file mode 100644
index 00000000000..75fc7f9d0b9

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +0 -0

reproducible-SRCDIR.patch

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +1 -0
@@ -0,0 +1,30 @@
+From bea5156cd7e7122715b26c769c35928141a1da2c Mon Sep 17 00:00:00

2001

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +5 -0
+From: Joshua Watt <[email protected]>
+Date: Mon, 18 Nov 2019 14:46:34 -0600
+Subject: [PATCH] Remove non-reproducible SRCDIR
+
+Removes SRCDIR as the prefix for finding the test font. This

wouldn't

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +3 -0
+work anyway, since that path is not present on the target.
+
+This patch is specific to OE, since it appears that this entire
Quoted 8 lines
Quoted 5 lines

method

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +3 -0
+of testing was removed when upstream was re-written in rust
+
+Upstream-Status: Inappropriate [OE-specific, no longer present

upstream]

what replaced it ( just curious ), can we backport the fix that removed it or made obsolete ?

Quoted 6 lines

A significant portion of the library was re-written in rust. This code appears to be only for internal testing and wasn't preserved when it was re-written (at least I couldn't find it in my cursory inspection). We haven't been able to upgrade the library due to lack of rust support in oe-core.

ah thanks. perhaps librsvg should be moved to meta-gnome or other layer which can depend on meta-rust. there are 3 recipes in oe-core which seem to depend on it and they all can use packageconfig to use it.

Quoted 41 lines
Quoted 41 lines
Quoted 40 lines
meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +10 -0
+Signed-off-by: Joshua Watt <[email protected]>
+---
+ rsvg-cairo-draw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
+index caa9104..cfb7ed2 100644
+--- a/rsvg-cairo-draw.c
++++ b/rsvg-cairo-draw.c
+@@ -398,7 +398,7 @@ set_font_options_for_testing (PangoContext

*context)
+ static void
+ create_font_config_for_testing (RsvgCairoRender *render)
+ {
+- const char *font_path = SRCDIR
"/tests/resources/LiberationSans-Regular.ttf";
++ const char *font_path = "/tests/resources/LiberationSans-
Regular.ttf";

meta/recipes-gnome/librsvg/librsvg/0001-Remove-non- new file +3 -0
+
+     if (render->font_config_for_testing != NULL)
+         return;
meta/recipes-gnome/librsvg/librsvg_2.40.20.bb +0 -0
index 7f98127fd01..6dd0533a5de 100644
@@ -20,6 +20,7 @@ inherit gnomebase gtk-doc pixbufcache upstream-

version-is-even gobject-introspec

 SRC_URI += "file://gtk-option.patch \
             file://0001-Auto-detect-Bsymbolic-fixes-configure-on-

macOS.patch \
+ file://0001-Remove-non-reproducible-SRCDIR.patch \
"

SRC_URI[archive.md5sum] = "4949d313b0c5d9161a5c259104af5568"
--
2.23.0