Skip to content

Commit e29d40e

Browse files
committed
Use F* binary release.
1 parent 7588aa8 commit e29d40e

14 files changed

Lines changed: 17 additions & 261 deletions

File tree

.devcontainer/Containerfile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu
22

33
RUN apt-get update && \
44
apt-get install -y --no-install-recommends \
5-
opam pkg-config libgmp-dev tmux ripgrep tig gdb \
5+
pkg-config libgmp-dev tmux ripgrep tig gdb \
66
clang clang-format ccls zstd rustup \
77
lsb-release wget software-properties-common gnupg && \
88
apt-get clean
@@ -16,20 +16,10 @@ RUN wget https://apt.llvm.org/llvm.sh && \
1616
rm llvm.sh
1717

1818
USER vscode
19-
RUN opam init --bare
2019

2120
RUN rustup install stable
2221

2322
RUN curl -fsSL https://gh.io/copilot-install | bash
2423

25-
RUN opam option depext-run-installs=true
26-
ENV OPAMYES=1
27-
RUN --mount=type=bind,source=.git,destination=/c2p-repo \
28-
git config --global --add safe.directory /c2p-repo && \
29-
sudo mkdir /workspaces && sudo chown vscode:vscode /workspaces && \
30-
cd /workspaces && git clone --depth=1 --recurse-submodules --reference-if-able=/c2p-repo --dissociate /c2p-repo c2pulse && \
31-
cd c2pulse && \
32-
./opt/fstar/.scripts/get_fstar_z3.sh ~/.local/bin/ && \
33-
make -j`nproc` build-pulse && \
34-
sudo tar --zstd -cf /c2pulse-opt-cache.tar.zst opt .git/modules && \
35-
cd / && sudo rm -rf /workspaces
24+
COPY ./opt/install-fstar.sh /tmp
25+
RUN /tmp/install-fstar.sh && sudo rm /tmp/install-fstar.sh

