cabal install --only

Hi all, What is the purpose of the "install" command's "--only" flag? The documentation says "Only installs the package in the current directory", but this is already supported by running "cabal install" in the current directory without arguments. Would it be fine if I removed "--only"? -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments

Hi.
What is the purpose of the "install" command's "--only" flag? The documentation says "Only installs the package in the current directory", but this is already supported by running "cabal install" in the current directory without arguments. Would it be fine if I removed "--only"?
No, please do not remove it. Running install without --only causes all sorts of things to happen, because install is the magic command. The --only flag is for use after you have already run build and really only does the installation, i.e. It behaves comparable to Setup install. Cheers, Andres

On 15 March 2013 15:14, Andres Löh
Hi.
What is the purpose of the "install" command's "--only" flag? The documentation says "Only installs the package in the current directory", but this is already supported by running "cabal install" in the current directory without arguments. Would it be fine if I removed "--only"?
No, please do not remove it. Running install without --only causes all sorts of things to happen, because install is the magic command. The --only flag is for use after you have already run build and really only does the installation, i.e. It behaves comparable to Setup install.
Ah, maybe the help text is ambiguous; I interpreted that as saying it "only installs the package in the current directory [not in some other directory]". Perhaps rename --only to --no-reconfigure or so? cabal install --reconfigure : run "cabal configure" with previous options before install [default] --no-reconfigure : build and install, without reconfiguring Conrad.

Hi,
On Fri, Mar 15, 2013 at 8:14 AM, Andres Löh
No, please do not remove it. Running install without --only causes all sorts of things to happen, because install is the magic command. The --only flag is for use after you have already run build and really only does the installation, i.e. It behaves comparable to Setup install.
Yes, I see from the code what it does, it's just that I think that the
option is obscure and very rarely used. It's not shown in the --help
output, though, so I guess it's not a big problem.
On Fri, Mar 15, 2013 at 8:46 AM, Conrad Parker
Ah, maybe the help text is ambiguous; I interpreted that as saying it "only installs the package in the current directory [not in some other directory]".
Perhaps rename --only to --no-reconfigure or so?
I don't think this name is better. "cabal install" runs the solver and installs all dependencies, while "install --only" only copies the files (like "make install"/"runghc Setup.[l]hs install"). -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments

On Fri, 2013-03-15 at 12:47 +0100, Mikhail Glushenkov wrote:
Hi,
On Fri, Mar 15, 2013 at 8:14 AM, Andres Löh
wrote: No, please do not remove it. Running install without --only causes all sorts of things to happen, because install is the magic command. The --only flag is for use after you have already run build and really only does the installation, i.e. It behaves comparable to Setup install.
Yes, I see from the code what it does, it's just that I think that the option is obscure and very rarely used. It's not shown in the --help output, though, so I guess it's not a big problem.
As other people have pointed out it's rather useful. The reason it's there is because our UI is confused. It's a wart that needs fixing not by removing it, but by removing the need for it. When we had the old "runhaskell Setup {configure,build,install}" interface then it was clear that the commands acted only on the local package and only did one step of the process: you had to have done the other steps first. When we moved to cabal-install, we wanted automation and a "do everything" command. So the install command will configure, build and install. But there isn't a proper dependency mechanism and there isn't a proper tracking of configuration state. So install always reconfigures, loosing any configuration you did previously with cabal configure. So that means if you do: cabal {configure --blah,build,install} then you loose that --blah config. So because of that one does sometimes want a --only. It's hidden because it's not official UI. So what would a proper UI look like here? I think one should consider it in the new context of sandboxes, or more generally the idea that in future the cabal command line UI does not act on individual packages in isolation but on packages in the context of an environment containing a set of source packages. So when I'm in an environment and I say configure on a package, that should save semi-persistently the config settings I give (and do package dependency analysis, if necessary it should (re)configure the other source packages in the environment that this one depends on). The build and install commands should work in a make-like fashion in that they have to be able to discover/check which packages are up to date (including if they are configured already, and if we already had an up to date InstallPlan). So install --only is redundant because install will do the right thing if you've already configured and built. And that's of course the reason we still have --only, because we don't have a proper make-like system for checking if packages are already configured or built etc. Duncan

Hi Duncan,
On Fri, Mar 15, 2013 at 4:46 PM, Duncan Coutts
So what would a proper UI look like here? [...]
Thanks, this makes sense.
The build and install commands should work in a make-like fashion in that they have to be able to discover/check which packages are up to date (including if they are configured already, and if we already had an up to date InstallPlan).
This would be also very useful for 'sandbox add-source', as we currently have to reinstall all dependencies on each 'cabal build'. See also #1177. -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments

Hi, Mikhail Glushenkov wrote:
What is the purpose of the "install" command's "--only" flag? The documentation says "Only installs the package in the current directory", but this is already supported by running "cabal install" in the current directory without arguments.
Before installing the package in the current directory, "cabal install" resolves, downloads, builds and installs dependencies. So "cabal install" is not at all the same as "cabal install --only". Tillmann
participants (5)
-
Andres Löh
-
Conrad Parker
-
Duncan Coutts
-
Mikhail Glushenkov
-
Tillmann Rendel