Re: [PATCH] Replace intimdating "WARNING" about an absent global config

Jacob Bachmeyer <[email protected]> Mon, 6 Oct 2025 21:43:36 -0500
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
On 10/6/25 05:22, Jonathan Wakely wrote:
> This replaces the shouty and scary-looking warning:
>
>    WARNING: Couldn't find the global config file.
>
> with a more informational message (assuming site.exp for the global init
> file):
>
>    No site.exp file or $DEJAGNU environment variable found.

This could also be confusing, because there are two init files that 
default to site.exp in two different places.

I note that search_and_load_file, which is used for several other 
configuration files, produces the "Using FILE as WHAT." messages and I 
am leaning towards a similar model for the global config file, except 
also including a plain "No global configuration defined." message if 
there is neither a global init file (default: $libdir/site.exp) nor a 
global configuration file ($DEJAGNU).

Considering the history of this message, which seems to be a legacy of 
the old Cygnus testing lab setup, it probably does not need to say 
"WARNING" anymore, but it still needs to be there. According to Rob 
Savoye, at Cygnus, the global config file contained the configuration 
for remote targets, and most of the tests used remote targets, so 
testing would not work without that file, thus the warning.

The scenarios where DejaGnu needs a global configuration are advanced 
enough that users can be reasonably expected to examine the sources, 
locate the one place that can emit that message, and read the nearby 
comments.  I am thinking about what to put in those comments.

I was planning to make this change for 1.7, but I guess it could safely 
go on the 1.6 series.

> This was discussed in the thread beginning at:
> https://lists.gnu.org/archive/html/dejagnu/2020-12/msg00004.html
> ---
>
> Tested with 'make all check'
>
> Could this be changed, so that new users are intimidated by the WARNING
> when it isn't actually a problem they need to care about?
>
> For example, GCC's testsuites work perfectly well without any global
> config, because they have sensible defaults for everything.

Actually, the reason that they work without a global configuration is 
that you are not running them on remote targets. DejaGnu has sensible 
defaults for testing on localhost, but sensible defaults for actual 
remote targets are not possible, thus the need for global configuration.


-- Jacob