forked from jconway/plr
-
Notifications
You must be signed in to change notification settings - Fork 27
/
appveyor.yml
1429 lines (1305 loc) · 56.7 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
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## # Skipping commits affecting specific files (GitHub and Bitbucket only).
## skip_commits:
## files:
## # skipping AppVeyor build if, in the push’s head commit, all of the files
## # have the extension .md
## - '**/*.md'
image: Visual Studio 2015
clone_depth: 1
environment:
# Always Try to save
APPVEYOR_SAVE_CACHE_ON_ERROR: true
matrix:
# cygwin - late November 2023
# cygwin - all cygwin work - except x86 "dragon" "archive" - binaries are not available
## - pg: master # non-static commit - from git
## PlatformToolset: v143
## Configuration: Debug
## Platform: x64
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## # rversion - from the already compiled "Cygwin R" - 4.3.0-1 - November 2023 - cygwin.com/packages/summary/R.html
## compiler: cygwin
##
## - pg: master # non-static commit - from git
## PlatformToolset: v143
## Configuration: Debug
## Platform: x86
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## # rversion - from the already compiled "Cygwin R" - 4.3.0-1 - November 2023 - cygwin.com/packages/summary/R.html
## compiler: cygwin
##
## - pg: REL_16_1 # static commit - from git
## PlatformToolset: v143
## Configuration: Debug
## Platform: x64
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## # rversion - from the already compiled "Cygwin R" - 4.3.0-1 - November 2023 - cygwin.com/packages/summary/R.html
## compiler: cygwin
##
## - pg: REL_16_1 # static commit - from git
## PlatformToolset: v143
## Configuration: Debug
## Platform: x86
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## # rversion - from the already compiled "Cygwin R" - 4.3.0-1 - November 2023 - cygwin.com/packages/summary/R.html
## compiler: cygwin
##
## - pg: REL_15_5 # static commit - from git
## PlatformToolset: v143
## Configuration: Debug
## Platform: x64
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## # rversion - from the already compiled "Cygwin R" - 4.3.0-1 - November 2023 - cygwin.com/packages/summary/R.html
## compiler: cygwin
##
## - pg: REL_15_5 # static commit - from git
## PlatformToolset: v143
## Configuration: Debug
## Platform: x86
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## # rversion - from the already compiled "Cygwin R" - 4.3.0-1 - November 2023 - cygwin.com/packages/summary/R.html
## compiler: cygwin
##
## # from the already compiled "Cygwin PostgreSQL" - 15.3-1 - November 2023 - https://cygwin.com/packages/summary/postgresql-src.html
## - PlatformToolset: v143
## Configuration: Release
## Platform: x64
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## # rversion - from the already compiled "Cygwin R" - 4.3.0-1 - November 2023 - cygwin.com/packages/summary/R.html
## compiler: cygwin
# from the "last" compiled "Cygwin PostgreSQL" - in December 2022 - https://cygwin.com/packages/summary/postgresql-src.html
- PlatformToolset: v143
Configuration: Release
Platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
# rversion - from the already compiled "Cygwin R" - in December 2022 - cygwin.com/packages/summary/R.html
compiler: cygwin
# # x86 "dragon" "archive" (binaries are not easily available)
#
# # plr to work with
# # MobaXterm Version 22.2 (2022-11-15) through the recent Version 23.2 (2023-06-25) and later 23.4?
# # from the "last" compiled "Cygwin PostgreSQL" - in November 2022 - https://cygwin.com/packages/summary/postgresql-src.html
# - PlatformToolset: v143
# Configuration: Debug
# Platform: x86
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
# # rversion - from the already compiled "Cygwin R" - in November 2022 - cygwin.com/packages/summary/R.html
# compiler: cygwin
# archive: mobaxterm232 # or alternately "mobaxterm"
# # msys2 - late November 2023
# # msys2
## - pg: master # branch - non-static commit - from git
## PlatformToolset: v143
## Configuration: Debug
## Platform: x64
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## rversion: 4.3.2
## compiler: msys2
##
## - pg: REL_16_1 # static commit - from git
## PlatformToolset: v143
## Configuration: Debug
## Platform: x64
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## rversion: 4.3.2
## compiler: msys2
##
## - pg: REL_15_5 # static commit - from git # binary distributer version is volitile
## PlatformToolset: v143
## Configuration: Debug
## Platform: x64
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## rversion: 4.3.2
## compiler: msys2
##
## # from the already compiled "MINGW64 PostgreSQL" - 16.1-1 - November 2023 - packages.msys2.org/package/mingw-w64-x86_64-postgresql
## # none - from the repository - November 2023 - pg 16.1-1
## - PlatformToolset: v143
## Configuration: Debug
## Platform: x64
## APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
## rversion: 4.3.2
## compiler: msys2
# msvc/msys2? - "pg" 10 - last version "pg" supports x86
# msvc/msys2? - "r" 4.1.3 - last version "r" supports x86
- pg: REL_10_STABLE # static commit - from git
PlatformToolset: v143
Configuration: Debug
Platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
rversion: 4.1.3
compiler: msys2
# # msvc - late November 2023
# # msvc
# msvc - "pg" 10 - last version "pg" supports x86
# msvc - "r" 4.1.3 - last version "r" supports x86
- pg: 10.23-1
PlatformToolset: v120
Configuration: Release
Platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
rversion: 4.1.3
compiler: msvc
- pg: REL_10_STABLE # verify can compile pgsql.sln on msvc 2015
PlatformToolset: v120
Configuration: Debug
Platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
rversion: 4.1.3
compiler: msvc
# # msvc - late November 2023 - the rest are 64bit builds
# # msvc
# In Jul 2024 Appveyor msvc - REL_17 [and master] attempted builds do not build
# cannot open file 'C:/projects/postgresql/src/tools/msvc/Mkvcbuild.pm': No such file or directory
# msvc(non-meson pure-msvc) builds of pg "17+ and "master" are no longer possible
#
#
# - pg: master # non-static commit - from git
# PlatformToolset: v143
# Configuration: Debug
# Platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
# rversion: 4.2.3
# compiler: msvc
#
# - pg: REL_17_BETA2 # static commit - from git
# PlatformToolset: v143
# Configuration: Debug
# Platform: x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
# rversion: 4.2.3
# compiler: msvc
- pg: REL_16_3 # static commit - from git
PlatformToolset: v143
Configuration: Debug
Platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
rversion: 4.2.3
compiler: msvc
- pg: 16.4-1
PlatformToolset: v143
Configuration: Release
Platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
rversion: 4.2.3
compiler: msvc
- pg: 15.8-1
PlatformToolset: v143
Configuration: Release
Platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
rversion: 4.2.3
compiler: msvc
- pg: 14.13-1
PlatformToolset: v143
Configuration: Release
Platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
rversion: 4.2.3
compiler: msvc
- pg: 13.16-1
PlatformToolset: v143
Configuration: Release
Platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
rversion: 4.2.3
compiler: msvc
- pg: 12.20-1
PlatformToolset: v143
Configuration: Release
Platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
rversion: 4.2.3
compiler: msvc
- pg: REL_11_STABLE # verify can compile pgsql.sln on msvc 2017
PlatformToolset: v140
Configuration: Debug
Platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
rversion: 4.2.3
compiler: msvc
- pg: 11.22-1
PlatformToolset: v140
Configuration: Release
Platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
rversion: 4.2.3
compiler: msvc
matrix:
allow_failures:
- pg: master
for:
-
matrix:
only:
- compiler: cygwin
# mileage from cygwin 32bit will vary
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Cygwin
init:
- echo compiler cygwin init
- systeminfo
# https://stackoverflow.com/questions/5089389/how-can-i-check-what-version-edition-of-visual-studio-is-installed-programmatica
- if not "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property productId
- if not "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productLineVersion
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" echo APPVEYOR_BUILD_WORKER_IMAGE is 2015
# Make %x64% available for caching
# a variable used in the Appveyor cach area must be defined in the init
- set gitrevshort=%APPVEYOR_REPO_COMMIT:~0,8%
- ps: |
# Set-PSDebug -Trace 2
if ("${env:compiler}" -eq "cygwin") {
if ("${env:Platform}" -eq "x64") {
${env:CYG_ARCH} = "x86_64"
${env:CYG_ROOT} = "C:\cygwin64"
${env:CYG_CACHE} = "C:\cygwin64\var\cache\setup"
} else {
${env:CYG_ARCH} = "x86"
${env:CYG_ROOT} = "C:\cygwin"
${env:CYG_CACHE} = "C:\cygwin\var\cache\setup"
}
}
# https://cygwin.com/mirrors.html and MobaXterm ~/.aptcyg/setup.ini
#
# CYG_MIRROR: http://cygwin.mirror.rafal.ca/
- set CYG_MIRROR="https://mirrors.kernel.org/sourceware/cygwin/"
- echo CYG_MIRROR %CYG_MIRROR%
- set CYG_SETUP_DOWNLOAD_URL="http://cygwin.com/setup-%CYG_ARCH%.exe"
- echo CYG_SETUP_DOWNLOAD_URL %CYG_SETUP_DOWNLOAD_URL%
#
# possible user provided in the matrix
# (for now, keep this area to be the same as "msys2" and NOT ALL "msys2" FEATURES are implemented)
#
- if not defined githubcache set githubcache=false
- if not defined pghint set pghint=none
- if not defined pg set pg=none
- if not defined pglinkbinoldurl set pglinkbinoldurl=none
# not (yet) used in compiler cygwin
# - if not defined rlinkbinoldurl set rlinkbinoldurl=none
- if not defined rversion_more set rversion_more=-nodetails
install:
- echo compiler cygwin install
- ps: |
# Set-PSDebug -Trace 2
${env:PATH} = "${env:CYG_ROOT}\bin;${env:PATH}"
# From the version
- ps: |
# Set-PSDebug -Trace 2
if("${env:pg}" -ne "none") {
${env:pgversion} = ${env:pg}
}
# if pg equals none - msys2 binary case,
# then later in the .sh scripts, pgversion will be determined by SQL
#
# only used about a custom PostgreSQL build (not an CYGWIN already compiled binary)
#
# no quotes - IMPORTANT to pass to bash
- set pgroot=C:\PGINSTALL
- mkdir "%pgroot%"
#
# if "githubcache: true",
# then use the git tag 0.0.0.0.0.GITHUBCACHE in github as a "cache" of
# pg already-compiled-binaries.
#
- set pg7z=pg-pg%pgversion%-%Platform%-%Configuration%-%compiler%.7z
- set pggithubbincacheurl=https://github.com/AndreMikulec/plr/releases/download/0.0.0.0.0.GITHUBCACHE/%pg7z%
#
# note: using Windows instead of Powershell
# I could not get the Invoke-??? . . . I would silently run (and die), I would not get error feedback.
#
- if "%githubcache%"=="true" if not exist "%pg7z%" (
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 "%pg7z%" -L "%pggithubbincacheurl%"
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" if exist "%pg7z%" (set pggithubbincachefound=true) else (set pggithubbincachefound=false)
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" if "%pggithubbincachefound%"=="true" (
mkdir "%pgroot%" &
7z x "%pg7z%" "-o%pgroot%" &
dir "%pgroot%" &
if exist "%pgroot%\bin\postgres.exe" (set pggithubbincacheextracted=true) else (set pggithubbincacheextracted=false)
)
# cygwin: executable IS STILL postgres.exe (not postgres)
# 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 (if any) old plr files, from the pg already-compiled-binary
# extraction from 0.0.0.0.0.GITHUBCACHE
#
- ps: |
# Set-PSDebug -Trace 2
if (("${env:githubcache}" -eq "true") -and ("${env:pggithubbincacheextracted}" -eq "true")) {
pushd "${env:pgroot}"
del share\extension\plr--*.sql 2>null
del share\extension\plr.control 2>null
del lib\plr.dll 2>null
del symbols\plr.pdb 2>null
popd
}
#
# PostgreSQL from source code: git, tag, or commit
#
- ps: |
# Set-PSDebug -Trace 2
if (("${env:pggithubbincacheextracted}" -eq "false") -and ("${env:pg}" -ne "none")) {
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: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
pwd
echo "Files . . ."
$Table = Get-ChildItem
foreach ($Row in $Table) { $Row.Name }
popd
}
- ps: |
# Somewhat safe to pass to Windows CMD
${env:cunsupported} = " "
# specific - "archive" is "none" or "last" or undefined
#
${env:cunsupported} = "false"
#
if("${env:Platform}" -eq "x86" -and "${env:archive}" -eq "") {
${env:CYG_MIRROR} = "http://mirrors.kernel.org/sourceware/cygwin-archive/20221123/"
${env:cunsupported} = "true"
}
# specific - "archive" is "mobaxterm" or "mobaxterm232"
if("${env:Platform}" -eq "x86" -and
("${env:archive}" -eq "mobaxterm" -or
"${env:archive}" -eq "mobaxterm232"
)) {
${env:CYG_MIRROR} = "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/06/12/123302/"
# override
${env:CYG_SETUP_DOWNLOAD_URL} = "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/setup/snapshots/setup-x86-2.919.exe"
}
- if "%cunsupported%"=="true" set unsupported_flag="--allow-unsupported-windows"
- if "%cunsupported%"=="false" set unsupported_flag=" "
- echo CYG_SETUP_DOWNLOAD_URL %CYG_SETUP_DOWNLOAD_URL%
# cywin AND PostreSQL development
- 'appveyor DownloadFile %CYG_SETUP_DOWNLOAD_URL% -FileName setup.exe'
- echo CYG_MIRROR %CYG_MIRROR%
- echo cunsupported %cunsupported%
- echo unsupported_flag %unsupported_flag% VALUE
- echo CYG_ROOT %CYG_ROOT%
- echo CYG_CACHE %CYG_CACHE%
- echo CYG_ARCH %CYG_ARCH%
# destroy appveyors already existing directories
- rmdir /S /Q "%CYG_ROOT%" || time /t
# cygwin install (verbose to help see HTTP 404 errors)
- echo setup.exe %unsupported_flag% -qnNdO -v -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%"
- 'setup.exe %unsupported_flag% -qnNdO -v -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" || type "%CYG_ROOT%\var\log\setup.log.full" || type "%CYG_ROOT%\var\log\setup.log" || time /t'
# Windows server
- 'setup.exe %unsupported_flag% -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P cygrunsrv'
# postgres installation requirements that are not already covered by the other lines further down
- 'setup.exe %unsupported_flag% -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P gcc-core -P make -P tar -P gzip -P libreadline7 -P zlib -P icu-devel -P bison -P perl'
- 'setup.exe %unsupported_flag% -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P flex -P libreadline-devel -P libssl-devel -P libxml2-devel -P libxslt-devel -P openldap-devel -P zlib-devel'
#
# plr - andre - other packages - experience of need - while trying to - manually step by step build plr
- 'setup.exe %unsupported_flag% -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P libintl-devel -P libcrypt-devel'
#
# to archive and un-archive (7z)
- 'setup.exe %unsupported_flag% -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P p7zip'
#
- bash -login -c "cygserver-config --yes"
#
- copy %CYG_ROOT%\etc\defaults\etc\cygserver.conf %CYG_ROOT%\etc\defaults\etc\cygserver.conf.original
- echo kern.ipc.shmmni 32767 >> %CYG_ROOT%\etc\defaults\etc\cygserver.conf
- echo kern.ipc.shmseg 32767 >> %CYG_ROOT%\etc\defaults\etc\cygserver.conf
#
- bash -login -c "cygrunsrv -S cygserver"
# PostgreSQL on cygwin
# https://cygwin.com/cgi-bin2/package-grep.cgi?grep=postgresql&arch=x86_64
#
### trying to add more -devel to try to solve a plr-make "lpostgres" linking error
- setup.exe %unsupported_flag% -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P postgresql-client -P postgresql -P postgresql-devel
# needs pg_config
# 1. USE_PGXS=1
# 2. new variables PKGLIBDIR SHAREDIR to determine the location of the new plr files (to be archived)
#
# PostgreSQL - from an CYGWIN already-compiled-binary - pg_config
### trying to add more -devel to try to solve a plr-make "lpostgres" linking error
- setup.exe %unsupported_flag% -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P libpq-devel
# R on cygwin
# https://cygwin.com/cgi-bin2/package-grep.cgi?grep=R-&arch=x86
###
### NEED A CYGWIN COMPILED "R", so "rversion" (if any) is effectively ignored
###
# only linking to the "R from cygwin"
### - if "%pg%"=="none" ( )
- setup.exe %unsupported_flag% -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P R -P R-debuginfo
build_script:
#
# Note - cygwin DOES NOT do "R subarchitectures" - R_ARCH - "/x64" and "/i386"
# set
- set R_HOME=%CYG_ROOT%\lib\R
#
- bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/build_script.sh"
after_build:
- bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/after_build.sh"
test_script:
- bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/test_script.sh"
-
matrix:
only:
- compiler: msys2
init:
- echo compiler msys2 init
- systeminfo
# https://stackoverflow.com/questions/5089389/how-can-i-check-what-version-edition-of-visual-studio-is-installed-programmatica
- if not "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property productId
- if not "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productLineVersion
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" echo APPVEYOR_BUILD_WORKER_IMAGE is 2015
# Make %x64% available for caching
# a variable used in the Appveyor cach area must be defined in the init
- set gitrevshort=%APPVEYOR_REPO_COMMIT:~0,8%
- ps: |
# Set-PSDebug -Trace 2
if ("${env:compiler}" -eq "msys2") {
if ("${env:Platform}" -eq "x64") {
${env:MSYSTEM} = "MINGW64"
} else {
${env:MSYSTEM} = "MINGW32"
}
}
if ("${env:MSYSTEM}" -eq "MINGW64") {
${env:R_ARCH} = "/x64"
} else {
${env:R_ARCH} = "/i386"
}
${env:rbinurl} = "https://cran.r-project.org/bin/windows/base/old/${env:rversion}/R-${env:rversion}-win.exe"
# "make installcheck" does not like spaces
${env:R_HOME} = "C:\RINSTALL"
#
# also see that each *.sh dot sources early ". ./init.sh"
if ("${env:Platform}" -eq "x64") {
${env:bit} = "64"
} else {
${env:bit} = "32"
}
${env:betterperl} = "strawberry${env:bit}"
${env:betterperlurl} = "https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-${env:bit}bit-portable.zip"
#
# possible user provided in the matrix
#
- if not defined githubcache set githubcache=false
- if not defined pghint set pghint=none
- if not defined pg set pg=none
- if not defined pglinkbinoldurl set pglinkbinoldurl=none
- if not defined rlinkbinoldurl set rlinkbinoldurl=none
- if not defined rversionurl set rversionurl=https://cran.r-project.org/bin/windows/base/old/%rversion%/R-%rversion%-win.exe
- if not defined rversion_more set rversion_more=-nodetails
install:
- echo compiler msys2 install
- ps: |
# Set-PSDebug -Trace 2
${env:PATH} = "C:\msys64\${env:MSYSTEM}\bin;C:\msys64\usr\bin;C:\msys64\bin;${env:PATH}"
# - if not exist R-%rversion%-win.exe appveyor downloadfile https://cran.r-project.org/bin/windows/base/old/%rversion%/R-%rversion%-win.exe
- ps: |
# Set-PSDebug -Trace 2
# default
# special named R version(s)
if("${env:rlinkbinoldurl}" -eq "none") {
if("${env:rversion}" -match "beta|alpha|devel|patched") {
${env:rversionurl} = "https://cran.r-project.org/bin/windows/base/R-${env:rversion}-win.exe"
}
} else {
# R general download (or a specific custom build)
${env:rversionurl} = ${env:rlinkbinoldurl}
}
# .7z .zip .exe
${env:rversionurl_download_ext} = [System.IO.Path]::GetExtension(${env:rversionurl})
# .7z .zip .exe # too many variants: not worth the time/code/headache/caching effort
if (Test-Path "R-${env:rversion}-win.exe") {
del "R-${env:rversion}-win.exe"
}
#
# any download
# PowerShell 4.0, an Alias of "curl"
if(-not ("${env:rversionurl_download_ext}" -eq ".exe")) {
curl -o "R-${env:rversion}-win${env:rversionurl_download_ext}" -v "${env:rversionurl}"
7z e "R-${env:rversion}-win${env:rversionurl_download_ext}" "R-${env:rversion}-win.exe"
} else {
curl -o "R-${env:rversion}-win.exe" -v "${env:rversionurl}"
}
#
- R-%rversion%-win.exe /VERYSILENT /DIR=%R_HOME% /NOICONS /TASKS=
# From the version
- ps: |
# Set-PSDebug -Trace 2
if("${env:pg}" -ne "none") {
${env:pgversion} = ${env:pg}
}
# if pg equals none - msys2 binary case,
# then later in the .sh scripts, pgversion will be determined by SQL
#
# only used about a custom PostgreSQL build (not an MSYS2 already compiled binary)
#
# no quotes - IMPORTANT to pass to bash
- set pgroot=C:\PGINSTALL
- mkdir "%pgroot%"
#
#
# In powershell the (above) will not run/install
# neither plain as here, nor in Invoke-Command,
# (Perhaps because, of "some" complexity)
- ps: |
# Set-PSDebug -Trace 2
if (-not (Test-Path "${env:betterperl}.zip")) {
curl -o "${env:betterperl}.zip" -v "${env:betterperlurl}"
}
7z x "${env:betterperl}.zip" "-oc:\${env:betterperl}"
# of needed to install pl/perl
${env:PATH} = "c:\${env:betterperl}\perl\bin;${env:PATH}"
which perl
${env:PATH} = "${env:PATH};c:\${env:betterperl}\c\bin"
which pexports
# note, if compiling PostgreSQL from source,
# then in the .sh files. one has to re-set the path
# xor append . . .
# export PATH=. . .etc . . .:${PATH}
# to the /etc/profile
#
# if "githubcache: true",
# then use the git tag 0.0.0.0.0.GITHUBCACHE in github as a "cache" of
# pg already-compiled-binaries.
#
- set pg7z=pg-pg%pgversion%-%Platform%-%Configuration%-%compiler%.7z
- set pggithubbincacheurl=https://github.com/AndreMikulec/plr/releases/download/0.0.0.0.0.GITHUBCACHE/%pg7z%
#
# note: using Windows instead of Powershell
# I could not get the Invoke-??? . . . I would silently run (and die), I would not get error feedback.
#
- if "%githubcache%"=="true" if not exist "%pg7z%" (
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 "%pg7z%" -L "%pggithubbincacheurl%"
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" if exist "%pg7z%" (set pggithubbincachefound=true) else (set pggithubbincachefound=false)
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" if "%pggithubbincachefound%"=="true" (
mkdir "%pgroot%" &
7z x "%pg7z%" "-o%pgroot%" &
dir "%pgroot%" &
if exist "%pgroot%\bin\postgres.exe" (set pggithubbincacheextracted=true) else (set pggithubbincacheextracted=false)
)
# msys2: executable IS STILL postgres.exe (not postgres)
# 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 plr files, from the pg already-compiled-binary
# extraction from 0.0.0.0.0.GITHUBCACHE, if any old files
#
# in the msys2 case, this will not happen (TODO: later remove this code)
#
- ps: |
# Set-PSDebug -Trace 2
if (("${env:githubcache}" -eq "true") -and ("${env:pggithubbincacheextracted}" -eq "true")) {
pushd "${env:pgroot}"
del share\extension\plr--*.sql 2>null
del share\extension\plr.control 2>null
del lib\plr.dll 2>null
del symbols\plr.pdb 2>null
popd
}
#
# PostgreSQL from source code: git, tag, or commit
#
- ps: |
# Set-PSDebug -Trace 2
if (("${env:pggithubbincacheextracted}" -eq "false") -and ("${env:pg}" -ne "none")) {
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: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
pwd
echo "Files . . ."
$Table = Get-ChildItem
foreach ($Row in $Table) { $Row.Name }
popd
}
# msys2
#
# Nov Dec 2021 Appveyor changed the PATH
# The [first] winpty.exe found is [the] "wrong [one]"
#
# Attempt to avoid the error:
#
# 1 [main] winpty (2980) C:\Program Files\Git\usr\bin\winpty.exe: *** fatal error - cygheap base mismatch detected
# This problem is probably due to using incompatible versions of the cygwin DLL
#
- bash --login -c "pacman --noconfirm -S --needed winpty"
# PostgreSQL from an MSYS2 already-compiled-binary.
- if "%pg%"=="none" (
bash --login -c "pacman --noconfirm -S --needed ${MINGW_PACKAGE_PREFIX}-postgresql"
)
#
# How to obtain older versions of packages using MSYS2?
# 2015
# https://stackoverflow.com/questions/33969803/how-to-obtain-older-versions-of-packages-using-msys2
#
- if "%pg%"=="none" if not "%pglinkbinoldurl%"=="none" (
bash -login -c "curl -o install.pkg.tar.zst ${pglinkbinoldurl}" &
bash -login -c "pacman -U --noconfirm install.pkg.tar.zst"
)
build_script:
- bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/build_script.sh"
after_build:
- bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/after_build.sh"
test_script:
- bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/test_script.sh"
-
matrix:
only:
- compiler: msvc
environment:
#
# Appveyor PostgreSQL clusters specific
#
PGUSER: postgres
PGPASSWORD: Password12!
#
# PostgreSQL client session
#
PGOPTIONS: -c log_error_verbosity=verbose -c log_min_messages=debug2 -c log_min_error_statement=debug2
#
# Appveyor build server environment variables
#
# ProgramFiles=C:\Program Files
# ProgramFiles(x86)=C:\Program Files (x86)
#
init:
- echo compiler msvc init
- systeminfo
# https://stackoverflow.com/questions/5089389/how-can-i-check-what-version-edition-of-visual-studio-is-installed-programmatica
- if not "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property productId
- if not "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productLineVersion
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" echo APPVEYOR_BUILD_WORKER_IMAGE is 2015
- ps: |
${env:msvcversion} = "2015"
${env:msvcproductid} = "unknown"
if (Test-Path "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe") {
${env:msvcversion} = $(& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productLineVersion)
${env:msvcproductid} = $(& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property productId)
}
if([int]"${env:msvcversion}" -ge 2019) {
${env:msvc_age} = "2019_or_younger"
} else {
${env:msvc_age} = "2017_or_older"
}
# Make %x64% available for caching
# a variable used in the Appveyor cache area must be defined in the init
- ps: |
if ("$env:Platform" -eq "x64") {
$env:pf = "$env:ProgramFiles"
$env:x64 = "-x64"
} else {
$env:pf = "${env:ProgramFiles(x86)}"
}
$env:exe = "postgresql-$env:pg-windows$env:x64.exe"
[Environment]::SetEnvironmentVariable("exe", $env:exe, "Machine")
if ("${env:Platform}" -eq "x64") {
${env:bit} = "64"
} else {
${env:bit} = "32"
}
${env:betterperl} = "strawberry${env:bit}"
${env:betterperlurl} = "https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-${env:bit}bit-portable.zip"
#
# possible user provided in the matrix
#
- if not defined githubcache set githubcache=false
- if not defined pghint set pghint=none
- if not defined rlinkbinoldurl set rlinkbinoldurl=none
- if not defined rversionurl set rversionurl=https://cran.r-project.org/bin/windows/base/old/%rversion%/R-%rversion%-win.exe
- if not defined rversion_more set rversion_more=-nodetails
install:
- echo compiler msvc install
#
- ps: |
# Set-PSDebug -Trace 2
# default
# special named R version(s)
if("${env:rlinkbinoldurl}" -eq "none") {
if("${env:rversion}" -match "beta|alpha|devel|patched") {
${env:rversionurl} = "https://cran.r-project.org/bin/windows/base/R-${env:rversion}-win.exe"
}
} else {
# R general download (or a specific custom build)
${env:rversionurl} = ${env:rlinkbinoldurl}
}
# .7z .zip .exe
${env:rversionurl_download_ext} = [System.IO.Path]::GetExtension(${env:rversionurl})
# .7z .zip .exe # too many variants: not worth the time/code/headache/caching effort
if (Test-Path "R-${env:rversion}-win.exe") {
del "R-${env:rversion}-win.exe"
}
#
# any download
# PowerShell 4.0, an Alias of "curl"
if(-not ("${env:rversionurl_download_ext}" -eq ".exe")) {
curl -o "R-${env:rversion}-win${env:rversionurl_download_ext}" -v "${env:rversionurl}"
7z e "R-${env:rversion}-win${env:rversionurl_download_ext}" "R-${env:rversion}-win.exe"
} else {
curl -o "R-${env:rversion}-win.exe" -v "${env:rversionurl}"
}
#
- R-%rversion%-win.exe /VERYSILENT
#
- set mingw=C:\msys64\mingw
#
# From the EnterpriseDB version name,
# if any, strip off 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%
#
# In the Perl x86 case, in Perl, in install.pl, "mkdir" silently fails.
# %pgroot% is always needed (to use\place binaries in) to do the regression tests,
# so just, explicitly (early), create that directory here now.
#
- if not exist "%pgroot%" mkdir "%pgroot%"
- echo SHOWING pgroot - "%pgroot%"
- dir "%pgroot%"
#
- SET R_HOME=%ProgramFiles%\R\R-%rversion%
- set rbin=%Platform:x86=i386%
- SET sed=C:\msys64\usr\bin\sed
# Appveyor specific: seems not required - with Appveyor - Strawberry perl is already in the path
# ActiveState Perl is good, but Strawberry Perl is preferred
#
- ps: |
# Set-PSDebug -Trace 2
if (-not (Test-Path "${env:betterperl}.zip")) {
curl -o "${env:betterperl}.zip" -v "${env:betterperlurl}"
}
7z x "${env:betterperl}.zip" "-oc:\${env:betterperl}"
# of needed to install pl/perl
${env:PATH} = "c:\${env:betterperl}\perl\bin;${env:PATH}"
which perl
${env:PATH} = "${env:PATH};c:\${env:betterperl}\c\bin"
which pexports
#
# if "githubcache: true",
# then use the git tag 0.0.0.0.0.GITHUBCACHE in github as a "cache" of
# pg already-compiled-binaries.
#
- set pg7z=pg-pg%pgversion%-%Platform%-%Configuration%-%compiler%.7z
- set pggithubbincacheurl=https://github.com/AndreMikulec/plr/releases/download/0.0.0.0.0.GITHUBCACHE/%pg7z%
#
# note: using Windows instead of Powershell
# I could not get the Invoke-??? . . . I would silently run (and die), I would not get error feedback.
#
- if "%githubcache%"=="true" if not exist "%pg7z%" (
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 "%pg7z%" -L "%pggithubbincacheurl%"
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" if exist "%pg7z%" (set pggithubbincachefound=true) else (set pggithubbincachefound=false)
- if "%githubcache%"=="true" if "%pggithubbincachefailingfound%"=="false" if "%pggithubbincachefound%"=="true" (
mkdir "%pgroot%" &
7z x "%pg7z%" "-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 plr files, from the pg already-compiled-binary
# extraction from 0.0.0.0.0.GITHUBCACHE, if any 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 2>null
del share\extension\plr.control 2>null
del lib\plr.dll 2>null
del symbols\plr.pdb 2>null
popd
}