perfbook.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -perfbook 0/3] Work around errors of unstable Inkscape
@ 2023-10-13 14:33 Akira Yokosawa
  2023-10-13 14:38 ` [PATCH -perfbook 1/3] Ignore error " Akira Yokosawa
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Akira Yokosawa @ 2023-10-13 14:33 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

Hi Paul,

I expected the crashing bug in Fedora's distro Inkscape would be
resolved by the time of Fedora 39 release.
I tested Fedora 39 beta and was disappointed to see more or less the
same crashes of command-line runs of Inkscape as those under Fedora 38.

As a matter of fact, even when Inkscape crashes, the export of PDF
is complete most of the time.  So the crashing bug can be worked
around by ignoring the error code from Inkscape and continue building.

This patch set implements the ad-hoc workaround in build scripts.

As you can see in Patch 1/3, the workaround is enabled by default.
This is because enabling it won't do any harm on systems with
stable Inkscape.

I might be able to add some heuristics not to enable the workaround
for stable Inkscape installs, but that can wait.

Ubuntu releases 22.04LTS, 23.04, and 23.10 are free of this issue.

        Thanks, Akira
--
Akira Yokosawa (3):
  Ignore error of unstable Inkscape
  Ignore emergency-save SVG files from Inkscape
  Make sure all PDF conversions are complete

 .gitignore |  1 +
 Makefile   | 17 ++++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)


base-commit: 84759ebac65a03aa28c5b02007e6c472b3416d3d
-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH -perfbook 1/3] Ignore error of unstable Inkscape
  2023-10-13 14:33 [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Akira Yokosawa
@ 2023-10-13 14:38 ` Akira Yokosawa
  2023-10-13 14:39 ` [PATCH -perfbook 2/3] Ignore emergency-save SVG files from Inkscape Akira Yokosawa
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Akira Yokosawa @ 2023-10-13 14:38 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

Recently, conversions of SVG --> PDF are hit by unstability of
command-line runs of Inkscape under the GNOME session/window manager.

There is an issue ticket at the upstream Inkscape repository [1].

It was closed after a bugfix in glib2, but Fedora 38 has not
received the fix.  Furthermore, pre-release Fedora 39, as well as
openSUSE tumbleweed, still has the very similar symptoms.

As a matter of fact, the conversion is properly finished most
of the time when the Inkscape error happened.

So let's add a make variable IGNORE_INKSCAPE_ERROR and ignore error
code from Inkscape when it is enabled.  It is enabled by default.

[1] Issue #4177 "glib2 2.76.0 breaks Command Line export" at
    https://gitlab.com/inkscape/inkscape/-/issues/

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Makefile b/Makefile
index f25baf27d8ad..18639b60cece 100644
--- a/Makefile
+++ b/Makefile
@@ -109,6 +109,7 @@ INKSCAPE := $(shell $(WHICH) inkscape 2>/dev/null)
 ifdef INKSCAPE
   INKSCAPE_ONE := $(shell inkscape --version 2>/dev/null | grep -c "Inkscape 1")
 endif
+IGNORE_INKSCAPE_ERROR ?= 1
 LATEXPAND := $(shell $(WHICH) latexpand 2>/dev/null)
 QPDF := $(shell $(WHICH) qpdf 2>/dev/null)
 
@@ -481,7 +482,11 @@ endif
 ifeq ($(INKSCAPE_ONE),0)
 	@inkscape --export-pdf=$@ $<i > /dev/null 2>&1
 else
+  ifneq ($(IGNORE_INKSCAPE_ERROR),0)
+	-@inkscape -o $@ $<i > /dev/null 2>&1
+  else
 	@inkscape -o $@ $<i > /dev/null 2>&1
+  endif
 endif
 	@rm -f $<i
 ifeq ($(chkpagegroup),on)
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH -perfbook 2/3] Ignore emergency-save SVG files from Inkscape
  2023-10-13 14:33 [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Akira Yokosawa
  2023-10-13 14:38 ` [PATCH -perfbook 1/3] Ignore error " Akira Yokosawa
