Skip to content

Commit da09038

Browse files
authored
Merge pull request #829 from MetaCoq/add-utils-and-common-initial-folders
Add utils and common initial folders and reorganize code and plugins
2 parents feb9020 + dd964c8 commit da09038

File tree

316 files changed

+1738
-800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+1738
-800
lines changed

.github/workflows/nix-action-coq-8.16-macos.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ jobs:
118118
name: 'Building/fetching previous CI target: equations'
119119
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
120120
--argstr job "equations"
121+
- if: steps.stepCheck.outputs.status == 'built'
122+
name: 'Building/fetching previous CI target: metacoq-utils'
123+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
124+
--argstr job "metacoq-utils"
125+
- if: steps.stepCheck.outputs.status == 'built'
126+
name: 'Building/fetching previous CI target: metacoq-common'
127+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
128+
--argstr job "metacoq-common"
121129
- if: steps.stepCheck.outputs.status == 'built'
122130
name: 'Building/fetching previous CI target: metacoq-template-coq'
123131
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
@@ -134,6 +142,18 @@ jobs:
134142
name: 'Building/fetching previous CI target: metacoq-erasure'
135143
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
136144
--argstr job "metacoq-erasure"
145+
- if: steps.stepCheck.outputs.status == 'built'
146+
name: 'Building/fetching previous CI target: metacoq-template-pcuic'
147+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
148+
--argstr job "metacoq-template-pcuic"
149+
- if: steps.stepCheck.outputs.status == 'built'
150+
name: 'Building/fetching previous CI target: metacoq-safechecker-plugin'
151+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
152+
--argstr job "metacoq-safechecker-plugin"
153+
- if: steps.stepCheck.outputs.status == 'built'
154+
name: 'Building/fetching previous CI target: metacoq-erasure-plugin'
155+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
156+
--argstr job "metacoq-erasure-plugin"
137157
- if: steps.stepCheck.outputs.status == 'built'
138158
name: Building/fetching current CI target
139159
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"

.github/workflows/nix-action-coq-8.16-ubuntu.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ jobs:
118118
name: 'Building/fetching previous CI target: equations'
119119
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
120120
--argstr job "equations"
121+
- if: steps.stepCheck.outputs.status == 'built'
122+
name: 'Building/fetching previous CI target: metacoq-utils'
123+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
124+
--argstr job "metacoq-utils"
125+
- if: steps.stepCheck.outputs.status == 'built'
126+
name: 'Building/fetching previous CI target: metacoq-common'
127+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
128+
--argstr job "metacoq-common"
121129
- if: steps.stepCheck.outputs.status == 'built'
122130
name: 'Building/fetching previous CI target: metacoq-template-coq'
123131
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
@@ -134,6 +142,18 @@ jobs:
134142
name: 'Building/fetching previous CI target: metacoq-erasure'
135143
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
136144
--argstr job "metacoq-erasure"
145+
- if: steps.stepCheck.outputs.status == 'built'
146+
name: 'Building/fetching previous CI target: metacoq-template-pcuic'
147+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
148+
--argstr job "metacoq-template-pcuic"
149+
- if: steps.stepCheck.outputs.status == 'built'
150+
name: 'Building/fetching previous CI target: metacoq-safechecker-plugin'
151+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
152+
--argstr job "metacoq-safechecker-plugin"
153+
- if: steps.stepCheck.outputs.status == 'built'
154+
name: 'Building/fetching previous CI target: metacoq-erasure-plugin'
155+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"
156+
--argstr job "metacoq-erasure-plugin"
137157
- if: steps.stepCheck.outputs.status == 'built'
138158
name: Building/fetching current CI target
139159
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.16"

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ checker/src/wf.mli
233233
/pcuic/src/classes0.mli
234234
/pcuic/src/classes0.ml
235235
/checker/metacoq-config
236+
/template-coq/metacoq-config
237+
/common/metacoq-config
236238
/translations/metacoq-config
237239
/erasure/_CoqProject
238240
/erasure/_PluginProject
@@ -244,6 +246,8 @@ checker/src/wf.mli
244246
/safechecker/metacoq-config
245247
/safechecker/_PluginProject
246248
/safechecker/_CoqProject
249+
/template-coq/_CoqProject
250+
/common/_CoqProject
247251
/safechecker/Makefile.safechecker.conf
248252
/safechecker/Makefile.safechecker
249253
/safechecker/Makefile.plugin.conf
@@ -289,6 +293,7 @@ test-suite/myMain.mli
289293
test-suite/myMain.ml
290294
test-suite/plugin-demo/Makefile.plugin
291295

