drom icon indicating copy to clipboard operation
drom copied to clipboard

Missing step in Quick Start doc

Open ghulette opened this issue 3 years ago • 3 comments

Working through the Quick Start prompts you to issue the following series of commands:

$ drom new hello_world
$ cd hello_world
$ drom project
$ drom build -y
$ drom run

Command 'drom' not found, did you mean:
...

The last one fails because drom is not installed on the (newly-created by drom) local switch. I resolved this with an opam install drom in between, very simple, but maybe some people would be confused.

Also I'm not exactly sure what the recommended solution is. If it is to have drom on the local switch maybe it should be included in the package list by default?

ghulette avatar Apr 06 '21 15:04 ghulette

I don't really understand the issue : did you PATH change between the 1st and 5th command ? is your shell automatically detecting that there is an _opam/ dir and changes the PATH accordingly without you issueing any command? I would assume it is a security issue...

For the recommended solution, it's not clear yet, there are some discussions about having "cross-switches" tools in OPAM, which would solve the issue. In the meantime, you may use drom opam-plugin to copy drom files in a cross-switch directory, and then copy drom binary in /usr/local/bin/ or some other shared directory. It's not perfect, as shared files will not be updated when you update drom unless you call again drom opam-plugin with the new version (personally, I keep the sources of drom somewhere, build it there, and use global symbolic links: /usr/local/bin/drom -> /home/lefessan/Github/drom/drom* /home/lefessan/.opam/plugins/opam-drom -> /home/lefessan/Github/drom/share/drom/ where /home/lefessan/Github/drom/ contains the GIT sources of drom )

lefessan avatar Apr 10 '21 09:04 lefessan

Looks like opam 2.1.2 is fussier than whatever you tested this with; even after drom opam-plugin, I get the error:

[ERROR] drom is not a known command or plugin (package drom.0.3.0 does not have the 'plugin' flag set).

SamB avatar Feb 28 '22 18:02 SamB

I'm thinking a wrapper package called opam-drom that depends on drom and installs the appropriate symlink to ~/.opam/plugins/bin would probably be the simplest approach here?

SamB avatar Feb 28 '22 18:02 SamB