.devcontainer/devcontainer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "c2pulse devcontainer",
3-
"image": "ghcr.io/fstarlang/c2pulse-devcontainer",
3+
"build": {
4+
"context": "..",
5+
"dockerfile": "Containerfile"
6+
},
47
"customizations": {
58
"vscode": {
69
"extensions": [
@@ -14,7 +17,6 @@
1417
},
1518
// Runs only once when container is prepared
1619
"onCreateCommand": {
17-
"restore-opt-cache": "cd /workspaces/c2pulse && test ! -f opt/opam.done && tar -xf /c2pulse-opt-cache.tar.zst || echo not using cache"
1820
},
1921
// Runs periodically and/or when content of repo changes
2022
"updateContentCommand": {

.github/workflows/ci.yml

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,6 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15-
with:
16-
submodules: recursive
17-
18-
- name: Install opam
19-
run: |
20-
sudo apt update
21-
sudo apt install -y opam
22-
opam init --bare
23-
24-
- name: Install Z3
25-
run: |
26-
echo "PATH=/usr/local/bin/:$PATH" >> $GITHUB_ENV
27-
sudo ./opt/fstar/.scripts/get_fstar_z3.sh /usr/local/bin/
28-
29-
- name: Compute cache key
30-
id: cachekey
31-
run: |
32-
echo "cachekey=$(./opt/ci-deps-hash)" >> "$GITHUB_OUTPUT"
33-
34-
- name: Get cache
35-
id: getcache
36-
uses: actions/cache/restore@v4
37-
with:
38-
path: opt
39-
key: ${{ steps.cachekey.outputs.cachekey }}
40-
41-
- name: Restore changes to files in opt
42-
run: |
43-
git reset --hard
44-
45-
- name: Build dependencies
46-
run: |
47-
make -j$(nproc) build-pulse
48-
49-
- name: Save cache
50-
if: ${{ steps.getcache.outputs.cache-hit != 'true' }}
51-
uses: actions/cache/save@v4
52-
with:
53-
path: opt
54-
key: ${{ steps.cachekey.outputs.cachekey }}
5515

5616
- name: Install clang
5717
run: |
@@ -61,17 +21,13 @@ jobs:
6121
sudo apt update
6222
sudo apt install -y clang-20 libclang-cpp20-dev g++ clang-tools-20 libclang-20-dev
6323
24+
- name: Install F*
25+
run: ./opt/install-fstar.sh --link-dir /usr/local/bin
26+
6427
- name: Build c2pulse
6528
run: |
6629
make -j$(nproc)
6730
6831
- name: Test c2pulse
6932
run: |
7033
make -j$(nproc) test
71-
72-
- name: Checking that code is correctly formatted
73-
if: always()
74-
run: |
75-
cargo fmt
76-
clang-format -i cpp/impl.cpp
77-
git diff --exit-code

.github/workflows/copilot-setup-steps.yml

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,14 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v3
18-
with:
19-
submodules: recursive
20-
21-
- name: Install opam
22-
run: |
23-
sudo apt update
24-
sudo apt install -y opam
25-
opam init --bare
26-
27-
- name: Install Z3
28-
run: |
29-
echo "PATH=/usr/local/bin/:$PATH" >> $GITHUB_ENV
30-
sudo ./opt/fstar/.scripts/get_fstar_z3.sh /usr/local/bin/
31-
32-
- name: Compute cache key
33-
id: cachekey
34-
run: |
35-
echo "cachekey=$(./opt/ci-deps-hash)" >> "$GITHUB_OUTPUT"
36-
37-
- name: Get cache
38-
id: getcache
39-
uses: actions/cache/restore@v4
40-
with:
41-
path: opt
42-
key: ${{ steps.cachekey.outputs.cachekey }}
43-
44-
- name: Restore changes to files in opt
45-
run: |
46-
git reset --hard
47-
48-
- name: Build dependencies
49-
run: |
50-
make -j$(nproc) build-pulse
51-
52-
- name: Save cache
53-
if: ${{ steps.getcache.outputs.cache-hit != 'true' }}
54-
uses: actions/cache/save@v4
55-
with:
56-
path: opt
57-
key: ${{ steps.cachekey.outputs.cachekey }}
5818

5919
- name: Install clang
6020
run: |
6121
wget https://apt.llvm.org/llvm.sh
6222
chmod +x llvm.sh
6323
sudo ./llvm.sh 20
6424
sudo apt update
65-
sudo apt install -y clang-20 libclang-cpp20-dev g++ clang-tools-20 libclang-20-dev
25+
sudo apt install -y clang-20 libclang-cpp20-dev g++ clang-tools-20 libclang-20-dev
26+
27+
- name: Install F*
28+
run: ./opt/install-fstar.sh --link-dir /usr/local/bin

.github/workflows/devcontainer.yml

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

.gitmodules

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

Makefile

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,8 @@ all: rust lib
55
rust:
66
cargo build
77

8-
ifeq ($(C2PULSE_OPT),0)
9-
10-
opt/opam-available.done:
11-
touch $@
12-
13-
else
14-
15-
opt/opam-available.done: opt/opam-init.done
16-
touch $@
17-
18-
opt/opam-init.done:
19-
opam update
20-
opam init --no-setup --root=opt/opam --compiler=5.3.0
21-
touch $@
22-
23-
endif
24-
25-
opt/env.mk opt/env.sh: opt/opam-available.done
26-
./opt/configure
27-
28-
include opt/env.mk
29-
30-
ifeq ($(C2PULSE_OPT),0)
31-
32-
.PHONY: build-pulse
33-
build-pulse:
34-
35-
else
36-
37-
.PHONY: build-opam
38-
build-opam: opt/opam.done
39-
40-
opt/opam.done: opt/fstar/fstar.opam
41-
opam install --deps-only $<
42-
touch $@
43-
44-
.PHONY: build-fstar
45-
build-fstar: opt/opam.done
46-
$(MAKE) -C opt/fstar ADMIT=1
47-
48-
.PHONY: build-pulse
49-
build-pulse: build-fstar
50-
51-
endif
52-
538
.PHONY: lib
54-
lib: build-pulse
9+
lib:
5510
$(MAKE) -C pulse
5611

5712
.PHONY: -testsuite

opt/.gitignore

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

opt/ci-deps-hash

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

opt/configure

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

0 commit comments

Comments
 (0)