Every time I install Erlang, I end up without Observer. Used the commands below on a Ubuntu laptop with Xmonad and a Debian 9 running in the cloud, and seemingly they both resulted in the same package being installed:
nix-env -iA pkgs.beam.packages.erlangR22
nix-env -iA nixpkgs.beam.interpreters.erlang
nix-env -iA nixpkgs.beam.interpreters.erlangR22_odbc_javac
The Nixpkgs manuals 15.2. BEAM Languages (Erlang, Elixir & LFE) section (Version 19.09.1484.84586a4514d) does not mention Observer at all. It has a fairly recent update by DianaOlympos
that does mention it, albeit I tried all these packages, but no joy:
Many Erlang/OTP distributions available in
beam.interpreters
have versions with ODBC and/or Java enabled or without wx (no observer support). For example, there’sbeam.interpreters.erlangR22_odbc_javac
, which corresponds tobeam.interpreters.erlangR22
andbeam.interpreters.erlangR22_nox
, which corresponds tobeam.interpreters.erlangR22
.
Shane Sveller pointed it out that the wxGTK
package needs to be set up using propagatedBuildInputs
, but not sure how to do that. (Simply just installing wxGTK
then Erlang doesn’t work of course; was naive enough to try it. Also found out that chapter 20 of Nix Pills is exactly about this topic.)
This is also kind of a follow-up to the question “How to install Erlang/Elixir on a non-NixOS system?“, but I didn’t realize it then that Observer is missing…
update: Apparently, it works somewhere out of the box. (Probably on NixOS.)
2
Answers
Kind of ashamed to admit that I am an idiot, but Observer was there all this time (along with
net_adm
)...For some reason, it wouldn't autocomplete on the
erl
shell, but onceobserver:start().
was typed in and executed, it would recognize the module, and provide a list of available functions when hitting the Tab key.I probably messed up translating between
iex
anderl
(observer.start().
and other combinations), and I assumed that the resulting error message (together with no autocompletion) means that the module was missing.I have an overwrite for erlang, such that wx support is enabled:
Save this (as
shell.nix
for example), and just run it:Works on my machine!
Note:
wxmac
inbuildInputs
is specific to MacOS (andwxGTK
to Linux). To find the right package for your OS, here are the availablewx
packages.