Bug 221361

Summary: www/firefox: Unable to build 55.0,1 due to system SQLite not compiled with SQLITE_ENABLE_FTS3
Product: Ports & Packages Reporter: VK <vlad-fbsd>
Component: Individual Port(s)Assignee: freebsd-gecko (Nobody) <gecko>
Status: Closed FIXED    
Severity: Affects Some People CC: madpilot, pavelivolkov
Priority: --- Keywords: patch, regression
Version: LatestFlags: jbeich: maintainer-feedback+
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Firefox-55.0,1 build log
none
sqlite3-3.20.0.log
none
Proposed fix madpilot: maintainer-approval? (pavelivolkov)

Description VK freebsd_triage 2017-08-09 11:07:25 UTC
Created attachment 185190 [details]
Firefox-55.0,1 build log

I'm unable to build Firefox-55.0,1 with Poudriere (11.1, amd64) because it complains that:

DEBUG: configure: error: System SQLite library is not compiled with SQLITE_ENABLE_FTS3.

But, I have sqlite3-3.20.0 with FTS3_TOKEN and FTS4 options enabled. Help text for FTS4 suggests it enables FTS3/4 module.

I've also tried deleting the sqlite3 package from Poudriere's repo directory, and rebuilt everything, which recompiled all ports that depend on sqlite3, but Firefox is still failing with the same error.

Attached is the full Firefox build log. Firefox-55.0,1 built fine the other day, but I guess it was with sqlite3-3.19.3,1, as 3.20.0 was bumped to yesterday (2017-08-08). Looking at the commit, only the version was bumped, no other changes were done.
Comment 1 VK freebsd_triage 2017-08-09 11:09:31 UTC
CC sqlite3 maintainer.
Comment 2 VK freebsd_triage 2017-08-09 11:12:15 UTC
Created attachment 185191 [details]
sqlite3-3.20.0.log

Add sqlite3 build log too.
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2017-08-09 11:27:27 UTC
Created attachment 185192 [details]
Proposed fix

I have encountered the same problem and added the attached fix, which makes everything work for me.

Looks like something changed in how sqlite3 processes it's compile time arguments. Or firefox changed how it checks them.
Comment 4 VK freebsd_triage 2017-08-09 11:57:36 UTC
I confirm that adding -DSQLITE_ENABLE_FTS3 under FTS4 option's cpp flags of sqlite3, enables Firefox to build now.

I was looking at the sqlite3 source to try and find what happened, but couldn't really find what broke. FTS3 should've been set with -DSQLITE_ENABLE_FTS4, source:

> /*
> ** FTS4 is really an extension for FTS3.  It is enabled using the
> ** SQLITE_ENABLE_FTS3 macro.  But to avoid confusion we also all
> ** the SQLITE_ENABLE_FTS4 macro to serve as an alisse for SQLITE_ENABLE_FTS3.
> */
> #if defined(SQLITE_ENABLE_FTS4) && !defined(SQLITE_ENABLE_FTS3)
> # define SQLITE_ENABLE_FTS3
> #endif

* https://www.sqlite.org/src/artifact/eb2502000148e809
Comment 5 Jan Beich freebsd_committer freebsd_triage 2017-08-09 12:43:25 UTC
Some discussion happened in bug 219963 comment 13 and later.
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-08-09 14:04:23 UTC
A commit references this bug:

Author: madpilot
Date: Wed Aug  9 14:04:03 UTC 2017
New revision: 447626
URL: https://svnweb.freebsd.org/changeset/ports/447626

Log:
  Add explicit SQLITE_ENABLE_FTS3. This fixes the firefox and thunderburd
  ports build.

  Due to recent changes in sqlite3 even if this flag is actually
  implicitly added to the build when the FTS4 option is enabled, it
  is not reported as present via the
  sqlite3_compileoption_used("SQLITE_ENABLE_FTS3") API call, which
  is used by the gecko ports configure script to check for a suitable
  sqlite3 library.

  Related upstream change: https://sqlite.org/src/info/9a443397a6b110f6

  PR:		221361, 219963
  Submitted by:	Vladimir Krstulja <vlad-fbsd@acheronmedia.com>,
  		jbeich@
  Approved by:	portmgr@ (blanket)
  MFH:		2017Q3

Changes:
  head/databases/sqlite3/Makefile
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2017-08-09 14:05:57 UTC
(In reply to Jan Beich from comment #5)
> Some discussion happened in bug 219963 comment 13 and later.

I took the freedom of committing my quick fix leveraging the fixit blanket, since breaking firefox and thunderbird can have a big fallout.

We should also align the version of the tcl-sqlite3 port. Should I file a separate PR for that so the maintainer has a chance to approve?
Comment 8 Jan Beich freebsd_committer freebsd_triage 2017-08-09 14:39:50 UTC
(In reply to Guido Falsi from comment #7)
> We should also align the version of the tcl-sqlite3 port. Should I file a
> separate PR for that so the maintainer has a chance to approve?

A separate bug is better since it'd be unrelated to gecko@ bustage. There weren't many commits touching TCL interface.

https://sqlite.org/src/finfo?name=src/tclsqlite.c&ci=version-3.20.0&n=3
Comment 9 commit-hook freebsd_committer freebsd_triage 2017-08-10 08:13:06 UTC
A commit references this bug:

Author: madpilot
Date: Thu Aug 10 08:12:47 UTC 2017
New revision: 447666
URL: https://svnweb.freebsd.org/changeset/ports/447666

Log:
  MFH: r447626

  Add explicit SQLITE_ENABLE_FTS3. This fixes the firefox and thunderburd
  ports build.

  Due to recent changes in sqlite3 even if this flag is actually
  implicitly added to the build when the FTS4 option is enabled, it
  is not reported as present via the
  sqlite3_compileoption_used("SQLITE_ENABLE_FTS3") API call, which
  is used by the gecko ports configure script to check for a suitable
  sqlite3 library.

  Related upstream change: https://sqlite.org/src/info/9a443397a6b110f6

  PR:		221361, 219963
  Submitted by:	Vladimir Krstulja <vlad-fbsd@acheronmedia.com>,
  		jbeich@
  Approved by:	portmgr@ (blanket)

  Approved by:	portmgr (antoine)

Changes:
_U  branches/2017Q3/
  branches/2017Q3/databases/sqlite3/Makefile
Comment 10 Pavel Volkov 2017-08-12 06:03:54 UTC
Hello. I approve of the patch. Thank you all. PR can be closed.
Comment 11 Guido Falsi freebsd_committer freebsd_triage 2017-08-31 14:41:51 UTC
Patch to sqlite3 committed and merged.