Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 223873 - dev-db/sqlite-3.5.9 fails to build with Tcl error, regardless of state of "tcl" USE flag
Summary: dev-db/sqlite-3.5.9 fails to build with Tcl error, regardless of state of "tc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All IRIX
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on: 212282
Blocks: 238745
  Show dependency tree
 
Reported: 2008-05-27 18:23 UTC by Stuart Shelton
Modified: 2011-12-15 21:58 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Failing mksqlite3c.tcl (mksqlite3c.tcl,7.18 KB, text/plain)
2008-05-27 18:25 UTC, Stuart Shelton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2008-05-27 18:23:51 UTC
$ USE="-tcl" emerge -v sqlite     

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] dev-db/sqlite-3.5.9 [3.5.6] USE="soundex threadsafe -debug -doc -tcl*" 0 kB 

Total: 1 package (1 upgrade), Size of downloads: 0 kB

>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) dev-db/sqlite-3.5.9 to /
 * sqlite-3.5.9.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                                                                                                       [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                                                         [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                                        [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                                       [ ok ]
 * checking sqlite-3.5.9.tar.gz ;-) ...                                                                                                                                                      [ ok ]
 * You must enable the tcl use flag if you want to run the testsuite.
 * Testsuite will not be run.
>>> Unpacking source...
>>> Unpacking sqlite-3.5.9.tar.gz to /usr/opt/portage/var/tmp/portage/dev-db/sqlite-3.5.9/work
 * Applying sandbox-fix2.patch ...                                                                                                                                                           [ ok ]
 * Running eautoreconf in '/usr/opt/portage/var/tmp/portage/dev-db/sqlite-3.5.9/work/sqlite-3.5.9' ...
 * Running aclocal ...                                                                                                                                                                       [ ok ]
 * Running libtoolize --copy --force ...                                                                                                                                                     [ ok ]
 * Running aclocal ...                                                                                                                                                                       [ ok ]
 * Running autoconf ...                                                                                                                                                                      [ ok ]
 * Running autoheader ...                                                                                                                                                                    [ ok ]
 * Running elibtoolize in: sqlite-3.5.9
 *   Applying install-sh-1.5.patch ...
 *   Applying portage-1.5.10.patch ...
 *   Applying sed-1.5.6.patch ...
 * Removing useless C++ checks ...                                                                                                                                                           [ ok ]
>>> Source unpacked.
>>> Compiling source in /usr/opt/portage/var/tmp/portage/dev-db/sqlite-3.5.9/work/sqlite-3.5.9 ...
 * econf: updating /sqlite-3.5.9/config.guess with /opt/portage/usr/share/gnuconfig/config.guess
 * econf: updating /sqlite-3.5.9/config.sub with /opt/portage/usr/share/gnuconfig/config.sub
./configure --prefix=/opt/portage/usr --host=mips-sgi-irix6.5 --mandir=/opt/portage/usr/share/man --infodir=/opt/portage/usr/share/info --datadir=/opt/portage/usr/share --sysconfdir=/opt/portage/etc --localstatedir=/opt/portage/var/lib --disable-debug --enable-threadsafe --enable-cross-thread-connections --disable-tcl --build=mips-sgi-irix6.5
...
sed -e s/--VERS--/3.5.9/ ./src/sqlite.h.in | \
        sed -e s/--VERSION-NUMBER--/3005009/ >sqlite3.h
./mkkeywordhash >keywordhash.h
cp ./tool/lempar.c .
cp ./src/parse.y .
./lemon  parse.y
mv parse.h parse.h.temp
gawk -f ./addopcodes.awk parse.h.temp >parse.h
cat parse.h ./src/vdbe.c | gawk -f ./mkopcodeh.awk >opcodes.h
sort -n -b -k 3 opcodes.h | gawk -f ./mkopcodec.awk >opcodes.c
rm -rf tsrc
mkdir -p tsrc
cp ./src/alter.c ./src/analyze.c ./src/attach.c ./src/auth.c ./src/bitvec.c ./src/btmutex.c ./src/btree.c ./src/btree.h ./src/btreeInt.h ./src/build.c ./src/callback.c ./src/complete.c ./src/date.c ./src/delete.c ./src/expr.c ./src/fault.c ./src/func.c ./src/hash.c ./src/hash.h ./src/insert.c ./src/journal.c ./src/legacy.c ./src/loadext.c ./src/main.c ./src/malloc.c ./src/mem1.c ./src/mem2.c ./src/mem3.c ./src/mem4.c ./src/mem5.c ./src/mutex.c ./src/mutex.h ./src/mutex_os2.c ./src/mutex_unix.c ./src/mutex_w32.c ./src/os.c ./src/os.h ./src/os_common.h ./src/os_unix.c ./src/os_win.c ./src/os_os2.c ./src/pager.c ./src/pager.h ./src/parse.y ./src/pragma.c ./src/prepare.c ./src/printf.c ./src/random.c ./src/select.c ./src/shell.c ./src/sqlite.h.in ./src/sqlite3ext.h ./src/sqliteInt.h ./src/sqliteLimit.h ./src/table.c ./src/tclsqlite.c ./src/tokenize.c ./src/trigger.c ./src/utf.c ./src/update.c ./src/util.c ./src/vacuum.c ./src/vdbe.c ./src/vdbe.h ./src/vdbeapi.c ./src/vdbeaux.c ./src/vdbeblob.c ./src/vdbefifo.c ./src/vdbemem.c ./src/vdbeInt.h ./src/vtab.c ./src/where.c keywordhash.h opcodes.c opcodes.h parse.c parse.h config.h sqlite3.h ./ext/fts1/fts1.c ./ext/fts1/fts1.h ./ext/fts1/fts1_hash.c ./ext/fts1/fts1_hash.h ./ext/fts1/fts1_porter.c ./ext/fts1/fts1_tokenizer.h ./ext/fts1/fts1_tokenizer1.c ./ext/fts2/fts2.c ./ext/fts2/fts2.h ./ext/fts2/fts2_hash.c ./ext/fts2/fts2_hash.h ./ext/fts2/fts2_icu.c ./ext/fts2/fts2_porter.c ./ext/fts2/fts2_tokenizer.h ./ext/fts2/fts2_tokenizer.c ./ext/fts2/fts2_tokenizer1.c ./ext/fts3/fts3.c ./ext/fts3/fts3.h ./ext/fts3/fts3_hash.c ./ext/fts3/fts3_hash.h ./ext/fts3/fts3_icu.c ./ext/fts3/fts3_porter.c ./ext/fts3/fts3_tokenizer.h ./ext/fts3/fts3_tokenizer.c ./ext/fts3/fts3_tokenizer1.c ./ext/icu/icu.c tsrc
rm tsrc/sqlite.h.in tsrc/parse.y
touch .target_source
tclsh8.4 ./tool/mksqlite3c.tcl
bad index "0": must be integer or end?-integer? (looks like invalid octal number)
    while executing
"string range $s78 0 $nstar"
    (procedure "section_comment" line 5)
    invoked from within
"section_comment "Begin file $tail""
    (procedure "copy_file" line 4)
    invoked from within
"copy_file tsrc/$file"
    ("foreach" body line 2)
    invoked from within
"foreach file {
   sqliteInt.h

   date.c
   os.c

   fault.c
   mem1.c
   mem2.c
   mem3.c
   mem5.c
   mutex.c
   mutex_os2.c
   mutex_unix.c
   mute..."
    (file "./tool/mksqlite3c.tcl" line 201)
make: *** [sqlite3.c] Error 1
 * ERROR: dev-db/sqlite-3.5.9 failed:
 *   emake all failed
 * 
 * Call stack:
 *               ebuild.sh:  49: <call src_compile>
 *             environment:3188:     emake all || die "emake all failed"
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * build log: '/usr/opt/portage/var/tmp/portage/dev-db/sqlite-3.5.9/temp/build.log'
 * ebuild environment: '/usr/opt/portage/var/tmp/portage/dev-db/sqlite-3.5.9/temp/environment'
 * S: '/usr/opt/portage/var/tmp/portage/dev-db/sqlite-3.5.9/work/sqlite-3.5.9'


This same error occurs with USE="tcl" or USE="-tcl" and regardless of FEATURES="test"

(And I don't think that it's the MIPSpro wrapper this time!)

tclsh8.4 is also from portage, not OS-native.
Comment 1 Stuart Shelton 2008-05-27 18:25:44 UTC
Created attachment 154507 [details]
Failing mksqlite3c.tcl


Does this file look valid?  Does it work correctly on other systems?

(Might this be a problem with dev-lang/tcl-8.4.18 rather than sqlite this time?)
Comment 2 Stuart Shelton 2008-05-27 18:31:50 UTC
If I run "tclsh8.4 tool/mksqlite3c.tcl" manually, it fails.

If I apply this patch:

--- mksqlite3c.tcl.old  2008-05-27 19:30:10.612808680 +0100
+++ mksqlite3c.tcl      2008-05-27 19:30:41.424218840 +0100
@@ -118,11 +118,8 @@ set s78 \
 # Insert a comment into the code
 #
 proc section_comment {text} {
-  global out s78
-  set n [string length $text]
-  set nstar [expr {60 - $n}]
-  set stars [string range $s78 0 $nstar]
-  puts $out "/************** $text $stars/"
+  global out
+  puts $out "/* $text */"
 }
 
 # Read the source file named $filename and write it into the

... then it succeeds!

For the sake of a nice bit of formatting, could the ebuild apply this patch?
(Although why is it failing in the first place??)
Comment 3 Stuart Shelton 2008-05-27 18:36:21 UTC
Hmm - it surely wouldn't be that all of those stars plus "Begin file " plus $tail (which, if it's a file path, might be quite long: something like '/opt/portage/var/tmp/portage/dev-db/sqlite-3.5.9/work/sqlite-3.5.9/tsrc/parse.c') are longer that 78 characters?

... would it?
Comment 4 Stuart Shelton 2008-05-28 10:17:25 UTC
With the above patch, sqlite runs into the same problem as in Bug 212282.
Comment 5 Fabian Groffen gentoo-dev 2008-07-09 07:45:15 UTC
Indeed, tclsh is being used for amalgation (or something).
@betelgeuse: I found the following patch necessary to really disable any tcl usage

Index: sqlite-3.5.9.ebuild
===================================================================
--- sqlite-3.5.9.ebuild (revision 27229)
+++ sqlite-3.5.9.ebuild (working copy)
@@ -55,6 +55,7 @@
                $(use_enable threadsafe) \
                $(use_enable threadsafe cross-thread-connections) \
                $(use_enable tcl) \
+               $(use_enable tcl amalgamation) \
                || die
        emake all || die "emake all failed"
 }
