forked from postgres-plr/plr
/
appveyor.yml
885 lines (834 loc) · 31.1 KB
/
appveyor.yml
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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
# required to be here, so that Visual Studio 2015, can compile PostgreSQL
image: Visual Studio 2015
clone_depth: 1
environment:
PGUSER: postgres
PGPASSWORD: Password12!
PGOPTIONS: -c log_error_verbosity=verbose -c log_min_messages=debug2 -c log_min_error_statement=debug2
APPVEYOR_SAVE_CACHE_ON_ERROR: true
# Notice
# 1. The first creation of the tag: GITHUBCACHE, will make a 2nd Appeveyor build run
# 2. Debug Builds that use the hardcoded plr.vcxproj (and plr.vcxproj.proj?) fail fast !
# 3. msvc.diff.R solves all msvc.diff problems of all compilations
# 4. After pg 13, the master, has the attional problem that the function hex_decode
# is not found.
# See the commit c3826f831e6e63e13a749fd3ab9fd7106707b549
# See the commit 62afb42a7f9f533efc6c19f462c3a848fa4ddb63
# pg - should be a specific binary version
# from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
# and its platforms: "Windows x86-64" and "Windows x86-32"
# This is "platform: x64" or "platform: x86"
#
# Alternately, pg can be a git branch, tag, or commit
#
# A branch, tag, and commit, is different from an already-compiled binary.
# It "does not have a dot "."" in the pg name.
# Of pg, if a commit is wanted, then also the flag - "pghint: commit" also must be set.
#
# Of a branch, tag, and commit, optionally,
# the flag - githubcache: true - may be set, to try to store the
# compiled pg in the github releases GITHUBCACHE, then retrieve it when necessary.
# Because compiling uses much time, and to try to avoid re-compiling,
# this "flag" can be useful for static source code, e.g., tags and commits
#
# When compiling plr with pg source code (branch, tag, or commit), the
# R file msvc.diff.R will be run, using Rscript.exe, and will patch files.
# These patched files will reduce the PostgreSQL regression testing to just the plr extension.
#
# If pg is a specific binary version
# and that PostgreSQL x64 version is already installed on Appveyor,
# then instead, the Appveyor version and platform will be used.
# A PostgreSQL pg binary will-not-be downloaded from "enterprisedb".
matrix:
# # REL_13_STABLE # branch - non-static commit
# - pg: REL_13_0 # tag - static commit
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
# # REL_13_STABLE # branch - non-static commit
# - pg: REL_13_0 # tag - static commit
# PlatformToolset: v141
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
# # works: 1st run
# # REL_13_STABLE # branch - non-static commit
# - pg: REL_13_0 # tag - static commit
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# # works: 1st run
# # REL_13_STABLE # branch - non-static commit
# - pg: REL_13_0 # tag - static commit
# PlatformToolset: v141
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# # not work
# # C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126: The specified solution configuration "Release|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\projects\postgresql\pgsql.sln]
# # REL_13_STABLE # branch - non-static commit
# - pg: REL_13_0 # tag - static commit
# PlatformToolset: v141
# configuration: Release
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# not work
# C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126: The specified solution configuration "Release|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\projects\postgresql\pgsql.sln]
# REL_13_STABLE # branch - non-static commit
- pg: REL_13_0 # tag - static commit
PlatformToolset: v141
configuration: Release
platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
rversion: 4.0.3
#
githubcache: true
# # not work
# # C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126: The specified solution configuration "Debug|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\projects\postgresql\pgsql.sln]
# # REL_13_STABLE # branch - non-static commit
# - pg: REL_13_0 # tag - static commit
# PlatformToolset: v141
# configuration: Debug
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# # works
# # REL_13_0
# - pg: 13.1-1
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
#
# # not work
# # copy %dll% tmp\lib
# # The system cannot find the file specified
# # REL_13_0
# - pg: 13.1-1
# PlatformToolset: v141
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
#
# # not work (not available at enterprisedb)
# # dir : Cannot find path 'C:\Program Files (x86)\PostgreSQL\13' because it does not exist.
# # REL_13_0
# - pg: 13.1-1
# PlatformToolset: v141
# configuration: Release
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
#
# # not work (not available at enerprisedb)
# # dir : Cannot find path 'C:\Program Files (x86)\PostgreSQL\13' because it does not exist.
# # REL_13_0
# - pg: 13.1-1
# PlatformToolset: v141
# configuration: Debug
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# # REL_13_0
# - pg: 13.1-1
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# # REL_13_STABLE # branch - non-static commit
# - pg: REL_13_0 # tag - static commit
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# # githubcache: true
# # do not look/save compiled pg in Github release GITHUBCACHE
# # default of githubcache is false
# # works
# # REL_12_STABLE # branch - non-static commit
# - pg: REL_12_0 # tag - static commit
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# # works
# # REL_12_STABLE # branch - non-static commit
# - pg: REL_12_0 # tag - static commit
# PlatformToolset: v141
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# # not work
# # C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126: The specified solution configuration "Release|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\projects\postgresql\pgsql.sln]
# # REL_12_STABLE # branch - non-static commit
# - pg: REL_12_0 # tag - static commit
# PlatformToolset: v141
# configuration: Release
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# # not work
# # C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126: The specified solution configuration "Debug|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\projects\postgresql\pgsql.sln]
# # REL_12_STABLE # branch - non-static commit
# - pg: REL_12_0 # tag - static commit
# PlatformToolset: v141
# configuration: Debug
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# # works
# # REL_12_0
# - pg: 12.5-1
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
#
# # not work
# # copy %dll% tmp\lib
# # The system cannot find the file specified.
# # REL_12_0
# - pg: 12.5-1
# PlatformToolset: v141
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
#
# # not work (enterprisedb does not have)
# # Cannot find path 'C:\Program Files (x86)\PostgreSQL\12' because it does not exist.
# # REL_12_0
# - pg: 12.5-1
# PlatformToolset: v141
# configuration: Release
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
#
# # not work (enterprisedb does not have)
# # Cannot find path 'C:\Program Files (x86)\PostgreSQL\12' because it does not exist.
# # REL_12_0
# - pg: 12.5-1
# PlatformToolset: v141
# configuration: Debug
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# # REL_12_0
# - pg: 12.5-1
# PlatformToolset: v141
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# # 12.5-1
# - pg: REL_12_0
# PlatformToolset: v141
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# githubcache: true
#
# - pg: master
# PlatformToolset: v141
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
#
#
# # Initial pgindent and pgperltidy run for v13.
# # src/tools/msvc/Mkvcbuild.pm
# #
# # static commit
# - pg: 5cbfce562f7cd2aab0cdc4694ce298ec3567930e
# #
# pghint: commit
# #
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
# #
# githubcache: true
#
# # REL_12_0
# - pg: 12.5-1
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 4.0.3
#
# # REL_11_0
# - pg: 11.11-1
# PlatformToolset: v141
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# rversion: 3.6.0
# # works
# # REL_10_STABLE # branch - non-static commit
# - pg: REL_10_0 # tag - static commit
# PlatformToolset: v120
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 4.0.3
# #
# githubcache: true
#
# # works
# # REL_10_STABLE # branch - non-static commit
# - pg: REL_10_0 # tag - static commit
# PlatformToolset: v120
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 4.0.3
# #
# githubcache: true
#
# # not work
# # C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126: The specified solution configuration "Release|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\projects\postgresql\pgsql.sln]
# # REL_10_STABLE # branch - non-static commit
# - pg: REL_10_0 # tag - static commit
# PlatformToolset: v120
# configuration: Release
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 4.0.3
# #
# githubcache: true
#
# # not work
# # C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126: The specified solution configuration "Debug|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\projects\postgresql\pgsql.sln]
# # REL_10_STABLE # branch - non-static commit
# - pg: REL_10_0 # tag - static commit
# PlatformToolset: v120
# configuration: Debug
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 4.0.3
# #
# githubcache: true
#
# # works
# # REL_10_0
# - pg: 10.16-1
# PlatformToolset: v120
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 4.0.3
#
# # not work
# # copy %dll% tmp\lib
# # The system cannot find the file specified.
# # REL_10_0
# - pg: 10.16-1
# PlatformToolset: v120
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 4.0.3
#
# # enterprisedb has this binary
# # works
# # REL_10_0
# - pg: 10.16-1
# PlatformToolset: v120
# configuration: Release
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 4.0.3
#
# # not work
# # copy %dll% tmp\lib
# # The system cannot find the file specified.
# # REL_10_0
# - pg: 10.16-1
# PlatformToolset: v120
# configuration: Debug
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 4.0.3
#
# # REL_10_0
# - pg: 10.16-1
# PlatformToolset: v120
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
# # good
# - pg: REL_10_0
# PlatformToolset: v120
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
#
# # good
# - pg: REL_10_0
# PlatformToolset: v120
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
#
# # fail:
# # C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126:
# # The specified solution configuration "Release|x86" is invalid.
# # Please specify a valid solution configuration using the
# # Configuration and Platform properties
# # (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU")
# # or leave those properties blank to use the default solution configuration.
# # [C:\projects\postgresql\pgsql.sln]
# - pg: REL_10_0
# PlatformToolset: v120
# configuration: Release
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
#
# # fail:
# # C:\projects\postgresql\pgsql.sln.metaproj : error MSB4126:
# # The specified solution configuration "Debug|x86" is invalid.
# # Please specify a valid solution configuration using the
# # Configuration and Platform properties
# # (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU")
# # or leave those properties blank to use the default solution configuration.
# # [C:\projects\postgresql\pgsql.sln]
# - pg: REL_10_0
# PlatformToolset: v120
# configuration: Debug
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
# # REL9_6_0
# - pg: 9.6.21
# PlatformToolset: v120
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
#
# - pg: 9.5.25-1
# PlatformToolset: v120
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
# - pg: 9.4.4-3
# PlatformToolset: v120
# configuration: Release
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
#
# - pg: 9.4.4-3
# PlatformToolset: v120
# configuration: Debug
# platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
#
# - pg: 9.4.4-3
# PlatformToolset: v120
# configuration: Release
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
#
# - pg: 9.4.4-3
# PlatformToolset: v120
# configuration: Debug
# platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# rversion: 3.6.0
matrix:
allow_failures:
- pg: master
# Appveyor build server environment variables
#
# ProgramFiles=C:\Program Files
# ProgramFiles(x86)=C:\Program Files (x86)
#
init: # Make %x64% available for caching
- if %PLATFORM%==x64 ( set pf=%ProgramFiles%&& set x64=-x64) else set pf=%ProgramFiles(x86)%
- set exe=postgresql-%pg%-windows%x64%.exe
- setx /m exe %exe%
# possible user provided in the matrix
- if not defined githubcache set githubcache=false
- if not defined pghint set pghint=none
install:
- if not exist R-%rversion%-win.exe appveyor downloadfile https://cran.r-project.org/bin/windows/base/old/%rversion%/R-%rversion%-win.exe
- R-%rversion%-win.exe /VERYSILENT
# We could have used RTools many R users have, but let's use msys64 existing on Appveyor intead
#- if not exist Rtools35.exe appveyor downloadfile https://cran.r-project.org/bin/windows/Rtools/Rtools35.exe
#- Rtools35.exe /VERYSILENT
- Set mingw=C:\msys64\mingw
# enterprisedb version name - strip off, if any, the - right-most part dot, then numbers, then one hyphen, then numbers
- ps: $env:pgversion = $env:pg -replace "[.]\d+-\d+$", ""
- echo pgversion=%pgversion%
- set pgroot=%pf%\PostgreSQL\%pgversion%
- echo %pgroot%
- SET R_HOME=%ProgramFiles%\R\R-%rversion%
- set RBIN=%PLATFORM:x86=i386%
- SET sed=C:\msys64\usr\bin\sed
#
# Perhaps a regular expression reading problem
# Solution.pm - sub DeterminePlatform
# wrong: Detected hardware platform x## Wrong!
# ActiveState Perl is good, but Strawberry Perl is preferred
#
- if %PLATFORM%==x64 (set BIT=64) else set BIT=32
- set betterperlurl=https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-%BIT%bit-portable.zip
- set betterperl=strawberry%BIT%
- if not exist %betterperl%.zip curl -o %betterperl%.zip %betterperlurl%
- 7z x %betterperl%.zip -oc:\%betterperl%
- set Path=c:\%betterperl%\perl\bin;%Path%
- which perl
- set Path=%Path%;c:\%betterperl%\c\bin
#
# CHANGE THE CURL URL BEFORE THE PULL REQUEST (IF ANY)
- set pgzip=pg-pg%pgversion%-R%rversion%-%PLATFORM%-%CONFIGURATION%.zip
- set pggithubbincacheurl=https://github.com/AndreMikulec/plr/releases/download/GITHUBCACHE/%pgzip%
- if "%githubcache%"=="true" if not exist "%pgzip%" (
bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/pggithubbincachefailingfound.sh" &
for /f "delims=" %%i in (%APPVEYOR_BUILD_FOLDER%\pggithubbincachefailingfound.txt) do (set pggithubbincachefailingfound=%%i)
)
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" curl -o "%pgzip%" -L "%pggithubbincacheurl%"
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" if exist "%pgzip%" (set pggithubbincachefound=true) else (set pggithubbincachefound=false)
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" if "%pggithubbincachefound%"=="true" (
mkdir "%pgroot%" &
7z x "%pgzip%" "-o%pgroot%" &
dir "%pgroot%" &
if exist "%pgroot%\bin\postgres.exe" (set pggithubbincacheextracted=true) else (set pggithubbincacheextracted=false)
)
# user provided (if any), in the matrix
- echo githubcache %githubcache%
# generated
# internal - do not reuse
- echo pggithubbincachefailingfound %pggithubbincachefailingfound%
# reused below
- echo pggithubbincachefound %pggithubbincachefound%
- if not defined pggithubbincachefound set pggithubbincachefound=false
- echo pggithubbincachefound %pggithubbincachefound%
# reused below
- echo pggithubbincacheextracted %pggithubbincacheextracted%
- if not defined pggithubbincacheextracted set pggithubbincacheextracted=false
- echo pggithubbincacheextracted %pggithubbincacheextracted%
# remove old files
- ps: |
Set-PSDebug -Trace 2
if (("$env:githubcache" -eq "true") -and ("$env:pggithubbincacheextracted" -eq "true")) {
pushd "$env:pgroot"
del share\extension\plr-*.sql
del share\extension\plr.control
del lib\plr.dll
del symbols\plr.pdb
popd
}
# minimal required
- ps: |
Set-PSDebug -Trace 2
if (("$env:githubcache" -eq "true") -and ("$env:pggithubbincacheextracted" -eq "true")) {
$env:PROJ="plr.vcxproj"
$env:dll="$($env:PLATFORM.replace('x86', '.'))\$env:CONFIGURATION\plr.dll"
}
- ps: |
# "branchtagcommit" exists only because it is an easier test in a windows batch
# test used in determining whether or not to perform patching (see below)
if ("$env:pg" -notmatch "[.]") {
$env:branchtagcommit = "yes"
} else {
$env:branchtagcommit = "no"
}
echo "branchtagcommit $env:branchtagcommit"
- ps: |
Set-PSDebug -Trace 2
# notmatch - no "dot found" in pg name, is a branch, tag, or commit
if (("$env:pggithubbincacheextracted" -eq "false") -and ("$env:pg" -notmatch "[.]")) {
git config --global advice.detachedHead false
$env:Path += ";C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64"
# git branch or commit - alphanumeric and all lowercase letters (slower download)
if(("$env:pg" -cmatch "^[a-z0-9]+$") -and ("$env:pghint" -eq "commit")) {
git clone -q https://git.postgresql.org/git/postgresql.git c:\projects\postgresql
pwd
pushd c:\projects\postgresql
pwd
git checkout -q $env:pg -b $env:pg
git branch
echo $env:pg
popd
pwd
# git branch or tag(detached head)
# PostgreSQL case - git branches and tags have at least one capital letter - but expect mostly CAPS
} else {
git clone -q --depth 1 --branch $env:pg https://git.postgresql.org/git/postgresql.git c:\projects\postgresql
pushd c:\projects\postgresql
pwd
git branch
echo $env:pg
popd
pwd
}
pushd c:\projects\postgresql
dir
popd
}
- if "%pggithubbincacheextracted%"=="false" if "%branchtagcommit%"=="yes" (
echo Begin performing patching on-the-fly &
echo Begin patching &
echo "%R_HOME%\bin\%RBIN%\Rscript.exe" --vanilla %APPVEYOR_BUILD_FOLDER%\msvc.diff.R &
"%R_HOME%\bin\%RBIN%\Rscript.exe" --vanilla %APPVEYOR_BUILD_FOLDER%\msvc.diff.R &
echo End patching &
echo Begin display of Mkvcbuild.pm &
type c:\projects\postgresql\src\tools\msvc\Mkvcbuild.pm &
echo End display of Mkvcbuild.pm &
echo Begin display of vcregress.pl &
type c:\projects\postgresql\src\tools\msvc\vcregress.pl &
echo End display of vcregress.pl &
echo End performaing patching on-the-fly
)
# from source code
- ps: |
Set-PSDebug -Trace 2
if (("$env:pggithubbincacheextracted" -eq "false") -and ("$env:pg" -notmatch "[.]")) {
gendef - "$env:R_HOME\bin\$env:RBIN\R.dll" > "R$env:PLATFORM.def" 2> $null
lib "/def:R$env:PLATFORM.def" "/out:R$env:PLATFORM.lib" "/MACHINE:$env:PLATFORM"
dir
pushd c:\projects\postgresql
dir
cmd /c mklink /J contrib\plr $env:APPVEYOR_BUILD_FOLDER
# patch already done - above
# patch -p1 -i "$env:APPVEYOR_BUILD_FOLDER\msvc.diff"
#
# creates both plr.vcxproj and pgsql.sln
perl contrib\plr\buildsetup.pl
dir
type C:\projects\postgresql\pgsql.sln
type plr.vcxproj
echo Comparing . . .
type pgcrypto.vcxproj
popd
dir
$env:PROJ="C:\projects\postgresql\pgsql.sln"
$env:dll="c:\projects\postgresql\$env:CONFIGURATION\plr\plr.dll"
}
# from binary
- ps: |
Set-PSDebug -Trace 2
if (("$env:pggithubbincacheextracted" -eq "false") -and ("$env:pg" -match "[.]")) {
$env:PROJ="plr.vcxproj"
$env:dll="$($env:PLATFORM.replace('x86', '.'))\$env:CONFIGURATION\plr.dll"
if (-not (Test-Path "$env:pgroot\bin")) {
if (-not (Test-Path "$env:exe")) {
Start-FileDownload "http://get.enterprisedb.com/postgresql/$env:exe"
}
& ".\$env:exe" --unattendedmodeui none --mode unattended --superpassword "$env:PGPASSWORD" --servicepassword "$env:PGPASSWORD" | Out-Null
Stop-Service "postgresql$env:x64-$env:pgversion"
if ( Test-Path "$env:pgroot\bin" ) {
echo "Directory $env:pgroot\bin does exist. - software from enterprisedb (https://www.enterprisedb.com/downloads/postgres-postgresql-downloads)."
dir "$env:pgroot"
} else {
throw "Directory $env:pgroot\bin does not exist.`r`nDoes enterprisedb (https://www.enterprisedb.com/downloads/postgres-postgresql-downloads) have that version/platform combination?"
}
}
if ( Test-Path "$env:pgroot\bin" ) {
echo "Directory $env:pgroot\bin does exist. - solution from appveyor (https://www.appveyor.com/docs/services-databases/#postgresql) or enterprisedb (https://www.enterprisedb.com/downloads/postgres-postgresql-downloads)."
dir "$env:pgroot"
} else {
throw "Neither appveyor (https://www.appveyor.com/docs/services-databases/#postgresql) nor enterprisedb (https://www.enterprisedb.com/downloads/postgres-postgresql-downloads) have that version/platform combination?"
}
}
cache:
- '%exe%'
- R-%rversion%-win.exe
build_script:
- REM verbosity levels: q[uiet], m[inimal](orig program), n[ormal] (default), d[etailed], and diag[nostic]
- msbuild /p:PlatformToolset=%PlatformToolset% /p:configuration=%CONFIGURATION% /p:platform=%PLATFORM%
%PROJ%
/verbosity:quiet /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- dir
after_build:
- appveyor AddMessage Packing -Category Information
- md tmp\share\extension
- dir
- copy *.sql tmp\share\extension\
- copy *.control tmp\share\extension\
- copy LICENSE tmp\PLR_LICENSE
- md tmp\lib
- md tmp\symbols
- copy %dll% tmp\lib
- copy %dll:.dll=.pdb% tmp\symbols
- dir tmp
- set zip=plr-%APPVEYOR_REPO_COMMIT:~0,8%-pg%pgversion%-R%rversion%-%PLATFORM%-%CONFIGURATION%.zip
- 7z a -r %zip% .\tmp\* > nul
#
- ps: |
Set-PSDebug -Trace 2
if (("$env:pggithubbincacheextracted" -eq "false") -and ("$env:pg" -notmatch "[.]")) {
pushd c:\projects\postgresql\src\tools\msvc
pwd
dir
perl install.pl "$env:pgroot"
dir
popd
pwd
}
#
# same as above (repeated here)
- set pgzip=pg-pg%pgversion%-R%rversion%-%PLATFORM%-%CONFIGURATION%.zip
#
# note, zipping must be performed here, after - perl install . pl
# note, pg has been installed inside %pgroot% == %pf%\PostgreSQL\%pgversion% (see above)
# note, the db must be down
# note, the environment variable "pggithubbincachefound" is
# used in determining whether or not to attempt to deploy to the Github release GITHUBCACHE (see below)
#
# "%pgroot%\bin\postgres.exe" SHOULD BE THERE - missing should NOT happen
- if "%githubcache%"=="true" if "%pggithubbincachefound%"=="false" if exist "%pgroot%\bin\postgres.exe" (
7z a -r "%pgzip%" "%pgroot%\*" > nul
)
test_script:
- path %pgroot%\bin;%PATH%
# which from? mingw?
- which postgres
# from source code, but at this point in time,
# the source code is an already (compiled) binary on disk - see above - perl install . pl
- ps: |
Set-PSDebug -Trace 2
if ("$env:pg" -notmatch "[.]") {
Set-Content -path pg.pass -value "$env:pgpassword" -encoding ascii
initdb -A md5 -U "$env:PGUSER" --pwfile=pg.pass C:\pgdata
pg_ctl register -S demand -N "postgresql$env:x64-$env:pgversion" -D c:\pgdata
} else {
Add-AppveyorMessage "Copying the extension files to the PostgreSQL directories." -Category Information
7z x "$env:zip" "-o$env:pgroot"
}
#
if (("$env:githubcache" -eq "true") -and ("$env:pggithubbincacheextracted" -eq "true")) {
7z x "$env:zip" "-o$env:pgroot"
}
- appveyor AddMessage "Starting the database server." -Category Information
- setx /M PATH "%R_HOME%\bin\%RBIN%;%PATH%"
- net start postgresql%x64%-%pgversion%
#
# need the server_version_num, so we can later, test to determine "psqlopt"
- psql --quiet --tuples-only -c "\pset footer off" -c "\timing off" -c "select current_setting('server_version_num')::integer;" --output=server_version_num.txt
- bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/server_version_num.sh"
- for /f "delims=" %%i in (server_version_num.txt) do (set server_version_num=%%i)
- type server_version_num.txt
- echo %server_version_num%
#
- ps: |
Set-PSDebug -Trace 2
Add-AppveyorTest Regression -Framework pg_regress -FileName sql\ -Outcome Running
# less than pg 9.5
if ([double]"$env:server_version_num" -lt 90500.0) {
$env:psqlopt="--psqldir"
} else {
$env:psqlopt="--bindir"
}
$env:Outcome="Passed"
$elapsed=(Measure-Command {
pg_regress "$env:psqlopt=$env:pgroot\bin" --dbname=pl_regression plr `
bad_fun opt_window do out_args 2>&1 |
%{ if ($_ -is [System.Management.Automation.ErrorRecord]) { $_.Exception.Message } else { $_ } } |
Out-Default
if ($LASTEXITCODE -ne 0) {
$env:Outcome="Failed"
}
}).TotalMilliseconds
Update-AppVeyorTest Regression -Framework pg_regress -FileName sql\ -Outcome "$env:Outcome" -Duration $elapsed
if ("$env:Outcome" -ne "Passed") {
type regression.diffs
$host.SetShouldExit($LastExitCode)
}
artifacts:
- path: 'plr-*.zip'
name: plr_zip
- path: 'pg-*.zip'
name: pg_zip
deploy:
- provider: GitHub
release: GITHUBCACHE
draft: false
prerelease: false
artifact: pg_zip
auth_token:
# CHANGE BACK TO THE 'ORIGINAL' BEFORE THE PULL REQUEST (IF ANY)
secure: KzS1DumC2yBg2LGN9x3AemHFOjAdp+rD58rW5aGGpwW4Pfdwdm7AmRpYKprPY8Gs
on:
pggithubbincachefound: false
# non - "branch, tag, or commit" will still be expected "false" ( githubcache != true )
# and never find a pg-*.zip to deploy - and that is OK.
# second, last of Github deployments, to try to appear as "latest"
- provider: GitHub
release: $(appveyor_repo_tag_name)
draft: false
prerelease: false
artifact: plr_zip
auth_token:
# CHANGE BACK TO THE 'ORIGINAL' BEFORE THE PULL REQUEST (IF ANY)
secure: KzS1DumC2yBg2LGN9x3AemHFOjAdp+rD58rW5aGGpwW4Pfdwdm7AmRpYKprPY8Gs
on:
appveyor_repo_tag: true
- provider: FTP
host: frs.sourceforge.net
protocol: sftp
username: andremikulec,andremikulec.u
password:
secure: 4gk4GyW4O5RooiOyGeRdoA==
artifact: pg_zip, plr_zip
folder: /home/frs/project/andremikulec
application:
active_mode: false