[erlang-questions] Confusion over documentation (OTPROOT vs OTP_ROOT)

Jay Custin jpcustin@REDACTED
Wed Nov 19 00:31:38 CET 2014


I needed to get to the bottom of an issue on my system that involved name
resolution.  I noticed in the Kernel Reference Manual that the net_adm:
host_file <http://www.erlang.org/doc/man/net_adm.html#host_file-0> function
it states that the host_file function:

Reads the .hosts.erlang file, see the section Files below. Returns the
hosts in this file as a list, or returns {error, Reason} if the file could
not be read or the Erlang terms on the file could not be interpreted.


When you scroll to the bottom and read the Files section you see the
following:

The .hosts.erlang file consists of a number of host names written as Erlang
terms. It is looked for in the current work directory, the user's home
directory, and $OTP_ROOT (the root directory of Erlang/OTP), in that order.

Note the underscore/underbar '_' in OTP_ROOT


If you then read the beginning of the code
<http://erlang.org/doc/man/code.html> module documentation, the second
paragraph of the Code Path section has the following:

Initially, the code path consists of the current working directory and all
Erlang object code directories under the library directory $OTPROOT/lib,
where $OTPROOT is the installation directory of Erlang/OTP, code:root_dir().

Note the LACK of the underscore/underbar '_' in OTPROOT


Luckily we can always fall back on the Kernel Reference Manual section
describing the config <http://www.erlang.org/doc/man/config.html> file
which clears it all up with:

When starting Erlang in embedded mode, it is assumed that exactly one
system configuration file is used, named sys.config. This file should be
located in $ROOT/releases/Vsn, where $ROOT is the Erlang/OTP root
installation directory and Vsn is the release version.

Confused about whether to use OTP or OTP_ in identifying the root
installation for Erlang/OTP?  Don't use either!


Now I suppose by having three different ways for "identifying the root
installation directory" that maybe the authors never intended for an end
user to define environmental/system variables... then again...

Building and Installing Erlang/OTP => make and $ERL_TOP
<http://www.erlang.org/doc/installation_guide/INSTALL.html#Advanced-configuration-and-build-of-ErlangOTP_make-and-ERLTOP>
opens
with the sentence, "All the makefiles in the entire directory tree use the
environment variable ERL_TOP to find the absolute path of the
installation." so maybe we need to define ONE environment variable.


So OTP_ROOT, OTPROOT, ROOT, or don't bother with any of them?


SenseiC bows out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141118/0c9c0f64/attachment.htm>


More information about the erlang-questions mailing list