Bug 248657

Summary: [exp-run] Mk/bsd.default-versions.mk: Update default version to PostgreSQL
Product: Ports & Packages Reporter: Kevin Bowling <kbowling>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Many People CC: girgen, mfechner, pgsql, ports-bugs, tmunro, tz, vvd
Priority: --- Keywords: needs-qa
Version: LatestFlags: antoine: maintainer-feedback? (pgsql)
linimon: exp-run?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to Mk/bsd.default-versions.mk
none
Fix build databases/pgsphere
none
databases/postgresql-orafce: update to 3.13.4 - add support of PostgreSQL 11 and 12, removed 9.2, 9.3 and 9.4
none
Fix build databases/pgsphere and update to support PostgreSQL 12
vvd: maintainer-approval? (sunpoet)
databases/postgresql-orafce: update to 3.13.4 - add support of PostgreSQL 11 and 12, removed 9.2, 9.3 and 9.4 kbowling: maintainer-approval+

Description Kevin Bowling freebsd_committer freebsd_triage 2020-08-14 14:02:31 UTC
At this point Postgres 12 has been out for a while.  Per Thomas Munro's recent BSDCan talk, there are significant advancements in pg12 especially on FreeBSD 11, 12 and HEAD https://www.bsdcan.org/events/bsdcan_2020/sessions/session/46/

I think we just need to from Mk/bsd.default-versions.mk and do an exp-run?
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2020-08-14 15:59:34 UTC
Using PostgreSQL 12 from release on several hosts with FreeBSD 12.0 and now 12.1 without any problems.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2020-08-15 04:31:27 UTC
Created attachment 217220 [details]
patch to Mk/bsd.default-versions.mk
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2020-08-15 04:32:28 UTC
^Triage: create a trivial patch.
Comment 4 Palle Girgensohn freebsd_committer freebsd_triage 2020-08-17 06:34:04 UTC
Excellent idea, thanks!

Yes, an exp-run is what is needed.
Comment 5 Antoine Brodin freebsd_committer freebsd_triage 2020-08-20 16:07:33 UTC
*** Bug 248778 has been marked as a duplicate of this bug. ***
Comment 6 Matthias Fechner freebsd_committer freebsd_triage 2020-08-23 12:04:02 UTC
I use version 12 already with gitlab. For the next version of gitlab postgresql 12 is required.

Thanks a lot for working on this!
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2020-08-24 03:28:26 UTC
Created attachment 217471 [details]
Fix build databases/pgsphere