296+
292297
template-coq/Makefile.plugin-e
293298
template-coq/Makefile.template-e
294299
template-coq/src/g_template_coq.ml
@@ -365,3 +370,30 @@ test-suite/plugin-demo/metacoq-config
365370
erasure/META
366371
safechecker/META
367372
template-coq/META
373+
374+
375+
template-pcuic/demo.v
376+
template-pcuic/Makefile.local
377+
template-pcuic/_CoqProject
378+
template-pcuic/Makefile.templatepcuic
379+
template-pcuic/Makefile.templatepcuic.conf
380+
381+
safechecker-plugin/metacoq-config
382+
safechecker-plugin/demo.v
383+
safechecker-plugin/Makefile.local
384+
safechecker-plugin/_CoqProject
385+
safechecker-plugin/_PluginProject
386+
safechecker-plugin/Makefile.safecheckerplugin
387+
safechecker-plugin/Makefile.safecheckerplugin.conf
388+
safechecker-plugin/Makefile.plugin
389+
safechecker-plugin/Makefile.plugin.conf
390+
391+
erasure-plugin/metacoq-config
392+
erasure-plugin/demo.v
393+
erasure-plugin/Makefile.local
394+
erasure-plugin/_CoqProject
395+
erasure-plugin/_PluginProject
396+
erasure-plugin/Makefile.erasureplugin
397+
erasure-plugin/Makefile.erasureplugin.conf
398+
erasure-plugin/Makefile.plugin
399+
erasure-plugin/Makefile.plugin.conf

.nix/cachedMake.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@ my-cachedMake (){
4343
fi
4444
}
4545

46+
my-cachedMake 'utils' 'utils/theories' 'MetaCoq.Utils'
47+
my-cachedMake 'common' 'common/theories' 'MetaCoq.Common'
4648
my-cachedMake 'template-coq' 'template-coq/theories' 'MetaCoq.Template'
4749
my-cachedMake 'pcuic' 'pcuic/theories' 'MetaCoq.PCUIC'
4850
my-cachedMake 'safechecker' 'safechecker/theories' 'MetaCoq.SafeChecker'
4951
my-cachedMake 'erasure' 'erasure/theories' 'MetaCoq.Erasure'
52+
my-cachedMake 'template-pcuic' 'template-pcuic/theories' 'MetaCoq.TemplatePCUIC'
5053

5154
unset -f my-nix-build-with-target
5255
unset -f my-cachedMake

.nix/coq-overlays/metacoq/default.nix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let
2525
releaseRev = v: "v${v}";
2626

2727
# list of core metacoq packages sorted by dependency order
28-
packages = [ "template-coq" "pcuic" "safechecker" "erasure" "all" ];
28+
packages = [ "utils" "common" "template-coq" "pcuic" "safechecker" "erasure" "template-pcuic" "safechecker-plugin" "erasure-plugin" "all" ];
2929

3030
template-coq = metacoq_ "template-coq";
3131

@@ -49,16 +49,15 @@ let
4949
patchShebangs ./configure.sh
5050
patchShebangs ./template-coq/update_plugin.sh
5151
patchShebangs ./template-coq/gen-src/to-lower.sh
52-
patchShebangs ./pcuic/clean_extraction.sh
53-
patchShebangs ./safechecker/clean_extraction.sh
54-
patchShebangs ./erasure/clean_extraction.sh
52+
patchShebangs ./safechecker-plugin/clean_extraction.sh
53+
patchShebangs ./erasure-plugin/clean_extraction.sh
5554
echo "CAMLFLAGS+=-w -60 # Unused module" >> ./safechecker/Makefile.plugin.local
56-
sed -i -e 's/mv $i $newi;/mv $i tmp; mv tmp $newi;/' ./template-coq/gen-src/to-lower.sh ./pcuic/clean_extraction.sh ./safechecker/clean_extraction.sh ./erasure/clean_extraction.sh
55+
sed -i -e 's/mv $i $newi;/mv $i tmp; mv tmp $newi;/' ./template-coq/gen-src/to-lower.sh ./safechecker-plugin/clean_extraction.sh ./erasure-plugin/clean_extraction.sh
5756
'' ;
5857

