Skip to content
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

Add --deps-only flag to spago build #330

Closed
justinwoo opened this issue Jul 23, 2019 · 7 comments · Fixed by #331
Closed

Add --deps-only flag to spago build #330

justinwoo opened this issue Jul 23, 2019 · 7 comments · Fixed by #331

Comments

@justinwoo
Copy link
Contributor

Many times you will change deps in your project, and want to then interactively fix your codebase.

@f-f
Copy link
Member

f-f commented Jul 23, 2019

@justinwoo could you detail an example?

@justinwoo
Copy link
Contributor Author

$ psc-package build --help
Usage: psc-package build [-d|--only-dependencies] [`purs compile`-options]
                         [--jobs ARG]
  Install dependencies and compile the current package

Available options:
  -d,--only-dependencies   Compile only the package's dependencies

if you remove deps you don't want in your project, your project doesn't build anymore. however, you still want to actually develop interactively at the leaf modules of your codebase.

@f-f
Copy link
Member

f-f commented Jul 23, 2019

I'm not sure I understand how this can happen. Assuming you have dependencies a, b, c and your project builds using all of them:

  • if you remove a then your project stops building. It doesn't make sense to rebuild only dependencies because the dependencies have already been built once
  • if you add d then your project should rebuild just fine even if you include project code

@justinwoo
Copy link
Contributor Author

This is also a problem when you upgrade packages, which is the equivalent of removing a package to add another.

@justinwoo
Copy link
Contributor Author

Another crucial detail is that it's not like all non-project sources will be built guaranteed, especially if module headers are parsed first and the compiler determines that there are no valid build plans (for good reason)

@justinwoo
Copy link
Contributor Author

Really, the only actual workaround for this missing feature is to rm -rf src test && spago build && git checkout .

@f-f
Copy link
Member

f-f commented Jul 23, 2019

We had a IRL chat with @justinwoo and it turns out the reason why you'd want to compile deps-only is for cases in which you:

  • switch branches and there's a significant diff of deps
  • update dependencies that introduce breakage

..and still want your purs ide to give you meaningful suggestions.

So you'd do spago build --deps-only and then start purs ide. Then you'd have relevant suggestions to fix your type errors.

@f-f f-f changed the title Build: needs flag to specify build only dependencies Add --deps-only flag to spago build Jul 23, 2019
@mergify mergify bot closed this as completed in #331 Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants