public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH v1 3/5] wip: meson: add install-{docs,doc-html,doc-man} targets
4+ messages / 3 participants
[nested] [flat]

* [PATCH v1 3/5] wip: meson: add install-{docs,doc-html,doc-man} targets
@ 2023-03-15 23:43  Andres Freund <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Andres Freund @ 2023-03-15 23:43 UTC (permalink / raw)

---
 meson.build              |  2 +-
 doc/src/sgml/meson.build | 27 ++++++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index b4b87f1a9fc..0ffeffa9edc 100644
--- a/meson.build
+++ b/meson.build
@@ -504,7 +504,7 @@ dir_man = get_option('mandir')
 
 # FIXME: These used to be separately configurable - worth adding?
 dir_doc = get_option('datadir') / 'doc' / 'postgresql'
-dir_doc_html = dir_doc
+dir_doc_html = dir_doc / 'html'
 
 dir_locale = get_option('localedir')
 
diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build
index e6fe124c7bc..2da737c8af4 100644
--- a/doc/src/sgml/meson.build
+++ b/doc/src/sgml/meson.build
@@ -1,6 +1,7 @@
 # Copyright (c) 2022-2023, PostgreSQL Global Development Group
 
 docs = []
+installdocs = []
 alldocs = []
 doc_generated = []
 
@@ -120,8 +121,16 @@ if xsltproc_bin.found()
   )
   alldocs += html
 
-  # build multi-page html docs as part of docs target
+  install_doc_html = run_target('install-doc-html',
+    command: [
+      python, install_files, '--prefix', dir_prefix,
+      '--install-dir-contents', dir_doc_html, html.full_path()],
+    depends: html)
+
+  # build and install multi-page html docs as part of docs target
   docs += html
+  installdocs += install_doc_html
+
 
   htmlhelp = custom_target('htmlhelp',
     input: ['stylesheet-hh.xsl', postgres_full_xml],
@@ -208,6 +217,21 @@ if xsltproc_bin.found()
     build_by_default: false,
   )
   alldocs += man
+
+  mans = []
+  foreach man_n : man.to_list()
+    mans += man_n.full_path()
+  endforeach
+
+  install_doc_man = run_target('install-doc-man',
+    command: [
+      python, install_files, '--prefix', dir_prefix,
+      '--install-dirs', dir_man, mans],
+    depends: man)
+
+  # even though we don't want to build man pages as part of 'docs', we do want
+  # to install them as part of install-docs
+  installdocs += install_doc_man
 endif
 
 
@@ -266,6 +290,7 @@ if docs.length() == 0
   run_target('docs', command: [missing, 'xsltproc'])
 else
   alias_target('docs', docs)
+  alias_target('install-docs', installdocs)
 endif
 
 if alldocs.length() == 0
-- 
2.38.0


--vw474qzskdrrkpyy
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
	filename="v1-0004-docs-html-copy-images-to-output-as-part-of-xslt-b.patch"



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

* [PATCH v2 3/8] wip: meson: add install-{docs,doc-html,doc-man} targets
@ 2023-03-15 23:43  Andres Freund <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Andres Freund @ 2023-03-15 23:43 UTC (permalink / raw)

---
 meson.build              |  2 +-
 doc/src/sgml/meson.build | 67 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 84fe2c3d4c3..33dd5b43ed5 100644
--- a/meson.build
+++ b/meson.build
@@ -504,7 +504,7 @@ dir_man = get_option('mandir')
 
 # FIXME: These used to be separately configurable - worth adding?
 dir_doc = get_option('datadir') / 'doc' / 'postgresql'
-dir_doc_html = dir_doc
+dir_doc_html = dir_doc / 'html'
 
 dir_locale = get_option('localedir')
 
diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build
index e6fe124c7bc..f24acebb0fe 100644
--- a/doc/src/sgml/meson.build
+++ b/doc/src/sgml/meson.build
@@ -1,6 +1,7 @@
 # Copyright (c) 2022-2023, PostgreSQL Global Development Group
 
 docs = []
+installdocs = []
 alldocs = []
 doc_generated = []
 
