I'm trying to use Gitlab Pages to automatically deploy my Hakyll blog, but I keep having problems with file encoding.
When building the pages, I get the following error:
[ERROR] /builds/jmite/hakyll/.stack/snapshots/x86_64-linux/lts-8.14/8.0.2/share/x86_64-linux-ghc-8.0.2/pandoc-citeproc-0.10.4.1/locales/locales-C-.xml: openBinaryFile: does not exist (No such file or directory)
My .gitlab-ci.yaml
looks like this:
image: fpco/stack-build:lts-8.14
before_script:
- LC_ALL=en_CA.UTF-8
- LANG=en_CA.UTF-8
- apt-get update && apt-get install xz-utils make
- export STACK_ROOT=`pwd`/.stack
- stack setup
- stack install --only-dependencies
- stack build
build:
cache:
paths:
- _cache
- .stack
script:
- stack exec site build
except:
- master
pages:
cache:
paths:
- _cache
- .stack
script:
- stack exec site build
artifacts:
paths:
- public
only:
- master
I've tried adding locale information to my config:
- LC_ALL=en_CA.UTF-8
- LANG=en_CA.UTF-8
But then I get the following error:
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8)
[ERROR] ./templates/default.html: hGetContents: invalid argument (invalid byte sequence)
How can I fix this? Is there a way to (1) change the encoding on mo local machine, and push to GitLab, so that the files will match whatever Pandoc is expecting, or (2) to configure the GitLab CI to work with them how they're encoded now?
When I open the files in vscode it says they are UTF-8. Are there ways to get more information about the encoding that might be causing problems?