Re: Bug: pg_regress makefile does not always copy refint.so - Mailing list pgsql-hackers

From Donghang Lin
Subject Re: Bug: pg_regress makefile does not always copy refint.so
Date
Msg-id CO2PR0801MB2247F47FDFA88719A6820E04F9289@CO2PR0801MB2247.namprd08.prod.outlook.com
Whole thread Raw
In response to Re: Bug: pg_regress makefile does not always copy refint.so  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Bug: pg_regress makefile does not always copy refint.so  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers

Hi Alvaro,

 

> I have a somewhat-related-but-not-really complaint.  I recently had need to

> have refint.so, autoinc.so and regress.so in the install directory; but it

> turns out that there's no provision at all to get them installed.

 

True, we also noticed this build bug described above by copying *.so and pg_regress binary around.

 

> I think it would be better to provide a Make rule to allow these files to be
> installed. 

I looked at what postgresql-test package provides today :

 

$ ls /usr/pgsql-15/lib/test/regress

autoinc.so  data  expected  Makefile  parallel_schedule  pg_regress  pg_regress.c  pg_regress.h  pg_regress_main.c  README  refint.so  regress.c  regressplans.sh  regress.so  resultmap  sql

(I’m not sure what this package is supposed to do,  it contains both source files and the executables.

 

The current pgsql install directory of regress only contains pg_regress binary,   
Do you suggest we add these files (excluding the scratched files) to the regress install directory?

autoinc.so  data  expected  Makefile  parallel_schedule  pg_regress  pg_regress.c  pg_regress.h  pg_regress_main.c  README  refint.so  regress.c  regressplans.sh  regress.so  resultmap  sql

 

>> 1. configure and build postgres
>> 2. edit file src/include/utils/rel.h so that contrib/spi will rebuild
>> 3. cd ${builddir}/src/test/regress
>> 4. make
>> We’ll find refint.so is rebuilt in contrib/spi, but not copied over to regress folder.
>> While autoinc.so is rebuilt and copied over.

 

I think this build bug is orthogonal to the inconvenient installation/packaging.

It produces inconsistent build result, e.g you have to run `make` twice to ensure newly built refint.so is copied to the build dir.

 

Regards,

Donghang Lin

(ServiceNow)

 

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Friday, October 14, 2022 at 8:15 PM
To: Donghang Lin <donghang.lin@servicenow.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: Bug: pg_regress makefile does not always copy refint.so

[External Email]


On 2022-Oct-14, Donghang Lin wrote:

> Hi hackers,
>
> When I was building pg_regress, it didn’t always copy a rebuilt version of refint.so to the folder.
>
> Steps to reproduce:
> OS: centos7
> PSQL version: 14.5
>
> 1. configure and build postgres
> 2. edit file src/include/utils/rel.h so that contrib/spi will rebuild
> 3. cd ${builddir}/src/test/regress
> 4. make
> We’ll find refint.so is rebuilt in contrib/spi, but not copied over to regress folder.
> While autoinc.so is rebuilt and copied over.

I have a somewhat-related-but-not-really complaint.  I recently had need to
have refint.so, autoinc.so and regress.so in the install directory; but it
turns out that there's no provision at all to get them installed.

Packagers have long have had a need for this; for example the postgresql-test
RPM file is built using this icky recipe:

%if %test
        # tests. There are many files included here that are unnecessary,
        # but include them anyway for completeness.  We replace the original
        # Makefiles, however.
        %{__mkdir} -p %{buildroot}%{pgbaseinstdir}/lib/test
        %{__cp} -a src/test/regress %{buildroot}%{pgbaseinstdir}/lib/test
        %{__install} -m 0755 contrib/spi/refint.so %{buildroot}%{pgbaseinstdir}/lib/test/regress
        %{__install} -m 0755 contrib/spi/autoinc.so %{buildroot}%{pgbaseinstdir}/lib/test/regress

I assume that the DEB does something similar, but I didn't look.

I think it would be better to provide a Make rule to allow these files to be
installed.  I'll see about a proposed patch.

--
Álvaro Herrera        Breisgau, Deutschland  —  https://urldefense.com/v3/__https://www.EnterpriseDB.com/__;!!N4vogdjhuJM!Gz471V39hPgZI8Uabm3fUUHoZIuoMKlnz6_W38wwQvH20ZKfYaIWioPYtBJU2U75apWuCP6NmZutZfZ92EDwq5vIcvs$
"Saca el libro que tu religión considere como el indicado para encontrar la
oración que traiga paz a tu alma. Luego rebootea el computador
y ve si funciona" (Carlos Duclós)

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Exponentiation confusion
Next
From: Tom Lane
Date:
Subject: Re: Checking for missing heap/index files