Skip to content

Commit 60dcbfd

Browse files
authored
Merge pull request #3838 from mtzguido/misc
Misc fixes
2 parents 20e123b + 2330819 commit 60dcbfd

File tree

4 files changed

+29
-31
lines changed

4 files changed

+29
-31
lines changed

Makefile

+13-14
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ build: 2
8888
# These files are regenerated as soon as *any* ml file reachable from
8989
# stage*/dune changes. This makes sure we trigger dune rebuilds when we
9090
# modify base ML files. However this will not catch deletion of a file.
91-
.stage1.ml.touch: $(shell find -L stage1/dune/ -name '*.ml' -type f)
92-
touch $@
93-
.stage2.ml.touch: $(shell find -L stage2/dune/ -name '*.ml' -type f)
94-
touch $@
91+
.src.ml.touch: .force
92+
[ -e $@ ] || touch $@
93+
find -L src/ml -newer $@ -exec touch $@ \; -quit
9594

96-
$(FSTAR1_BARE_EXE): .bare1.src.touch .stage1.ml.touch $(MAYBEFORCE)
95+
$(FSTAR1_BARE_EXE): .bare1.src.touch .src.ml.touch $(MAYBEFORCE)
9796
$(call bold_msg, "BUILD", "STAGE 1 FSTARC-BARE")
9897
$(MAKE) -C stage1 fstarc-bare
9998
touch -c $@
@@ -111,7 +110,7 @@ $(FSTAR1_BARE_EXE): .bare1.src.touch .stage1.ml.touch $(MAYBEFORCE)
111110
TOUCH=$@ \
112111
$(MAKE) -f mk/plugins.mk ocaml
113112