@ 2023-10-13 14:39 ` Akira Yokosawa
  2023-10-13 14:42 ` [PATCH -perfbook 3/3] Make sure all PDF conversions are complete Akira Yokosawa
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Akira Yokosawa @ 2023-10-13 14:39 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

When Inkscape is terminated by an error, it saves the SVG file
it was processing into an emergency-save SVG file.

In perfbook, this results in extra SVG files such as:

    - advsync/rt-regimes.svgi.2023_MM_DD_hh_mm_ss.0.svg
    - datastruct/hashzu-a.svgi.2023_MM_DD_hh_mm_ss.0.svg

Ignore those files in successive runs of make and remove them
in "make clean", "make cleanfigs", and "make cleanfigs-svg".

Update .gitignore as well.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 .gitignore | 1 +
 Makefile   | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index fa20ccb5de94..ce93394f53b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@
 *.epsi
 *__.eps
 *.svgi
+*.svg*.svg
 *.fcv
 *.ltms
 *.pdfp
diff --git a/Makefile b/Makefile
index 18639b60cece..6e220c2db524 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,9 @@ FIGSOURCES := $(wildcard */*.fig) $(wildcard */*/*.fig)
 
 EPSSOURCES_FROM_FIG := $(FIGSOURCES:%.fig=%.eps)
 
-SVGSOURCES := $(wildcard */*.svg)
+SVGSOURCES_ALL := $(wildcard */*.svg)
+SVG_EMERGENCY := $(wildcard */*.svg*.svg)
+SVGSOURCES := $(filter-out $(SVG_EMERGENCY),$(SVGSOURCES_ALL))
 FAKE_EPS_FROM_SVG := $(SVGSOURCES:%.svg=%.eps)
 PDFTARGETS_OF_SVG := $(SVGSOURCES:%.svg=%.pdf)
 
@@ -603,7 +605,7 @@ clean:
 	rm -f perfbook*.sil
 	rm -f CodeSamples/snippets.d
 	rm -f *.synctex*
-	@rm -f $(OBSOLETE_FILES) $(EPSSOURCES_TMP)
+	@rm -f $(OBSOLETE_FILES) $(EPSSOURCES_TMP) $(SVG_EMERGENCY)
 
 paper-clean:
 	rm -f $(BASE_DEPENDS)
@@ -627,7 +629,7 @@ cleanfigs-eps:
 	rm -f $(PDFTARGETS_OF_EPS)
 
 cleanfigs-svg:
