pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Move snowball_create.sql creation into perl file
7+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2023-05-23 5df5bea290  Fix the install rule for snowball_create.sql.
* pgsql: Move snowball_create.sql creation into perl file
@ 2022-07-18 19:56 Andres Freund <andres@anarazel.de>
  2023-05-23 13:47 ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Andres Freund @ 2022-07-18 19:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Move snowball_create.sql creation into perl file

This is in preparation for building postgres with meson / ninja.

We already have duplicated code for this between the make and msvc
builds. Adding a third copy seems like a bad plan, thus move the generation
into a perl script.

As we don't want to rely on perl being available for builds from tarballs,
generate the file during distprep.

Author: Peter Eisentraut <peter@eisentraut.org>
Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/5e216522-ba3c-f0e6-7f97-5276d0270029@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b3a0d8324cf1f02c04a7099a436cfd68cfbf4566

Modified Files
--------------
src/backend/snowball/Makefile           | 106 ++++++-----------------
src/backend/snowball/snowball_create.pl | 148 ++++++++++++++++++++++++++++++++
src/tools/msvc/Install.pm               |  36 +-------
3 files changed, 179 insertions(+), 111 deletions(-)



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

* Re: pgsql: Move snowball_create.sql creation into perl file
  2022-07-18 19:56 pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
@ 2023-05-23 13:47 ` Christoph Berg <myon@debian.org>
  2023-05-23 14:06   ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Christoph Berg @ 2023-05-23 13:47 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-hackers@lists.postgresql.org, PostgreSQL Packagers <pgsql-packagers@lists.postgresql.org>

Re: Andres Freund
> Move snowball_create.sql creation into perl file
> 
> This is in preparation for building postgres with meson / ninja.
> 
> We already have duplicated code for this between the make and msvc
> builds. Adding a third copy seems like a bad plan, thus move the generation
> into a perl script.
> 
> As we don't want to rely on perl being available for builds from tarballs,
> generate the file during distprep.
> 
> Author: Peter Eisentraut <peter@eisentraut.org>
> Author: Andres Freund <andres@anarazel.de>
> Discussion: https://postgr.es/m/5e216522-ba3c-f0e6-7f97-5276d0270029@enterprisedb.com

Hi,

this seems to have broken out-of-tree builds from tarballs:

make -C backend/snowball install
make[3]: Entering directory '/srv/projects/postgresql/debian/16/build/src/backend/snowball'
/bin/mkdir -p '/srv/projects/postgresql/debian/16/build/tmp_install/usr/lib/postgresql/16/lib'
/bin/mkdir -p '/srv/projects/postgresql/debian/16/build/tmp_install/usr/share/postgresql/16' '/srv/projects/postgresql/debian/16/build/tmp_install/usr/share/postgresql/16/tsearch_data'
/usr/bin/install -c -m 755  dict_snowball.so '/srv/projects/postgresql/debian/16/build/tmp_install/usr/lib/postgresql/16/lib/dict_snowball.so'
/usr/bin/install -c -m 644 snowball_create.sql '/srv/projects/postgresql/debian/16/build/tmp_install/usr/share/postgresql/16'
/usr/bin/install: cannot stat 'snowball_create.sql': No such file or directory
make[3]: *** [Makefile:110: install] Error 1

The file is present in src/backend/snowball/ but not in build/src/backend/snowball/:

-rw-r--r-- 1 myon myon 44176 22. Mai 21:20 src/backend/snowball/snowball_create.sql

Christoph





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

* Re: pgsql: Move snowball_create.sql creation into perl file
  2022-07-18 19:56 pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
  2023-05-23 13:47 ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
@ 2023-05-23 14:06   ` Christoph Berg <myon@debian.org>
  2023-05-23 14:46     ` Re: pgsql: Move snowball_create.sql creation into perl file Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Christoph Berg @ 2023-05-23 14:06 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; PostgreSQL Packagers <pgsql-packagers@lists.postgresql.org>

Re: To Andres Freund
> this seems to have broken out-of-tree builds from tarballs:
> 
> /usr/bin/install -c -m 644 snowball_create.sql '/srv/projects/postgresql/debian/16/build/tmp_install/usr/share/postgresql/16'
> /usr/bin/install: cannot stat 'snowball_create.sql': No such file or directory

Fortunately, there is an easy workaround, just delete
src/backend/snowball/snowball_create.sql before building, it will then
be recreated in the proper build directory.

Christoph





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

* Re: pgsql: Move snowball_create.sql creation into perl file
  2022-07-18 19:56 pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
  2023-05-23 13:47 ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  2023-05-23 14:06   ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
@ 2023-05-23 14:46     ` Tom Lane <tgl@sss.pgh.pa.us>
  2023-05-23 14:50       ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  2023-05-23 18:41       ` Re: pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
  0 siblings, 2 replies; 7+ messages in thread

From: Tom Lane @ 2023-05-23 14:46 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Andres Freund <andres@anarazel.de>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; PostgreSQL Packagers <pgsql-packagers@lists.postgresql.org>

Christoph Berg <myon@debian.org> writes:
>> this seems to have broken out-of-tree builds from tarballs:
>> 
>> /usr/bin/install -c -m 644 snowball_create.sql '/srv/projects/postgresql/debian/16/build/tmp_install/usr/share/postgresql/16'
>> /usr/bin/install: cannot stat 'snowball_create.sql': No such file or directory

I think the attached will do for a proper fix.  I'm not inclined
to re-wrap just for this.

			regards, tom lane

Attachments:

fix-snowball-install-rule.patch (text/x-diff, 784B) download diff --git a/src/backend/snowball/Makefile b/src/backend/snowball/Makefile index 29076371db..4bebfa0250 100644 --- a/src/backend/snowball/Makefile +++ b/src/backend/snowball/Makefile @@ -106,10 +106,13 @@ $(SQLSCRIPT): snowball_create.pl snowball_func.sql.in snowball.sql.in distprep: $(SQLSCRIPT) -install: all installdirs install-lib - $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)' +install: all installdirs install-lib install-script $(INSTALL_DATA) $(addprefix $(srcdir)/stopwords/,$(stop_files)) '$(DESTDIR)$(datadir)/$(DICTDIR)' +# $(SQLSCRIPT) might be in the srcdir or the build dir +install-script: $(SQLSCRIPT) + $(INSTALL_DATA) $< '$(DESTDIR)$(datadir)' + installdirs: installdirs-lib $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(datadir)/$(DICTDIR)' =
^ permalink raw reply [nested|flat] 7+ messages in thread

* Re: pgsql: Move snowball_create.sql creation into perl file
  2022-07-18 19:56 pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
  2023-05-23 13:47 ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  2023-05-23 14:06   ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  2023-05-23 14:46     ` Re: pgsql: Move snowball_create.sql creation into perl file Tom Lane <tgl@sss.pgh.pa.us>