114-
$(FSTAR1_FULL_EXE): .bare1.src.touch .full1.src.touch .stage1.ml.touch $(MAYBEFORCE)
113+
$(FSTAR1_FULL_EXE): .bare1.src.touch .full1.src.touch .src.ml.touch $(MAYBEFORCE)
115114
$(call bold_msg, "BUILD", "STAGE 1 FSTARC")
116115
$(MAKE) -C stage1 fstarc-full
117116
touch -c $@
@@ -129,7 +128,7 @@ $(FSTAR1_FULL_EXE): .bare1.src.touch .full1.src.touch .stage1.ml.touch $(MAYBEFO
129128
$(MAKE) -f mk/lib.mk ocaml verify
130129
# ^ NB: also verify files we don't extract
131130

132-
.alib1.touch: .alib1.src.touch .stage1.ml.touch $(MAYBEFORCE)
131+
.alib1.touch: .alib1.src.touch .src.ml.touch $(MAYBEFORCE)
133132
$(call bold_msg, "BUILD", "STAGE 1 LIB")
134133
$(MAKE) -C stage1/ libapp
135134
touch $@
@@ -149,7 +148,7 @@ $(FSTAR1_FULL_EXE): .bare1.src.touch .full1.src.touch .stage1.ml.touch $(MAYBEFO
149148
TOUCH=$@ \
150149
$(MAKE) -f mk/lib.mk ocaml
151150

152-
.plib1.touch: .plib1.src.touch .stage1.ml.touch $(MAYBEFORCE)
151+
.plib1.touch: .plib1.src.touch .src.ml.touch $(MAYBEFORCE)
153152
$(call bold_msg, "BUILD", "STAGE 1 PLUGLIB")
154153
$(MAKE) -C stage1/ libplugin
155154
touch $@
@@ -168,7 +167,7 @@ $(FSTAR1_FULL_EXE): .bare1.src.touch .full1.src.touch .stage1.ml.touch $(MAYBEFO
168167
TOUCH=$@ \
169168
$(MAKE) -f mk/fstar-12.mk ocaml
170169

171-
$(FSTAR2_BARE_EXE): .bare2.src.touch .stage2.ml.touch $(MAYBEFORCE)
170+
$(FSTAR2_BARE_EXE): .bare2.src.touch .src.ml.touch $(MAYBEFORCE)
172171
$(call bold_msg, "BUILD", "STAGE 2 FSTARC-BARE")
173172
$(MAKE) -C stage2 fstarc-bare FSTAR_DUNE_RELEASE=1
174173
touch -c $@
@@ -189,7 +188,7 @@ $(FSTAR2_BARE_EXE): .bare2.src.touch .stage2.ml.touch $(MAYBEFORCE)
189188
TOUCH=$@ \
190189
$(MAKE) -f mk/plugins.mk ocaml
191190

192-
$(FSTAR2_FULL_EXE): .bare2.src.touch .full2.src.touch .stage2.ml.touch $(MAYBEFORCE)
191+
$(FSTAR2_FULL_EXE): .bare2.src.touch .full2.src.touch .src.ml.touch $(MAYBEFORCE)
193192
$(call bold_msg, "BUILD", "STAGE 2 FSTARC")
194193
$(MAKE) -C stage2 fstarc-full FSTAR_DUNE_RELEASE=1
195194
touch -c $@
@@ -207,7 +206,7 @@ $(FSTAR2_FULL_EXE): .bare2.src.touch .full2.src.touch .stage2.ml.touch $(MAYBEFO
207206
$(MAKE) -f mk/lib.mk ocaml verify
208207
# ^ NB: also verify files we don't extract
209208

210-
.alib2.touch: .alib2.src.touch .stage2.ml.touch $(MAYBEFORCE)
209+
.alib2.touch: .alib2.src.touch .src.ml.touch $(MAYBEFORCE)
211210
$(call bold_msg, "BUILD", "STAGE 2 LIB")
212211
$(MAKE) -C stage2/ libapp FSTAR_DUNE_RELEASE=1
213212
touch $@
@@ -227,7 +226,7 @@ $(FSTAR2_FULL_EXE): .bare2.src.touch .full2.src.touch .stage2.ml.touch $(MAYBEFO
227226
TOUCH=$@ \
228227
$(MAKE) -f mk/lib.mk ocaml
229228

230-
.plib2.touch: .plib2.src.touch .stage2.ml.touch $(MAYBEFORCE)
229+
.plib2.touch: .plib2.src.touch .src.ml.touch $(MAYBEFORCE)
231230
$(call bold_msg, "BUILD", "STAGE 2 PLUGLIB")
232231
$(MAKE) -C stage2/ libplugin FSTAR_DUNE_RELEASE=1
233232
touch $@
@@ -282,10 +281,10 @@ else
282281
LINK_OK=0
283282
endif
284283

285-
.stage1.src.touch: .bare1.src.touch .full1.src.touch .alib1.src.touch .plib1.src.touch .stage1.ml.touch
284+
.stage1.src.touch: .bare1.src.touch .full1.src.touch .alib1.src.touch .plib1.src.touch .src.ml.touch
286285
touch $@
287286

288-
.stage2.src.touch: .bare2.src.touch .full2.src.touch .alib2.src.touch .plib2.src.touch .stage2.ml.touch
287+
.stage2.src.touch: .bare2.src.touch .full2.src.touch .alib2.src.touch .plib2.src.touch .src.ml.touch
289288
touch $@
290289

291290
.install-stage1.touch: export FSTAR_LINK_LIBDIRS=$(LINK_OK)

mk/generic-0.mk

+5-8
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,14 @@ FSTAR := $(FSTAR_EXE) $(SIL) $(FSTAR_OPTIONS)
8484

8585
DEPSTEM := $(CACHE_DIR)/.depend$(TAG)
8686

87-
# We always run this to compute a full list of fst/fsti files in the
88-
# $(SRC) (ignoring the roots, it's a bit conservative). The list is
89-
# saved in $(DEPSTEM).touch.chk, and compared to the one we generated
90-
# before in $(DEPSTEM).touch. If there's a change (or the 'previous')
91-
# does not exist, the timestamp of $(DEPSTEM0.touch will be updated
92-
# triggering an actual dependency run.
87+
# This file's timestamp is updated whenever anything in $(SRC)
88+
# changes, forcing rebuilds downstream. Note that deleting a file
89+
# will bump the directories timestamp, we also catch that.
9390
.PHONY: .force
9491
$(DEPSTEM).touch: .force
9592
mkdir -p $(dir $@)
96-
find $(SRC) -name '*.fst*' > $@.chk
97-
diff -q $@ $@.chk 2>/dev/null || cp $@.chk $@
93+
[ -e $@ ] || touch $@
94+
find $(SRC) -newer $@ -exec touch $@ \; -quit
9895

9996
$(DEPSTEM): $(DEPSTEM).touch
10097
$(call msg, "DEPEND", $(SRC))

mk/generic-1.mk

+5-8
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,14 @@ FSTAR := $(FSTAR_EXE) $(SIL) $(FSTAR_OPTIONS)
7676

7777
DEPSTEM := $(CACHE_DIR)/.depend$(TAG)
7878

79-
# We always run this to compute a full list of fst/fsti files in the
80-
# $(SRC) (ignoring the roots, it's a bit conservative). The list is
81-
# saved in $(DEPSTEM).touch.chk, and compared to the one we generated
82-
# before in $(DEPSTEM).touch. If there's a change (or the 'previous')
83-
# does not exist, the timestamp of $(DEPSTEM0.touch will be updated
84-
# triggering an actual dependency run.
79+
# This file's timestamp is updated whenever anything in $(SRC)
80+
# changes, forcing rebuilds downstream. Note that deleting a file
81+
# will bump the directories timestamp, we also catch that.
8582
.PHONY: .force
8683
$(DEPSTEM).touch: .force
8784
mkdir -p $(dir $@)
88-
find $(SRC) -name '*.fst*' > $@.chk
89-
diff -q $@ $@.chk 2>/dev/null || cp $@.chk $@
85+
[ -e $@ ] || touch $@
86+
find $(SRC) -newer $@ -exec touch $@ \; -quit
9087

9188
$(DEPSTEM): $(DEPSTEM).touch
9289
$(call msg, "DEPEND", $(SRC))

src/tactics/FStarC.Tactics.V2.Basic.fst

+6-1
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,12 @@ let t_apply_lemma (noinst:bool) (noinst_lhs:bool)
11101110
in
11111111
let bs, comp = U.arrow_formals_comp t in
11121112
match lemma_or_sq comp with
1113-
| None -> fail "not a lemma or squashed function"
1113+
| None ->
1114+
fail_doc [
1115+
prefix 2 1 (text "Term to apply has computation type:") (pp comp);
1116+
text "`apply_lemma` can only apply functions with the Lemma effect or returning a squashed value.";
1117+
]
1118+
11141119
| Some (pre, post) ->
11151120
let! uvs, _, implicits, subst =
11161121
foldM_left

0 commit comments

Comments
 (0)