Hi,I'm trying to load only a 1.0 version of the package from a "3rdparty" directory adjacent to the website code. I discovered that the 1.1 wasn't 100% compatible and that caused the Maintenance threads to cycle like crazy without their customary waiting time. There were many many months between using 1.0 on the website and installing the 1.1 package independently so it caught me by surprise.
But the trouble came when I tried to load the /-exact ... 1.0/ version and that failed because only 1.1 is available, now (with 1.1 installed under /usr/local/....). It could not see the 1.0 anymore.
But, if I remove 1.1 from the system and restart apache then it loads the 1.0 once again and uses it quite happily.
In the cut down test code I posted I couldn't replicate a step. With both packages available I can successfully/package require -exact ... 1.0/, even with 1.1 installed under /usr/local/...
HOWEVER there is a little strangeness as the 1.0 package does not show up in /package versions/, but I can still load it anyway.
Kind regards, Scott On 17/3/25 18:04, Massimo Manghi wrote:
On 3/15/25 11:35, Scott Pitcher wrote:Hi,I'm having a little trouble loading a specific version of a package in my Rivet based website.I have a package called Lockfile 1.0 which was originally part of the website base code. That lives in a directory titled "3rdparty". During the ChildInitScript (called "childboot.tcl") this directory is added to the auto_path -namespace eval ::Website {variable website ; # Where all library and site configuration is stored.try { # # Setup the library directories. # set website(basedir) [file dir [info script]] set website(logdir) [file join $website(basedir) .. log] set website(libdir) [file join $website(basedir) lib] * set website(3rdpartydir) [file join $website(basedir) .. 3rdparty]* set website(tmpdir) [file join $website(basedir) .. tmp]..............................................................................................## Set the path for loading tclIndex files. This is all we need and the rest of the library # will load. Any source directories in the website configuration should be in # website(SourceDirs) after content is loaded, and we'll set those after.# lappend ::auto_path [file normalize $website(libdir)] if {[file isdirectory $website(3rdpartydir)]} { *lappend ::auto_path [file normalize $website(3rdpartydir)]* }Further down this script calls the childinit.tcl which loads the website content, opens data bases etc and three of those modules "package require Lockfile" and away it goes and just works.Well it did, until I installed a Lockfile 1.1 package independently in / usr/local/lib/tcltk. This was a more recent version and I was using it with some other tools not related to the Rivet website. This library was not completely compatible with the version sitting alongside the Rivet website, but all good - I'd changed the version number to 1.1.Over on the website the incompatible library caused the Apache threads to run at 50% CPU and it sat there and span its wheels. The old Lockfile automatically waited but the new one doesn't so the database maintenance threads were running as fast as the CPU would let them. The new 1.1 library has a -wait option so as to act like the old version.it's advisable to introduce some delay in a thread loop to avoid races on the processor's coresSo I thought easy - require Lockfile 1.0, and the package can be loaded out of the 3rdparty directory like it did before -namespace eval ::TicketMaster { package require Thread package require sha1 package require -exact Lockfile 1.0But no, now it fails with a complaint that it needs 1.0 but it has 1.1, with the 1.1 being the package over in /usr/local......I got lost. Are you trying to load two versions of a package within the same interpreter? But if they provide commands within the same namespace how can they coexist?-- Massimo
-- +-----------------------------------------------------------------------------+ |...will make the wilderness a pool of water, the dry land springs of water...| +-----------------------------------------------------------------------------+ | Scott [email protected] | | +61-3-9008-5695 (B) SVP Technical Services | |PGP:https://gnupg.org/ ABN 79 220 496 603 | |KEY:https://pgp.mit.edu/pks/lookup?op=vindex&search=0xEDBE43639EFD884D | +-----------------------------------------------------------------------------+ DISCLAIMER: The content of this email is confidential and strictly intended only for the recipient(s) specified in the message. If you have received this message by mistake it is strictly forbidden to keep this email in any form, electronic or hard copy, or to share any part of it with any one else, without the prior, written consent of the author. If you have received this message by mistake, please let me know by replying to this email, and then destroy it and any copies. SECURITY: I prefer to send and receive confidential messages protected by PGP public key encryption. If you are willing to or are interested in protecting our email communication with PGP encryption, please refer tohttps://gnupg.org/.
OpenPGP_0xEDBE43639EFD884D.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
