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

option --version is buggy #274

Closed
francoisthire opened this issue Nov 14, 2019 · 14 comments · Fixed by #289
Closed

option --version is buggy #274

francoisthire opened this issue Nov 14, 2019 · 14 comments · Fixed by #289

Comments

@francoisthire
Copy link
Contributor

lambdapi --version prints

Lambdapi %%VERSION%%
@rlepigre
Copy link
Contributor

That's not a bug, that's a feature of Dune. Only releases have their version substituted.

@francoisthire
Copy link
Contributor Author

Well If I do make install I expect to have something better than %%%VERSION%%%.

@francoisthire
Copy link
Contributor Author

This is very frustrating because right now there is no easy way to know the current version of lambdapi.

@rlepigre
Copy link
Contributor

I agree, I'm as pissed of as you are by how crappy dune is. I would expect a version number like devel-<commit hash>, but apparently that's not possible.

@rlepigre
Copy link
Contributor

@francoisthire: I just discovered that if you install using opam pin then you get the version number.

@ejgallego
Copy link
Collaborator

You need to use the build-info library https://dune.readthedocs.io/en/stable/dune-libs.html#build-info

@rlepigre
Copy link
Contributor

rlepigre commented Nov 21, 2019

I find the idea of carrying build-system dependent code around in my project kind of worrying... But thanks @ejgallego! I did not know that already existed.

But anyway, is there any doc available for that library? I can't even find its source code in the middle of the whole dune repository. I'm hoping that it also provides installation paths.

@ejgallego
Copy link
Collaborator

I find the idea of carrying build-system dependent code around in my project kind of worrying... But thanks @ejgallego! I did not know that already existed.

The version problem is not an easy problem; in particular it is hard to maintain a proper incremental build. You don't the binary rebuilt on every hash change.

You can use build-info or else you can roll your own wrapper to git describe too, but then you have to be very careful as to avoid the rebuild problem.

Code for build-info is here BTW https://github.com/ocaml/dune/tree/master/otherlibs/build-info

@rlepigre
Copy link
Contributor

OK, do since build-info does not allow to do what I want, I don't think it is worth using it. I'm personally OK with the current situation where releases get a version number, and you also get a version number if you pin the repository. I'd rather not implement the version stuff myself.

As for the other limitations, I think I'm gonna have to hack around.

@ejgallego
Copy link
Collaborator

since build-info does not allow to do what I want

What would you like it to do? At least for the original request in this issue, it should work.

@rlepigre
Copy link
Contributor

Yeah, it would. But I also want to know where the lib directory used for the installation is (i.e., the result of opam var lib).

@ejgallego
Copy link
Collaborator

That's indeed your own ocaml/dune#1534 and ocaml/dune#1185 , IMHO it is better to have a small lookup function that considers different possibilities than to hardcode a path.

For example in Coq we set the data path at configure time, however in the build we can override in several ways so everything works (famous last words)

@rlepigre
Copy link
Contributor

Exactly! This problem keeps coming up for me. And yeah, I would like to avoid hackish solutions, and would prefer to have some guarantees. But I guess I'll just rely on some lookup function to discover the configuration.

@ejgallego
Copy link
Collaborator

Lookup tends to be pretty convenient, IMHO rebuilding the binary on install is quite of a bit hammer to use just for this.

@rlepigre rlepigre linked a pull request Mar 7, 2020 that will close this issue
6 tasks
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.

3 participants