What do you do if a transitive dependency is broken?

In a situation where the maintainer is unavailable what do you do?

With direct dependencies, its possible to fork the dependency, create a fix and add your branch github details to the extra-deps in stack.yaml.

How do you do this if it’s not a direct dependency but a transitive dependency. I get an error about the dependencies conflicting if I try to add it to my stack.yaml extra-deps.
The error I get is:

The same package name is used in more than one local package or extra-deps.

Is this not possible? Or do you have to fork every dependency along the dependency chain to point to the new dependency repository?

If you’re willing to use cabal, it does allow you to patch indirect dependencies (for example).

1 Like

(Specifically, I think validation-selective is an indirect dependency.)

1 Like

Also, is there a specific package in question? If so could you say what it is? Maybe we can just get it fixed.

Maybe you could share your stack.yaml? That might also help us understand what your specific problem is.

Thanks!! So i imagine this isn’t supported by stack?

But glad it’s possible atleast. Maybe we switch soon.

This was a more general question this time.

But an example dependency I’m waiting on is the postgres-options dependency which is a dependency of tmp-postgres which I depend on. There’s already a PR that fixes the issues with postgres-option, so It would have been nice to just point to that PR branch already.

Nothing very fancy in this case. So there’s nothing unique in the stack.yml at the moment.

stack.yaml is the place to pin all transitive dependencies. Can you share your stack.yaml? That error looks like you already have the dependency you’re trying to pin mentioned in extra-deps.

1 Like