Skip to content
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

COQBIN should be used in configure.ac #127

Open
Villetaneuse opened this issue Oct 25, 2023 · 5 comments · May be fixed by #128
Open

COQBIN should be used in configure.ac #127

Villetaneuse opened this issue Oct 25, 2023 · 5 comments · May be fixed by #128

Comments

@Villetaneuse
Copy link
Contributor

It's more or less standard that the COQBIN environment variable sets the directory where coq executables are to be found (this is especially convenient with a dev build). This should be considered in configure.ac. Since I don't know much about autoconf I couldn't do it immediately.

If someone with some autoconf experience can fix this, it would be welcome. Otherwise, I might give it a try.

@ybertot
Copy link
Collaborator

ybertot commented Oct 26, 2023

I don't understand. What is the use case?

@Villetaneuse
Copy link
Contributor Author

As a use case, assume alice has a local copy of the coq repository. She does something like this:

$ echo $COQBIN
/home/alice/coq/_build/install/default/bin
$ autoconf

and then autoconf finds coqc and coq_makefile in /home/alice/coq/_build/install/default/bin instead of the one (if any) in the PATH directories.

This is useful for instance when the user has a development version of coq and wants to test coq_dpdgraph against it.
It is done in Coquelicot.

It is not vital since the user can still prepend its PATH with its COQBIN before running autoconf, but it would make the building steps more uniform with the other libraries.

@ybertot
Copy link
Collaborator

ybertot commented Oct 26, 2023

Understood. I don't really understand autoconf myself, and there is pressure to remove its use. One proposed solution is to have a build process relying on dune. Another solution that I had in mind was to only rely on opam to perform checks about dependencies. Your use case makes me realize (and remember) that some users are unhappy with opam which forces to re-compile everything for each switch.

My next question is relative to your use case (since I am not an expert on autoconf, I may not be able to implement your need, but I still need to know more if I try). Do you wish COQBIN to be used in priority (even if coqc can be found in the PATH) or do you wish COQBIN to be used as as fallback solution when nothing is found in the PATH

@Villetaneuse
Copy link
Contributor Author

Thank you. I think that COQBIN, if set and non empty usually has priority over the PATH. Then if the user prefers to build it against a released version in her PATH, she can just unset COQBIN or make it empty.

@ybertot
Copy link
Collaborator

ybertot commented Oct 26, 2023

I am now stopping to work on this issue, for lack of time today. I think a solution might be found by playing with the extra optional arguments to command AC_CHECK_PROG (look for the documentation of autoconf here, for instance) it might be possible to just set the path to :$COQBIN:$PATH in the two calls to AC_CHECK_PROG at lines 177 and 192 of configure.ac of today.

@Villetaneuse Villetaneuse linked a pull request Oct 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants