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

Refactor LocalBuildInfo interface. #3595

Merged
merged 5 commits into from
Jul 24, 2016
Merged

Conversation

ezyang
Copy link
Contributor

@ezyang ezyang commented Jul 22, 2016

This is an omnibus patch, with the overall goal of making
LocalBuildInfo Great Again. The essential ideas:

  • New type 'TargetInfo' which bundles together 'ComponentLocalBuildInfo'
    and 'Component'. Eventually, it will also record file paths / module
    targets. This data structure is basically what you want; a lot of
    old Cabal code did lots of gyrations converting from
    'ComponentLocalBuildInfo' to 'Component' and vice versa, now
    it's all centralized.
  • The "new" API for 'LocalBuildInfo' is in
    "Distribution.Types.LocalBuildInfo". The general principle
    is, where we previous dealt in 'ComponentLocalBuildInfo',
    we now deal in 'TargetInfo'. There are shockingly few
    functions we need!
  • I've restored 'componentsConfigs' to its Cabal 1.24 signature
    for BC.
  • I killed a number of unused functions from "Distribution.Simple.LocalBuildInfo":
    'getLocalComponent', 'maybeGetDefaultLibraryLocalBuildInfo',
    'maybeGetComponentLocalBuildInfo', 'checkComponentsCyclic' and
    'enabledComponents'. For each I checked on Hackage that they were
    not used.
  • 'getComponentLocalBuildInfo', 'withComponentsInBuildOrder' and
    'componentsInBuildOrder' are deprecated to encourage people
    to instead use the 'TargetInfo's to finger which components
    they want built.
  • 'ComponentLocalBuildInfo' now stores internally the computed
    'componentInternalDeps', so that 'LocalBuildInfo' can simply store
    a graph of 'ComponentLocalBuildInfo'.
  • The code in Configure has been streamlined to use our new Graph
    data type to great success.
  • The type of 'runTest' changed to take a 'ComponentLocalBuildInfo',
    bringing it more in line with everything else.
  • New function 'readTargetInfos' which combines 'readBuildTargets'
    and 'checkBuildTargets', which is what you really wanted anyway.

Signed-off-by: Edward Z. Yang [email protected]

@ezyang
Copy link
Contributor Author

ezyang commented Jul 22, 2016

I appear to have messed up LibV09 in the patch: attempting to close over UnitIds that don't exist. I'll have to investigate tomorrow.

ezyang added 3 commits July 23, 2016 16:50
This is an omnibus patch, with the overall goal of making
LocalBuildInfo Great Again.  The essential ideas:

* New type 'TargetInfo' which bundles together 'ComponentLocalBuildInfo'
  and 'Component'.  Eventually, it will also record file paths / module
  targets.  This data structure is basically what you want; a lot of
  old Cabal code did lots of gyrations converting from
  'ComponentLocalBuildInfo' to 'Component' and vice versa, now
  it's all centralized.

* The "new" API for 'LocalBuildInfo' is in
  "Distribution.Types.LocalBuildInfo".  The general principle
  is, where we previous dealt in 'ComponentLocalBuildInfo',
  we now deal in 'TargetInfo'.  There are shockingly few
  functions we need!

* I've restored 'componentsConfigs' to its Cabal 1.24 signature
  for BC.

* I killed a number of unused functions from "Distribution.Simple.LocalBuildInfo":
  'getLocalComponent', 'maybeGetDefaultLibraryLocalBuildInfo',
  'maybeGetComponentLocalBuildInfo', 'checkComponentsCyclic' and
  'enabledComponents'.  For each I checked on Hackage that they were
  not used.

* 'getComponentLocalBuildInfo', 'withComponentsInBuildOrder' and
  'componentsInBuildOrder' are deprecated to encourage people
  to instead use the 'TargetInfo's to finger which components
  they want built.

* 'ComponentLocalBuildInfo' now stores internally the computed
  'componentInternalDeps', so that 'LocalBuildInfo' can simply store
  a graph of 'ComponentLocalBuildInfo'.

* The code in Configure has been streamlined to use our new Graph
  data type to great success.

* The type of 'runTest' changed to take a 'ComponentLocalBuildInfo',
  bringing it more in line with everything else.

* New function 'readTargetInfos' which combines 'readBuildTargets'
  and 'checkBuildTargets', which is what you really wanted anyway.

Signed-off-by: Edward Z. Yang <[email protected]>
@ezyang ezyang force-pushed the pr/lbi-refactor branch from e2d296e to 5122823 Compare July 23, 2016 23:50
ezyang added 2 commits July 23, 2016 18:37
The big change here is that most of the functions in
Distribution.Types.HookedBuildInfo have to take a
PackageDescription explicitly.  I hate the new type,
so I primed these new functions, and added functions
which use 'localPkgDescr'.  Presently those have WARNINGs
attached to them so people don't accidentally use them;
once we fix 'HookedBuildInfo' we can change this.

Signed-off-by: Edward Z. Yang <[email protected]>
@ezyang ezyang force-pushed the pr/lbi-refactor branch from 6630de8 to da227c5 Compare July 24, 2016 01:37
@ezyang
Copy link
Contributor Author

ezyang commented Jul 24, 2016

Latest build was squash only.

@ezyang ezyang merged commit e95266f into haskell:master Jul 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant