Skip to content

Prevent stack from recompiling external dependencies #1915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
callmeyesh opened this issue Mar 15, 2016 · 3 comments
Closed

Prevent stack from recompiling external dependencies #1915

callmeyesh opened this issue Mar 15, 2016 · 3 comments

Comments

@callmeyesh
Copy link

I am relatively new to stack and I wasn't able to figure out if this feature already exists. Before I explain my question, let me explain our development setup. We use jenkins to build our repo. The haskell project will be a small subset of a larger python project. The haskell project is mainly used to generate artifacts.

The jenkins master does a git clean each time before building a git branch. My haskell project has some external dependency like argparser & aeson. Each time my build scripts execute a stack build, these external dependencies get compiled because they are deleted when jenkins executes the git clean command.

Is there anyway to tell stack to download the external deps to a global folder outside the project folder? Like the global-pkg-db path instead of the .stack-work folder? What is the best way to prevent stack from recompile the external dependencies?

This is my stack.yaml file:

# This file was automatically generated by stack init
# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-5.8

# Local packages, usually specified by relative directory name
packages:
- '.'
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps:
- aeson-0.11.1.1
- argparser-0.3.4
- text-1.2.2.0

# Override default flag values for local packages and extra-deps
flags: {}

# Extra package databases containing global packages
extra-package-dbs: []
@mgsloan
Copy link
Contributor

mgsloan commented Mar 16, 2016

By having extra-deps versions of aeson and text, anything that depends on them (many packages) will be built and compiled to your local project directory. This may be resolved by #1265, which will hopefully happen soonish.

@callmeyesh
Copy link
Author

Awesome, that will improve the compilation time. Is there anyway to specify the location where the extra-deps will get compiled?

@mgsloan
Copy link
Contributor

mgsloan commented Mar 16, 2016

You can change the work-dir location, but due to the intersection of various issues, it isn't as flexible as we'd like: #1731

Once extra-deps are compiled to something like a snapshot, those dependencies will be outside of your project dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants