Continue install after a failure

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Continue install after a failure

Petr Kmoch
Hi all,

when running the install step of a CMake-generated buildsystem (i.e. 'make install' or building the VS project INSTALL), the run terminates after the first failure (e.g. when it cannot find a file which is to be installed). Is there a way to globally change this behaviour so that the error is reported (perhaps as a warning), but the install step goes on?

Petr

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Continue install after a failure

Andreas Pakulat-2
Hi,

On Sat, Oct 20, 2012 at 11:39 AM, Petr Kmoch <[hidden email]> wrote:
> when running the install step of a CMake-generated buildsystem (i.e. 'make
> install' or building the VS project INSTALL), the run terminates after the
> first failure (e.g. when it cannot find a file which is to be installed). Is
> there a way to globally change this behaviour so that the error is reported
> (perhaps as a warning), but the install step goes on?

For Makefile Generator you can run make -k install, that way make
keeps on going even when errors occur. No idea about VS, NMake, Ninja
or XCode generators probably depends on wether the respective tool has
a switch for continuing if errors occur.

Andreas
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Continue install after a failure

Petr Kmoch
Hi Andreas,

thanks for your tip. Unfortunately, 'make -k install' doesn't help, as the entire install step is a single command (cmake -P ...), so once this fails, there is no other command make could continue with. Is there no way to do this natively in cmake?

I could (in theory) add OPTIONAL to all install() commands, but that has the problem of being absolutely silent when a file is not found, and I'd need at least a message or warning. Is cmake really all-or-nothing in this aspect, or does anyone know a feature I'm overlooking?

Thanks for any help.

Petr

On Sat, Oct 20, 2012 at 12:46 PM, Andreas Pakulat <[hidden email]> wrote:
Hi,

On Sat, Oct 20, 2012 at 11:39 AM, Petr Kmoch <[hidden email]> wrote:
> when running the install step of a CMake-generated buildsystem (i.e. 'make
> install' or building the VS project INSTALL), the run terminates after the
> first failure (e.g. when it cannot find a file which is to be installed). Is
> there a way to globally change this behaviour so that the error is reported
> (perhaps as a warning), but the install step goes on?

For Makefile Generator you can run make -k install, that way make
keeps on going even when errors occur. No idea about VS, NMake, Ninja
or XCode generators probably depends on wether the respective tool has
a switch for continuing if errors occur.

Andreas


--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Continue install after a failure

David Cole
On Mon, Oct 22, 2012 at 3:22 AM, Petr Kmoch <[hidden email]> wrote:

> Hi Andreas,
>
> thanks for your tip. Unfortunately, 'make -k install' doesn't help, as the
> entire install step is a single command (cmake -P ...), so once this fails,
> there is no other command make could continue with. Is there no way to do
> this natively in cmake?
>
> I could (in theory) add OPTIONAL to all install() commands, but that has the
> problem of being absolutely silent when a file is not found, and I'd need at
> least a message or warning. Is cmake really all-or-nothing in this aspect,
> or does anyone know a feature I'm overlooking?
>
> Thanks for any help.
>
> Petr
>
>
> On Sat, Oct 20, 2012 at 12:46 PM, Andreas Pakulat <[hidden email]> wrote:
>>
>> Hi,
>>
>> On Sat, Oct 20, 2012 at 11:39 AM, Petr Kmoch <[hidden email]> wrote:
>> > when running the install step of a CMake-generated buildsystem (i.e.
>> > 'make
>> > install' or building the VS project INSTALL), the run terminates after
>> > the
>> > first failure (e.g. when it cannot find a file which is to be
>> > installed). Is
>> > there a way to globally change this behaviour so that the error is
>> > reported
>> > (perhaps as a warning), but the install step goes on?
>>
>> For Makefile Generator you can run make -k install, that way make
>> keeps on going even when errors occur. No idea about VS, NMake, Ninja
>> or XCode generators probably depends on wether the respective tool has
>> a switch for continuing if errors occur.
>>
>> Andreas
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


CMake is all-or-nothing with respect to an install tree. If the cmake
install script hits a "FATAL_ERROR" message then it stops and will not
continue beyond that point...

The best way to "Continue install after a failure" is to eliminate the
failure, and try again.


HTH,
David
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Continue install after a failure

Petr Kmoch
On Mon, Oct 22, 2012 at 4:58 PM, David Cole <[hidden email]> wrote:
On Mon, Oct 22, 2012 at 3:22 AM, Petr Kmoch <[hidden email]> wrote:
> Hi Andreas,
>
> thanks for your tip. Unfortunately, 'make -k install' doesn't help, as the
> entire install step is a single command (cmake -P ...), so once this fails,
> there is no other command make could continue with. Is there no way to do
> this natively in cmake?
>
> I could (in theory) add OPTIONAL to all install() commands, but that has the
> problem of being absolutely silent when a file is not found, and I'd need at
> least a message or warning. Is cmake really all-or-nothing in this aspect,
> or does anyone know a feature I'm overlooking?
>
> Thanks for any help.
>
> Petr
>
>
> On Sat, Oct 20, 2012 at 12:46 PM, Andreas Pakulat <[hidden email]> wrote:
>>
>> Hi,
>>
>> On Sat, Oct 20, 2012 at 11:39 AM, Petr Kmoch <[hidden email]> wrote:
>> > when running the install step of a CMake-generated buildsystem (i.e.
>> > 'make
>> > install' or building the VS project INSTALL), the run terminates after
>> > the
>> > first failure (e.g. when it cannot find a file which is to be
>> > installed). Is
>> > there a way to globally change this behaviour so that the error is
>> > reported
>> > (perhaps as a warning), but the install step goes on?
>>
>> For Makefile Generator you can run make -k install, that way make
>> keeps on going even when errors occur. No idea about VS, NMake, Ninja
>> or XCode generators probably depends on wether the respective tool has
>> a switch for continuing if errors occur.
>>
>> Andreas
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


CMake is all-or-nothing with respect to an install tree. If the cmake
install script hits a "FATAL_ERROR" message then it stops and will not
continue beyond that point...

The best way to "Continue install after a failure" is to eliminate the
failure, and try again.

Would you accept a patch giving control over this behaviour? Something like a boolean variable CMAKE_INSTALL_STOP_ON_ERROR (the default being TRUE, of course).

Petr

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Continue install after a failure

David Cole
On Tue, Oct 23, 2012 at 2:53 AM, Petr Kmoch <[hidden email]> wrote:

> On Mon, Oct 22, 2012 at 4:58 PM, David Cole <[hidden email]> wrote:
>>
>> On Mon, Oct 22, 2012 at 3:22 AM, Petr Kmoch <[hidden email]> wrote:
>> > Hi Andreas,
>> >
>> > thanks for your tip. Unfortunately, 'make -k install' doesn't help, as
>> > the
>> > entire install step is a single command (cmake -P ...), so once this
>> > fails,
>> > there is no other command make could continue with. Is there no way to
>> > do
>> > this natively in cmake?
>> >
>> > I could (in theory) add OPTIONAL to all install() commands, but that has
>> > the
>> > problem of being absolutely silent when a file is not found, and I'd
>> > need at
>> > least a message or warning. Is cmake really all-or-nothing in this
>> > aspect,
>> > or does anyone know a feature I'm overlooking?
>> >
>> > Thanks for any help.
>> >
>> > Petr
>> >
>> >
>> > On Sat, Oct 20, 2012 at 12:46 PM, Andreas Pakulat <[hidden email]> wrote:
>> >>
>> >> Hi,
>> >>
>> >> On Sat, Oct 20, 2012 at 11:39 AM, Petr Kmoch <[hidden email]>
>> >> wrote:
>> >> > when running the install step of a CMake-generated buildsystem (i.e.
>> >> > 'make
>> >> > install' or building the VS project INSTALL), the run terminates
>> >> > after
>> >> > the
>> >> > first failure (e.g. when it cannot find a file which is to be
>> >> > installed). Is
>> >> > there a way to globally change this behaviour so that the error is
>> >> > reported
>> >> > (perhaps as a warning), but the install step goes on?
>> >>
>> >> For Makefile Generator you can run make -k install, that way make
>> >> keeps on going even when errors occur. No idea about VS, NMake, Ninja
>> >> or XCode generators probably depends on wether the respective tool has
>> >> a switch for continuing if errors occur.
>> >>
>> >> Andreas
>> >
>> >
>> >
>> > --
>> >
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the CMake FAQ at:
>> > http://www.cmake.org/Wiki/CMake_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.cmake.org/mailman/listinfo/cmake
>>
>>
>> CMake is all-or-nothing with respect to an install tree. If the cmake
>> install script hits a "FATAL_ERROR" message then it stops and will not
>> continue beyond that point...
>>
>> The best way to "Continue install after a failure" is to eliminate the
>> failure, and try again.
>
>
> Would you accept a patch giving control over this behaviour? Something like
> a boolean variable CMAKE_INSTALL_STOP_ON_ERROR (the default being TRUE, of
> course).
>
> Petr

Why is patching CMake easier than fixing your project? And how long
are you going to let your own project's install tree be broken before
you do fix it?

I don't like the idea of a half-installed (or any fraction less than
1.0) bit of software...

Perhaps others will chime in and we can get a sense of how folks weigh
in on this issue.

I will consider any patch that is offered for consideration... but
I'll be honest: I'd never use this feature myself.


David
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Continue install after a failure

Eric Noulard
2012/10/23 David Cole <[hidden email]>:

> On Tue, Oct 23, 2012 at 2:53 AM, Petr Kmoch <[hidden email]> wrote:
>> On Mon, Oct 22, 2012 at 4:58 PM, David Cole <[hidden email]> wrote:
>>>
>>> On Mon, Oct 22, 2012 at 3:22 AM, Petr Kmoch <[hidden email]> wrote:
>>> > Hi Andreas,
>>> >
>>> > thanks for your tip. Unfortunately, 'make -k install' doesn't help, as
>>> > the
>>> > entire install step is a single command (cmake -P ...), so once this
>>> > fails,
>>> > there is no other command make could continue with. Is there no way to
>>> > do
>>> > this natively in cmake?
>>> >
>>> > I could (in theory) add OPTIONAL to all install() commands, but that has
>>> > the
>>> > problem of being absolutely silent when a file is not found, and I'd
>>> > need at
>>> > least a message or warning. Is cmake really all-or-nothing in this
>>> > aspect,
>>> > or does anyone know a feature I'm overlooking?
>>> >
>>> > Thanks for any help.
>>> >
>>> > Petr
>>> >
>>> >
>>> > On Sat, Oct 20, 2012 at 12:46 PM, Andreas Pakulat <[hidden email]> wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> On Sat, Oct 20, 2012 at 11:39 AM, Petr Kmoch <[hidden email]>
>>> >> wrote:
>>> >> > when running the install step of a CMake-generated buildsystem (i.e.
>>> >> > 'make
>>> >> > install' or building the VS project INSTALL), the run terminates
>>> >> > after
>>> >> > the
>>> >> > first failure (e.g. when it cannot find a file which is to be
>>> >> > installed). Is
>>> >> > there a way to globally change this behaviour so that the error is
>>> >> > reported
>>> >> > (perhaps as a warning), but the install step goes on?
>>> >>
>>> >> For Makefile Generator you can run make -k install, that way make
>>> >> keeps on going even when errors occur. No idea about VS, NMake, Ninja
>>> >> or XCode generators probably depends on wether the respective tool has
>>> >> a switch for continuing if errors occur.
>>> >>
>>> >> Andreas
>>> >
>>> >
>>> >
>>> > --
>>> >
>>> > Powered by www.kitware.com
>>> >
>>> > Visit other Kitware open-source projects at
>>> > http://www.kitware.com/opensource/opensource.html
>>> >
>>> > Please keep messages on-topic and check the CMake FAQ at:
>>> > http://www.cmake.org/Wiki/CMake_FAQ
>>> >
>>> > Follow this link to subscribe/unsubscribe:
>>> > http://www.cmake.org/mailman/listinfo/cmake
>>>
>>>
>>> CMake is all-or-nothing with respect to an install tree. If the cmake
>>> install script hits a "FATAL_ERROR" message then it stops and will not
>>> continue beyond that point...
>>>
>>> The best way to "Continue install after a failure" is to eliminate the
>>> failure, and try again.
>>
>>
>> Would you accept a patch giving control over this behaviour? Something like
>> a boolean variable CMAKE_INSTALL_STOP_ON_ERROR (the default being TRUE, of
>> course).
>>
>> Petr
>
> Why is patching CMake easier than fixing your project? And how long
> are you going to let your own project's install tree be broken before
> you do fix it?
>
> I don't like the idea of a half-installed (or any fraction less than
> 1.0) bit of software...

Me neither.

>
> Perhaps others will chime in and we can get a sense of how folks weigh
> in on this issue.

My personal opinion is that may be the only feature I'd like would be a
"real fake install" i.e. 0% installed not a possibly random X percent
installed with random leftover.

it could be callable like:
make fake-install or check-install or ... set(CMAKE_FAKE_INSTALL 1) or ...

which would check whether all need-to be installed bits are accessibles.
This would basically put the file(INSTALL ...) sub-command in a mode
that would only check access and print-out some informations message
without moving, copying or renaming any files or directory.

e.g:

-- Would be Up-to-date: .../share/aclocal/cmake.m4
-- Would be Installing: ..../doc/cmake-2.8/cpack.html

instead of
-- Up-to-date: .../share/aclocal/cmake.m4
-- Installing: .../doc/cmake-2.8/cpack.html

That said I did live without that feature until now so I bet I can
live without it forever :-]

--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Continue install after a failure

Petr Kmoch
On Tue, Oct 23, 2012 at 1:07 PM, Eric Noulard <[hidden email]> wrote:
2012/10/23 David Cole <[hidden email]>:
> On Tue, Oct 23, 2012 at 2:53 AM, Petr Kmoch <[hidden email]> wrote:
>> On Mon, Oct 22, 2012 at 4:58 PM, David Cole <[hidden email]> wrote:
>>>
>>> On Mon, Oct 22, 2012 at 3:22 AM, Petr Kmoch <[hidden email]> wrote:
>>> > Hi Andreas,
>>> >
>>> > thanks for your tip. Unfortunately, 'make -k install' doesn't help, as
>>> > the
>>> > entire install step is a single command (cmake -P ...), so once this
>>> > fails,
>>> > there is no other command make could continue with. Is there no way to
>>> > do
>>> > this natively in cmake?
>>> >
>>> > I could (in theory) add OPTIONAL to all install() commands, but that has
>>> > the
>>> > problem of being absolutely silent when a file is not found, and I'd
>>> > need at
>>> > least a message or warning. Is cmake really all-or-nothing in this
>>> > aspect,
>>> > or does anyone know a feature I'm overlooking?
>>> >
>>> > Thanks for any help.
>>> >
>>> > Petr
>>> >
>>> >
>>> > On Sat, Oct 20, 2012 at 12:46 PM, Andreas Pakulat <[hidden email]> wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> On Sat, Oct 20, 2012 at 11:39 AM, Petr Kmoch <[hidden email]>
>>> >> wrote:
>>> >> > when running the install step of a CMake-generated buildsystem (i.e.
>>> >> > 'make
>>> >> > install' or building the VS project INSTALL), the run terminates
>>> >> > after
>>> >> > the
>>> >> > first failure (e.g. when it cannot find a file which is to be
>>> >> > installed). Is
>>> >> > there a way to globally change this behaviour so that the error is
>>> >> > reported
>>> >> > (perhaps as a warning), but the install step goes on?
>>> >>
>>> >> For Makefile Generator you can run make -k install, that way make
>>> >> keeps on going even when errors occur. No idea about VS, NMake, Ninja
>>> >> or XCode generators probably depends on wether the respective tool has
>>> >> a switch for continuing if errors occur.
>>> >>
>>> >> Andreas
>>> >
>>> >
>>> >
>>> > --
>>> >
>>> > Powered by www.kitware.com
>>> >
>>> > Visit other Kitware open-source projects at
>>> > http://www.kitware.com/opensource/opensource.html
>>> >
>>> > Please keep messages on-topic and check the CMake FAQ at:
>>> > http://www.cmake.org/Wiki/CMake_FAQ
>>> >
>>> > Follow this link to subscribe/unsubscribe:
>>> > http://www.cmake.org/mailman/listinfo/cmake
>>>
>>>
>>> CMake is all-or-nothing with respect to an install tree. If the cmake
>>> install script hits a "FATAL_ERROR" message then it stops and will not
>>> continue beyond that point...
>>>
>>> The best way to "Continue install after a failure" is to eliminate the
>>> failure, and try again.
>>
>>
>> Would you accept a patch giving control over this behaviour? Something like
>> a boolean variable CMAKE_INSTALL_STOP_ON_ERROR (the default being TRUE, of
>> course).
>>
>> Petr
>
> Why is patching CMake easier than fixing your project? And how long
> are you going to let your own project's install tree be broken before
> you do fix it?
>
> I don't like the idea of a half-installed (or any fraction less than
> 1.0) bit of software...

Me neither.

>
> Perhaps others will chime in and we can get a sense of how folks weigh
> in on this issue.

My personal opinion is that may be the only feature I'd like would be a
"real fake install" i.e. 0% installed not a possibly random X percent
installed with random leftover.

it could be callable like:
make fake-install or check-install or ... set(CMAKE_FAKE_INSTALL 1) or ...

which would check whether all need-to be installed bits are accessibles.
This would basically put the file(INSTALL ...) sub-command in a mode
that would only check access and print-out some informations message
without moving, copying or renaming any files or directory.

e.g:

-- Would be Up-to-date: .../share/aclocal/cmake.m4
-- Would be Installing: ..../doc/cmake-2.8/cpack.html

instead of
-- Up-to-date: .../share/aclocal/cmake.m4
-- Installing: .../doc/cmake-2.8/cpack.html

That said I did live without that feature until now so I bet I can
live without it forever :-]


We're using the install step of CMake to prepare the "installation source" in a location where it's then picked up by a 3rd party install-shield generator. And we're currently doing major re-structuring of the entire installation (involving several big cooperating products), which must work on several sites with different 3rd party installation paths etc. Only being able to fix one error per install run is extremely frustrating.

Eric's suggestion of a "fake install" would solve our case, of course.

I understand it's far from a typical use case, but AFAIK, all software development tools are moving away from "bail out on first error" to trying to report as many as possible (and still failing at the end, if applicable).

Petr

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake