lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Data directory and libraries to preload


From: Vadim Zeitlin
Subject: [lmi] Data directory and libraries to preload
Date: Tue, 31 May 2016 22:41:09 +0200

 Hello,

 The recent mention of the circular dependency on data directory reminded
me about a related problem described by the following comment in the
configuration_filepath() function in configurable_settings.cpp (with some
extra context for clarity):

    std::string filename = LMI_INSTALL_PREFIX "/etc/opt/lmi/"
                            + configuration_filename();
    if(0 != access(filename.c_str(), R_OK))
        {
        // TODO ?? At this point, AddDataDir() refers to the directory
        // where the wx binary resides. A configurable_settings object
        // apparently exists before ProcessCommandLine() is called.
        filename = AddDataDir(configuration_filename());

 The comment is correct, this code is called before the command line is
parsed and so even if the --data_path option is specified, it is not taken
into account here and configurable_settings.xml must exist either in the
default location ("$prefix/etc/opt/lmi") or in the executable directory.
I don't know if it's a real problem in practice, I guess it isn't as normal
lmi users do always have the global configuration file, but it's still
somewhat annoying.

 And there is a simple way to avoid this because the reason for this
happening is the call to MswDllPreloader::PreloadDesignatedDlls() early
during the startup process. I don't think it's really necessary to preload
these DLLs so early, surely we could do this in Skeleton::OnInit() after
parsing the command line options, couldn't we?

 What do you think?
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]