Comment 6 Stuart Shelton 2008-09-25 11:03:54 UTC
Still a problem in sqlite-3.6.2
Comment 7 Stuart Shelton 2009-01-23 13:20:02 UTC
... and still a problem in sqlite-3.6.10.
Comment 8 Jan 2009-05-03 18:18:27 UTC
Just ran into this problem with sqlite-3.6.12 and tcl not being installed (amd64). Wasn't aware of this bug earlier because I unmerged tcl since I built sqlite the last time...

The patch from Fabian (comment #5) still works. Just built sqlite without tcl.
Comment 9 Paul Philippov 2009-08-16 16:39:38 UTC
same with sqlite-3.6.17

# emerge -va sqlite

[ebuild     U ] dev-db/sqlite-3.6.17 [3.6.14.2] USE="threadsafe -debug -doc -soundex -tcl" 0 kB

fails with:

>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-db/sqlite-3.6.17/work/sqlite-3.6.17 ...
make -j2 -s TCLLIBDIR=/usr/lib/sqlite-3.6.17 
/bin/sh: tclsh: command not found
make: *** [sqlite3.h] Error 127
make: *** Waiting for unfinished jobs....
 * 
 * ERROR: dev-db/sqlite-3.6.17 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2795:  Called die
 * The specific snippet of code:
 *       emake TCLLIBDIR="/usr/$(get_libdir)/${P}" || die "emake failed"
 *  The die message:
 *   emake failed
Comment 10 Matthew Kern 2009-08-16 19:09:19 UTC
indeed - it seems that regardless of the tcl use flag, sqlite still requires that tcl be installed for tclsh. This seems to be a different problem than the original on this bug?
Comment 11 Paul Philippov 2009-08-17 03:37:53 UTC
(In reply to comment #10)
> indeed - it seems that regardless of the tcl use flag, sqlite still requires
> that tcl be installed for tclsh. This seems to be a different problem than the
> original on this bug?

I guess my error still within the topic - sqlite fails to build with tcl error even with -tcl USE flag.

I found that sqlite-3.6.17-fix_installation.patch makes usage of tcl mandatory through replacement of sed/awk commands with mksqlite3[h|c].tcl scripts in Makefile.in and main.mk. I wonder if it was really necessary to replace system tools with tcl stuff?
Comment 12 Fabian Groffen gentoo-dev 2009-08-17 06:48:20 UTC
Cc-ing (new) maintainer due to last comment (#11)
Comment 13 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-08-17 11:21:12 UTC
(In reply to comment #9, comment #10, comment #11 and comment #12)

It's bug #281294.
Comment 14 Fabian Groffen gentoo-dev 2009-10-25 10:08:29 UTC
closing