-
Notifications
You must be signed in to change notification settings - Fork 23
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
mostly cosmetic changes #9
Conversation
- theories directory (standard Coq projects) - use coq_makefile for building > gets us a standard `install` target - fix all deprecation warnings in coq 8.8 > note: might not be backwards compatible
There are three reasons why I didn't use
I guess 1) should be easy to address (I hope 😉), I don't know about 2) but it should not be too much of a concern for this repo because it doesn't have many files, and 3) could probably be automated, is there a standard way to to this? If we can address these three concerns to a reasonable extent, I'd be happy to merge this. And thanks for fixing the deprecation warnings! CC'ing @JasonGross and @vmurali because they use bbv in fiat-crypto and kami, respectively. |
👍 and thanks to fixing warnings and moving code to a subdirectory, no opinion on |
@samuelgruetter To your point 2, I believe this has changed. It seems to get all the dependencies via the following command: "coqdep" -dyndep var -f _CoqProject > ".coqdeps.d" || ( RV=$?; rm -f ".coqdeps.d"; exit $RV ) Personally, I like the list because it ensures that your build doesn't rely on any files that you aren't checking in. |
Before making claim 2), I did actually bother to checkout your branch and run Regarding 3), I'll just add an So I'll merge this, thanks @gmalecha! |
Looks like I didn't realize this affects all the projects using bbv :( In my setup, my _CoqProject using bbv has the following: -R . Kami And inside my files (in Kami), I do "Require Import bbv/Word.". Should I now change _CoqProject as follows? -R . Kami Why is this a good idea as opposed to storing the .vo files directly in the directories named after the project? |
The change didn't work. What should I do to use bbv correctly now? |
You should do:
-Q . Kami
-Q ../bbv/theories bbv
You can use -R as well, but it isn't recommended. Using -Q requires that
you write bbv.Xxx rather than just Xxx.
Inside your files, do Require Import bbv.Xxx.
If it doesn't work, then what is the error message?
On Tue, Jul 3, 2018, 1:15 PM Murali Vijayaraghavan ***@***.***> wrote:
The change didn't work. What should I do to use bbv correctly now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASlV0CxcFXuYXMynMDVQiRHDTNlmbWwks5uC6a4gaJpZM4U9LNV>
.
--
- gregory malecha
gmalecha.github.io
|
I think the mistake was I edited just the _CoqProject file without editing
the Makefile. And I was not using coq_makefile (because I don't like
listing all the files in the directory, point (2) raised by Sam). This is
resolved now.
Regarding -Q vs -R, I use -R, but I do Require Import bbv.Xxx, after which,
I use [word n] instead of [bbv.word n]. Are you saying with -R, I might
have been able to do Require Import Xxx ?
On Wed, Jul 4, 2018 at 3:09 AM, Gregory Malecha <notifications@github.com>
wrote:
… You should do:
-Q . Kami
-Q ../bbv/theories bbv
You can use -R as well, but it isn't recommended. Using -Q requires that
you write bbv.Xxx rather than just Xxx.
Inside your files, do Require Import bbv.Xxx.
If it doesn't work, then what is the error message?
On Tue, Jul 3, 2018, 1:15 PM Murali Vijayaraghavan <
***@***.***>
wrote:
> The change didn't work. What should I do to use bbv correctly now?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#9 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/
AASlV0CxcFXuYXMynMDVQiRHDTNlmbWwks5uC6a4gaJpZM4U9LNV>
> .
>
--
- gregory malecha
gmalecha.github.io
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOaRWZUSAKQUFlv9VEnefN-9AAk_do_ks5uDJRngaJpZM4U9LNV>
.
|
If you don't like listing all the files in the directory, you can always do something like: _CoqProject:
rm -f _CoqProject
echo "-Q ... " > _CoqProject
for x in theories/*.v; do echo $$x >> _CoqProject; done Yes, that is the strongly discouraged semantics of |
Just did something like what you suggested: c2afed0 |
Oh... that seems like a step in the wrong direction to me. Can we change it back? Providing a script to generate the file is fine, but it shouldn't be necessary. |
I think the right solution is to ask for a feature request (I don't actually know who is responsible for _CoqProject format, etc). |
What would be the feature you're requesting? |
A flag that automatically includes all the files in the directory. Say the flag is "-P" _CoqProject: This should automatically include all the files inside theories directory, so that "Require Import bbv.Word.", etc. should import the definitions in theories/Word.v, respectively, as opposed to listing all the necessary files manually. |
No, I think this is not a reasonable feature to ask for, because
If you want to have to not manually list files, then you can build your Makefile.coq:
$(COQBIN)coq_makefile -o Makefile.coq -f _CoqProject `find . -name "*.v"` |
@samuelgruetter You might want to check out the You could use something like SORT_COQPROJECT = sed 's,[^/]*/,~&,g' | env LC_COLLATE=C sort | sed 's,~,,g' | uniq
.PHONY: update-_CoqProject
update-_CoqProject::
(echo '-R theories bbv'; (git ls-files 'theories/*.v' | $(SORT_COQPROJECT))) > _CoqProject |
Just curious, in what way is your |
I like that proposal, no opinion on the implementation of sort. |
This Makefile seems to work. This can of course be made more generic by parsing getting all the directories listed in _CoqProject (under -Q or -R) instead of manually setting up VS for every directory. This way, the Makefile takes care of dependencies when a new file is added, and doesn't recompile already compiled files. (_CoqProject does not contain all the files in it.) VS:=$(wildcard .v) .PHONY: coq src clean ARGS := $(shell cat _CoqProject) coq: Makefile.coq.all Makefile.coq.all: Makefile $(VS) src: Makefile.coq.src Makefile.coq.src: Makefile $(VS) clean:: Makefile.coq.all Makefile.coq.src |
I think you can mix |
@vmurali why do you want to have both a |
OK I will take care of the current issues in the Makefile (non-use of
_CoqProject, redundant definitions, etc) and if they work for my other
repositories, I will make a PR.
…On Tue, Jul 10, 2018 at 9:30 AM, Samuel Gruetter ***@***.***> wrote:
@vmurali <https://github.com/vmurali> why do you want to have both a
Makefile.coq.all and a Makefile.coq.src?
Otherwise this Makefile (with @JasonGross <https://github.com/JasonGross>'s
fix) looks fine to me and would be worth a PR!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOaRTAmAwSpHzRmY7oYdxkvsgZ75bTlks5uFNaPgaJpZM4U9LNV>
.
|
What do you guys think about this change? Personally, I like the
theories
directory and I'd like to package this up as an opam and/or nix package so that it is easily installed.theories
directory. This seems like the common practice in Coq projects (just likesrc
directories are common in other languages).coq_makefile
for building, gets us a standardinstall
target as well as documentation and is common practice.