delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/04/04/07:08:12

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_NUMERIC_HELO,SPF_HELO_PASS,TW_YG,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Achim Gratz <Stromeko AT NexGo DOT DE>
Subject: Re: [bug] Something fishy going on with sqlite3...
Date: Wed, 4 Apr 2012 11:07:35 +0000 (UTC)
Lines: 63
Message-ID: <loom.20120404T093239-277@post.gmane.org>
References: <87aa3hd4a5 DOT fsf AT Rainer DOT invalid> <jjti4r$2t7$1 AT dough DOT gmane DOT org> <8762e5d3le DOT fsf AT Rainer DOT invalid> <jjtkmo$po1$1 AT dough DOT gmane DOT org> <871uotd0ub DOT fsf AT Rainer DOT invalid> <jjtqmt$93i$1 AT dough DOT gmane DOT org> <loom DOT 20120316T080148-390 AT post DOT gmane DOT org> <loom DOT 20120403T153444-198 AT post DOT gmane DOT org> <4F7B8E9A DOT 100 AT etr-usa DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Warren Young <warren <at> etr-usa.com> writes:
> 
> Send me the cygport file and I'll build new sqlite3 packages.

I've just made a local patch package, tests look good so far.
Specifically, I can now build the Perl DBD::SQLite module (either with
the bundled SQLite or the locally installed library) and have all
tests pass even when I'm not administrator.

---8<----->8---
ORIG_PN="sqlite"
ORIG_PV=`echo $PV|tr . \ |\
awk -e '{printf "%1d%02d%02d%02d",$1,$2,$3,$4;}'`
DESCRIPTION="SQLite database library"
HOMEPAGE="http://www.sqlite.org/"
SRC_URI="http://www.sqlite.org/${ORIG_PN}-autoconf-${ORIG_PV}.tar.gz"
SRC_DIR="${ORIG_PN}-autoconf-${ORIG_PV}"

PKG_NAMES="${PN} lib${PN}_0 lib${PN}-devel"
PKG_HINTS='setup lib devel'
PKG_CONTENTS[0]='usr/bin/*.exe usr/share/'
PKG_CONTENTS[1]='usr/bin/*.dll'
PKG_CONTENTS[2]='usr/include/ usr/lib/'

NO_AUTOHEADER=1

CYGCONF_ARGS="CC=gcc-4 CXX=g++-4"
# define -DSQLITE_OS_UNIX to avoid Cygwin being recognized as "Windows"
CPPFLAGS="-DSQLITE_OS_UNIX -DSQLITE_ENABLE_COLUMN_METADATA\
 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS_PARENTHESIS\
 -DSQLITE_ENABLE_FTS4"
---8<----->8---

> (If you're wondering why I haven't responded to this thread before
> now, it's because this is the first post to the thread that told me
> there was a problem with the package.)

I wasn't sure either where the problem was.  This particular "feature"
has been in SQLite forever and on of my colleagues just tells me he's
been bitten by it many years before.  The conditions for it to occur
are apparently sufficiently narrow to not bother most folks.  To
summarize (and hopefully for others to reproduce by now), all of the
following conditions must hold for the error to trigger:

1. The user running SQLite must not have administrative rights.
2. SQLite must not be run from a Windows console, but in mintty.
(I didn't test other terminals).
3. SQLite needs to be told to open a TEMPORARY database _and_ put it to disk.

This will get you "Error: unable to open database file".  If you build
SQLite with debugging switched on, it will actually tell you a quite
different story:

assertion "isDelete==0 || isCreate" failed: file
"/usr/src/sqlite3-3.7.3-1p1/src/sqlite-3.7.3/sqlite3.c", line 31496,
function: winOpen Abort (core dumped)

The clue here is that it tried to use a Windows interface to open the
file, not a Cygwin one, which got me on the right track.


-- 
Achim.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019