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

Comments

@justinwoo
Copy link
Collaborator

commented Jul 23, 2019

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

@f-f

This comment has been minimized.

Copy link
Member

commented Jul 23, 2019

@justinwoo could you detail an example?

@justinwoo

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 23, 2019

$ 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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 23, 2019

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

@justinwoo

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 23, 2019

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

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 23, 2019

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

@f-f

This comment has been minimized.

Copy link
Member

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 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
2 participants
You can’t perform that action at this time.