(In reply to Antoine Brodin from comment #7)
Are both build fine with PostgreSQL 11?

1st is VLA (https://en.wikipedia.org/wiki/Variable-length_array) issue - patch in attach.
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2020-08-24 05:33:10 UTC
Created attachment 217475 [details]
databases/postgresql-orafce: update to 3.13.4 - add support of PostgreSQL 11 and 12, removed 9.2, 9.3 and 9.4

(In reply to Antoine Brodin from comment #7)
2nd is deprecated version of the port databases/postgresql-orafce.

Patch is in attach.
I can create separate PR if it's necessary.
Comment 10 Vladimir Druzenko freebsd_committer freebsd_triage 2020-08-24 18:03:30 UTC
Created attachment 217497 [details]
Fix build databases/pgsphere and update to support PostgreSQL 12

There is a commit which added support of the PostgreSQL 12.
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2020-08-24 18:17:27 UTC
Created attachment 217499 [details]
databases/postgresql-orafce: update to 3.13.4 - add support of PostgreSQL 11 and 12, removed 9.2, 9.3 and 9.4

Updated LICENSE.
Comment 12 commit-hook freebsd_committer freebsd_triage 2020-08-26 01:52:51 UTC
A commit references this bug:

Author: kbowling
Date: Wed Aug 26 01:52:12 UTC 2020
New revision: 546242
URL: https://svnweb.freebsd.org/changeset/ports/546242

Log:
  databases/postgresql-oraface: update to 3.13.4

  Add support for PostgreSQL 11 and 12, removes 9.2-9.4

  PR:		248657
  Submitted by:	VVD@unislabs.com
  Sponsored by:	BBOX.io

Changes:
  head/databases/postgresql-orafce/Makefile
  head/databases/postgresql-orafce/distinfo
  head/databases/postgresql-orafce/pkg-plist
Comment 13 Kevin Bowling freebsd_committer freebsd_triage 2020-08-26 01:52:59 UTC
Comment on attachment 217499 [details]
databases/postgresql-orafce: update to 3.13.4 - add support of PostgreSQL 11 and 12, removed 9.2, 9.3 and 9.4

committed orafce update with a few minor changes
Comment 14 commit-hook freebsd_committer freebsd_triage 2020-09-11 21:54:39 UTC
A commit references this bug:

Author: kbowling
Date: Fri Sep 11 21:54:27 UTC 2020
New revision: 548262
URL: https://svnweb.freebsd.org/changeset/ports/548262

Log:
  databases/pgsphere: Update to support PG12

  PR:		248657
  Submitted by:	VVD@unislabs.com
  Approved by:	sunpoet (maintainer timeout)
  Sponsored by:	BBOX.io

Changes:
  head/databases/pgsphere/Makefile
  head/databases/pgsphere/distinfo
Comment 15 Kevin Bowling freebsd_committer freebsd_triage 2020-09-11 21:55:18 UTC
pgsphere patch committed with minor changes, can we go ahead and commit the default version patch?
Comment 16 Vladimir Druzenko freebsd_committer freebsd_triage 2020-09-11 22:55:35 UTC
(In reply to commit-hook from comment #14)
Why did you remove this line from patch:
> CFLAGS="${CFLAGS} -Wvla"

Build error:
polygon.c:827:14: error: variable length array used [-Werror,-Wvla]
                SPoint          arr[nelem];
                                   ^
polygon.c:895:11: error: variable length array used [-Werror,-Wvla]
        SPoint          s[poly->npts + 2];
                         ^
2 errors generated.
gmake[2]: *** [<builtin>: polygon.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
path.c:516:14: error: variable length array used [-Werror,-Wvla]
                SPoint          arr[nelem];
                                   ^

Possible there are better solution, but this work too.
Comment 17 Kevin Bowling freebsd_committer freebsd_triage 2020-09-12 06:39:34 UTC
(In reply to VVD from comment #16)
Under what context are you compiling with -Werror?  The software is deliberately using VLAs, is your compiler desiring to set the standard to c99 instead of c11?
Comment 18 Vladimir Druzenko freebsd_committer freebsd_triage 2020-09-12 13:45:28 UTC
(In reply to Kevin Bowling from comment #17)
With -Werror instead -Wvla it build fine too.
> CFLAGS="${CFLAGS} -Werror"

Don't know how to do this better.
Comment 19 Kevin Bowling freebsd_committer freebsd_triage 2020-09-12 14:09:36 UTC
(In reply to VVD from comment #18)
I am asking, why in your environment do you have -Werror?  Which compiler?  This is not normal and none of the tinderbox builds have triggered so far from my commit so it seems like your make.conf or environment are not normal.
Comment 20 Vladimir Druzenko freebsd_committer freebsd_triage 2020-09-12 14:21:56 UTC
(In reply to Kevin Bowling from comment #19)
12.1 amd64 with default clang 8:
$ clang --version
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin

I don't have -Werror by default, but if I add it to databases/pgsphere/Makefile as I described, then port build fine.
Comment 21 Kevin Bowling freebsd_committer freebsd_triage 2020-09-12 23:08:05 UTC
(In reply to VVD from comment #20)
You should not be adding -Werror or other -W flags anywhere, that is your issue, for whatever reason your environment is enabling -Werror while building ports and that is not supported or advisable under any circumstances unless you are fixing upstream software.

Here is a clean log from FreeBSD 12.1 https://people.freebsd.org/~kbowling/logs/pgsphere-1.1.5_3.log.

Investigate what is going on in your environment and report back.
Comment 22 Vladimir Druzenko freebsd_committer freebsd_triage 2020-09-13 01:31:53 UTC
(In reply to Kevin Bowling from comment #21)

Tested on 2 different hosts with 12.1-p9 amd64:

===>  License BSD3CLAUSE accepted by the user
===>   pgsphere-1.1.5_3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by pgsphere-1.1.5_3 for building
===>  Extracting for pgsphere-1.1.5_3
=> SHA256 Checksum OK for pgsphere-pgsphere-1.1.5-e0b303d_GH0.tar.gz.
===>  Patching for pgsphere-1.1.5_3
===>   pgsphere-1.1.5_3 depends on package: gmake>=4.3 - found
===>   pgsphere-1.1.5_3 depends on file: /usr/local/bin/as - found
===>   pgsphere-1.1.5_3 depends on shared library: libpq.so.5 - found (/usr/local/lib/libpq.so.5)
===>  Configuring for pgsphere-1.1.5_3
===>  Building for pgsphere-1.1.5_3
gmake[2]: Entering directory '/usr/ports/databases/pgsphere/work/pgsphere-e0b303d'
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o sscan.o sscan.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o sparse.o sparse.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o sbuffer.o sbuffer.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o vector3d.o vector3d.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o point.o point.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o euler.o euler.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o circle.o circle.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o line.o line.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o ellipse.o ellipse.c
cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -march=core2  -O3 -funroll-loops -fstack-protector-strong -fno-strict-aliasing  -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -I/usr/local/include -I/usr/local/include -I/usr/local/include  -c -o polygon.o polygon.c
polygon.c:827:14: error: variable length array used [-Werror,-Wvla]
                SPoint          arr[nelem];
                                   ^
polygon.c:895:11: error: variable length array used [-Werror,-Wvla]
        SPoint          s[poly->npts + 2];
                         ^
2 errors generated.
gmake[2]: *** [<builtin>: polygon.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/usr/ports/databases/pgsphere/work/pgsphere-e0b303d'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/pgsphere
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/pgsphere

Removed /etc/make.conf before this test.

Check your log:
=======================<phase: lib-depends    >============================
===>   pgsphere-1.1.5_3 depends on shared library: libpq.so.5 - not found
===>   Installing existing package /packages/All/postgresql11-client-11.9.txz
[FreeBSD:12:amd64-default] Installing postgresql11-client-11.9...
[FreeBSD:12:amd64-default] `-- Installing readline-8.0.4...
[FreeBSD:12:amd64-default] `-- Extracting readline-8.0.4: .......... done
[FreeBSD:12:amd64-default] Extracting postgresql11-client-11.9: .......... done
=====
Message from postgresql11-client-11.9:

Why PG 11?
Comment 23 Kevin Bowling freebsd_committer freebsd_triage 2020-09-13 02:39:01 UTC
(In reply to VVD from comment #22)
There is something screwy with your build environment, we are misusing the intent of this ticket now so will you move this to a private discussion with me or new a ticket.  Your CFLAGS show -Werror=vla and that should not be the case.  Upload a full poudriere testport log that I can look at somewhere.
Comment 24 Kevin Bowling freebsd_committer freebsd_triage 2020-09-13 02:45:07 UTC
(In reply to Kevin Bowling from comment #23)
(In reply to VVD from comment #22)
Ok I see it now, fixing!
Comment 25 commit-hook freebsd_committer freebsd_triage 2020-09-13 03:19:28 UTC
A commit references this bug:

Author: kbowling
Date: Sun Sep 13 03:19:21 UTC 2020
New revision: 548447
URL: https://svnweb.freebsd.org/changeset/ports/548447

Log:
  databases/pgsphere: stop using VLAs to fix PG12 compilation

  PR:		248657
  Reported by:	vvd@unislabs.com
  Obtained from:	https://github.com/akorotkov/pgsphere/pull/14
  Sponsored by:	BBOX.io

Changes:
  head/databases/pgsphere/Makefile
  head/databases/pgsphere/files/
  head/databases/pgsphere/files/patch-path.c
  head/databases/pgsphere/files/patch-polygon.c
Comment 26 Kevin Bowling freebsd_committer freebsd_triage 2020-09-13 05:57:13 UTC
I'd like to commit the default version patch in 7 days unless someone raises a complaint.
Comment 27 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2020-09-20 23:04:09 UTC
No complaints were raised. Please go ahead :)
Comment 28 commit-hook freebsd_committer freebsd_triage 2020-09-21 19:01:54 UTC
A commit references this bug:

Author: kbowling
Date: Mon Sep 21 19:01:05 UTC 2020
New revision: 549479
URL: https://svnweb.freebsd.org/changeset/ports/549479

Log:
  Mk/bsd.default-versions.mk: Update PGSQL_DEFAULT to 12

  PR:		248657
  Submitted by:	linimon
  Reported by:	kbowling
  Reviewed by:	tz
  Sponsored by:	BBOX.io

Changes:
  head/Mk/bsd.default-versions.mk
Comment 29 Kevin Bowling freebsd_committer freebsd_triage 2020-09-21 19:02:37 UTC
Closing as fixed, please let me know if any issues.
Comment 30 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2020-09-21 23:01:44 UTC
You are missing an UPDATING entry. This is very important, because users will loose their data and access if they do not know about this. [Yes, i am aware that the data is not lost, but it will surely look like it].

You can use a reduced set of my entry from 20190829.
Comment 31 commit-hook freebsd_committer freebsd_triage 2020-09-22 19:57:16 UTC
A commit references this bug:

Author: kbowling
Date: Tue Sep 22 19:57:07 UTC 2020
New revision: 549629
URL: https://svnweb.freebsd.org/changeset/ports/549629

Log:
  Add an UPDATING entry for PostgreSQL default version change to 12

  PR:		248657
  Reported by:	tz
  Sponsored by:	BBOX.io

Changes:
  head/UPDATING
Comment 32 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2020-09-22 20:03:24 UTC
Thank you! :)
Comment 33 Palle Girgensohn freebsd_committer freebsd_triage 2020-09-23 09:17:17 UTC
Thanks a lot for all your efforts! Great to see this happen!

Palle