Skip to content

Commit abc15de

Browse files
authored
Fix packagecompile CI hang (#55)
enforce single threaded call of PackageCompiler.create_app see JuliaLang/PackageCompiler.jl#990 * change code fold * Fold line and not block * single line command * chmod all read julia * change project dir * add chown * enforce pull before run * add fold * Fix stuck compiling nonincremental system image by enforcing single thread * Ensure files are always owned by user * Unset env var JULIA_NUM_THREADS * do not depend on dir existence for chown
1 parent 9ceb29c commit abc15de

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.github/workflows/PackageCompiler.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ jobs:
3030
cache-to: type=registry,ref=danlooo/julia_package_compiler_dev:cache,mode=max
3131

3232
- name: Run Docker container
33-
run: docker run \
34-
-v $PWD:/work \
35-
-u $(id -u ${USER}):$(id -g ${USER}) \
36-
danlooo/julia_package_compiler_dev:latest /work
33+
run: >
34+
sudo chown -R $USER:$USER . &&
35+
docker pull danlooo/julia_package_compiler_dev:latest &&
36+
docker run -v $PWD:/work danlooo/julia_package_compiler_dev:latest /work &&
37+
sudo chown -R $USER:$USER .
3738
3839
- name: Upload binaries
3940
uses: actions/upload-artifact@v4

packagecompiler/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
FROM julia:1.11.3-bookworm
22

33
WORKDIR /app
4-
ENV JULIA_NUM_THREADS=auto
4+
# unset threads see https://github.com/JuliaLang/PackageCompiler.jl/issues/990
5+
ENV JULIA_NUM_THREADS=
56
ENV JULIA_DEPOT_PATH=/.julia
67

78
RUN apt-get update && apt-get install -y build-essential
8-
COPY Project.toml /.julia/environments/v1.11/
9+
COPY Project.toml ./
910
RUN julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.status()'
11+
RUN chmod -R +r /.julia
1012
COPY run.jl ./
1113
ENTRYPOINT [ "./run.jl" ]

packagecompiler/run.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/bin/env -S julia --threads=auto
1+
#!/usr/bin/env -S julia --project=/app
22

33
using PackageCompiler
44

5-
dir = ARGS
5+
dir = ARGS[1]
66

77
PackageCompiler.create_app(dir, "$dir/packagecompiler/app";
88
precompile_statements_file="$dir/packagecompiler/precompile_statements.jl",

0 commit comments

Comments
 (0)