-	rm -f $(PDFTARGETS_OF_SVG)
+	rm -f $(PDFTARGETS_OF_SVG) $(SVG_EMERGENCY)
 
 cleanfigs: cleanfigs-eps cleanfigs-svg
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH -perfbook 3/3] Make sure all PDF conversions are complete
  2023-10-13 14:33 [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Akira Yokosawa
  2023-10-13 14:38 ` [PATCH -perfbook 1/3] Ignore error " Akira Yokosawa
  2023-10-13 14:39 ` [PATCH -perfbook 2/3] Ignore emergency-save SVG files from Inkscape Akira Yokosawa
@ 2023-10-13 14:42 ` Akira Yokosawa
  2023-10-13 23:43 ` [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Paul E. McKenney
  2023-10-14 23:22 ` Akira Yokosawa
  4 siblings, 0 replies; 7+ messages in thread
From: Akira Yokosawa @ 2023-10-13 14:42 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

Crashes of Inkscape can disturb parallel runs of SVG --> PDF conversions.

Add a sub-make run of "make -j1 figs" in the early stage of latex
run to make sure any missing PDF figures can be prepared in time.

Note:
    If GNUmake's dependency check is perfect, when there were any
    missing PDF files remaining, the recipe of autodate.tex shouldn't
    run.  Unfortunately, it looks like that is not the case.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 6e220c2db524..3875c52b1570 100644
--- a/Makefile
+++ b/Makefile
@@ -267,6 +267,10 @@ endif
 autodate.tex: $(LATEXSOURCES) $(BIBSOURCES) $(LST_SOURCES) \
     $(PDFTARGETS_OF_EPS) $(PDFTARGETS_OF_SVG) $(FCVSNIPPETS) $(FCVSNIPPETS_VIA_LTMS) \
      $(GITREFSTAGS) utilities/autodate.sh
+ifneq ($(IGNORE_INKSCAPE_ERROR),0)
+	# Make sure all SVG --> PDF conversions are complete
+	$(MAKE) -j1 figs
+endif
 	sh utilities/autodate.sh
 
 perfbook_flat.tex: autodate.tex
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH -perfbook 0/3] Work around errors of unstable Inkscape
  2023-10-13 14:33 [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Akira Yokosawa
                   ` (2 preceding siblings ...)
  2023-10-13 14:42 ` [PATCH -perfbook 3/3] Make sure all PDF conversions are complete Akira Yokosawa
@ 2023-10-13 23:43 ` Paul E. McKenney
  2023-10-14 23:22 ` Akira Yokosawa
  4 siblings, 0 replies; 7+ messages in thread
From: Paul E. McKenney @ 2023-10-13 23:43 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Fri, Oct 13, 2023 at 11:33:18PM +0900, Akira Yokosawa wrote:
> Hi Paul,
> 
> I expected the crashing bug in Fedora's distro Inkscape would be
> resolved by the time of Fedora 39 release.
> I tested Fedora 39 beta and was disappointed to see more or less the
> same crashes of command-line runs of Inkscape as those under Fedora 38.
> 
> As a matter of fact, even when Inkscape crashes, the export of PDF
> is complete most of the time.  So the crashing bug can be worked
> around by ignoring the error code from Inkscape and continue building.
> 
> This patch set implements the ad-hoc workaround in build scripts.
> 
> As you can see in Patch 1/3, the workaround is enabled by default.
> This is because enabling it won't do any harm on systems with
> stable Inkscape.
> 
> I might be able to add some heuristics not to enable the workaround
> for stable Inkscape installs, but that can wait.
> 
> Ubuntu releases 22.04LTS, 23.04, and 23.10 are free of this issue.

Ouch!

But look like a good approach.  Queued and pushed, thank you!

							Thanx, Paul

>         Thanks, Akira
> --
> Akira Yokosawa (3):
>   Ignore error of unstable Inkscape
>   Ignore emergency-save SVG files from Inkscape
>   Make sure all PDF conversions are complete
> 
>  .gitignore |  1 +
>  Makefile   | 17 ++++++++++++++---
>  2 files changed, 15 insertions(+), 3 deletions(-)
> 
> 
> base-commit: 84759ebac65a03aa28c5b02007e6c472b3416d3d
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -perfbook 0/3] Work around errors of unstable Inkscape
  2023-10-13 14:33 [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Akira Yokosawa
                   ` (3 preceding siblings ...)
  2023-10-13 23:43 ` [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Paul E. McKenney
@ 2023-10-14 23:22 ` Akira Yokosawa
  2023-10-14 23:57   ` Paul E. McKenney
  4 siblings, 1 reply; 7+ messages in thread
From: Akira Yokosawa @ 2023-10-14 23:22 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

On 2023/10/13 23:33, Akira Yokosawa wrote:
> Hi Paul,
> 
> I expected the crashing bug in Fedora's distro Inkscape would be
> resolved by the time of Fedora 39 release.
> I tested Fedora 39 beta and was disappointed to see more or less the
> same crashes of command-line runs of Inkscape as those under Fedora 38.
> 
> As a matter of fact, even when Inkscape crashes, the export of PDF
> is complete most of the time.  So the crashing bug can be worked
> around by ignoring the error code from Inkscape and continue building.
> 
> This patch set implements the ad-hoc workaround in build scripts.
> 
> As you can see in Patch 1/3, the workaround is enabled by default.
> This is because enabling it won't do any harm on systems with
> stable Inkscape.
> 
> I might be able to add some heuristics not to enable the workaround
> for stable Inkscape installs, but that can wait.
> 
> Ubuntu releases 22.04LTS, 23.04, and 23.10 are free of this issue.

No, Ubuntu 23.04 shows this symptom, rarer than Fedora but still...

        Thanks, Akira

> 
>         Thanks, Akira
> --
> Akira Yokosawa (3):
>   Ignore error of unstable Inkscape
>   Ignore emergency-save SVG files from Inkscape
>   Make sure all PDF conversions are complete
> 
>  .gitignore |  1 +
>  Makefile   | 17 ++++++++++++++---
>  2 files changed, 15 insertions(+), 3 deletions(-)
> 
> 
> base-commit: 84759ebac65a03aa28c5b02007e6c472b3416d3d

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -perfbook 0/3] Work around errors of unstable Inkscape
  2023-10-14 23:22 ` Akira Yokosawa
@ 2023-10-14 23:57   ` Paul E. McKenney
  0 siblings, 0 replies; 7+ messages in thread
From: Paul E. McKenney @ 2023-10-14 23:57 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Sun, Oct 15, 2023 at 08:22:44AM +0900, Akira Yokosawa wrote:
> On 2023/10/13 23:33, Akira Yokosawa wrote:
> > Hi Paul,
> > 
> > I expected the crashing bug in Fedora's distro Inkscape would be
> > resolved by the time of Fedora 39 release.
> > I tested Fedora 39 beta and was disappointed to see more or less the
> > same crashes of command-line runs of Inkscape as those under Fedora 38.
> > 
> > As a matter of fact, even when Inkscape crashes, the export of PDF
> > is complete most of the time.  So the crashing bug can be worked
> > around by ignoring the error code from Inkscape and continue building.
> > 
> > This patch set implements the ad-hoc workaround in build scripts.
> > 
> > As you can see in Patch 1/3, the workaround is enabled by default.
> > This is because enabling it won't do any harm on systems with
> > stable Inkscape.
> > 
> > I might be able to add some heuristics not to enable the workaround
> > for stable Inkscape installs, but that can wait.
> > 
> > Ubuntu releases 22.04LTS, 23.04, and 23.10 are free of this issue.
> 
> No, Ubuntu 23.04 shows this symptom, rarer than Fedora but still...

Even more reason for it to be applied, then.  ;-)

Again, thank you!

							Thanx, Paul

>         Thanks, Akira
> 
> > 
> >         Thanks, Akira
> > --
> > Akira Yokosawa (3):
> >   Ignore error of unstable Inkscape
> >   Ignore emergency-save SVG files from Inkscape
> >   Make sure all PDF conversions are complete
> > 
> >  .gitignore |  1 +
> >  Makefile   | 17 ++++++++++++++---
> >  2 files changed, 15 insertions(+), 3 deletions(-)
> > 
> > 
> > base-commit: 84759ebac65a03aa28c5b02007e6c472b3416d3d

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-10-14 23:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-13 14:33 [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Akira Yokosawa
2023-10-13 14:38 ` [PATCH -perfbook 1/3] Ignore error " Akira Yokosawa
2023-10-13 14:39 ` [PATCH -perfbook 2/3] Ignore emergency-save SVG files from Inkscape Akira Yokosawa
2023-10-13 14:42 ` [PATCH -perfbook 3/3] Make sure all PDF conversions are complete Akira Yokosawa
2023-10-13 23:43 ` [PATCH -perfbook 0/3] Work around errors of unstable Inkscape Paul E. McKenney
2023-10-14 23:22 ` Akira Yokosawa
2023-10-14 23:57   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).