bgamari / dhall-gitlab-ci

A Dhall encoding of the GitLab CI configuration schema
BSD 3-Clause "New" or "Revised" License
46 stars 19 forks source link

Prelude/package.dhall checksum incorrect #13

Open bobdoah opened 2 years ago

bobdoah commented 2 years ago

I'm trying to run the example, using an import and it's failing with:

dhall:
↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/package.dhall
  ↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/GitLab/package.dhall
    ↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/GitLab/Job/package.dhall
      ↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/GitLab/Job/Type.dhall
        ↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/GitLab/Prelude.dhall
          ↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/Prelude.dhall
            ↳ https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall
  sha256:0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d

Error: Import integrity check failed

Expected hash:

↳ 0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d

Actual hash:

↳ 10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e

24│   https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall sha256:0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d

https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/Prelude.dhall:24:3

It seems like the checksum committed is wrong.

mx00s commented 2 years ago

Odd. It worked for me.

$ git clone https://github.com/bgamari/dhall-gitlab-ci.git
$ cd dhall-gitlab-ci
$ dhall <<< ./examples/single-job.dhall
''
"generated-job":
  "allow_failure": false
  "image":
    "entrypoint":
      - " "
    "name": "alpine:latest"
  "script":
    - "echo 'Hello World'"
  "stage": "build"
  "variables": {}
"variables":
  "GIT_SUBMODULE_STRATEGY": "normal"
''

I tested using a somewhat old version:

$ dhall --version
1.39.0
bobdoah commented 2 years ago

Yeah, I'm using the latest:

% dhall --version
1.41.1

I can't see any obvious reason in the changelog why this would have broken: https://hackage.haskell.org/package/dhall-1.41.1/changelog

kenranunderscore commented 2 years ago

For the record, same problem here when upgrading to dhall in version 1.40.2. For now I'm using @bobdoah's PR directly, otherwise the pipeline won't build.

dhamidi commented 2 years ago

It turned out that there is another issue with the latest dhall version: https://discourse.dhall-lang.org/t/first-steps-failed-when-trying-dhall-for-gitlab-ci/602/3

The behavior of import has changed, so the fallback to use an include without the integrity checksum doesn't work anymore.

jackmac92 commented 1 year ago

I was hoping to get a bit more familiar with dhall by using it for gitlab-ci, any recs on a temporary workaround?

Could I somehow get that version of the Prelude cached on my machine? Or fork and deal with fixing the sha check w/in the code of this repo?

bobdoah commented 1 year ago

You can use the PR (https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/9cde297ccee35a473c9ef0944348b70367a899ac/package.dhall), or my fork: https://raw.githubusercontent.com/bobdoah/dhall-gitlab-ci/master/package.dhall

bgamari commented 1 year ago

I have merged the MR. Thanks everyone!