foo
bar
src
...
stack.yaml
package.yaml
src
...
stack.yaml
package.yaml
The foo package has bar declared as extra-dep in stack.yaml.
I would like to build all the remote dependencies of foo given only stack.yaml and package.yaml (I mean, these are the only two files available in the file-system and seen by Stack).
What I tried so far fails telling me that the bar folder does not exist
um… I stopped using stack a while ago but IIRC, you have onestack.yaml per project and onepackage.yaml per package within a project (a project may have multiple packages). Hence your project should look like this
bar
src
...
package.yaml
foo
src
...
package.yaml
stack.yaml
where stack.yaml contains
resolver: lts...
packages:
- foo
- bar
This way foo and bar are project packages, not dependencies. I think you don’t need to declare bar as an extra dependency but just a dependency in foo/package.yaml. Maybe this way when you run stack build --only-deps it will not build bar as it is a project package. Notice I am not so sure about this…
um… so I don’t think you can achive what you want as your are explicitly saying that bar is an external dependency (hence not part of project itself). Maybe you can look into the documentation for some flag like skip or something like that.
Also you can try to create a volume in docker pointing to .stack-work folder (if that’s the name), if you want to speed up the docker builds