-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Return a user errormessage when OCAMLFIND_CONF unset / no ocamlf…
…ind in PATH Signed-off-by: Antonio Nuno Monteiro <[email protected]>
- Loading branch information
1 parent
cecbdd6
commit 668b185
Showing
2 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
test/blackbox-tests/test-cases/custom-cross-compilation/no-ocamlfind-in-path.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Dune shows an error message when ocamlfind isn't in PATH and OCAMLFIND_CONF | ||
isn't set | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.7) | ||
> (package (name repro)) | ||
> EOF | ||
$ cat > dune <<EOF | ||
> (executable | ||
> (name gen) | ||
> (modules gen) | ||
> (enabled_if | ||
> (= %{context_name} "default")) | ||
> (libraries libdep)) | ||
> (rule | ||
> (with-stdout-to | ||
> gen.ml | ||
> (echo "let () = Format.printf \"let x = 1\""))) | ||
> (library | ||
> (name repro) | ||
> (public_name repro) | ||
> (modules foo)) | ||
> EOF | ||
|
||
$ mkdir ocaml-bin | ||
$ cat > ocaml-bin/ocamlc <<EOF | ||
> #!/usr/bin/env sh | ||
> export PATH="\$ORIG_PATH" | ||
> exec ocamlc "\$@" | ||
> EOF | ||
$ chmod +x ocaml-bin/ocamlc | ||
|
||
$ DUNE_PATH=$(dirname `which dune`) | ||
$ SH_PATH=$(dirname `which sh`) | ||
$ env ORIG_PATH="$PATH" PATH="$SH_PATH:$DUNE_PATH:$PWD/ocaml-bin" dune build @install -x foo | ||
Error: Could not find ocamlfind in PATH or an environment variable | ||
`OCAMLFIND_CONF' while cross-compiling with toolchain `foo' | ||
Hint: | ||
- `opam install ocamlfind' and/or: | ||
- Point `OCAMLFIND_CONF' to the findlib configuration that defines this | ||
toolchain | ||
[1] | ||
|