Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid local reproduction Dockerfile #84

Closed
dra27 opened this issue Mar 22, 2021 · 3 comments
Closed

Invalid local reproduction Dockerfile #84

dra27 opened this issue Mar 22, 2021 · 3 comments

Comments

@dra27
Copy link
Contributor

dra27 commented Mar 22, 2021

cf. ocurrent/obuilder#66.

The final RUN command being produced is not valid:

RUN  \
    opam remove -y leveldb.1.3.0 && opam depext -uivy leveldb.1.3.0 \
    res=$? \
    test "$res" = 0 && exit 0 \
    if test "$res" = 60 && diff -q /usr/bin/opam /usr/bin/opam-2.0; then \
    sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam \
    opam remove -y leveldb.1.3.0 && opam install -vy leveldb.1.3.0 && opam reinstall -vyt leveldb.1.3.0 \
    exit 1 \
    fi \
    test "$res" != 31 && exit 1 \
    export OPAMCLI=2.0 \
    build_dir=$(opam var prefix)/.opam-switch/build \
    failed=$(ls "$build_dir") \
    for pkg in $failed; do \
    if opam show -f x-ci-accept-failures: "$pkg" | grep -qF "\"alpine-3.12\""; then \
    echo "A package failed and has been disabled for CI using the 'x-ci-accept-failures' field." \
    fi \
    done \
    exit 1 \
    
@dra27
Copy link
Contributor Author

dra27 commented Mar 22, 2021

There are three possible solutions:

  1. Generate a script with a here document earlier in the instructions (like the opam-repository clone) and RUN that instead
  2. Hoist the shell script into the pipeline
  3. Add the missing semi-colons

@dra27
Copy link
Contributor Author

dra27 commented Mar 22, 2021

Diff for option 3:

--- a   2021-03-22 09:49:41.685481622 +0000
+++ b  2021-03-22 09:47:14.055174720 +0000
@@ -1,19 +1,19 @@
 RUN  \
-    opam remove -y leveldb.1.3.0 && opam depext -uivy leveldb.1.3.0 \
-    res=$? \
-    test "$res" = 0 && exit 0 \
+    opam remove -y leveldb.1.3.0 && opam depext -uivy leveldb.1.3.0; \
+    res=$?; \
+    test "$res" = 0 && exit 0; \
     if test "$res" = 60 && diff -q /usr/bin/opam /usr/bin/opam-2.0; then \
-    sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam \
-    opam remove -y leveldb.1.3.0 && opam install -vy leveldb.1.3.0 && opam reinstall -vyt leveldb.1.3.0 \
-    exit 1 \
-    fi \
-    test "$res" != 31 && exit 1 \
-    export OPAMCLI=2.0 \
-    build_dir=$(opam var prefix)/.opam-switch/build \
-    failed=$(ls "$build_dir") \
+    sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam; \
+    opam remove -y leveldb.1.3.0 && opam install -vy leveldb.1.3.0 && opam reinstall -vyt leveldb.1.3.0; \
+    exit 1; \
+    fi; \
+    test "$res" != 31 && exit 1; \
+    export OPAMCLI=2.0; \
+    build_dir=$(opam var prefix)/.opam-switch/build; \
+    failed=$(ls "$build_dir"); \
     for pkg in $failed; do \
     if opam show -f x-ci-accept-failures: "$pkg" | grep -qF "\"alpine-3.12\""; then \
-    echo "A package failed and has been disabled for CI using the 'x-ci-accept-failures' field." \
-    fi \
-    done \
+    echo "A package failed and has been disabled for CI using the 'x-ci-accept-failures' field."; \
+    fi; \
+    done; \
     exit 1 \

@kit-ty-kate
Copy link
Contributor

Fixed in #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants