Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

60%
+1 −0
Q&A Adding dependency with cabal in gitlab-ci

I have a project I normally build with nix and cabal, however I also want to publish my documentation onto gitlab pages. It's impractical to run my nix on the gitlab CI, so I've just been using cab...

0 answers  ·  posted 1mo ago by WheatWizard‭

#2: Nominated for promotion by user avatar Alexei‭ · 2024-05-03T07:27:38Z (13 days ago)
#1: Initial revision by user avatar WheatWizard‭ · 2024-04-12T17:03:19Z (about 1 month ago)
Adding dependency with cabal in gitlab-ci
I have a project I normally build with nix and cabal, however I also want to publish my documentation onto gitlab pages. It's impractical to run my nix on the gitlab CI, so I've just been using cabal. Here was my `.gitlab-ci.yaml`:

```yaml
default:
  image: haskell:9

stages:
  - pages

pages:
  stage: pages
  artifacts:
    paths:
      - public
  script:
    - cabal v2-haddock --builddir=out
    - mv ./out/build/*/ghc-*/*-*/doc/html/*/ ./public
```

And here's my `package.yaml`:

```yaml
name:                lib
version:             0.1.1.0
license:             AGPL
author:              Me
copyright:           2024 Me
extra-source-files:
  - README.md

dependencies:
  - base >= 4.14 && < 5
  - containers >= 0.6.5 && < 0.7

library:
  source-dirs:
    src
```

This worked until I needed to use `text-icu`. I added `text-icu` to my nix and `package.yaml`:

```diff
 dependencies:
   - base >= 4.14 && < 5
   - containers >= 0.6.5 && < 0.7
+  - text
+  - text-icu >= 0.7 && < 0.9

```

And this works on my local machine just fine. But I can't use my nix on gitlab CI and  gitlab's docker image doesn't have `text-icu`. So I get an error:

```text
Error: cabal: Could not resolve dependencies:
[__0] trying: lib-0.1.1.0 (user goal)
[__1] unknown package: text-icu (dependency of lib)
[__1] fail (backjumping, conflict set: lib, text-icu)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: lib, text-icu
```

How can I supply this dependency to the gitlab-ci so that cabal can access it?