You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add flag to build all packages in project with new-build #3391
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.
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 "*".
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...".
👍 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.
Activity
23Skidoo commentedon May 2, 2016
Or something like
build *.hesselink commentedon May 2, 2016
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.hesselink commentedon May 2, 2016
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.
hvr commentedon May 2, 2016
I wonder if it makes sense to have 'cabal.project' allow to define the default target-set when
cabal new-buildis called without an argument. The implicit default could then be defined as "*".dcoutts commentedon May 3, 2016
Right, can't use * due to shells. But some other syntax is ok, e.g. "all".
Here's another strawman proposal:
cabal (new-)buildon 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...".
acfoltzer commentedon Jul 21, 2016
👍 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.projectfile but no.cabalfiles. 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
--alland--onlyrespectively, picking one as the default. We already havecabal build --onlywhich skips add-sourced dependencies–this would be of a similar flavor.ezyang commentedon Jul 21, 2016
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.
Fix haskell#3391: build all packages if no target is specified.
Fix haskell#3391: build all packages if no target is specified.
Merge pull request #3715 from ezyang/pr/3391