diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9914bc..3f7b3ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,17 +4,14 @@ stages: .before_script_template: &common_before_script before_script: - ls -l .. - - apt-get update && apt-get install alex happy - - ghc-pkg list - - cabal update && cabal install --only-dependencies -j2 --enable-tests --enable-documentation - mkdir -p ../ghc-mod.sdist-$CI_PIPELINE_ID - - touch ChangeLog - - cabal sdist --output-directory=../ghc-mod.sdist-$CI_PIPELINE_ID - - cd ../ghc-mod.sdist-$CI_PIPELINE_ID + - cabal update + - cabal install cabal-doctest + - cabal act-as-setup -- sdist --output-directory=../ghc-mod.sdist-$CI_PIPELINE_ID + - cd core && cabal act-as-setup -- sdist --output-directory=../../ghc-mod.sdist-$CI_PIPELINE_ID/core + - cd ../../ghc-mod.sdist-$CI_PIPELINE_ID after_script: - - cd "$CI_PROJECT_DIR" - - ghc-pkg list | tee packages.list - rm -rf "$CI_PROJECT_DIR"/../ghc-mod.sdist-$CI_PIPELINE_ID .script_template: &common_script @@ -22,44 +19,40 @@ after_script: - echo $PWD - which cabal - cabal --version - - cabal configure --enable-tests - - cabal build -j2 - - which cabal - - cabal --version - - ./dist/build/spec/spec - - ./dist/build/doctest/doctest - - cabal haddock + - cabal new-configure --enable-tests --only-dependencies + - cabal new-build + - cabal new-test + - cabal new-haddock .artifacts_template: &common_artifacts artifacts: paths: - - packages.list - ~/.cabal/logs when: always job-ghc802: - image: registry.gitlab.com/dxld/ghc-mod:ghc8.2.2-cabal-install2.0.0.0 + image: registry.gitlab.com/dxld/ghc-mod:ghc8.2.2-cabal-install2.0.0.1 stage: build <<: *common_before_script <<: *common_script <<: *common_artifacts job-ghc800: - image: registry.gitlab.com/dxld/ghc-mod:ghc8.0.2-cabal-install1.24.0.2 + image: registry.gitlab.com/dxld/ghc-mod:ghc8.0.2-cabal-install2.0.0.1 stage: build <<: *common_before_script <<: *common_script <<: *common_artifacts job-ghc710: - image: registry.gitlab.com/dxld/ghc-mod:ghc7.10.3-cabal-install1.22.8.0 + image: registry.gitlab.com/dxld/ghc-mod:ghc7.10.3-cabal-install2.0.0.1 stage: build <<: *common_before_script <<: *common_script <<: *common_artifacts job-ghc708: - image: registry.gitlab.com/dxld/ghc-mod:ghc7.8.4-cabal-install1.18.2.0 + image: registry.gitlab.com/dxld/ghc-mod:ghc7.8.4-cabal-install2.0.0.1 stage: build <<: *common_before_script <<: *common_script diff --git a/scripts/docker.sh b/scripts/docker.sh index de8aedd..19b38f8 100755 --- a/scripts/docker.sh +++ b/scripts/docker.sh @@ -15,19 +15,24 @@ while read -r ghc_rel ghc ghc_arch ghc_ext cabal cabal_rev image; do [ -n "$target" ] && [ x"$ghc_rel" != x"$target" ] && continue ghc_url="https://downloads.haskell.org/~ghc/${ghc_rel}/ghc-${ghc}-${ghc_arch}.tar.${ghc_ext}" - cabal_url="https://hackage.haskell.org/package/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz" + cabal_url="https://www.haskell.org/cabal/release/cabal-install-${cabal}/cabal-install-${cabal}-x86_64-unknown-linux.tar.gz" + + ## To build cabal from source: + #cabal_url="https://hackage.haskell.org/package/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz" # https://www.haskell.org/cabal/release/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz - cabal_meta_url="https://hackage.haskell.org/package/cabal-install-${cabal}/revision/${cabal_rev}.cabal" + #cabal_meta_url="https://hackage.haskell.org/package/cabal-install-${cabal}/revision/${cabal_rev}.cabal" + ghc_file="$(basename "$ghc_url")" + cabal_exe_file="cabal" cabal_file="$(basename "$cabal_url")" - cabal_meta_file=cabal-install-"${cabal}"-"${cabal_rev}".cabal + # cabal_meta_file=cabal-install-"${cabal}"-"${cabal_rev}".cabal ADDITIONAL_COMMANDS="" ADDITIONAL_BOOTSTRAP_SETUP="true" if [ x"$image" = x"debian:squeeze" ]; then - ADDITIONAL_PACKAGES=" libncursesw5 realpath" + ADDITIONAL_PACKAGES="realpath" ADDITIONAL_COMMANDS="${ADDITIONAL_COMMANDS}COPY sources.list /etc/apt/ COPY 10-no-check-valid-until /etc/apt/apt.conf.d/ " @@ -41,20 +46,25 @@ EOF cat > "$tmpdir"/10-no-check-valid-until < "$tmpdir/$cabal_exe_file" + + #wget -nv -nc -c "$cabal_url" && cp -l "$cabal_file" "$tmpdir" + # if [ ! -e "$dldir"/"${cabal_meta_file}" ]; then + # wget -nv "$cabal_meta_url" -O "$dldir"/"${cabal_meta_file}" + # fi && cp -l "$dldir"/"${cabal_meta_file}" "$tmpdir" ls -l "$tmpdir" cd "$d" || exit 1 - ADDITIONAL_COMMANDS="${ADDITIONAL_COMMANDS}COPY $ghc_file $cabal_file $cabal_meta_file /root/ + ADDITIONAL_COMMANDS="${ADDITIONAL_COMMANDS}COPY $ghc_file $cabal_exe_file /root/ " cat > "$tmpdir"/Dockerfile <