@@ -120,8 +121,21 @@ if xsltproc_bin.found()
   )
   alldocs += html
 
-  # build multi-page html docs as part of docs target
+  install_doc_html = custom_target('install-html',
+    output: 'install-html', input: html,
+    command: [
+      python, install_files, '--prefix', dir_prefix,
+      '--install-dir-contents', dir_doc_html, '@INPUT@'],
+    depends: html,
+    build_always_stale: true,
+    build_by_default: false,
+  )
+  alias_target('install-doc-html', install_doc_html)
+
+  # build and install multi-page html docs as part of docs target
   docs += html
+  installdocs += install_doc_html
+
 
   htmlhelp = custom_target('htmlhelp',
     input: ['stylesheet-hh.xsl', postgres_full_xml],
@@ -208,6 +222,20 @@ if xsltproc_bin.found()
     build_by_default: false,
   )
   alldocs += man
+
+  install_doc_man = custom_target('install-man',
+    output: 'install-man', input: man,
+    command: [
+      python, install_files, '--prefix', dir_prefix,
+      '--install-dirs', dir_man, '@INPUT@'],
+    build_always_stale: true,
+    build_by_default: false,
+  )
+  alias_target('install-doc-man', install_doc_man)
+
+  # even though we don't want to build man pages as part of 'docs', we do want
+  # to install them as part of install-docs
+  installdocs += install_doc_man
 endif
 
 
@@ -262,10 +290,47 @@ if pandoc.found() and xsltproc_bin.found()
   alldocs += postgres_epub
 endif
 
+
+##
+## Experimental Texinfo targets
+##
+
+db2x_xsltproc = find_program('db2x_xsltproc', native: true, required: false)
+db2x_texixml = find_program('db2x_texixml', native: true, required: false)
+makeinfo = find_program('makeinfo', native: true, required: false)
+
+if db2x_texixml.found() and db2x_xsltproc.found() and makeinfo.found()
+    postgres_texixml = custom_target('postgres.texixml',
+      input: postgres_full_xml,
+      output: 'postgres.texixml',
+      command: [db2x_xsltproc, '-s', 'texi',
+                '-g', 'output-file=postgres',
+                '@INPUT@', '-o', '@OUTPUT@'],
+      build_by_default: false,
+    )
+    postgres_texi = custom_target('postgres.texi',
+      input: postgres_texixml,
+      output: 'postgres.texi',
+      command: [db2x_texixml, '--encoding=utf-8', '@INPUT@',
+                '--output-dir=@OUTDIR@'],
+      build_by_default: false,
+    )
+    postgres_info = custom_target('postgres.info',
+      input: postgres_texi,
+      output: 'postgres.info',
+      command: [makeinfo, '--enable-encoding', '--no-split', '--no-validate',
+                '@INPUT@', '-o', '@OUTPUT0@'],
+      build_by_default: false,
+    )
+    alldocs += postgres_info
+endif
+
+
 if docs.length() == 0
   run_target('docs', command: [missing, 'xsltproc'])
 else
   alias_target('docs', docs)
+  alias_target('install-docs', installdocs)
 endif
 
 if alldocs.length() == 0
-- 
2.38.0


--az2jhiapsr25u55d
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
	filename="v2-0004-meson-add-install-quiet-world-targets.patch"



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

* Re: post-freeze damage control
@ 2024-04-09 12:46  Robert Haas <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Robert Haas @ 2024-04-09 12:46 UTC (permalink / raw)
  To: Tomas Vondra <[email protected]>; +Cc: Michael Paquier <[email protected]>; pgsql-hackers

On Tue, Apr 9, 2024 at 7:24 AM Tomas Vondra
<[email protected]> wrote:
> I think it's a bit more nuanced, because it's about backups/restore. The
> bug might be subtle, and you won't learn about it until the moment when
> you need to restore (or perhaps even long after that). At which point
> "You might have taken the backup in some other way." is not really a
> viable exit route.
>
> Anyway, I'm still not worried about this particular feature, and I'll
> keep doing the stress testing.

