forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4b53872
committed
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correctway to write a rule that generates two files". However, what we did is toprovide empty rules that "generate" the secondary output files from theprimary one, and that's not right either. Depending on the details ofthe creating process, the primary file might end up timestamped later thanone or more secondary files, causing subsequent make runs to consider thesecondary file(s) out of date. That's harmless in a plain build, sincemake will just re-execute the empty rule and nothing happens. But it'sfatal in a VPATH build, since make will expect the secondary file to berebuilt in the build directory. This would manifest as "file not found"failures during VPATH builds from tarballs, if we were ever unlucky enoughto ship a tarball with apparently out-of-date secondary files. (It's notclear 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 $@" actionnot an empty rule. Also, make sure that this rule actually gets invokedduring 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, becausethose rules are due to get replaced soon in the bootstrap data formatpatch, 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 toback-fill the changes in that one makefile from v10.Discussion:https://postgr.es/m/18556.1521668179@sss.pgh.pa.us1 parent8694cc9 commit4b53872
9 files changed
+58
-51
lines changedLines changed: 6 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
315 | 315 |
| |
316 | 316 |
| |
317 | 317 |
| |
318 |
| - | |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
323 |
| - | |
324 |
| - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
325 | 321 |
| |
326 | 322 |
| |
327 | 323 |
| |
| |||
352 | 348 |
| |
353 | 349 |
| |
354 | 350 |
| |
355 |
| - | |
356 |
| - | |
357 |
| - | |
358 |
| - | |
359 |
| - | |
360 |
| - | |
361 |
| - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
362 | 354 |
| |
363 | 355 |
| |
364 | 356 |
| |
|
Lines changed: 20 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
80 | 77 |
| |
81 | 78 |
| |
82 | 79 |
| |
| |||
86 | 83 |
| |
87 | 84 |
| |
88 | 85 |
| |
89 |
| - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
90 | 90 |
| |
91 | 91 |
| |
92 | 92 |
| |
| |||
130 | 130 |
| |
131 | 131 |
| |
132 | 132 |
| |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 |
| |
134 | 140 |
| |
135 | 141 |
| |
136 | 142 |
| |
137 | 143 |
| |
138 |
| - | |
| 144 | + | |
139 | 145 |
| |
140 | 146 |
| |
141 | 147 |
| |
142 | 148 |
| |
143 |
| - | |
144 |
| - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
145 | 152 |
| |
146 | 153 |
| |
147 |
| - | |
| 154 | + | |
148 | 155 |
| |
149 | 156 |
| |
150 | 157 |
| |
| |||
219 | 226 |
| |
220 | 227 |
| |
221 | 228 |
| |
222 |
| - | |
| 229 | + | |
223 | 230 |
| |
224 | 231 |
| |
225 | 232 |
| |
|
Lines changed: 11 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
31 |
| - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 |
| |
33 | 38 |
| |
34 | 39 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
29 |
| - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
24 |
| - | |
25 |
| - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 |
| |
27 | 30 |
| |
28 | 31 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 |
| |
40 | 43 |
| |
41 | 44 |
| |
42 | 45 |
| |
43 | 46 |
| |
44 | 47 |
| |
45 | 48 |
| |
46 |
| - | |
| 49 | + | |
47 | 50 |
| |
48 | 51 |
| |
49 | 52 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 |
| - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 |
| |
44 | 47 |
| |
45 | 48 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
66 |
| - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
67 | 69 |
| |
68 | 70 |
| |
69 | 71 |
| |
|
Lines changed: 0 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 | 39 |
| |
49 | 40 |
| |
50 | 41 |
| |
|
0 commit comments
Comments
(0)