Hey everyone,
I’m new here, working together with @Lee_Hambley. We both really like dhall and specifically want to use it to generate our Gitlab CI YAML files, because they have reached a level of complexity that is hard to deal with in plain YAML.
Unfortunately, my first experience with dhall is frustrating. Here is the series of steps I’ve been through:
- Learn about dhall and get excited
- Install dhall
- Search for a dhall-based solution to my problem and find it https://github.com/bgamari/dhall-gitlab-ci
- Copy-paste the example from the README and hit a wall
why does the import fallback in the Prelude.dhall
not work?
Context
the import integrity check fails when importing the Gitlab module, but I don’t see the reason why:
:; export DHALL_PRELUDE='https://prelude.dhall-lang.org'
:; dhall-to-yaml-ng --file .gitlab-ci.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
This is also detailed in this issue on Github: https://github.com/bgamari/dhall-gitlab-ci/issues/13
But the Prelude.dhall
file explicitly has a fallback without the integrity check:
env:DHALL_PRELUDE
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall sha256:0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall
What happened
Setting DHALL_PRELUDE
apparently had no effect, so it fell back to the first import, which fails due to the failed integrity check and then execution stops.
What I expected to happen
The final import without the integrity check is executed and works, since there is no integrity check.