Skip to content

Commit

Permalink
WIP WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bclement-ocp committed Mar 20, 2024
1 parent ee897a3 commit 1e599bc
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/
47 changes: 40 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
FROM ocamlpro/ocaml:4.14
FROM quay.io/pypa/manylinux_2_28_aarch64 AS compilation

USER ocaml
ADD https://github.com/ocaml/opam/releases/download/2.2.0-beta1/opam-2.2.0-beta1-arm64-linux /bin/opam

RUN sudo apk add zlib-static
RUN chmod +x /bin/opam

COPY . .
RUN opam init -a --bare --disable-sandboxing

RUN sudo chmod a+wx .
COPY . /src/alt-ergo

RUN opam switch create . ocaml-system --locked --deps-only --ignore-constraints-on alt-ergo-lib,alt-ergo-parsers
WORKDIR /src/alt-ergo

ENV OPAMYES 1
ENV OPAMDEPEXTYES 1
ENV OPAMCONFIRMLEVEL unsafe-yes
ENV OPAMERRLOGLEN 0

RUN yum -y install gmp-static zlib-static

RUN opam switch create . 4.14.1 --locked --deps-only --ignore-constraints-on alt-ergo-lib,alt-ergo-parsers

RUN opam exec -- dune subst

RUN LINK_MODE=static opam exec -- dune build --release src/bin/text/Main_text.exe
RUN LINK_MODE=mixed opam exec -- dune build --release src/bin/text/Main_text.exe

FROM scratch AS alt-ergo
COPY --from=compilation /src/alt-ergo/src/bin/text/Main_text.exe /bin/alt-ergo
ENTRYPOINT [ "/bin/alt-ergo" ]

# FROM ocamlpro/ocaml:4.14 AS compilation
#
# USER ocaml
#
# RUN sudo apk add zlib-static
#
# COPY --chown=ocaml:ocaml . /src/alt-ergo
#
# WORKDIR /src/alt-ergo
#
# RUN opam switch create . ocaml-system --locked --deps-only --ignore-constraints-on alt-ergo-lib,alt-ergo-parsers
#
# RUN opam exec -- dune subst
#
# RUN LINK_MODE=static opam exec -- dune build --release src/bin/text/Main_text.exe
#
# FROM scratch AS alt-ergo
# COPY --from=compilation /src/alt-ergo/src/bin/text/Main_text.exe /bin/alt-ergo
# ENTRYPOINT [ "/bin/alt-ergo" ]
3 changes: 2 additions & 1 deletion src/bin/text/gen-link-flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ case "$LINK_MODE" in
linux)
for lib in $LIBS; do
CCLIB="$CCLIB -l$lib"
done;;
done
CCLIB="-Wl,-Bstatic $CCLIB -Wl,-Bdynamic";;
macosx)
for lib in $LIBS; do
if [[ $lib == lib* ]]; then
Expand Down

0 comments on commit 1e599bc

Please sign in to comment.