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 support for "setup" components to target selector & new-build #4675

Open
hvr opened this issue Aug 7, 2017 · 2 comments
Open

Add support for "setup" components to target selector & new-build #4675

hvr opened this issue Aug 7, 2017 · 2 comments

Comments

@hvr
Copy link
Member

hvr commented Aug 7, 2017

Currently, we cannot refer to custom-setup components

See Distribution.Client.TargetSelector for currently supported syntax.

In order to reify custom-setup components in the target selector syntax, we'd have to introduce a new (singleton) namespace "setup", which has onlyat most a single inhabitant (hence a singleton -- however, this inhabitant only exists for build-type:custom packages), also named "setup". Consequently, this gives us the following ways to refer to the custom setup script for a package foo

  • foo:setup (package-name : component-name)
  • setup (component-name)
  • setup:setup (namespace-name : component-name)
  • foo:setup:setup (package-name : namespace-name : component-name )
  • :pkg:foo:setup:setup (explicitly qualified package-name : namespace-name : component-name )

(Optional) Moreover, we could add the "filter" setups, which then gives us the ability to refer to custom-setups components of multiple packages via

  • setups
  • all:setups
  • :all:setups
  • foo:setups (trivial: all setup components in the package foo; IOW, same as foo:setup:setup)

This may be a pre-requisite for #4293 which needs the ability to cabal new-build setup(s) w/o building all remaining targets.

@ezyang
Copy link
Contributor

ezyang commented Jan 2, 2018

In fact, we already have a concept for this, in Distribution.Solver.Types.ComponentDep:

-- | Component of a package.
data Component =
    ComponentLib
  | ComponentSubLib UnqualComponentName
  | ComponentFLib   UnqualComponentName
  | ComponentExe    UnqualComponentName
  | ComponentTest   UnqualComponentName
  | ComponentBench  UnqualComponentName
  | ComponentSetup
  deriving (Show, Eq, Ord, Generic)

So extending this idea further seems profitable.

@ezyang
Copy link
Contributor

ezyang commented Jan 2, 2018

A prereq for doing this profitability is out-of-line custom setup build, i.e., a stripped down version of #4047

@typedrat typedrat self-assigned this Jun 12, 2018
@typedrat typedrat mentioned this issue Jun 19, 2018
8 tasks
@typedrat typedrat removed their assignment Jul 20, 2018
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

4 participants