Open rleonid opened 8 years ago
To add more info, so the issue is that we recommend creating a Makefile with the line
include $(shell opam config var solvuu-build:lib)/solvuu.mk
And the issue OP is experiencing is that the opam
executable is not found in this context. It seems Make causes his PATH to be not used correctly. Thus, the $(shell ... )
part ends up being empty, and Make thinks it is supposed to include /solvuu.mk
and this of course doesn't exist.
Does anyone know the portable way to call out to a shell command from within Make?
To add a bit more info, I changed the Makefile to
include $(shell /full/path/to/opam config var solvuu-build:lib)/solvuu.mk
so perhaps a more robust mechanism would be to tie an installation of solvuu_build
to the opam
that it is using?
tie an installation of
solvuu_build
to theopam
that it is using?
I don't think there is a general way to do that because opam
is an executable that could be anywhere. It is not related in any way to the directory structure opam maintains because opam
is not installed by opam.
I was suggesting inserting the result of which opam
during the build
phase.
If which opam
is a reliable way to get the path to an executable, then we could recommend the following Makefile:
OPAM=$(shell which opam)
include $(shell $(OPAM) config var solvuu-build:lib)/solvuu.mk
Just hit this again, as I was reinstalling things. Can you add that change? On testing, it solves my problems.
Can you add that change?
Do you mean determining the path to opam by doing OPAM=$(shell which opam)
? You feel that is the more correct general solution? We just need to update the documentation then.
I'm not clear on exactly what the problem is. If which opam
works within the Makefile, it seems impossible that opam
is not found because all which
does is search PATH
.
On my instance the shell opam config var solvuu-build:lib
part fails.
But, weirdly, using the OPAM=$(shell which opam)
technique succeeds. Maybe because the final shell
invocation somehow doesn't operate with the full PATH
variable.
and
and
our
~
is NFS mounted.