Skip to content

Commit 1770d3b

Browse files
committed
update
1 parent 4a733e3 commit 1770d3b

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

.github/scripts/depexts/generate-actions.sh

+14-21
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ EOF
106106
cat >$dir/Dockerfile << EOF
107107
FROM nixos/nix
108108
RUN nix-channel --update
109-
RUN nix-shell -p gnum4 git rsync patch gnutar bzip2 gnumake wget ocamlPackages.ocaml ocamlPackages.ocaml-compiler-libs unzip gcc diffutils patch getconf
109+
RUN nix-env -i gnum4 git rsync patch bzip2 gnumake wget ocaml ocaml5.1.1-ocaml-compiler-libs unzip gcc diffutils patch getconf-glibc gnused
110110
EOF
111111
esac
112112

@@ -127,38 +127,31 @@ RUN echo 'default-invariant: [ $OCAML_INVARIANT ]' > /opam/opamrc
127127
RUN /usr/bin/opam init --no-setup --disable-sandboxing --bare --config /opam/opamrc git+$OPAM_REPO#$OPAM_REPO_SHA
128128
RUN echo 'archive-mirrors: "https://opam.ocaml.org/cache"' >> \$OPAMROOT/config
129129
RUN /usr/bin/opam switch create this-opam --formula='$OCAML_INVARIANT'
130-
RUN /usr/bin/opam install opam-core opam-state opam-solver opam-repository opam-format opam-client --deps
131-
RUN /usr/bin/opam clean -as --logs
132-
COPY entrypoint.sh /opam/entrypoint.sh
133130
EOF
134131

135-
if [ "$target" != "nix" ]; then
136-
cat >>$dir/Dockerfile << EOF
137-
ENTRYPOINT ["/opam/entrypoint.sh"]
132+
# we can't `nix-env -i binutils`
133+
# https://github.com/NixOS/nix/issues/10587
134+
if [ $target == "nix" ]; then
135+
cat >>$dir/Dockerfile << EOF
136+
RUN nix-shell -p binutils --run "/usr/bin/opam install opam-core opam-state opam-solver opam-repository opam-format opam-client --deps"
138137
EOF
139138
else
140-
cat >>$dir/Dockerfile << EOF
141-
ENTRYPOINT ["nix-shell", "-p", "gnum4", "git", "rsync", "patch", "gnutar", "bzip2", "gnumake", "wget", "ocamlPackages.ocaml", "ocamlPackages.ocaml-compiler-libs", "unzip", "gcc", "diffutils", "patch", "getconf", "--run", "/opam/entrypoint.sh"]
139+
cat >>$dir/Dockerfile << EOF
140+
RUN /usr/bin/opam install opam-core opam-state opam-solver opam-repository opam-format opam-client --deps
142141
EOF
143142
fi
144143

144+
cat >>$dir/Dockerfile << EOF
145+
RUN /usr/bin/opam clean -as --logs
146+
COPY entrypoint.sh /opam/entrypoint.sh
147+
ENTRYPOINT ["/opam/entrypoint.sh"]
148+
EOF
149+
145150
### Generate the entrypoint
146151
cat >$dir/entrypoint.sh << EOF
147152
#!/bin/sh
148153
set -eux
149154
150-
EOF
151-
152-
if [ "$target" != "nix" ]; then
153-
cat >>$dir/entrypoint.sh << EOF
154-
export PATH="$PATH:/usr/bin/"
155-
chmod +x /usr/bin/opam
156-
157-
EOF
158-
fi
159-
160-
### Generate the entrypoint
161-
cat >$dir/entrypoint.sh << EOF
162155
git config --global --add safe.directory /github/workspace
163156
164157
# Workdir is /github/workpaces

0 commit comments

Comments
 (0)