Skip to content

Commit

Permalink
Bug 1513320 - SQLite package backport for Debian 7; r=glandium
Browse files Browse the repository at this point in the history
The SQLite in Debian 7 (3.7.13) lacks support for common table
expressions (the WITH keyword), which was introduced in SQLite
3.8.3. The Mercurial SQLite storage backend currently relies on
CTEs. Even if a future Mercurial doesn't require CTE, it is likely
that it will still use CTE if available for performance reasons.
So, it is in our best interest to give Mercurial access to a
modern SQLite. Plus, using a modern SQLite and avoiding potential
bugs in old versions seems prudent.

This commit introduces a SQLite package backport for Debian 7
so we can use the new SQLite feature. We had to minimally patch
the build to work with an older version of TCL that isn't using
multiarch.

I observed libsqlite3 being installed as part of building various
other packages (such as Python). I initially added the package as
a dependency so packages would be built against a more modern
SQLite. But glandium doesn't believe it matters, since nothing
should be doing build-time feature detection. Python is the most
important downstream package (since Mercurial uses its SQLite).
I audited the CPython build system and did not see any build-time
SQLite feature detection or version sniffing. So I think we'll be
fine building against an older SQLite.

Differential Revision: https://phabricator.services.mozilla.com/D14194

--HG--
extra : moz-landing-system : lando
  • Loading branch information
indygreg committed Dec 12, 2018
1 parent 8753c7d commit 12bd069
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
58 changes: 58 additions & 0 deletions build/debian-packages/sqlite3-wheezy.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
diff --git a/debian/changelog b/debian/changelog
index ba3d92c..8a122c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+sqlite3 (3.16.2-5.deb7moz1) wheezy; urgency=medium
+
+ * Mozilla backport for wheezy.
+ * debian/control, debian/rules:
+ - Downgrade tcl version from 8.6 to 8.5.
+ - Update tcl library path to reflect lack of multiarch.
+
+ -- Gregory Szorc <[email protected]> Tue, 11 Dec 2018 12:13:00 -0700
+
sqlite3 (3.16.2-5) unstable; urgency=medium

* Backport fix for corruption due to REPLACE in an auto-vacuumed database.
diff --git a/debian/control b/debian/control
index af12a8d..e150d02 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,8 @@ Source: sqlite3
Section: devel
Priority: optional
Maintainer: Laszlo Boszormenyi (GCS) <[email protected]>
-Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), autoconf (>= 2.59), libtool (>= 1.5.2), automake, autotools-dev, chrpath, libreadline-dev, tcl8.6-dev, dh-autoreconf
-Build-Conflicts: tcl8.4, tcl8.4-dev, tcl8.5, tcl8.5-dev
+Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), autoconf (>= 2.59), libtool (>= 1.5.2), automake, autotools-dev, chrpath, libreadline-dev, tcl8.5-dev, dh-autoreconf
+Build-Conflicts: tcl8.4, tcl8.4-dev
Homepage: http://www.sqlite.org/
Standards-Version: 3.9.8

diff --git a/debian/rules b/debian/rules
index 72333f7..198f716 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,10 +22,10 @@ export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

export LDFLAGS += -Wl,--as-needed
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
- confflags += --build $(DEB_HOST_GNU_TYPE) --with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)/tcl8.6
+ confflags += --build $(DEB_HOST_GNU_TYPE) --with-tcl=/usr/lib/tcl8.5
export CROSS_BUILDING=no
else
- confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)/tcl8.6
+ confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --with-tcl=/usr/lib/tcl8.5
LDFLAGS += -L/usr/lib/$(DEB_HOST_MULTIARCH)
export CROSS_BUILDING=yes
endif
@@ -115,7 +115,7 @@ install: build
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
echo "pkg_mkIndex -verbose $(DESTDIR)/usr/lib/tcltk/sqlite3" | \
LD_LIBRARY_PATH=$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH) \
- tclsh8.6
+ tclsh8.5
grep -q 'package ifneeded sqlite3' \
$(DESTDIR)/usr/lib/tcltk/sqlite3/pkgIndex.tcl || \
(echo "pkgIndex.tcl seems to be wrong" && exit 1)
1 change: 1 addition & 0 deletions taskcluster/ci/docker-image/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
- deb7-python3.5
- deb7-python3-defaults
- deb7-python-zstandard
- deb7-sqlite3
- deb7-xz-utils
toolchain-build:
symbol: I(toolchain)
Expand Down
11 changes: 11 additions & 0 deletions taskcluster/ci/packages/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ job-defaults:
snapshot: 20171210T214726Z

jobs:
deb7-sqlite3:
description: "SQLite backport for Debian wheezy"
treeherder:
symbol: Deb7(sqlite3)
run:
using: debian-package
dsc:
url: http://snapshot.debian.org/archive/debian/20171003T220520Z/pool/main/s/sqlite3/sqlite3_3.16.2-5.dsc
sha256: 21a2d432ace9ecf50ca5d64580af78d4414a0cfcc8b8a4f15222e11cf105da09
patch: sqlite3-wheezy.diff

deb7-python:
description: "Python backport for Debian wheezy"
treeherder:
Expand Down

0 comments on commit 12bd069

Please sign in to comment.