5958
configurePhase = optionalString (package == "all") pkgallMake + ''
6059
touch ${pkgpath}/metacoq-config
61-
'' + optionalString (elem package ["safechecker" "erasure"]) ''
60+
'' + optionalString (elem package ["safechecker" "erasure" "template-pcuic" "safechecker-plugin" "erasure-plugin"]) ''
6261
echo "-I ${template-coq}/lib/coq/${coq.coq-version}/user-contrib/MetaCoq/Template/" > ${pkgpath}/metacoq-config
6362
'' + optionalString (package == "single") ''
6463
./configure.sh local

Makefile

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ifeq '$(METACOQ_CONFIG)' 'local'
1212
export OCAMLPATH
1313
endif
1414

15-
.PHONY: printconf all template-coq pcuic erasure install uninstall html clean mrproper .merlin test-suite translations
15+
.PHONY: printconf all utils template-coq pcuic erasure install uninstall html clean mrproper .merlin test-suite translations
1616

1717
printconf:
1818
ifeq '$(METACOQ_CONFIG)' 'local'
@@ -27,92 +27,139 @@ endif
2727
endif
2828

2929
install: all translations
30+
$(MAKE) -C utils install
31+
$(MAKE) -C common install
3032
$(MAKE) -C template-coq install
3133
$(MAKE) -C pcuic install
3234
$(MAKE) -C safechecker install
35+
$(MAKE) -C template-pcuic install
36+
$(MAKE) -C safechecker-plugin install
3337
$(MAKE) -C erasure install
3438
$(MAKE) -C translations install
3539

3640
uninstall:
41+
$(MAKE) -C utils uninstall
42+
$(MAKE) -C common uninstall
3743
$(MAKE) -C template-coq uninstall
3844
$(MAKE) -C pcuic uninstall
3945
$(MAKE) -C safechecker uninstall
46+
$(MAKE) -C template-pcuic uninstall
47+
$(MAKE) -C safechecker-plugin uninstall
4048
$(MAKE) -C erasure uninstall
4149
$(MAKE) -C translations uninstall
4250