In all sincerity, I appreciate the endorsement. Basically what's been
scaring me about this feature is the possibility that there's some
incurable design flaw that I've managed to completely miss. If it has
some more garden-variety bugs, that's still pretty bad: people will
potentially lose data and be unable to get it back. But, as long as
we're able to find the bugs and fix them, the situation should improve
over time until, hopefully, everybody trusts it roughly as much as we
trust, say, crash recovery. Perhaps even a bit more: I think this code
is much better-written than our crash recovery code, which has grown
into a giant snarl that nobody seems able to untangle, despite
multiple refactoring attempts. However, if there's some reason why the
approach is fundamentally unsound which I and others have failed to
detect, then we're at risk of shipping a feature that is irretrievably
broken. That would really suck.

I'm fairly hopeful that there is no such design defect: I certainly
can't think of one. But, it's much easier to imagine an incurable
problem here than with, say, the recent pruning+freezing changes.
Those changes might have bugs, and those bugs might be hard to find,
but if they do exist and are found, they can be fixed. Here, it's a
little less obvious that that's true. We're relying on our ability, at
incremental backup time, to sort out from the manifest and the WAL
summaries, what needs to be included in the backup in order for a
subsequent pg_combinebackup operation to produce correct results. The
basic idea is simple enough, but the details are complicated, and it
feels like a subtle defect in the algorithm could potentially scuttle
the whole thing. I'd certainly appreciate having more smart people try
to think of things that I might have overlooked.

-- 
Robert Haas
EDB: http://www.enterprisedb.com






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

* Re: post-freeze damage control
@ 2024-04-09 13:34  Stefan Fercot <[email protected]>
  parent: Robert Haas <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Stefan Fercot @ 2024-04-09 13:34 UTC (permalink / raw)
  To: Robert Haas <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Michael Paquier <[email protected]>; pgsql-hackers

Hi,

On Tuesday, April 9th, 2024 at 2:46 PM, Robert Haas <[email protected]> wrote:
> In all sincerity, I appreciate the endorsement. Basically what's been
> scaring me about this feature is the possibility that there's some
> incurable design flaw that I've managed to completely miss. If it has
> some more garden-variety bugs, that's still pretty bad: people will
> potentially lose data and be unable to get it back. But, as long as
> we're able to find the bugs and fix them, the situation should improve
> over time until, hopefully, everybody trusts it roughly as much as we
> trust, say, crash recovery. Perhaps even a bit more: I think this code
> is much better-written than our crash recovery code, which has grown
> into a giant snarl that nobody seems able to untangle, despite
> multiple refactoring attempts. However, if there's some reason why the
> approach is fundamentally unsound which I and others have failed to
> detect, then we're at risk of shipping a feature that is irretrievably
> broken. That would really suck.

IMHO it totally worth shipping such long-waited feature sooner than later.
Yes, it is a complex one, but you started advertising it since last January already, so people should already be able to play with it in Beta.

And as you mentioned in your blog about the evergreen backup:

> But if you're anything like me, you'll already see that this arrangement
> has two serious weaknesses. First, if there are any data-corrupting bugs
> in pg_combinebackup or any of the server-side code that supports
> incremental backup, this approach could get you into big trouble.

At some point, the only way to really validate a backup is to actually try to restore it.
And if people get encouraged to do that faster thanks to incremental backups, they could detect potential issues sooner.
Ultimately, users will still need their full backups and WAL archives.
If pg_combinebackup fails for any reason, the fix will be to perform the recovery from the full backup directly.
They still should be able to recover, just slower.

--
Stefan FERCOT
Data Egret (https://dataegret.com)






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


end of thread, other threads:[~2024-04-09 13:34 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 23:43 [PATCH v1 3/5] wip: meson: add install-{docs,doc-html,doc-man} targets Andres Freund <[email protected]>
2023-03-15 23:43 [PATCH v2 3/8] wip: meson: add install-{docs,doc-html,doc-man} targets Andres Freund <[email protected]>
2024-04-09 12:46 Re: post-freeze damage control Robert Haas <[email protected]>
2024-04-09 13:34 ` Re: post-freeze damage control Stefan Fercot <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox