Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrondin committed Apr 11, 2022
1 parent e459f3e commit 8c87788
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ strings/
flow/
test/
bad/
src/flow_parser
src/sedlex
src/collections
11 changes: 4 additions & 7 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ git clone --branch v0.175.1 --depth 1 [email protected]:facebook/flow.git flow
ln -s "$(pwd)/flow/src/parser" src/flow_parser
ln -s "$(pwd)/flow/src/third-party/sedlex" src/sedlex
ln -s "$(pwd)/flow/src/hack_forked/utils/collections" src/collections

# MacOS
sed -i '' 's/Pervasives/Stdlib/g' flow/src/parser/parser_flow.ml
# Linux
sed -i 's/Pervasives/Stdlib/g' flow/src/parser/parser_flow.ml
```

### MacOS - Build & Run
Expand All @@ -36,6 +31,8 @@ docker run -it --rm \
-v "$(pwd):/app" \
-v "$(realpath "$(pwd)/../group-income-simple"):/repo" \
-w /repo \
ubuntu:18.04
# Then run: '/app/strings.linux .'
ubuntu:20.04
# Then run:
## apt-get update && apt-get install musl
## /app/strings.linux frontend
```
34 changes: 10 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
FROM ocaml/opam2:debian-8-opam
WORKDIR /home/opam/opam-repository

RUN sudo apt-get update \
&& sudo apt-get install -y m4 pkg-config libev-dev \
&& git pull origin master \
&& opam-sandbox-disable \
&& opam init -k git -a /home/opam/opam-repository --bare \
&& opam init --bare \
&& opam switch create 4.10 4.10.0+flambda \
&& opam switch 4.10 \
&& opam install -y opam-depext

RUN opam repository set-url default https://opam.ocaml.org \
&& opam update \
&& OPAMYES=1 opam install core \
&& opam clean

FROM asemio/mountain-caravan:1.1.1
WORKDIR /app
RUN sudo apk update \
&& sudo apk upgrade \
&& sudo apk add --no-cache perl cmake

COPY strings.opam .

RUN OPAMYES=1 opam install . --deps-only
ENV DUNE_PROFILE release

RUN sudo chown -R opam /app \
&& git clone --branch v0.120.1 --depth 1 https://github.com/facebook/flow.git flow
RUN opam update \
&& OPAMYES=1 opam install . --deps-only

COPY . .

ENV DUNE_PROFILE release

RUN sudo chown -R opam /app \
&& git clone --branch v0.175.1 --depth 1 https://github.com/facebook/flow.git flow \
&& ln -s "$(pwd)/flow/src/parser" src/flow_parser \
&& sed -i 's/Pervasives/Stdlib/g' flow/src/parser/parser_flow.ml \
&& ln -s "$(pwd)/flow/src/third-party/sedlex" src/sedlex \
&& ln -s "$(pwd)/flow/src/hack_forked/utils/collections" src/collections \
&& opam exec -- dune build src/cli/strings.exe \
&& cp /app/_build/default/src/cli/strings.exe . \
&& chmod 755 strings.exe \
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Simply run it before submitting a Pull Request!
```sh
./strings.mac frontend
```
- **MacOS**: Mojave and later.
- **MacOS**: Monterey or newer
- **Linux** and **WSL**
- Ubuntu 14.04+
- Debian 8+
- Your distribution is supported if `ldd --version` displays `GLIBC 2.19` or later.
- Ubuntu 20.04 or newer
- Debian 11 (Bullseye) or newer
- You'll need to install your Linux distribution's `musl` package: `apt-get install musl`
2 changes: 1 addition & 1 deletion dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(ocamlopt_flags -Oclassic)
)
(release
(flags (:standard -warn-error +A))
(flags (:standard -warn-error -A))
(ocamlopt_flags -O3 -unbox-closures)
)
)

0 comments on commit 8c87788

Please sign in to comment.