haskell / haskell/cabal

Proper way to vendor dependencies?

Open
#10,934 4 comments 0 reactions 0 assignees View on GitHub
type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**What is your question?**
I need to build a program locally using cabal-install without internet access.

The build environment only includes GHC and cabal-install; no additional packages are installed. Therefore, all build dependencies must be available locally in some form.

Many modern statically linked languages (such as Rust and Go) provide a dependency vendoring mechanism to address this issue. Is it possible to achieve something similar using the native cabal-install tools?

**System information**
- GNU/Linux
- `cabal` - 3.14.2.0
- `GHC` - 9.6.6

**Additional context**
For my purposes, I wrote a small script that creates a local repository with all the required package dependencies.

https://github.com/lRespublica/cabal-vendor

However, I’m still running into a few issues. For example, it's not possible to specify a relative path for the repository location, so I have to resort to using `sed` hacks during the build process - which isn't ideal.

That’s why I’m asking this question here - maybe I’m going about this the wrong way.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing cabal-install's native offline package and repository handling, then compare it with the linked cabal-vendor script and its relative-path limitation. Done would require a maintainer-confirmed, supported vendoring approach or a clearly scoped change proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.