Skip to content

Ocamlbuild looks for executables in /usr/bin #280

@aremath

Description

@aremath

I'm using windows bash with opam to use ocamlbuild, which functions like Ubuntu for most things. Commands like
$which ocamlfind
~/.opam/4.04.0/bin/ocamlfind
and
$which ocamlbuild
~/.opam/4.04.0/bin/ocamlbuild
work fine, and I can invoke ocamlfind from the command line. When I try ocamlbuild though, I get
$ocamlbuild
/bin/sh: 1: /usr/bin/ocamlfind: not found
Failure: Error while running: /usr/bin/ocamlfind list.
Which implies to me that ocamlbuild is looking in /usr/bin/ for ocamlfind. I don't have ocaml installed there, so clearly it can't find the file, but surely the behavior should be for ocamlbuild to look in opam's bin folder for the executables first?

$PATH yields ~/.opam/4.04.0/bin/:..., and I put eval $(opam config env) in both my ~/.bashrc and my ~/.profile so even if ocamlbuild is launching some kind of sub-shell, the $PATH variable should still have my opam folder first. Notably, the error message reports for /bin/sh, so is it possible that that shell doesn't run my ~/.bashrc file, so doesn't have the $PATH variable set properly?

Is there some config file I can edit that tells ocamlbuild where it expects to find ocamlfind and other executables?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions