Bug 225627 - databases/sqlite3: update to 3.22.0
Summary: databases/sqlite3: update to 3.22.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Yuri Victorovich
URL: https://reviews.freebsd.org/D14216
Depends on:
Blocks: 226476
  Show dependency treegraph
Reported: 2018-02-02 13:40 UTC by Charlie Li
Modified: 2018-03-14 08:51 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (pavelivolkov)

patch (5.82 KB, patch)
2018-02-03 13:22 UTC, Pavel Volkov
pavelivolkov: maintainer-approval+
Details | Diff
poudriere log (30.78 KB, text/plain)
2018-02-03 13:26 UTC, Pavel Volkov
no flags Details
new patch (one string was lost) (5.84 KB, patch)
2018-02-10 12:56 UTC, Pavel Volkov
pavelivolkov: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Li 2018-02-02 13:40:36 UTC
Comment 1 Pavel Volkov 2018-02-03 13:22:21 UTC
Created attachment 190291 [details]

This is a changed:
1. The port upgraded to version 3.22.0.
2. Added the new option OFFSET (off by default).
3. Deleted options: DBPAGE, DBSTAT, RTREE.
3.1 This options always 'enable' into original distributions.
3.2 This options enabled by default in this port.
3.3 This is allowed make more compatibles (with original distributions) port.
3.4 Removed 'path' phase (and path files) from port.
Comment 2 Pavel Volkov 2018-02-03 13:26:38 UTC
Created attachment 190292 [details]
poudriere log
Comment 3 Pavel Volkov 2018-02-03 13:33:18 UTC
Please, see also:
Comment 4 Yuri Victorovich freebsd_committer 2018-02-05 20:43:54 UTC

The current patch is rejected with the current tree.

Could you please update it?

