Skip to content

Commit f4eefdd

Browse files
authored
Merge pull request #4163 from mtzguido/fsharp
Fix F# lib, rules, and wire it in CI
2 parents c915ba9 + 9646db2 commit f4eefdd

10 files changed

Lines changed: 34 additions & 216 deletions

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,32 @@ jobs:
8181
# as that runs after the normal build and takes ~10 minutes.
8282
run: make -skj$(nproc) _test _test_pulse
8383

84+
# Build the F# library and the examples.
85+
fsharp:
86+
runs-on: ubuntu-latest
87+
container: mtzguido/dev-base:v2
88+
steps:
89+
- name: Cleanup
90+
run: sudo find . -delete
91+
- run: echo "HOME=/home/user" >> $GITHUB_ENV
92+
- uses: mtzguido/set-opam-env@master
93+
94+
- name: Checkout
95+
uses: actions/checkout@master
96+
with:
97+
submodules: true
98+
99+
- name: Get fstar package
100+
uses: actions/download-artifact@v8
101+
with:
102+
name: fstar.tar.gz
103+
104+
- name: Set up package locally
105+
run: tar xzf fstar.tar.gz && ln -s fstar out
106+
107+
- name: Run tests, without forcing a build
108+
run: make -skj$(nproc) fsharp-all FSTAR_EXE=$(pwd)/out/bin/fstar.exe
109+
84110
# This runs the bare tests over the bare stage2 compiler.
85111
# We start from the built repo.
86112
bare:

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,23 @@ $(FSTAR2_FULL_EXE): .bare2.src.touch .full2.src.touch .src.ml.touch $(MAYBEFORCE
313313
touch $@
314314

315315
# F# library
316-
fsharp-lib.src: export FSTAR_EXE ?= $(FSTAR3_FULL_EXE)
317-
fsharp-lib.src: .alib2.src.touch .force
316+
fsharp-lib.src: export FSTAR_EXE ?= $(INSTALLED_FSTAR3_FULL_EXE)
317+
fsharp-lib.src: .force
318318
# NB: shares checked files from .alib2.src,
319319
# hence the dependency, though it is not quite precise.
320320
$(call bold_msg, "EXTRACT", "FSHARP LIB")
321321
# Note: FStar.Map and FStar.Set are special-cased
322+
# Also note: we explicitly add an include for F*'s own library so it can
323+
# find the checked files for it, and make this run about extraction
324+
# only. The lib.mk makefile passes --no_default_includes.
322325
env \
323326
SRC=ulib/ \
324-
CACHE_DIR=stage2/ulib.checked/ \
325327
OUTPUT_DIR=fsharp/extracted/ \
328+
CACHE_DIR=fsharp/_cached/ \
326329
CODEGEN=FSharp \
327330
TAG=fsharplib \
328-
DEPFLAGS='--extract -FStar.Map,-FStar.Set' \
331+
DEPFLAGS='--extract -FStar.Map,-FStar.Set --already_cached Prims,FStar' \
332+
OTHERFLAGS='--include $(shell $(FSTAR_EXE) --locate_lib)' \
329333
$(MAKE) -f mk/lib.mk all-fs
330334

331335
.PHONY: fsharp-lib

fsharp/base/FStar_CommonST.fs

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

fsharp/base/FStar_Heap.fs

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

fsharp/base/FStar_HyperStack_All.fs

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

fsharp/base/FStar_HyperStack_IO.fs

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

fsharp/base/FStar_HyperStack_ST.fs

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

fsharp/base/FStar_Monotonic_Heap.fs

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

fsharp/base/FStar_ST.fs

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

fsharp/ulibfs.fsproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
<Compile Include="base/FStar_Dyn.fs" Link="FStar_Dyn.fs" />
2323
<Compile Include="base/FStar_Float.fs" Link="FStar_Float.fs" />
2424
<Compile Include="base/FStar_Ghost.fs" Link="FStar_Ghost.fs" />
25-
<Compile Include="base/FStar_Monotonic_Heap.fs" Link="FStar_Monotonic_Heap.fs" />
26-
<Compile Include="base/FStar_CommonST.fs" Link="FStar_CommonST.fs" />
27-
<Compile Include="base/FStar_Heap.fs" Link="FStar_Heap.fs" />
2825
<Compile Include="base/FStar_Int16.fs" Link="FStar_Int16.fs" />
2926
<Compile Include="base/FStar_Int32.fs" Link="FStar_Int32.fs" />
3027
<Compile Include="base/FStar_Int64.fs" Link="FStar_Int64.fs" />
@@ -43,7 +40,6 @@
4340
2. Add 'type ordered = Type{hasOrder 'a}' or similar and use it instead of 'eqtype' in Set/Map interface.
4441
-->
4542
<Compile Include="base/FStar_Set.fs" Link="FStar_Set.fs" />
46-
<Compile Include="base/FStar_ST.fs" Link="FStar_ST.fs" />
4743
<Compile Include="base/FStar_Exn.fs" Link="FStar_Exn.fs" />
4844
<Compile Include="base/FStar_String.fs" Link="FStar_String.fs" />
4945
<Compile Include="base/FStar_UInt16.fs" Link="FStar_UInt16.fs" />
@@ -62,7 +58,6 @@
6258
<Compile Link="FStar_StrongExcludedMiddle.fs" Include="extracted\FStar_StrongExcludedMiddle.fs" />
6359
<Compile Link="FStar_PropositionalExtensionality.fs" Include="extracted\FStar_PropositionalExtensionality.fs" />
6460
<Compile Link="FStar_PredicateExtensionality.fs" Include="extracted\FStar_PredicateExtensionality.fs" />
65-
<Compile Link="FStar_Monotonic_Witnessed.fs" Include="extracted\FStar_Monotonic_Witnessed.fs" />
6661
<!-- TODO: (Warning 341) Expected parameter 'state of witnessed to be unused in its definition and eliminated -->
6762
<Compile Link="FStar_List_Tot_Properties.fs" Include="extracted\FStar_List_Tot_Properties.fs" />
6863
<Compile Include="base/FStar_Map.fs" Link="FStar_Map.fs" />
@@ -85,7 +80,6 @@
8580
<Compile Link="FStar_BigOps.fs" Include="extracted\FStar_BigOps.fs" />
8681
<Compile Link="FStar_Int128.fs" Include="extracted\FStar_Int128.fs" />
8782
<Compile Link="FStar_Integers.fs" Include="extracted\FStar_Integers.fs" />
88-
<Compile Link="FStar_Ref.fs" Include="extracted\FStar_Ref.fs" />
8983
</ItemGroup>
9084
<ItemGroup>
9185
<PackageReference Update="FSharp.Core" Version="4.3.4" />

0 commit comments

Comments
 (0)