[sword-devel] InstallMgr Woes

Greg Hellings greg.hellings at gmail.com
Fri Feb 5 15:41:31 EST 2021


Just to prove to myself that I'm not completely crazy, I just did the same
process on my Windows machine where I'm running Fedora 33 in WSL2, using
the exact same bits and bytes of SWORD.

I still had to edit /etc/sword.conf to avoid writing files to
/usr/share/sword, but it installed the KJV to ~/.sword without an issue,
and is working flawlessly. So it's something wonky with my Fedora
Silverblue box.

--Greg

On Fri, Feb 5, 2021 at 2:34 PM Greg Hellings <greg.hellings at gmail.com>
wrote:

>
>
> On Fri, Feb 5, 2021 at 12:49 PM Troy A. Griffitts <scribe at crosswire.org>
> wrote:
>
>> Hi Greg,
>>
>> I few quick comments and thoughts...
>>
>> So, regarding the commandline tool and option: installmgr -init
>>
>> This simply does:
>>
>>                 SWBuf baseDir = FileMgr::getSystemFileMgr()->getHomeDir();
>>                 if (baseDir.length() < 1) baseDir = ".";
>>                 baseDir += "/.sword/InstallMgr";
>>                 confPath = baseDir + "/InstallMgr.conf";
>>
>> So, regarding its own configuration and temporary storage, it always
>> uses, basically ~/.sword/installMgr/
>>
>> SWORD_PATH should be honored regarding WHERE to finally install modules,
>> but they will first always be downloaded to ~/.sword/installMgr and once a
>> successful download is completely, the install to SWORD_PATH should happen.
>>
> Is there a particular reason to not make that configurable via the same
> methods? It definitely threw me off, and in the world of Flatpaks, Snaps,
> AppImage, etc there are times where an application should be made to honor
> other configurations (e.g. making it relative to $XDG_DATA_DIR if that's
> defined instead of directly off of $HOME). I would have expected SWORD_PATH
> to be the mechanism used, so that was a surprise to me when it didn't.
>
>> Also, SWORD has a long list of rules it uses to find your SWORD library,
>> each with precedence.  For example, a SWORD library detected in you CWD is
>> highest priority.  i.e., be sure you aren't running the command from a
>> folder which has a mods.conf file or mods.d/ folder or it will think you
>> wish to operate on your CWD.  And on the positive side, try to cd ~/.sword
>> and run installmgr (assuming a ~/.sword/mods.d/ folder exists).  You
>> shouldn't have to set SWORD_PATH for installmgr to install to ~/.sword if
>> it is your CWD.
>>
> There were no mods.conf or mods.d folders in my CWD when I was running
> these. Running installmgr from within my ~/.sword folder still results in
> no files installed. But the mystery runs deeper. I just tried using the ASV
> module, and it worked fine. Then I installed NETfree, and it worked fine,
> but the data files for the ASV module were removed. Now I can't install any
> of them to ~/.sword. But they install to ~/.local/share/sword/ successfully.
>
>> I am curious that you got it working without /etc/sword.conf entries.
>>
> Indeed, I could not get it working when that was set (I didn't try
> changing that to my homedir, I just commented out its contents entirely).
>
>> You can always see the rules used to determine your library location by
>> turning log level all the way up:
>>
>> SWORD_LOGLEVEL=DEBUG ~/src/sword/utilities/installmgr -ri CrossWire KJV
>>
> Debugging output is how I knew it was claiming to write the files to the
> proper location. Those tell me all the proper values for
> destMgr->prefixPath properly pointing to ~/.sword or ~/.local/share/sword
> depending on my current environment settings. And before it writes the file
> it gives the full path. But, for whatever reason, that doesn't seem to be
> happening consistently.
>
>> You will get all kinds of noise, but near the top (I would recommend a
>> tput clear, to reset your scrollback buffer), you should see:
>>
>> [0.00146] Checking working directory for mods.d...
>> [0.00146] found.
>> [0.00147] LOOKING UP MODULE CONFIGURATION COMPLETE.
>>
> At this point, I can install the modules, but when I try to read them with
> diatheke, I get empty string outputs. They were working fine earlier today
> once I did get them installed.
>
> So, basically, my experience with the modules install is non-deterministic
> and I'm about to pull my hair out trying to figure out what's going on! I
> don't know if it is my filesystem (BTRFS), my system (Fedora Silverblue is
> designed to be weird), something in my Fedora packaging of the library
> (always a possibility), or if I'm being bombarded with Gamma rays right now
> and it's causing my computer to spazz out. Everything I'm doing is still
> working wonderfully and deterministically in CI, so I guess that's a
> blessing.
>
> Anyways, if you have any ideas on how I can further plumb the mysteries,
> I'd be happy to take them on.
>
> --Greg
>
>>
>> Just a few things to try experimenting with.
>>
>> Troy
>>
>>
>>
>>
>> On 2/5/21 10:50 AM, Greg Hellings wrote:
>>
>> PREAMBLE:
>> I'm trying to install modules with installmgr on the command line. I seem
>> to frequently run into issues with it silently dumping the files somewhere
>> where they don't actually exist, and it's happening again. But I think I've
>> narrowed down some of when it happens:
>>
>> I currently have a /etc/sword.conf that points to /usr/local/share. In
>> that folder there are locale.d, mods.d, and modules folders, but the folder
>> is not writable. This works as expected, installmgr downloads the files
>> then tries to write them and says it failed and suggests it might be my
>> permissions.
>>
>> FIRST ISSUE:
>> So I set SWORD_PATH to ~/.sword. I run installmgr init, sync, update
>> CrossWire, and try to install KJV. Now I get an attempt to write the files
>> - the kjv.conf gets written into mods.d, but the data files are nowhere to
>> be found. No errors, either. Debugging is telling me it's trying to write
>> them into ~/.sword/modules/texts/ztext/kjv, and it successfully creates the
>> modules/texts/ztext folders, but nothing below that. Not the "kjv" folder
>> and no data files. So now I try setting SWORD_PATH to
>> ~/.local/share/sword. Same result as before.
>>
>> Once I comment out the entries in /etc/sword.conf, all is well! I get my
>> files AND my folder structure. But only when SWORD_PATH is set to
>> ~/.local/share/sword/. No luck under ~/.sword/. It still misbehaves.
>>
>> SECOND ISSUE:
>> With SWORD_PATH set to ~/.local/share/sword/, I try running installmgr
>> sync again after deleting my ~/.sword directory. It's writing files to
>> ~/.sword still. This is despite the debugging telling me "Checking
>> $SWORD_PATH... found(/var/home/ghelling/.local/share/sword)". Yes, I know
>> the folder path is odd but ~/ is /var/home/ghelling on Fedora Silverblue.
>>
>> If I'm setting SWORD_PATH to ~/.local/share/sword, then shouldn't
>> installmgr also honor that path for downloading its files? And shouldn't
>> installmgr be able to write the data files to ~/.sword in the first case?
>>
>> --Greg
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.orghttp://crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://crosswire.org/pipermail/sword-devel/attachments/20210205/d29c865f/attachment.html>


More information about the sword-devel mailing list