dlang-tour / core

D Language online tour (https://tour.dlang.org/) and online editor (https://run.dlang.io/)
Boost Software License 1.0
115 stars 48 forks source link

Upgrade dub dependencies #781

Closed dkorpel closed 1 year ago

dkorpel commented 1 year ago

Trying to unblock https://github.com/dlang/dmd/pull/14891

dkorpel commented 1 year ago

What does this error mean?

> [dependencies-cache 2/2] RUN dub --cache=local build:
#13 15.79 Fetching mustache-d 0.1.5 (getting selected version)...
#13 16.90 Fetching diet-ng 1.8.1 (getting selected version)...
#13 18.04 Fetching openssl 3.2.2 (getting selected version)...
#13 19.37 Fetching dyaml 0.9.2 (getting selected version)...
#13 20.84 Fetching mir-linux-kernel 1.0.1 (getting selected version)...
#13 21.96 Fetching libdparse 0.22.0 (getting selected version)...
#13 23.16 Fetching dfmt 0.14.2 (getting selected version)...
#13 24.52 Invalid source/import path: /src/.dub/packages/dfmt-0.14.2/dfmt/bin
#13 24.53 Running pre-generate commands for dfmt...
#13 26.44 Invalid variable: DC
------
Dockerfile:31
--------------------
  29 |     FROM base AS dependencies-cache
  30 |     COPY --from=dub-cache /out .
  31 | >>> RUN dub --cache=local build
  32 |     
  33 |     # ------------------------------- App builders ------------------------------- #
--------------------
ERROR: failed to solve: process "/bin/sh -c dub --cache=local build" did not complete successfully: exit code: 2
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c dub --cache=local build" did not complete successfully: exit code: 2
Geod24 commented 1 year ago

#13 26.44 Invalid variable: DC

Uh oh, I think we also need to update dub, which you will do by updating the alpine image (https://github.com/dlang-tour/core/blob/master/Dockerfile#L1).

EDIT: Except we're already on 3.16

dkorpel commented 1 year ago

I didn't update dfmt, why can it not build anymore?

Geod24 commented 1 year ago

@dkorpel :

diff --git a/Dockerfile b/Dockerfile
index 67e87db..c2abd9a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,7 @@
-ARG BASE_IMAGE=alpine:3.16
+# Use edge to get dub v1.30 instead of v1.28 (3.16),
+# as we otherwise hit https://github.com/dlang/dub/issues/2192
+# Change to alpine:3.17 when released.
+ARG BASE_IMAGE=alpine:edge

 # ----------------------------------- Base ----------------------------------- #
 FROM $BASE_IMAGE AS base
@@ -53,7 +56,7 @@ RUN dub --cache=local run -- --sanitycheck
 #                                    Runner                                    #
 # ---------------------------------------------------------------------------- #
 FROM $BASE_IMAGE as runner-cache
-RUN apk --no-cache add ldc-runtime libexecinfo libgcc tzdata docker-cli
+RUN apk --no-cache add ldc-runtime libgcc tzdata docker-cli
 EXPOSE 8080
 WORKDIR /app

Still testing locally (build is slow) but that might solve your problems.

dkorpel commented 1 year ago

@Geod24 Can you add a new tag so buildkite picks this up?

Geod24 commented 1 year ago

Voilà: https://github.com/dlang-tour/core/releases/tag/v1.2.4

PetarKirov commented 1 year ago

Thank you @dkorpel and @Geod24!