NetBSD Problem Report #58448
From www@netbsd.org Fri Jul 19 16:52:55 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id EE05B1A9239
for <gnats-bugs@gnats.NetBSD.org>; Fri, 19 Jul 2024 16:52:54 +0000 (UTC)
Message-Id: <20240719165212.AE5DD1A923A@mollari.NetBSD.org>
Date: Fri, 19 Jul 2024 16:52:12 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: databases/sqlite3 is missing dbstat option
X-Send-Pr-Version: www-1.0
>Number: 58448
>Category: pkg
>Synopsis: databases/sqlite3 is missing dbstat option
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jul 19 16:55:00 +0000 2024
>Last-Modified: Thu Aug 08 08:30:02 +0000 2024
>Originator: Taylor R Campbell
>Release: current, 2024Q2, ...
>Organization:
The NetBSqlDbstat Foundation
>Environment:
>Description:
The databases/sqlite3 package ships without the sqlite3 DBSTAT virtual table: https://sqlite.org/dbstat.html
It also has no build-time option to enable it.
>How-To-Repeat:
try to use, e.g., lang/tcl's sqlite3_analyzer (see also PR pkg/58447: https://gnats.NetBSD.org/58447)
>Fix:
Probably something like this:
--- a/databases/sqlite3/options.mk
+++ b/databases/sqlite3/options.mk
@@ -1,11 +1,15 @@
# $NetBSD: options.mk,v 1.7 2023/02/20 07:28:31 wiz Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.sqlite3
-PKG_SUPPORTED_OPTIONS= fts icu deserialize
+PKG_SUPPORTED_OPTIONS= sqlite3-dbstat fts icu deserialize
PKG_SUGGESTED_OPTIONS= fts # enabled in NetBSD builtin version
.include "../../mk/bsd.options.mk"
+.if !empty(PKG_OPTIONS:Msqlite3-dbstat)
+CFLAGS+= -DSQLITE_ENABLE_DBSTAT_VTAB=1
+.endif
+
.if !empty(PKG_OPTIONS:Mfts)
CFLAGS+= -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1
.endif
>Audit-Trail:
From: Taylor R Campbell <riastradh@NetBSD.org>
To: gnats-bugs@NetBSD.org, pkgsrc-bugs@NetBSD.org
Cc:
Subject: Re: pkg/58448: databases/sqlite3 is missing dbstat option
Date: Fri, 19 Jul 2024 17:01:52 +0000
I note Debian ships sqlite3 with the following options enabled:
export CFLAGS += -O2 -fno-strict-aliasing \
-DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_COLUMN_METADATA \
-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_RTREE=1 -DSQLITE_SOUNDEX=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY \
-DSQLITE_ENABLE_DBSTAT_VTAB \
-DSQLITE_ALLOW_ROWID_IN_VIEW \
-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 \
-DSQLITE_ENABLE_LOAD_EXTENSION \
-DSQLITE_ENABLE_JSON1 \
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
-DSQLITE_THREADSAFE=1 \
-DSQLITE_ENABLE_FTS3_TOKENIZER=1 \
-DSQLITE_USE_URI=1 \
-DSQLITE_MAX_SCHEMA_RETRY=25 \
-DSQLITE_ENABLE_PREUPDATE_HOOK \
-DSQLITE_ENABLE_SESSION \
-DSQLITE_ENABLE_STMTVTAB \
-DSQLITE_STRICT_SUBTYPE=1 \
-DSQLITE_MAX_VARIABLE_NUMBER=250000
Maybe we should follow suit with most of these, so that when you
install the sqlite3 package for the sqlite3 shell you get something
batteries-included, while applications that embed sqlite3 may keep it
stripped down.
Full list of build options to consider:
https://sqlite.org/compile.html
Either way, we should have the rationale for the default set of
option written down somewhere obvious, like in comments in options.mk.
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58448 CVS commit: pkgsrc/databases/sqlite3
Date: Fri, 19 Jul 2024 17:11:54 +0000
Module Name: pkgsrc
Committed By: riastradh
Date: Fri Jul 19 17:11:54 UTC 2024
Modified Files:
pkgsrc/databases/sqlite3: options.mk
Log Message:
databases/sqlite3: New sqlite3-dbstat option.
Enables the DBSTAT virtual table:
https://sqlite.org/dbstat.html
No revbump because option is default-off for now.
PR pkg/58448
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/databases/sqlite3/options.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc:
Subject: Re: pkg/58448: databases/sqlite3 is missing dbstat option
Date: Fri, 19 Jul 2024 21:03:59 +0200
> Maybe we should follow suit with most of these, so that when you
> install the sqlite3 package for the sqlite3 shell you get something
> batteries-included, while applications that embed sqlite3 may keep it
> stripped down.
>
> Full list of build options to consider:
>
> https://sqlite.org/compile.html
>
> Either way, we should have the rationale for the default set of
> option written down somewhere obvious, like in comments in options.mk.
Since NetBSD ships with sqlite3 too, and pkgsrc tries to use the
builtin NetBSD version, all these points also apply to the NetBSD
version of sqlite. Should that be a separate PR?
Thomas
From: Taylor R Campbell <riastradh@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org,
pkgsrc-bugs@netbsd.org
Subject: Re: pkg/58448: databases/sqlite3 is missing dbstat option
Date: Fri, 19 Jul 2024 19:27:24 +0000
> Date: Fri, 19 Jul 2024 19:05:01 +0000 (UTC)
> From: Thomas Klausner <wiz@NetBSD.org>
>
> Since NetBSD ships with sqlite3 too, and pkgsrc tries to use the
> builtin NetBSD version, all these points also apply to the NetBSD
> version of sqlite. Should that be a separate PR?
Actually I think it would be better for base sqlite3 not to be exposed
as a libsqlite3.so shlib, and pkgsrc should ignore the base sqlite3.
Base sqlite3 is used only for a couple of things:
- apropos
- a Lua module (not sure if anything uses that, maybe it should be
shipped separately in pkgsrc)
- formerly Heimdal but that was bad (PR 57406) so I nixed it
and nothing else that I know of. And it's lagged far behind pkgsrc
sqlite3 for a long time. It might be better to just bake it into
apropos and otherwise take it out of the NetBSD build.
From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58448 CVS commit: pkgsrc
Date: Thu, 8 Aug 2024 08:27:53 +0000
Module Name: pkgsrc
Committed By: wiz
Date: Thu Aug 8 08:27:53 UTC 2024
Modified Files:
pkgsrc/security/heimdal: builtin.mk
Removed Files:
pkgsrc/databases/sqlite3: builtin.mk
Log Message:
sqlite3: do not accept builtin versions any longer
Since pkgsrc can't tell what features are enabled, and at least
NetBSD's sqlite3 was not meant to be used by pkgsrc (it was built
with minimal features enabled, for heimdal support).
Also do not accept heimdal from NetBSD versions where it linked against
sqlite3 (fixed in NetBSD-current) to avoid pulling in two different
versions of sqlite3 into binaries when depending both on heimdal and
sqlite3.
Inspired by PR 58448, and discussed on tech-pkg.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r0 pkgsrc/databases/sqlite3/builtin.mk
cvs rdiff -u -r1.20 -r1.21 pkgsrc/security/heimdal/builtin.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.