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

Planned improvements to component handling in Cabal/cabal-install #3287

Closed
4 of 5 tasks
ezyang opened this issue Apr 5, 2016 · 3 comments
Closed
4 of 5 tasks

Planned improvements to component handling in Cabal/cabal-install #3287

ezyang opened this issue Apr 5, 2016 · 3 comments

Comments

@ezyang
Copy link
Contributor

ezyang commented Apr 5, 2016

Cabal and cabal-install operate on a per-package basis, rather than a per-component basis; this is the source of many bugs:

I had a previous proposal for a per-component setup interface at #3064 but after discussion, we are going to go for a more conservative plan:

  • We'll partially fix Disable library building, only build other components #2775, proceeding a bit differently than suggested in the ticket. Presently, if you say cabal build myexe, this will build myexe as well as any components it depends on (e.g., the library). If you pass the --one-shot flag, we will assume that all of its dependencies are up-to-date and only build the immediate component. However, it will assume, e.g., the library it needs, has been built and registered in place; it would not be possible to request the executable to be built against an already installed version of the package. (I suppose if you fix Make Cabal accept --dependency flags qualified by components #3286 that will solve that problem, because you'll just configure the dependency to point elsewhere.)
  • We'll add a --one-shot mode to ./Setup copy. If you don't specify a component it will instead install package-global information.
  • We'll add a --one-shot mode to ./Setup register.
  • Decouple InstallPlan from PackageIndex; i.e., have cabal-install have a copy of the code so that InstallPlan isn't implemented internally using a PackageIndex but with its own data type PlanIndex. See Refactor of PackageIndex and InstallPlan  #3525.
  • Generalize InstallPlan to not be keyed on UnitId, but on a new data type that reflects various build items we may need to do, specifically (1) download a package, (2) configure a package, (3) build a component in a package (this step takes advantage of --one-shot). At the same time, rewrite the install plan runner to handle these steps individually.
ezyang added a commit to ezyang/cabal that referenced this issue Apr 6, 2016
…#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 6, 2016
…#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 6, 2016
…#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 6, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
…#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
…askell#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
…askell#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
…askell#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 7, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
…askell#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
…askell#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
…askell#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
…askell#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
…askell#3287)

--one-shot lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 8, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 9, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 9, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 11, 2016
…askell#2775 (haskell#3287)

--assume-deps-up-to-date lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 11, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 11, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 11, 2016
…askell#2775 (haskell#3287)

--assume-deps-up-to-date lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 11, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 11, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 12, 2016
…askell#2775 (haskell#3287)

--assume-deps-up-to-date lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 12, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 12, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 12, 2016
…askell#2775 (haskell#3287)

--assume-deps-up-to-date lets you compile a single component without
building its dependencies.

Signed-off-by: Edward Z. Yang <[email protected]>
ezyang added a commit to ezyang/cabal that referenced this issue Apr 12, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Apr 12, 2016
@ezyang
Copy link
Contributor Author

ezyang commented Aug 15, 2016

This ticket got obsoleted by #3662

@ezyang ezyang closed this as completed Aug 15, 2016
@dcoutts
Copy link
Contributor

dcoutts commented Aug 16, 2016

Generalize InstallPlan to not be keyed on UnitId, but on a new data type that reflects various build items we may need to do, specifically (1) download a package, (2) configure a package, (3) build a component in a package (this step takes advantage of --one-shot). At the same time, rewrite the install plan runner to handle these steps individually.

Also, I don't think this last item is actually needed. The existing approach to the build runner can avoid re-configuring and can download in parallel.

@ezyang
Copy link
Contributor Author

ezyang commented Aug 16, 2016

Well, it would be needed if took the approach described in this ticket (which we ended up not doing. Per-component builds as currently implement have to reconfigure for each component; not really possible to avoid without reimplementing configure in cabal-install.

ezyang added a commit to ezyang/cabal that referenced this issue Oct 18, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Oct 18, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Oct 18, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Oct 19, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Oct 19, 2016
ezyang added a commit to ezyang/cabal that referenced this issue Oct 19, 2016
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

3 participants