Skip to content

Support subdirectories with remote tarball deps in cabal.project #7821

@brandon-leapyear

Description

@brandon-leapyear

Related to: #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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions