Skip to content

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

Open

Description

@hvr

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.

Activity

  1. added
    cabal-install: v2-build system
    on Aug 7, 2017
  2. ezyang commented on Jan 2, 2018

    @ezyang
    Contributor

    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.

  3. ezyang commented on Jan 2, 2018

    @ezyang
    Contributor

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

  4. self-assigned this
    on Jun 12, 2018
  5. removed their assignment
    on Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cabal-install: v2-build systemtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions