pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix make rules that generate multiple output files.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix make rules that generate multiple output files.
@ 2018-03-23 17:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-03-23 17:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix make rules that generate multiple output files.

For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files".  However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either.  Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date.  That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens.  But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory.  This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files.  (It's not
clear whether that has ever actually happened, but it definitely could.)

To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule.  Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.

It's been like this a long time, so back-patch to all supported branches.

In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.

Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4c26965166c8180a1f017fac85447f0bc9df98cf

Modified Files
--------------
src/Makefile.shlib                   | 20 ++++++--------------
src/backend/Makefile                 | 22 ++++++++++++++--------
src/backend/catalog/Makefile         | 13 ++++++++-----
src/backend/parser/Makefile          | 17 +++++++++++------
src/backend/utils/Makefile           |  5 +++--
src/bin/psql/Makefile                |  7 +++++--
src/interfaces/ecpg/preproc/Makefile |  5 ++++-
src/pl/plpgsql/src/Makefile          |  4 +++-
src/test/isolation/Makefile          |  9 ---------
9 files changed, 54 insertions(+), 48 deletions(-)



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

* pgsql: Fix make rules that generate multiple output files.
@ 2018-03-23 17:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-03-23 17:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix make rules that generate multiple output files.

For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files".  However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either.  Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date.  That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens.  But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory.  This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files.  (It's not
clear whether that has ever actually happened, but it definitely could.)

To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule.  Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.

It's been like this a long time, so back-patch to all supported branches.

In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.

Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/Makefile.shlib                   | 20 ++++++--------------
src/backend/Makefile                 | 33 ++++++++++++++++++++-------------
src/backend/catalog/Makefile         | 13 ++++++++-----
src/backend/parser/Makefile          | 17 +++++++++++------
src/backend/storage/lmgr/Makefile    |  5 +++--
src/backend/utils/Makefile           |  9 ++++++---
src/bin/psql/Makefile                |  7 +++++--
src/interfaces/ecpg/preproc/Makefile |  5 ++++-
src/pl/plpgsql/src/Makefile          |  4 +++-
src/test/isolation/Makefile          |  9 ---------
10 files changed, 66 insertions(+), 56 deletions(-)



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

* pgsql: Fix make rules that generate multiple output files.
@ 2018-03-23 17:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-03-23 17:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix make rules that generate multiple output files.

For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files".  However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either.  Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date.  That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens.  But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory.  This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files.  (It's not
clear whether that has ever actually happened, but it definitely could.)

To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule.  Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.

It's been like this a long time, so back-patch to all supported branches.

In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.

Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/36c07fc2996b252a144819f4e43d3e715ca6b10d

Modified Files
--------------
src/Makefile.shlib                   | 20 ++++++--------------
src/backend/Makefile                 | 26 ++++++++++++++++----------
src/backend/catalog/Makefile         | 13 ++++++++-----
src/backend/parser/Makefile          | 17 +++++++++++------
src/backend/storage/lmgr/Makefile    |  5 +++--
src/backend/utils/Makefile           |  5 +++--
src/bin/psql/Makefile                |  7 +++++--
src/interfaces/ecpg/preproc/Makefile |  5 ++++-
src/pl/plpgsql/src/Makefile          |  4 +++-
src/test/isolation/Makefile          |  9 ---------
10 files changed, 59 insertions(+), 52 deletions(-)



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

* pgsql: Fix make rules that generate multiple output files.
@ 2018-03-23 17:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-03-23 17:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix make rules that generate multiple output files.

For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files".  However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either.  Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date.  That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens.  But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory.  This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files.  (It's not
clear whether that has ever actually happened, but it definitely could.)

To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule.  Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.

It's been like this a long time, so back-patch to all supported branches.

In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.

Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5d814c8413d7cda15431e96432727adbcb08446b

Modified Files
--------------
src/Makefile.shlib                   | 20 ++++++--------------
src/backend/Makefile                 | 22 ++++++++++++++--------
src/backend/catalog/Makefile         | 13 ++++++++-----
src/backend/parser/Makefile          | 17 +++++++++++------
src/backend/utils/Makefile           |  5 +++--
src/bin/psql/Makefile                |  7 +++++--
src/interfaces/ecpg/preproc/Makefile |  5 ++++-
src/pl/plpgsql/src/Makefile          |  4 +++-
src/test/isolation/Makefile          |  9 ---------
9 files changed, 54 insertions(+), 48 deletions(-)



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

* pgsql: Fix make rules that generate multiple output files.
@ 2018-03-23 17:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-03-23 17:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix make rules that generate multiple output files.

For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files".  However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either.  Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date.  That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens.  But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory.  This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files.  (It's not
clear whether that has ever actually happened, but it definitely could.)

To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule.  Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.

It's been like this a long time, so back-patch to all supported branches.

In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.

Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3bd5009033555ca8085dae45ec166c33c5d60b87

Modified Files
--------------
src/Makefile.shlib                   | 10 +++-------
src/backend/Makefile                 |  6 ++++++
src/backend/catalog/Makefile         | 13 ++++++++-----
src/backend/parser/Makefile          | 17 +++++++++++------
src/backend/utils/Makefile           |  5 +++--
src/bin/psql/Makefile                |  7 +++++--
src/interfaces/ecpg/preproc/Makefile |  5 ++++-
src/pl/plpgsql/src/Makefile          |  4 +++-
src/test/isolation/Makefile          |  9 ---------
9 files changed, 43 insertions(+), 33 deletions(-)



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

* pgsql: Fix make rules that generate multiple output files.
@ 2018-03-23 17:46  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-03-23 17:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix make rules that generate multiple output files.

For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files".  However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either.  Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date.  That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens.  But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory.  This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files.  (It's not
clear whether that has ever actually happened, but it definitely could.)

To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule.  Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.

It's been like this a long time, so back-patch to all supported branches.

In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.

Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4b538727e2a0e5eae228650c1c145c90471aa521

Modified Files
--------------
src/Makefile.shlib                   | 20 ++++++--------------
src/backend/Makefile                 | 33 ++++++++++++++++++++-------------
src/backend/parser/Makefile          | 17 +++++++++++------
src/backend/storage/lmgr/Makefile    |  5 +++--
src/backend/utils/Makefile           |  9 ++++++---
src/bin/psql/Makefile                |  7 +++++--
src/interfaces/ecpg/preproc/Makefile |  5 ++++-
src/pl/plpgsql/src/Makefile          |  4 +++-
src/test/isolation/Makefile          |  9 ---------
9 files changed, 58 insertions(+), 51 deletions(-)



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


end of thread, other threads:[~2018-03-23 17:46 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23 17:46 pgsql: Fix make rules that generate multiple output files. Tom Lane <tgl@sss.pgh.pa.us>
2018-03-23 17:46 pgsql: Fix make rules that generate multiple output files. Tom Lane <tgl@sss.pgh.pa.us>
2018-03-23 17:46 pgsql: Fix make rules that generate multiple output files. Tom Lane <tgl@sss.pgh.pa.us>
2018-03-23 17:46 pgsql: Fix make rules that generate multiple output files. Tom Lane <tgl@sss.pgh.pa.us>
2018-03-23 17:46 pgsql: Fix make rules that generate multiple output files. Tom Lane <tgl@sss.pgh.pa.us>
2018-03-23 17:46 pgsql: Fix make rules that generate multiple output files. 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