|
| 1 | +N0REP0 |
| 2 | +### : Check the bevahiour when presented with a broken submodule |
| 3 | +### mkdir submodule |
| 4 | +### git -C ./submodule init -q |
| 5 | +### git -C ./submodule config core.autocrlf false |
| 6 | +### touch ./submodule/some-file |
| 7 | +### git -C ./submodule add ./some-file |
| 8 | +### git -C ./submodule commit -qm "first commit" |
| 9 | +### mkdir use-submodule |
| 10 | +### git -C ./use-submodule init -q |
| 11 | +### git -C ./use-submodule config core.autocrlf false |
| 12 | +### git -C ./use-submodule submodule add ../submodule ./vendor |
| 13 | +Cloning into '${BASEDIR}/use-submodule/vendor'... |
| 14 | +done. |
| 15 | +### git -C ./use-submodule commit -qm "first commit" |
| 16 | +### <create-submodule-pkg.sh> |
| 17 | +mkdir -p REPO/packages/submodule/submodule.1 |
| 18 | +cat > REPO/packages/submodule/submodule.1/opam << EOF |
| 19 | +opam-version: "2.0" |
| 20 | +build: ["ls" "vendor/some-file"] |
| 21 | +url { |
| 22 | + src: "git+file://${BASEDIR}/use-submodule" |
| 23 | +} |
| 24 | +EOF |
| 25 | +### sh ./create-submodule-pkg.sh |
| 26 | +### opam update |
| 27 | + |
| 28 | +<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><> |
| 29 | +[default] synchronised from file://${BASEDIR}/REPO |
| 30 | +Now run 'opam upgrade' to apply any package updates. |
| 31 | +### opam switch create submodule --empty |
| 32 | +### opam install --verbose submodule |
| 33 | +The following actions will be performed: |
| 34 | +=== install 1 package |
| 35 | + - install submodule 1 |
| 36 | + |
| 37 | +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> |
| 38 | +Processing 1/3: [submodule.1: git] |
| 39 | +-> retrieved submodule.1 (git+file://${BASEDIR}/use-submodule) |
| 40 | +Processing 2/3: [submodule: ls] |
| 41 | ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "ls" "vendor/some-file" (CWD=${BASEDIR}/OPAM/submodule/.opam-switch/build/submodule.1) |
| 42 | +- vendor/some-file |
| 43 | +-> compiled submodule.1 |
| 44 | +-> installed submodule.1 |
| 45 | +Done. |
| 46 | +### rm -r ./submodule |
| 47 | +### opam remove submodule |
| 48 | +The following actions will be performed: |
| 49 | +=== remove 1 package |
| 50 | + - remove submodule 1 |
| 51 | + |
| 52 | +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> |
| 53 | +-> removed submodule.1 |
| 54 | +Done. |
| 55 | +### opam install --verbose submodule |
| 56 | +The following actions will be performed: |
| 57 | +=== install 1 package |
| 58 | + - install submodule 1 |
| 59 | + |
| 60 | +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> |
| 61 | +Processing 1/3: [submodule.1: git] |
| 62 | +[WARNING] Git submodule update failed in ${BASEDIR}/OPAM/submodule/.opam-switch/sources/submodule.1 |
| 63 | +-> retrieved submodule.1 (git+file://${BASEDIR}/use-submodule) |
| 64 | +Processing 2/3: [submodule: ls] |
| 65 | ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "ls" "vendor/some-file" (CWD=${BASEDIR}/OPAM/submodule/.opam-switch/build/submodule.1) |
| 66 | +- ls: cannot access 'vendor/some-file': No such file or directory |
| 67 | +[ERROR] The compilation of submodule.1 failed at "ls vendor/some-file". |
| 68 | + |
| 69 | +##% output ### |
| 70 | +# ls: cannot access 'vendor/some-file': No such file or directory |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> |
| 75 | ++- The following actions failed |
| 76 | +| - build submodule 1 |
| 77 | ++- |
| 78 | +- No changes have been performed |
| 79 | +'${OPAM} install --verbose submodule' failed. |
| 80 | +# Return code 31 # |
0 commit comments