Comment 5 Yuri Victorovich freebsd_committer 2018-02-05 20:50:52 UTC
(In reply to Yuri Victorovich from comment #4)

Pavel, it's okay, don't bother, I will take it from here.

Comment 6 Yuri Victorovich freebsd_committer 2018-02-06 01:09:55 UTC
I think I would lean towards not retiring these 3 port options.
The reason is that SQLite is a pretty strong upstream, and they do things for good reasons.
I would prefer for port options to be in close correspondence with build options.
Comment 7 Jan Beich freebsd_committer 2018-02-09 18:18:38 UTC
Removing DBSTAT would break gecko@ ports e.g., https://ptpb.pw/djj3

$ make clean configure BATCH= -C/usr/ports/www/firefox
checking for sqlite3 >= 3.20.1... yes
checking SQLITE_CFLAGS... -I/usr/local/include 
checking SQLITE_LIBS... -L/usr/local/lib -lsqlite3 
checking for SQLITE_SECURE_DELETE support in system SQLite... yes
checking for SQLITE_THREADSAFE support in system SQLite... yes
checking for SQLITE_ENABLE_FTS3 support in system SQLite... yes
checking for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite... yes
checking for SQLITE_ENABLE_DBSTAT_VTAB support in system SQLite... no
configure: error: System SQLite library is not compiled with SQLITE_ENABLE_DBSTAT_VTAB.
Comment 8 Yuri Victorovich freebsd_committer 2018-02-09 18:28:54 UTC
(In reply to Jan Beich from comment #7)

I'm not going to remove options.
Comment 9 Pavel Volkov 2018-02-10 12:56:16 UTC
Created attachment 190479 [details]
new patch (one string was lost)

Indeed, one line in the patch was lost.
@@ -117,7 +112,7 @@
Comment 10 Pavel Volkov 2018-02-10 13:03:33 UTC
(In reply to Yuri Victorovich from comment #8)
Please apply the patch using the following commands:

rm -R /usr/ports/databases/sqlite3 && svnlite up /usr/ports/databases/sqlite3
patch -d /usr/ports -l -p0 -E -V none -i sqlite3-20180210.diff ; rmdir /usr/ports/databases/sqlite3/files

this will give a clean directory.

Removed options remain always on.
You can check them using the command:

sqlite3 "" "PRAGMA compile_options"
Comment 11 Pavel Volkov 2018-03-11 12:08:42 UTC
Interesting. The function sqlite_compileoption_used() gives a different result depending on where it is called from.

1. From sqlite3 shell:

% sqlite3 "" "select sqlite_compileoption_used('SQLITE_ENABLE_DBSTAT_VTAB');"

It's true.

% sqlite3 "" "PRAGMA compile_options"

2. And from C program:

% cat sqlite-test-vtab.c
#include <stdio.h>
#include "sqlite3.h"
int main(int argc, char **argv) {
        int result = sqlite3_compileoption_used("SQLITE_ENABLE_DBSTAT_VTAB");
        printf("SQLITE_ENABLE_DBSTAT_VTAB: %s (%i)\n", result ?"true":"false", result);
        return 0;

% cc `pkg-config sqlite3 --cflags --libs` -o sqlite-test-vtab sqlite-test-vtab.c && ./sqlite-test-vtab

It's false.
Comment 12 Yuri Victorovich freebsd_committer 2018-03-11 18:59:34 UTC
(In reply to Pavel Volkov from comment #11)


You should as this on their mailing list: sqlite-users@mailinglists.sqlite.org

Comment 13 Sunpoet Po-Chuan Hsieh freebsd_committer 2018-03-11 21:50:03 UTC
Can we commit it with the following workaround in Makefile and investigate it later?

# Workaround for removed DBPAGE, DBSTAT and RTREE options
Comment 14 Yuri Victorovich freebsd_committer 2018-03-11 22:07:59 UTC

I will not delete these options, because they are described in the documentation. They should delete them first if this is what is what they want.

I will look some more and will commit.

Comment 15 Yuri Victorovich freebsd_committer 2018-03-13 09:36:35 UTC
Now I think I understand this issue. :-)

There are 2 sets of build options. One set is for the shared library, and another set is for the sqlite3 shell program.

When you deleted these options, they are completely gone from the shared library, hence the build failure that Jan reported in comment#7.

The options that are seemingly permanently enabled in Makefile.ac are only permanently enabled for the sqlite3 shell program, not for the shared library.

So it appears that it's safest to just keep those options as they were.
Comment 16 Pavel Volkov 2018-03-13 14:24:47 UTC
(In reply to Sunpoet Po-Chuan Hsieh from comment #13)
This workaround work correctly for parameters -DSQLITE_ENABLE_DBSTAT_VTAB=1, -DSQLITE_ENABLE_RTREE=1.
At me it repeats in FreeBSD and in the Ubuntu (16.04.4 LTS).
Comment 17 Sunpoet Po-Chuan Hsieh freebsd_committer 2018-03-13 15:19:14 UTC
(In reply to Yuri Victorovich from comment #15)

Thanks for the investigation. I saw the enabled flags in Makefile.in and thought they are applied everywhere.

It makes sense to keep those options.
Comment 18 Yuri Victorovich freebsd_committer 2018-03-14 08:50:36 UTC
Committed with changes.
Thank you for the update!
Comment 19 commit-hook freebsd_committer 2018-03-14 08:51:03 UTC
A commit references this bug:

Author: yuri
Date: Wed Mar 14 08:50:25 UTC 2018
New revision: 464472
URL: https://svnweb.freebsd.org/changeset/ports/464472

  databases/sqlite: Update to 3.22.0


  Port changes:
  * Added the OFFSET option for the new sqlite_offset() function
  * Added 'Optional extensions' and 'Optional functions' option
    groups for better options readability
  * Deleted patches from files/ because they were disabling certain
    options in the command-line utility that the upstream keeps
    always enabled there
  * Changed capitalization in some options according to
    common spelling rules

  PR:		225627
  Submitted by:	Charlie Li <ml+freebsd@vishwin.info> (original version)
  Submitted by:	Pavel Volkov <pavelivolkov@gmail.com> (maintainer, later version)
  Approved by:	Pavel Volkov <pavelivolkov@gmail.com> (maintainer)
  Differential Revision:	https://reviews.freebsd.org/D14216