-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ocamlbuild looks for executables in /usr/bin
#280
Comments
This looks like it may be some misconfiguration issue. Unfortunately there is no runtime option to have ocamlbuild reports on its configuration right now, so could you instead execute the following piece of code? module Conf = Ocamlbuild_pack.Ocamlbuild_config
let () =
let s = Printf.printf "%s = %S\n%!" in
let b = Printf.printf "%s = %B\n%!" in
s "bindir" Conf.bindir;
s "libdir" Conf.libdir;
s "ocaml_libdir" Conf.ocaml_libdir;
s "libdir_abs" Conf.libdir_abs;
b "ocaml_native" Conf.ocaml_native;
b "ocaml_native_tools" Conf.ocaml_native_tools;
b "supports_shared_libraries" Conf.supports_shared_libraries;
s "a" Conf.a;
s "o" Conf.o;
s "so" Conf.so;
s "ext_dll" Conf.ext_dll;
s "exe" Conf.exe;
s "version" Conf.version;
() If you write this to a
The second is to open an
|
Is what I get when I run that. The bindir printout is the most surprising to me, given that For reference:
|
I belive that your hypothesis on .bashrc trouble is exactly right, as I look at this code which implements OCamlbuild's command-invocation logic. In the Windows case, it invokes The I could remove it now, and I guess your life would improve, but I don't understand why this is needed. As far as I can tell, |
I have
Since I'm on windows, but using the Ubuntu subsystem. |
Ah, so that wasn't it. The quest goes on... I think |
I'm using windows bash with
opam
to useocamlbuild
, 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 tryocamlbuild
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/
forocamlfind
. I don't haveocaml
installed there, so clearly it can't find the file, but surely the behavior should be forocamlbuild
to look inopam
's bin folder for the executables first?$PATH
yields~/.opam/4.04.0/bin/:...
, and I puteval $(opam config env)
in both my~/.bashrc
and my~/.profile
so even ifocamlbuild
is launching some kind of sub-shell, the$PATH
variable should still have myopam
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 findocamlfind
and other executables?The text was updated successfully, but these errors were encountered: