Skip to content

Commit 48ac22f

Browse files
Lef IoannidisCopilot
andcommitted
Fix opam install for F* 2: remove references to deleted LowStar modules
- Remove LowStar.Printf.fst and LowStar.Endianness.fst from krmllib ROOTS (these modules no longer exist in F* 2's ulib) - Exclude krmllib .fst files that depend on LowStar.Buffer / FStar.HyperStack.* which were removed in F* 2 - Remove 'LowStar -LowStar.Lib' from --already_cached - Remove -bundle LowStar.Endianness= and LowStar.Printf from -library flags - Exclude hand-written C files (lowstar_printf.c, fstar_hyperstack_io.c, testlib.c, c.c, c_string.c) whose headers are no longer extracted - Update fstar_uint128_gcc64.h to use krml/lowstar_endianness.h instead of the no-longer-extracted LowStar_Endianness.h - Regenerate krmllib/dist/ for F* 2 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 03c7894 commit 48ac22f

46 files changed

Lines changed: 105 additions & 1084 deletions

Some content is hidden

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

krmllib/Makefile

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,23 @@ endif
4040

4141
FSTAR = $(RUNLIM) $(FSTAR_EXE) $(FSTAR_OPTIONS) --cache_dir obj \
4242
$(addprefix --include , $(INCLUDE_PATHS)) \
43-
--already_cached 'Prims FStar -FStar.Krml.Endianness LowStar -LowStar.Lib'
43+
--already_cached 'Prims FStar -FStar.Krml.Endianness'
4444

4545
# Note: not compatible with the OPAM layout until fstar can be queried for the
4646
# location of ulib.
47-
ROOTS = $(wildcard *.fst) $(wildcard *.fsti) $(wildcard ../runtime/*.fst) \
47+
# Files that depend on LowStar.Buffer / FStar.HyperStack.* which were removed in F* 2
48+
FSTAR2_INCOMPATIBLE = \
49+
C.Endianness.fst C.Failure.fst C.fst C.Loops.fst C.String.fst C.String.fsti \
50+
FStar.Krml.Endianness.fst \
51+
LowStar.Lib.AssocList.fst LowStar.Lib.AssocList.fsti \
52+
LowStar.Lib.LinkedList.fst LowStar.Lib.LinkedList2.fst \
53+
TestLib.fsti \
54+
../runtime/WasmSupport.fst
55+
56+
ROOTS = $(filter-out $(FSTAR2_INCOMPATIBLE),$(wildcard *.fst) $(wildcard *.fsti) $(wildcard ../runtime/*.fst)) \
4857
FStar.UInt128.fst FStar.Date.fsti \
4958
FStar.IO.fsti FStar.Int.Cast.Full.fst \
50-
FStar.Bytes.fsti FStar.Dyn.fsti LowStar.Printf.fst LowStar.Endianness.fst
59+
FStar.Bytes.fsti FStar.Dyn.fsti
5160

5261
.PHONY: clean clean-c
5362
clean: clean-c
@@ -113,21 +122,23 @@ ifeq ($(OS),Windows_NT)
113122
local_krml_home := $(shell cygpath -m "$(local_krml_home)")
114123
endif
115124

125+
# Hand-written C files that depend on headers no longer extracted in F* 2
126+
INCOMPATIBLE_C_FILES = fstar_uint128_msvc.c fstar_hyperstack_io.c lowstar_printf.c testlib.c c.c c_string.c
127+
116128
# Everything in the universe
117129
$(GENERIC_DIR)/Makefile.include: $(ALL_KRML_FILES) | $(GENERIC_DIR) $(wildcard c/*.c) $(wildcard c/*.h) ../_build/default/src/Karamel.exe
118130
KRML_HOME="$(local_krml_home)" \
119131
../krml $(KRML_ARGS) -tmpdir $(GENERIC_DIR) \
120132
-warn-error +9+11 \
121133
$(MACHINE_INTS) \
122134
$(addprefix -add-include ,'<inttypes.h>' '"krmllib.h"' '"krml/internal/compat.h"' '"krml/internal/target.h"') \
123-
-bundle LowStar.Endianness= \
124135
-bundle FStar.Endianness,FStar.Range \
125-
-library C,C.Endianness,C.Failure,C.Loops,FStar.BitVector,FStar.Bytes,FStar.Char,FStar.Int,FStar.Krml.Endianness,FStar.Math.Lib,FStar.ModifiesGen,FStar.Monotonic.Heap,FStar.Monotonic.HyperStack,FStar.Mul,FStar.Pervasives,FStar.Pervasives.Native,FStar.ST,FStar.UInt,FStar.UInt63,LowStar.Printf \
136+
-library C,C.Endianness,C.Failure,C.Loops,FStar.BitVector,FStar.Bytes,FStar.Char,FStar.Int,FStar.Krml.Endianness,FStar.Math.Lib,FStar.ModifiesGen,FStar.Monotonic.Heap,FStar.Monotonic.HyperStack,FStar.Mul,FStar.Pervasives,FStar.Pervasives.Native,FStar.ST,FStar.UInt,FStar.UInt63 \
126137
-bundle FStar.BV \
127-
$(filter-out fstar_uint128_msvc.c,$(notdir $(wildcard c/*.c))) \
138+
$(filter-out $(INCOMPATIBLE_C_FILES),$(notdir $(wildcard c/*.c))) \
128139
-o libkrmllib.a \
129140
$^
130-
cp c/*.c c/*.h $(dir $@)
141+
cd c && cp $(filter-out $(INCOMPATIBLE_C_FILES),$(notdir $(wildcard c/*.c) $(wildcard c/*.h))) ../$(dir $@)
131142

132143
# Minimalistic build (just machine integers and endianness)
133144
$(MINI_DIR)/Makefile.include: $(ALL_KRML_FILES) | $(MINI_DIR) $(wildcard c/fstar_uint128*.h) ../_build/default/src/Karamel.exe
@@ -141,7 +152,6 @@ $(MINI_DIR)/Makefile.include: $(ALL_KRML_FILES) | $(MINI_DIR) $(wildcard c/fstar
141152
'"krml/lowstar_endianness.h"' \
142153
'"krml/internal/types.h"' \
143154
'"krml/internal/target.h"') \
144-
-bundle LowStar.Endianness= \
145155
-bundle '*,WindowsWorkaroundSigh' \
146156
fstar_uint128.c \
147157
-o libkrmllib.a \

krmllib/c/fstar_uint128_gcc64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#include "FStar_UInt128.h"
2727
#include "FStar_UInt_8_16_32_64.h"
28-
#include "LowStar_Endianness.h"
28+
#include "krml/lowstar_endianness.h"
2929

3030
/* GCC + using native unsigned __int128 support */
3131

krmllib/dist/generic/C.h

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

krmllib/dist/generic/C_Failure.h

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

krmllib/dist/generic/C_Loops.h

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

krmllib/dist/generic/C_String.h

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

krmllib/dist/generic/FStar_BigOps.h

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

krmllib/dist/generic/FStar_BitVector.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ extern Prims_list__bool
7171
krml_checked_int_t s
7272
);
7373

74+
extern Prims_list__bool
75+
*FStar_BitVector_rotate_left_vec(
76+
krml_checked_int_t n,
77+
Prims_list__bool *a,
78+
krml_checked_int_t s
79+
);
80+
81+
extern Prims_list__bool
82+
*FStar_BitVector_rotate_right_vec(
83+
krml_checked_int_t n,
84+
Prims_list__bool *a,
85+
krml_checked_int_t s
86+
);
87+
7488

7589
#define FStar_BitVector_H_DEFINED
7690
#endif /* FStar_BitVector_H */

krmllib/dist/generic/FStar_Bytes.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,6 @@ extern Prims_string FStar_Bytes_print_bytes(FStar_Bytes_bytes uu___);
139139

140140
extern FStar_Bytes_bytes FStar_Bytes_bytes_of_string(Prims_string uu___);
141141

142-
typedef uint8_t *FStar_Bytes_lbuffer;
143-
144-
extern FStar_Bytes_bytes FStar_Bytes_of_buffer(uint32_t l, uint8_t *buf);
145-
146-
extern void FStar_Bytes_store_bytes(FStar_Bytes_bytes src, uint8_t *dst);
147-
148142

149143
#define FStar_Bytes_H_DEFINED
150144
#endif /* FStar_Bytes_H */

krmllib/dist/generic/FStar_GSet.h

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

0 commit comments

Comments
 (0)