Skip to content

Add flag to build all packages in project with new-build #3391

Closed

Description

@hesselink

As discussed here, it would be useful to have a way to build all packages in a project with new-build, perhaps a flag like --all.

Activity

  1. added
    cabal-install: v2-build system
    on May 2, 2016
  2. 23Skidoo commented on May 2, 2016

    @23Skidoo
    Member

    Or something like build *.

  3. hesselink commented on May 2, 2016

    @hesselink
    ContributorAuthor

    The problem with that (I initially thought the same thing) is that the shell will expand it, so you'll have to escape it to pass it to cabal.

  4. hesselink commented on May 2, 2016

    @hesselink
    ContributorAuthor

    Another option (suggested by mightybyte) is to build all packages when called without targets in the root directory, or maybe more generally, all targets in subdirectories of the current directory.

  5. hvr commented on May 2, 2016

    @hvr
    Member

    I wonder if it makes sense to have 'cabal.project' allow to define the default target-set when cabal new-build is called without an argument. The implicit default could then be defined as "*".

  6. added this to the milestone on May 3, 2016
  7. dcoutts commented on May 3, 2016

    @dcoutts
    Contributor

    Right, can't use * due to shells. But some other syntax is ok, e.g. "all".

    Here's another strawman proposal: cabal (new-)build on it's own builds the package in the current dir by default, and if there's none then it tells you what packages are in the project and also mentions the "all" target, in nice easy-to-paste-and-run syntactic form.

    Also an opportunity to mention to new users that targets can include more than just package names, but also dirs, exe/lib/test names and eventually also files/modules/tarballs etc.

    Related to this, I'd love help from people to go through the UI and some basic workflows and build up a somewhat more comprehensive and detailed plan for both what the UI should do and also how it should react and guide users when they make mistakes. For example when should we point out "btw, you're in this project, here's how to find out more about the project status...".

  8. acfoltzer commented on Jul 21, 2016

    @acfoltzer
    Collaborator

    👍 to the no-argument behavior being to build all packages in the project, but I can see why this might not be a universal sentiment. I just find the current behavior unclear and surprising when the root of my project has a cabal.project file but no .cabal files. When I'm in "project mode" I suppose I just more naturally think of operations like that on the project level, rather than the package level.

    If we do want to add flags to switch between whole-project and current-package behavior, I suggest --all and --only respectively, picking one as the default. We already have cabal build --only which skips add-sourced dependencies–this would be of a similar flavor.

  9. ezyang commented on Jul 21, 2016

    @ezyang
    Contributor

    Yeah, I think new-build in a project repo should just build everything. It's as if you ran new-build listing each of the packages you listed up.

  10. added a commit that references this issue on Aug 24, 2016
    ad5bda4
  11. added a commit that references this issue on Aug 28, 2016
    e742447
  12. added a commit that references this issue on Aug 31, 2016
    118c709
  13. modified the milestones: cabal-install 2.0, on Sep 6, 2016
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

    attention: patchcabal-install: v2-build systemtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions