Bug 208740

Summary: databases/db[5-6]: enable Tcl extension, modernize Makefile
Product: Ports & Packages Reporter: Pietro Cerutti <gahr>
Component: Individual Port(s)Assignee: Matthias Andree <mandree>
Status: Closed FIXED    
Severity: Affects Only Me CC: gahr
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Description Flags
enable Tcl extension, modernize Makefile
Updated patch to include pkgIndex.tcl
Updated patch to fix JAVA_VARS
Changes for db5 none

Description Pietro Cerutti freebsd_committer 2016-04-12 10:04:50 UTC
Created attachment 169236 [details]
enable Tcl extension, modernize Makefile
Comment 1 Pietro Cerutti freebsd_committer 2016-04-12 14:25:50 UTC
Created attachment 169239 [details]
Updated patch to include pkgIndex.tcl
Comment 2 Pietro Cerutti freebsd_committer 2016-04-13 07:23:35 UTC
Created attachment 169276 [details]
Updated patch to fix JAVA_VARS
Comment 3 Pietro Cerutti freebsd_committer 2016-04-13 07:44:45 UTC
Created attachment 169277 [details]
Changes for db5
Comment 4 Pietro Cerutti freebsd_committer 2016-04-13 07:47:09 UTC
I have added a patch to apply the same changes to databases/db5. Also, I have shuffled a few blocks around to minimize the diff between db5/Makefile and db6/Makefile.
Comment 5 commit-hook freebsd_committer 2016-05-23 20:18:42 UTC
A commit references this bug:

Author: mandree
Date: Mon May 23 20:18:25 UTC 2016
New revision: 415741
URL: https://svnweb.freebsd.org/changeset/ports/415741

  Update to 6.2.23. Add TCL option. Cleanup.

  Changes submitted by gahr@:
  Enable a new TCL option, adding a pkgIndex.tcl file.
  Modernize Makefile. [1]

  Changes by mandree@:
  Fix installation of TCL API docs if TCL option is enabled.
  Update to new upstream release 6.2.23.
  Install the upgrade61.sh script if SQL option is enabled, with
  additional fixes distributed as a patch to avoid licensing concerns.
  Add an UPDATING entry.
  Add changes in Mk/Uses/bdb.mk.

  db5 parts of PR 208740 to be committed in a separate transaction later.

  PR:		208740
  Submitted by:	gahr@

Comment 6 Matthias Andree freebsd_committer 2016-05-23 21:53:13 UTC

I have committed the db6 update, and I will commit a subset of your proposed db5 changes (namely, the Makefile cleanup), but since I've received scary compiler warnings on 10.3-RELEASE amd64 such as this one (and there are also examples with variables as source argument):

  ../lang/tcl/tcl_db.c:3711:30: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size]
                                          (void)strncat(buf, " ", sizeof(buf));
  ../lang/tcl/tcl_db.c:3711:30: note: change the argument to be the free space in the destination buffer minus the terminating null byte

I will refrain from enabling TCL, this seems unsafe.  

If you think we would want TCL in db5, I need a patch that fully reviews the corresponding strncat use, and possibly patches this to use strlcat, or backports the differences from db6.

I'll also mark Java 8 incompatible while I'm here, if someone can fix the incompatibility between db5 and openjdk8, I'll happily take patches, other than that, I'm a Java noob and cannot help here for now.
Comment 7 Matthias Andree freebsd_committer 2016-05-23 21:53:56 UTC
(In reply to Matthias Andree from comment #6)
(Java 8 incompatible with db5 only, db6 seems OK with OpenJDK 8)
Comment 8 commit-hook freebsd_committer 2016-05-23 22:07:50 UTC
A commit references this bug:

Author: mandree
Date: Mon May 23 22:07:25 UTC 2016
New revision: 415749
URL: https://svnweb.freebsd.org/changeset/ports/415749

  Modernize Makefile and chase new requisites.

  * Modernize Makefile [1].

  * The Tcl changes suggested in the PR [1] are applied but commented out
    because the code causes scary "warning: the value of the size argument
    in 'strncat' is too large, might lead to a buffer overflow
    [-Wstrncat-size]" in lang/tcl/tcl_*.c on FreeBSD 10.3 amd64.

  * Other than what is suggested in the PR,
    refuse to add the TCL option, and leave --disable-tcl in.

  * JAVA option: restrict to Java versions 1.6 and 1.7 because the port
    fails to compile with JAVA option enabled and openjdk8
    (IllegalArgument exception).

  portlint cleanups:
  * Set PATCH_WRKSRC, and refresh patches with "make makepatch".
  * Use Space (not HTab) after WWW: tag in pkg-descr
  * Drop "The" from COMMENT.

  PR:		208740 [1]
  Submitted by:	gahr@ [1]

Comment 9 Matthias Andree freebsd_committer 2016-05-23 22:09:27 UTC
If someone comes up with patches to make db5 compatible with Java 8, or patches to make the Tcl code safe, please file new PRs and only reference this (208740).