Skip to content

Commit

Permalink
Conditionally set precompile timing
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Mar 8, 2024
1 parent 3f41678 commit bf24435
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# docker build -f test/integration/Dockerfile .
# ```

# Minimum Julia version supported should match the Project.toml
ARG JULIA_VERSION=1.10.2
FROM julia:${JULIA_VERSION}-bookworm

Expand All @@ -18,12 +19,26 @@ ENV JULIA_PROJECT=/root/.julia/dev/${PKG_NAME}
COPY Project.toml *Manifest.toml ${JULIA_PROJECT}/
RUN mkdir $JULIA_PROJECT/src && \
echo "module ${PKG_NAME} end" >${JULIA_PROJECT}/src/${PKG_NAME}.jl
RUN julia -e 'using Pkg; Pkg.Registry.update(); Pkg.instantiate(); Pkg.precompile(strict=true, timing=true)'
RUN julia -e ' \
using Pkg; \
Pkg.Registry.update(); \
Pkg.instantiate(); \
if VERSION >= v"1.9.0-beta2.67" \
Pkg.precompile(strict=true, timing=true); \
else \
Pkg.precompile(strict=true); \
end;'

COPY . ${JULIA_PROJECT}
RUN mv ${JULIA_PROJECT}/test/integration/entrypoint.jl ${JULIA_PROJECT} && \
rmdir ${JULIA_PROJECT}/test/integration
RUN julia -e 'using Pkg; Pkg.precompile(strict=true, timing=true)'
RUN julia -e ' \
using Pkg; \
if VERSION >= v"1.9.0-beta2.67" \
Pkg.precompile(strict=true, timing=true); \
else \
Pkg.precompile(strict=true); \
end;'

WORKDIR ${JULIA_PROJECT}
ENTRYPOINT ["julia", "entrypoint.jl"]

0 comments on commit bf24435

Please sign in to comment.