[m-dev.] proposed changes to mmc --version

Julien Fischer jfischer at opturion.com
Fri Aug 25 20:03:42 AEST 2023


Hi all,

I have some proposals concerning the version message produced by mmc --version.
This currently has the form:

     Mercury Compiler, version 22.01.7-beta-2023-07-28, on x86_64-pc-linux-gnu
     Copyright (C) 1993-2012 The University of Melbourne
     Copyright (C) 2013-2023 The Mercury team

1. GCC allows packagers / vendors to include extra information about who built
the GCC you are using in the version information displayed by the compiler.
For example, the output of gcc --version on one of my machines is:

     gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
     Copyright (C) 2015 Free Software Foundation, Inc.
     This is free software; see the source for copying conditions.  There is NO
     Warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I propose to do allow something similar for Mercury, by adding a new flag to
the configure script that lets you specify that information and including
it the version information (when present).

2. In order to accommodate the above, we will need to change how we display the
version information since the first line, particular, is getting rather long.
Here is a proposed change:

     Mercury Compiler VERSION (PACKAGEVERSION)
     Target: TARGETARCH
     Copyright (C) 1993-2012 The University of Melbourne
     Copyright (C) 2013-2023 The Mercury team

where (PACKAGEVERSION) would be omitted if the new configuration option is not
specified. For example:

     Mercury Compiler 22.01.7-beta-2023-07-28 (Opturion 2023b)
     Target: x86_64-pc-linux-gnu
     Copyright (C) 1993-2012 The University of Melbourne
     Copyright (C) 2013-2023 The Mercury team

"x86_64-pc-linux-gnu" is the target architecture for the compiler.
The use of the word "on" in the current verison information is ambiguous
at best. (That wording predates any support we have for cross-compilation).

3. Should we omit configuration information, such as the target architecture,
from the version message entirely and have a separate option for printing
that information, e.g. --output-target-arch?

Should we have --output-configuration option that prints the compiler's
current configuration (i.e. what's set in Mercury.config) in an easily
parasable format?

4. Many of the other tools in the system do not support a --version option.
I propose to add such an option, using whatever format is agreed above.

Julien.


More information about the developers mailing list