Re: cabal install --only

2013-03-15 Thread 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.

Cheers,
Andres
___
cabal-devel mailing list
cabal-devel@haskell.org
http://www.haskell.org/mailman/listinfo/cabal-devel


Re: cabal install --only

2013-03-15 Thread Conrad Parker
On 15 March 2013 15:14, Andres Löh and...@well-typed.com wrote:
 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.

___
cabal-devel mailing list
cabal-devel@haskell.org
http://www.haskell.org/mailman/listinfo/cabal-devel


Re: cabal install --only

2013-03-15 Thread Mikhail Glushenkov
Hi,

On Fri, Mar 15, 2013 at 8:14 AM, Andres Löh and...@well-typed.com 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.

On Fri, Mar 15, 2013 at 8:46 AM, Conrad Parker con...@metadecks.org wrote:

 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

___
cabal-devel mailing list
cabal-devel@haskell.org
http://www.haskell.org/mailman/listinfo/cabal-devel


Re: cabal install --only

2013-03-15 Thread Tillmann Rendel

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

___
cabal-devel mailing list
cabal-devel@haskell.org
http://www.haskell.org/mailman/listinfo/cabal-devel


Re: cabal install --only

2013-03-15 Thread Duncan Coutts
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 and...@well-typed.com 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


___
cabal-devel mailing list
cabal-devel@haskell.org
http://www.haskell.org/mailman/listinfo/cabal-devel


Re: cabal install --only

2013-03-15 Thread Mikhail Glushenkov
Hi Duncan,

On Fri, Mar 15, 2013 at 4:46 PM, Duncan Coutts
duncan.cou...@googlemail.com wrote:

 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

___
cabal-devel mailing list
cabal-devel@haskell.org
http://www.haskell.org/mailman/listinfo/cabal-devel