"opam init" missing from install instructions
I encountered the following issue when first compiling the project. I'm not sure how exhaustive the instructions are supposed to be, or should be.
After installing opam for the first time, opam install fails and instructs you to run opam init.
Perhaps this should be mentioned in build.md.
It might be worthwhile to also mention that opam init will modify your ~/.profile in order to add stuff to PATH and "upgrade" the shell with some other features.
This is required for make to work correctly, since it looks for ocamlfind.
I ended up moving the code it added from ~/.profile to ~/.bashrc, since I didn't want to start a new session.
I think the specifics of installing opam are outside the scope of what Emily can document, since installing opam will not be identical on all computers. However maybe I can provide a link to a better guide for opam installation, so I'll leave this issue open while I look into that…
(Also I think profile and bashrc are the same, just bashrc is loaded by bash and profile is loaded by both sh and bash. don't quote me on that though…)
At least on my Ubuntu machine, .profile isn't executed when I open a new terminal window through e.g. gnome-terminal, but does when I login through a virtual terminal.
.profile is executed when you log in to your computer.
Apparently Linux and Mac OS X terminals behave differently in this regard. Maybe consider filing a bug on OPAM saying that the install is confusing on Linux systems? https://github.com/ocaml/opam/issues
.profile is executed when you log in on Linux, and the environment variables it sets are visible to all running programs.
I'll take it up with opam. There's even a note in the source about it: https://github.com/ocaml/opam/blob/faa5c2719666111d669e60b4cdbd62472f81e998/src/core/opamStd.ml#L637
opam init (with a small comment) would be a nice addition to the build docs, though, since the list of commands appears to be a copy-paste affair ("Run these commands"), when in fact it's not.
I left a comment in this opam issue, where editing ~/.profile has actually caused a problem: https://github.com/ocaml/opam/issues/2375
So the change needed would be to add
opam init
source ~/.profile
To the Linux build instructions. You agree…?
What opam does depends on your shell, and in the case of bash it will, for example, edit .bash_profile if it exists instead of ~/.profile (and if the opam bug is fixed as I suggested, it will just require opening a new window to reload the rc file).
An exact command can't be provided, so a general note about what's happening should be enough. Here's an example, but it may be too verbose:
opam init # Follow the instructions on the screen. You will need to
# open a new terminal, or even "source ~/.profile" for the
# changes to take effect