Leesa ([info]shamangirl) wrote in [info]lj_dev,
@ 2008-04-18 04:49:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Still having probs with User Search
Once again, I am attempting to install LJ-UserSearch. Everything seems to go fine till you get to the last line of install-into-ljhome:

perl -pe 's/$ENV{LJHOME}\///' < $LJHOME/cgi-bin/i386-linux-thread-multi/auto/LJ/UserSearch/.packlist

It errors out because there isn't a packlist - heck, there isn't a directory structure like that which would contain a file known as .packlist!

Something is either missing or out of date, so I'd appreciate help. Thanks!


(Post a new comment)

Been a while since I installed it, but...
[info]potolo
2008-04-28 02:47 pm UTC (link)
It looks like the compile+build of the module first determines your architecture, then installs files into an architecture-dependent library tree. Next, the LJ-UserSearch module install script ($LJHOME/src/LJ-UserSearch/install-into-ljhome) acts on that tree, but fails because the path to it is hardcoded for a specific arch.

Example of it failing:
root@someserver:/home/lj/src/LJ-UserSearch# ./install-into-ljhome
Checking if your kit is complete...
Looks good
Writing Makefile for LJ::UserSearch
cp lib/LJ/UserSearch.pm blib/lib/LJ/UserSearch.pm
AutoSplitting blib/lib/LJ/UserSearch.pm (blib/lib/auto/LJ/UserSearch)
[SNIP]
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/LJ-UserSearch....ok
All tests successful.
Files=1, Tests=12, 0 wallclock secs ( 0.04 cusr + 0.01 csys = 0.05 CPU)
[SNIP]
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/lj/cgi-bin/i486-linux-gnu-thread-multi/auto/LJ/UserSearch/autosplit.ix
Installing /home/lj/cgi-bin/i486-linux-gnu-thread-multi/LJ/UserSearch.pm
[SNIP]
*** BEGIN CONTENTS OF PACKLIST ***
./install-into-ljhome: line 23: /home/lj/cgi-bin/i386-linux-thread-multi/auto/LJ/UserSearch/.packlist: No such file or directory
*** END CONTENTS OF PACKLIST ***
root@someserver:/home/lj/src/LJ-UserSearch#
Line in script causing the problem and how to fix it:

perl -pe 's/$ENV{LJHOME}\///' < $LJHOME/cgi-bin/i386-linux-thread-multi/auto/LJ/UserSearch/.packlist

See, if your architecture is i386-linux that works. Otherwise, you'd need to amend that line in the script to conform to your system. You can find out arch information by running "uname -a" at a Bash prompt; or, during the make/install part of LJ-UserSearch installation you might see output like:
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/lj/cgi-bin/i486-linux-gnu-thread-multi/auto/LJ/UserSearch/autosplit.ix

That would let you know to edit from …cgi-bin/i386-linux-thread-multi/auto… to …cgi-bin/i486-linux-gnu-thread-multi/auto….

Example of the install-into-ljhome script once you have edited it:
echo "*** BEGIN CONTENTS OF PACKLIST ***"
# This next command shouldn't be hard coded, but ExtUtils::Installed doesn't work properly with libs outside perls main sear$
# perl -pe 's/$ENV{LJHOME}\///' < $LJHOME/cgi-bin/i386-linux-thread-multi/auto/LJ/UserSearch/.packlist
perl -pe 's/$ENV{LJHOME}\///' < $LJHOME/cgi-bin/i486-linux-gnu-thread-multi/auto/LJ/UserSearch/.packlist
echo "*** END CONTENTS OF PACKLIST ***"
Then, once edited, instead of a failure you would see something like:
...Writing /home/lj/cgi-bin/i486-linux-gnu-thread-multi/auto/LJ/UserSearch/.packlist
Appending installation info to /home/lj/cgi-bin/i486-linux-gnu-thread-multi/perllocal.pod
*** BEGIN CONTENTS OF PACKLIST ***
cgi-bin/i486-linux-gnu-thread-multi/LJ/UserSearch.pm
cgi-bin/i486-linux-gnu-thread-multi/auto/LJ/UserSearch/UserSearch.bs
cgi-bin/i486-linux-gnu-thread-multi/auto/LJ/UserSearch/UserSearch.so
cgi-bin/i486-linux-gnu-thread-multi/auto/LJ/UserSearch/autosplit.ix
src/LJ-UserSearch/man/man3/LJ::UserSearch.3pm
*** END CONTENTS OF PACKLIST ***
root@someserver:/home/lj/src/LJ-UserSearch#

(Reply to this)(Thread)

Re: Been a while since I installed it, but...
[info]shamangirl
2008-04-29 12:38 am UTC (link)
Okay, I managed to correct the line so that install-into-ljhome ran normally. I then tried the directory search (directory.bml), clicking on California (which is showing 116 journals) and the search came up with no results.

Is there another step to go through before search is totally functional?

(Reply to this)(Parent)(Thread)

Re: Been a while since I installed it, but...
[info]potolo
2008-05-06 10:13 pm UTC (link)
I don't know to be honest. I had a brief look to find out what files and setup might be needed. It seems to rely on Gearman/TheSchwartz running and four workers. My notes follow. Hopefully this will help reduce the time it takes you to get up and running — if my 'guesses' are correct.

Six relevant files:
src/LJ-UserSearch/install-into-ljhome
Installs the underlying search system module: LJ::UserSearch::*

bin/build-usersearch
Writes the usersearch.data file to update. Originally this file did more, but its functionality was split into two parts. This script still does the file-writing part. The database update part is now handled by bin/worker/directory-meta, a 'manual worker' that can lock the db/table as necessary

bin/worker/directory-meta
A worker to update the db, locking tables if/when necessary

bin/worker/search-updater
Restarts the search-master processes (search-lookup) after it writes the usersearch file for current machine. For search-updater to restart workers when needed, the hostname you use in your TheSchwartz (bin/)workers config file needs to match the output of hostname on the machine.

bin/worker/search-lookup
Gearman worker for directory search

bin/worker/search-constraints
Worker for processing and passing where needed the search constraints like only in location sometown with interest jelly
Search metadata goes in a combination of the table usersearch_packdata and the usersearch.packdata file (snapshot image, updated during idletime, to read into memory for efficiency?), for effective searching. The $LJ::USERSEARCH_METAFILE_PATH config variable sets the filename & path the search-updater worker should use for the usersearch data file. It should default to "$LJ::HOME/var/usersearch.data" anyway, but probably won't hurt if you were to explicitly define it in ljconfig.pl.

Gray area: what writes the file, bin/build-usersearch or /bin/worker/search-updater? Is build-usersearch obsoleted by search-updater? The second one is newer, and (FWIW) does have more code.

(Reply to this)(Parent)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…