haskell / haskell/cabal

Support subdirectories with remote tarball deps in cabal.project

Open
#7,821 11 comments 0 reactions 0 assignees View on GitHub
attention: pr-welcome cabal-install: other type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Related to: https://github.com/haskell/cabal/issues/2189

Currently, one can add
```
source-repository-package
type: git
location: git://...
tag: ...
```

to use a git repo to download a project to use as a dependency. I would like to explicitly specify a URL to a tarball that can be unzipped and used.

This is useful because when making a PR from a forked repo, GitHub adds the commit to the original repo's set of commits. For example, if I fork `user1/my-repo` to `user2/my-repo`, add commit A to the `user2/my-repo` fork, and make a PR, GitHub allows downloading the commit from `https://github.com/user1/my-repo/archive/A.tar.gz`. However, cloning the original `user1/my-repo` repo and doing `git checkout A` does not work.

One could workaround this with

```
packages:
https://github.com/owner/repo/commit.tar.gz
```
which works in most use-cases, but doesn't work if the Cabal project is within a subdirectory of the archive (e.g. a monorepo)

This is already supported in Stack: https://docs.haskellstack.org/en/stable/yaml_configuration/#extra-deps

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.