@ 2023-05-23 14:50       ` Christoph Berg <myon@debian.org>
  1 sibling, 0 replies; 7+ messages in thread

From: Christoph Berg @ 2023-05-23 14:50 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andres Freund <andres@anarazel.de>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; PostgreSQL Packagers <pgsql-packagers@lists.postgresql.org>

Re: Tom Lane
> I think the attached will do for a proper fix.  I'm not inclined
> to re-wrap just for this.

Sure, I just posted it here in case others run into the same problem.

Thanks!

Christoph





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

* Re: pgsql: Move snowball_create.sql creation into perl file
  2022-07-18 19:56 pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
  2023-05-23 13:47 ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  2023-05-23 14:06   ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  2023-05-23 14:46     ` Re: pgsql: Move snowball_create.sql creation into perl file Tom Lane <tgl@sss.pgh.pa.us>
@ 2023-05-23 18:41       ` Andres Freund <andres@anarazel.de>
  2023-05-23 18:51         ` Re: pgsql: Move snowball_create.sql creation into perl file Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 7+ messages in thread

From: Andres Freund @ 2023-05-23 18:41 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Christoph Berg <myon@debian.org>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; PostgreSQL Packagers <pgsql-packagers@lists.postgresql.org>

Hi,

On 2023-05-23 10:46:30 -0400, Tom Lane wrote:
> Christoph Berg <myon@debian.org> writes:
> >> this seems to have broken out-of-tree builds from tarballs:
> >> 
> >> /usr/bin/install -c -m 644 snowball_create.sql '/srv/projects/postgresql/debian/16/build/tmp_install/usr/share/postgresql/16'
> >> /usr/bin/install: cannot stat 'snowball_create.sql': No such file or directory
> 
> I think the attached will do for a proper fix.

Thanks.


> I'm not inclined to re-wrap just for this.

Agreed.


I wonder if we should add a CI task to test creating a tarball and building
from it, both inside the source directory and as a vpath build? We rebuild for
both gcc and clang, each with assertions and without, to check if there are
warnings. We could probably just switch to building from the tarball for some
of those.

I guess I need to go and check how long the "release" tarball generation
takes...

Greetings,

Andres Freund





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

* Re: pgsql: Move snowball_create.sql creation into perl file
  2022-07-18 19:56 pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
  2023-05-23 13:47 ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  2023-05-23 14:06   ` Re: pgsql: Move snowball_create.sql creation into perl file Christoph Berg <myon@debian.org>
  2023-05-23 14:46     ` Re: pgsql: Move snowball_create.sql creation into perl file Tom Lane <tgl@sss.pgh.pa.us>
  2023-05-23 18:41       ` Re: pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
@ 2023-05-23 18:51         ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2023-05-23 18:51 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Christoph Berg <myon@debian.org>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

[ dropping -packagers ]

Andres Freund <andres@anarazel.de> writes:
> I guess I need to go and check how long the "release" tarball generation
> takes...

It's quick except for the documentation-generating steps.  Maybe
we could test that part only once?

			regards, tom lane





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


end of thread, other threads:[~2023-05-23 18:51 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 19:56 pgsql: Move snowball_create.sql creation into perl file Andres Freund <andres@anarazel.de>
2023-05-23 13:47 ` Christoph Berg <myon@debian.org>
2023-05-23 14:06   ` Christoph Berg <myon@debian.org>
2023-05-23 14:46     ` Tom Lane <tgl@sss.pgh.pa.us>
2023-05-23 14:50       ` Christoph Berg <myon@debian.org>
2023-05-23 18:41       ` Andres Freund <andres@anarazel.de>
2023-05-23 18:51         ` Tom Lane <tgl@sss.pgh.pa.us>

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