-
-
Notifications
You must be signed in to change notification settings - Fork 112
/
Makefile
332 lines (295 loc) · 9.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# contrib/orioledb/Makefile
MODULE_big = orioledb
EXTENSION = orioledb
PGFILEDESC = "orioledb - orioledb transactional storage engine via TableAm"
SHLIB_LINK += -lzstd -lcurl -lssl -lcrypto
DATA_built = $(patsubst %_prod.sql,%.sql,$(wildcard sql/*_prod.sql))
DATA = $(filter-out $(wildcard sql/*_*.sql) $(DATA_built), $(wildcard sql/*sql))
EXTRA_CLEAN = include/utils/stopevents_defs.h \
include/utils/stopevents_data.h
OBJS = src/btree/btree.o \
src/btree/build.o \
src/btree/check.o \
src/btree/find.o \
src/btree/insert.o \
src/btree/io.o \
src/btree/iterator.o \
src/btree/merge.o \
src/btree/modify.o \
src/btree/page_chunks.o \
src/btree/page_contents.o \
src/btree/page_state.o \
src/btree/print.o \
src/btree/scan.o \
src/btree/split.o \
src/btree/undo.o \
src/catalog/ddl.o \
src/catalog/free_extents.o \
src/catalog/indices.o \
src/catalog/o_aggregate_cache.o \
src/catalog/o_amop_cache.o \
src/catalog/o_amproc_cache.o \
src/catalog/o_class_cache.o \
src/catalog/o_enum_cache.o \
src/catalog/o_collation_cache.o \
src/catalog/o_database_cache.o \
src/catalog/o_indices.o \
src/catalog/o_operator_cache.o \
src/catalog/o_opclass_cache.o \
src/catalog/o_proc_cache.o \
src/catalog/o_range_cache.o \
src/catalog/o_sys_cache.o \
src/catalog/o_tables.o \
src/catalog/o_type_cache.o \
src/catalog/sys_trees.o \
src/checkpoint/checkpoint.o \
src/checkpoint/control.o \
src/indexam/handler.o \
src/orioledb.o \
src/recovery/logical.o \
src/recovery/recovery.o \
src/recovery/wal.o \
src/recovery/worker.o \
src/s3/archive.o \
src/s3/checkpoint.o \
src/s3/control.o \
src/s3/checksum.o \
src/s3/headers.o \
src/s3/queue.o \
src/s3/requests.o \
src/s3/worker.o \
src/tableam/bitmap_scan.o \
src/tableam/descr.o \
src/tableam/func.o \
src/tableam/handler.o \
src/tableam/index_scan.o \
src/tableam/key_range.o \
src/tableam/key_bitmap.o \
src/tableam/operations.o \
src/tableam/scan.o \
src/tableam/tree.o \
src/transam/undo.o \
src/transam/oxid.o \
src/tuple/format.o \
src/tuple/toast.o \
src/tuple/slot.o \
src/tuple/sort.o \
src/workers/bgwriter.o \
src/utils/compress.o \
src/utils/o_buffers.o \
src/utils/page_pool.o \
src/utils/planner.o \
src/utils/seq_buf.o \
src/utils/stopevent.o \
src/utils/ucm.o \
$(WIN32RES)
REGRESSCHECKS = btree_sys_check \
alter_type \
bitmap_scan \
btree_compression \
btree_print \
createas \
ddl \
explain \
foreign_keys \
generated \
getsomeattrs \
indices \
indices_build \
inherits \
ioc \
joins \
nulls \
opclass \
parallel_scan \
partial \
partition \
primary_key \
row_level_locks \
row_security \
subquery \
subtransactions \
tableam \
temp \
toast \
trigger \
types
ISOLATIONCHECKS = bitmap_hist_scan \
btree_iterate \
btree_print_backend_id \
concurrent_update_delete \
fkeys \
included \
insert_fails \
ioc_deadlock \
ioc_lost_update \
isol_ddl \
isol_rc \
isol_rr \
isol_rr_bscan \
isol_rr_seqscan \
load_refind_page \
merge \
partition_move \
rightlink \
rll \
rll_deadlock \
rll_mix \
rll_subtrans \
table_lock_test \
uniq
TESTGRESCHECKS_PART_1 = test/t/checkpointer_test.py \
test/t/eviction_bgwriter_test.py \
test/t/eviction_compression_test.py \
test/t/eviction_test.py \
test/t/file_operations_test.py \
test/t/files_test.py \
test/t/incomplete_split_test.py \
test/t/merge_test.py \
test/t/o_tables_test.py \
test/t/o_tables_2_test.py \
test/t/recovery_test.py \
test/t/recovery_opclass_test.py \
test/t/recovery_worker_test.py \
test/t/replication_test.py \
test/t/types_test.py \
test/t/undo_eviction_test.py
TESTGRESCHECKS_PART_2 = test/t/checkpoint_concurrent_test.py \
test/t/checkpoint_eviction_test.py \
test/t/checkpoint_same_trx_test.py \
test/t/checkpoint_split1_test.py \
test/t/checkpoint_split2_test.py \
test/t/checkpoint_split3_test.py \
test/t/checkpoint_update_compress_test.py \
test/t/checkpoint_update_test.py \
test/t/ddl_test.py \
test/t/eviction_full_memory_test.py \
test/t/include_indices_test.py \
test/t/indices_build_test.py \
test/t/logical_test.py \
test/t/not_supported_yet_test.py \
test/t/parallel_test.py \
test/t/reindex_test.py \
test/t/s3_test.py \
test/t/schema_test.py \
test/t/toast_index_test.py \
test/t/trigger_test.py \
test/t/unlogged_test.py \
test/t/vacuum_test.py
PG_REGRESS_ARGS=--no-locale --inputdir=test --outputdir=test --temp-instance=./test/tmp_check
PG_ISOLATION_REGRESS_ARGS=--no-locale --inputdir=test --outputdir=test/output_iso --temp-instance=./test/tmp_check_iso
ifdef IS_DEV
sql/%.sql:
@cat sql/$*_prod.sql sql/$*_dev.sql > $@
else
sql/%.sql:
@cat sql/$*_prod.sql > $@
endif
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
override PG_CPPFLAGS += -I$(CURDIR)/include
include $(PGXS)
ifeq ($(shell expr $(MAJORVERSION) \>= 14), 1)
REGRESSCHECKS += toast_column_compress
endif
ifeq ($(shell expr $(MAJORVERSION) \>= 15), 1)
TESTGRESCHECKS_PART_2 += test/t/merge_into_test.py
ISOLATIONCHECKS += isol_merge
endif
regresscheck: | install
$(pg_regress_check) \
--temp-config test/orioledb_regression.conf \
$(PG_REGRESS_ARGS) \
$(REGRESSCHECKS)
isolationcheck: | install
$(pg_isolation_regress_check) \
--temp-config test/orioledb_isolation.conf \
$(PG_ISOLATION_REGRESS_ARGS) \
$(ISOLATIONCHECKS)
$(TESTGRESCHECKS_PART_1) $(TESTGRESCHECKS_PART_2): | install
$(with_temp_install) \
python3 -W ignore::DeprecationWarning -m unittest -v $@
installcheck: regresscheck isolationcheck testgrescheck
echo "All checks are successful!"
else
subdir = contrib/orioledb
top_builddir = ../..
override PG_CPPFLAGS += -I$(top_srcdir)/$(subdir)/include
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
regresscheck: | submake-regress submake-orioledb temp-install
$(pg_regress_check) \
--temp-config $(top_srcdir)/contrib/orioledb/test/orioledb_regression.conf \
$(PG_REGRESS_ARGS) \
$(REGRESSCHECKS)
isolationcheck: | submake-isolation submake-orioledb temp-install
$(pg_isolation_regress_check) \
--temp-config $(top_srcdir)/contrib/orioledb/test/orioledb_isolation.conf \
$(PG_ISOLATION_REGRESS_ARGS) \
$(ISOLATIONCHECKS)
$(TESTGRESCHECKS_PART_1) $(TESTGRESCHECKS_PART_2): | submake-orioledb temp-install
PG_CONFIG="$(abs_top_builddir)/tmp_install$(bindir)/pg_config" \
$(with_temp_install) \
python3 -m unittest -v $@
check: regresscheck isolationcheck testgrescheck
echo "All checks are successful!"
endif
# Retrieve the current commit hash from the Git repository.
# If the .git environment does not exist (e.g., in a Docker environment or a non-Git setup),
# fallback to a default "fake" commit hash (all zeros) to avoid errors.
COMMIT_HASH := $(shell git rev-parse HEAD 2>/dev/null)
ifeq ($(strip $(COMMIT_HASH)),)
COMMIT_HASH := 0000000000000000000000000000000000000000
endif
override CFLAGS_SL += -DCOMMIT_HASH=$(COMMIT_HASH) -Wno-error=deprecated-declarations
ifdef VALGRIND
override with_temp_install += PGCTLTIMEOUT=3000 \
valgrind --vgdb=yes --leak-check=no --gen-suppressions=all \
--suppressions=valgrind.supp --time-stamp=yes \
--log-file=pid-%p.log --trace-children=yes \
--trace-children-skip=*/initdb
else
override with_temp_install += PGCTLTIMEOUT=900
endif
include/utils/stopevents_data.h: include/utils/stopevents_defs.h
include/utils/stopevents_defs.h: stopevents.txt stopevents_gen.py
python3 stopevents_gen.py
ifndef ORIOLEDB_PATCHSET_VERSION
ORIOLEDB_PATCHSET_VERSION=1
endif
CUR_ORIOLEDB_PATCHSET_VERSION := $(shell grep '^$(MAJORVERSION):' .pgtags | cut -d'_' -f2)
check_patchset_version:
@if [ $(CUR_ORIOLEDB_PATCHSET_VERSION) != $(ORIOLEDB_PATCHSET_VERSION) ]; then \
echo "Wrong orioledb patchset version:"\
"expected $(CUR_ORIOLEDB_PATCHSET_VERSION),"\
"got $(ORIOLEDB_PATCHSET_VERSION)"; \
echo "Rebuild and install patched orioledb/postgres using tag"\
"'patches$(MAJORVERSION)_$(CUR_ORIOLEDB_PATCHSET_VERSION)'"; \
false; \
fi
$(OBJS): include/utils/stopevents_defs.h check_patchset_version
submake-regress:
$(MAKE) -C $(top_builddir)/src/test/regress all
submake-isolation:
$(MAKE) -C $(top_builddir)/src/test/isolation all
submake-orioledb:
$(MAKE) -C $(top_builddir)/contrib/orioledb
testgrescheck: $(TESTGRESCHECKS_PART_1) $(TESTGRESCHECKS_PART_2)
testgrescheck_part_1: $(TESTGRESCHECKS_PART_1)
testgrescheck_part_2: $(TESTGRESCHECKS_PART_2)
temp-install: EXTRA_INSTALL=contrib/orioledb
orioledb.typedefs: $(OBJS)
./typedefs_gen.py
pgindent: orioledb.typedefs
pgindent --typedefs=orioledb.typedefs \
src/*.c \
src/*/*.c \
include/*.h \
include/*/*.h
yapf:
yapf -i test/t/*.py
yapf -i *.py
.PHONY: submake-orioledb submake-regress check \
regresscheck isolationcheck testgrescheck pgindent \
$(TESTGRESCHECKS_PART_1) $(TESTGRESCHECKS_PART_2)