4351
html: all
4452
"coqdoc" --multi-index -toc -utf8 -html \
4553
--with-header ./html/resources/header.html --with-footer ./html/resources/footer.html \
54+
-R utils/theories MetaCoq.Utils \
55+
-R common/theories MetaCoq.Common \
4656
-R template-coq/theories MetaCoq.Template \
4757
-R pcuic/theories MetaCoq.PCUIC \
4858
-R safechecker/theories MetaCoq.SafeChecker \
59+
-R template-pcuic/theories MetaCoq.TemplatePCUIC \
4960
-R erasure/theories MetaCoq.Erasure \
61+
-R erasure-plugin/theories MetaCoq.ErasurePlugin \
5062
-R translations MetaCoq.Translations \
5163
-R examples MetaCoq.Examples \
5264
-d html */theories/*.v */theories/*/*.v translations/*.v examples/*.v
5365

5466
clean:
67+
$(MAKE) -C utils clean
68+
$(MAKE) -C common clean
5569
$(MAKE) -C template-coq clean
5670
$(MAKE) -C pcuic clean
5771
$(MAKE) -C safechecker clean
72+
$(MAKE) -C template-pcuic clean
5873
$(MAKE) -C erasure clean
74+
$(MAKE) -C erasure-plugin clean
5975
$(MAKE) -C examples clean
6076
$(MAKE) -C test-suite clean
6177
$(MAKE) -C translations clean
6278

6379
vos:
80+
$(MAKE) -C utils
81+
$(MAKE) -C common
6482
$(MAKE) -C template-coq
6583
$(MAKE) -C pcuic vos
6684
$(MAKE) -C safechecker vos
85+
$(MAKE) -C template-pcuic vos
6786
$(MAKE) -C erasure vos
87+
$(MAKE) -C erasure-plugin vos
6888
$(MAKE) -C translations vos
6989

7090
quick:
91+
$(MAKE) -C utils
92+
$(MAKE) -C common
7193
$(MAKE) -C template-coq
7294
$(MAKE) -C pcuic quick
7395
$(MAKE) -C safechecker quick
96+
$(MAKE) -C template-pcuic quick
7497
$(MAKE) -C erasure quick
98+
$(MAKE) -C erasure-plugin quick
7599
$(MAKE) -C translations quick
76100

77101
mrproper:
102+
$(MAKE) -C utils mrproper
103+
$(MAKE) -C common mrproper
78104
$(MAKE) -C template-coq mrproper
79105
$(MAKE) -C pcuic mrproper
80106
$(MAKE) -C safechecker mrproper
107+
$(MAKE) -C template-pcuic mrproper
81108
$(MAKE) -C erasure mrproper
109+
$(MAKE) -C erasure-plugin mrproper
82110
$(MAKE) -C examples mrproper
83111
$(MAKE) -C test-suite mrproper
84112
$(MAKE) -C translations mrproper
85113

86114
.merlin:
115+
$(MAKE) -C utils .merlin
116+
$(MAKE) -C common .merlin
87117
$(MAKE) -C template-coq .merlin
88118
$(MAKE) -C pcuic .merlin
89119
$(MAKE) -C safechecker .merlin
120+
$(MAKE) -C template-pcuic .merlin
90121
$(MAKE) -C erasure .merlin
122+
$(MAKE) -C erasure-plugin .merin
91123

92-
template-coq:
124+
utils:
125+
$(MAKE) -C utils
126+
127+
common: utils
128+
$(MAKE) -C common
129+
130+
template-coq: common
93131
$(MAKE) -C template-coq
94132

95-
pcuic: template-coq
133+
pcuic: common
96134
$(MAKE) -C pcuic
97135

98-
safechecker: template-coq pcuic
136+
safechecker: pcuic
99137
$(MAKE) -C safechecker
100138

101-
erasure: template-coq safechecker pcuic
139+
template-pcuic: template-coq pcuic
140+
$(MAKE) -C template-pcuic
141+
142+
safechecker-plugin: safechecker template-pcuic
143+
$(MAKE) -C safechecker-plugin
144+
145+
erasure: safechecker
102146
$(MAKE) -C erasure
103147

104-
examples: safechecker erasure
148+
erasure-plugin: erasure template-pcuic
149+
$(MAKE) -C erasure-plugin
150+
151+
examples: safechecker-plugin erasure-plugin
105152
$(MAKE) -C examples
106153

107-
test-suite: template-coq safechecker erasure
154+
test-suite: safechecker-plugin erasure-plugin
108155
$(MAKE) -C test-suite
109156

110157
translations: template-coq
111158
$(MAKE) -C translations
112159

113160
cleanplugins:
114161
$(MAKE) -C template-coq cleanplugin
115-
$(MAKE) -C safechecker cleanplugin
162+
$(MAKE) -C safechecker-plugin cleanplugin
116163
$(MAKE) -C erasure cleanplugin
117164

118165
ci-local-noclean:

build-packages.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

checker/src/to-lower.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

checktodos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
if [[ $(git grep -c todo | grep theories) = template-coq/theories/utils/MCUtils.v:3 ]]
3+
if [[ $(git grep -c todo | grep theories) = utils/theories/MCUtils.v:3 ]]
44
then
55
echo "No todos found"
66
if [[ $(git grep -c Admitted | grep theories) = "" ]]
@@ -14,7 +14,7 @@ then
1414
fi
1515
else
1616
echo "Found todos:"
17-
git grep -c todo | grep theories | grep -v "template-coq/theories/utils/MCUtils.v:3"
17+
git grep -c todo | grep theories | grep -v "utils/theories/MCUtils.v:3"
1818
exit 1
1919
fi
2020
endef

0 commit comments

Comments
 (0)