[jira] Created: (SOLR-765) ant example fails if example/work directory doesn't exist

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

[jira] Created: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
ant example fails if example/work directory doesn't exist
---------------------------------------------------------

                 Key: SOLR-765
                 URL: https://issues.apache.org/jira/browse/SOLR-765
             Project: Solr
          Issue Type: Bug
    Affects Versions: 1.3
            Reporter: Lars Kotthoff
            Priority: Minor


Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Kotthoff updated SOLR-765:
-------------------------------

    Attachment: SOLR-755.patch

Patch adding 'failonerror="false"' to the delete in the example ant task.

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-755.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Kotthoff updated SOLR-765:
-------------------------------

    Attachment:     (was: SOLR-755.patch)

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Kotthoff updated SOLR-765:
-------------------------------

    Attachment: SOLR-765.patch

I promise to clean up my solr-patch-mess and not attach the wrong patch again.

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629958#action_12629958 ]

Hoss Man commented on SOLR-765:
-------------------------------

why don't you have an example/work directory?

it's actually committed to svn as an empty directory, and explicitly included as an empty directory in the releases.

(i'm completely surprised that the example works at all if you've manually deleted the work directory)

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630134#action_12630134 ]

Lars Kotthoff commented on SOLR-765:
------------------------------------

bq. why don't you have an example/work directory?

Actually, I have no idea. I was working with an old checkout (which I updated first), ran "ant example", and it failed.

Is there any reason why the empty directories are checked in to SVN instead of taking care of that in the build.xml? I think this makes it easier to mess things up yourself without realising it, e.g. by deleting the work directory manually to make sure that you've got a "fresh" start. Same thing for the example/logs directory which is required to run Jetty.

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man resolved SOLR-765.
---------------------------

    Resolution: Invalid

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630832#action_12630832 ]

Hoss Man commented on SOLR-765:
-------------------------------

bq. Actually, I have no idea. I was working with an old checkout (which I updated first), ran "ant example", and it failed.

that's really weird .. even if you manually deleted it svn update should have recreated it.

bq. Is there any reason why the empty directories are checked in to SVN instead of taking care of that in the build.xml

well, one reason is that it makes it easier to see what's going on when browsing the repository (without actually needing to run ant) ... but it's not like we've ever had any serious discussion about it on solr-dev or anything ... it's just the way things worked out.

if you're working with svn and you want to make sure you have a "fresh start" use "svn revert -R" and "ant clean"

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630858#action_12630858 ]

Lars Kotthoff commented on SOLR-765:
------------------------------------

bq. if you're working with svn and you want to make sure you have a "fresh start" use "svn revert -R" and "ant clean"

Ok, but that doesn't solve the problem if you're not using a checkout. I just think that it's not particularly good pratice to assume the existence of directories and fail if they don't when it's perfectly possible to check for the existence and create them/ignore errors in the build script.

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631868#action_12631868 ]

Otis Gospodnetic commented on SOLR-765:
---------------------------------------

Is there any harm in doing what Lars is suggesting?  If no, why not commit?  I can imagine removing a dir locally for whatever reason and regardless of whether I'm working with a svn checkout or downloaded dist.


> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631870#action_12631870 ]

Hoss Man commented on SOLR-765:
-------------------------------


Directories either need to be owned by svn or not -- you don't want a hybrid approach. if you have a directory owned by svn but you also have the build scripts recreate that directory as needed, you can get into really screwy situations because of the inconsistency between a directory existing as SVN expects, but the metadata for that dir is missing...

{noformat}
chrish@asimov:~/lucene/solr$ rm -r example/work/
rm: remove write-protected regular file `example/work//.svn/dir-prop-base'? y
rm: remove write-protected regular file `example/work//.svn/entries'? y
rm: remove write-protected regular file `example/work//.svn/format'? y
rm: remove write-protected regular file `example/work//.svn/all-wcprops'? y
chrish@asimov:~/lucene/solr$ mkdir example/work
chrish@asimov:~/lucene/solr$ svn status
~      example/work
chrish@asimov:~/lucene/solr$ svn update
svn: Directory 'example/work/.svn' containing working copy admin area is missing
chrish@asimov:~/lucene/solr$ svn revert -R .
svn: Try 'svn revert --recursive' instead?
svn: Directory 'example/work/.svn' containing working copy admin area is missing
chrish@asimov:~/lucene/solr$ svn status
~      example/work
{noformat}

This is one reason why a few years back i argued against even having "example" committed into svn at all -- i would have preferred a "src/example" and have the build system create all the directories it needed under "build/example" and copy files as appropriate ... but i don't really think it's worth completely revamping now.

The nice thing about how we have things now (empty dirs committed) is that if people don't like ant and want to setup their own "project configs' in their favorite editors the "example" directory as it comes (without the solr.war) is a complete environment -- you don't have to do anything but run "java -jar start.jar" and jetty will run, and you can add the war however you want (ie: build by your IDE)

We can't project people from themselves ... even if we recreate the empty directories on the fly (in a way that doesn't burn people using svn), we can't recreate things like example/etc or example/lib if people inadvertently delete those.


> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631918#action_12631918 ]

Lars Kotthoff commented on SOLR-765:
------------------------------------

The current patch just adds failonerror="false", which won't do any harm, as it's not creating anything. Creating a directory would only be required when the example/log/ directory has been deleted (as this is required by Jetty). The other option is to simply put the logfiles somewhere else if the directory is missing. However, IMHO this should be part of a separate issue if we decided that this needs to be handled more robustly as well though.

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633436#action_12633436 ]

Hoss Man commented on SOLR-765:
-------------------------------


1) my previous comment was in regards to your "possible to check for the existence and create them/ignore errors in the build script" statement

2) regarding the patch: it can do harm.  I could have sworn i posted a comment about this before resolving but clearly i forgot to hit submit or something...

The purpose cleaning out the work directory is to provide a safety check to ensure that an older copy of the webapp (with old jars) isn't left lying around where Jetty might pick it up and use it by mistake -- it's not suppose to happen but it can.  If we use failonerror="false" it won't just silently ignore a missing work directly, it will also silently ignore any situation where files in the work directory can't be deleted by ant (because of the way the perms are set, or because windows prevents open files from being deleted, etc..) which means the whole point (the safety check) is gone --  people will unwittingly be using old jars and banging their heads against their keyboards not knowing why

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-765) ant example fails if example/work directory doesn't exist

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Kotthoff updated SOLR-765:
-------------------------------

    Attachment: SOLR-765.patch

Right, fair enough. I'm attaching a new patch which calls <mkdir> on example/work and example/log. If the directories exist, nothing happens. If for some reason they've been lost, they are created.

> ant example fails if example/work directory doesn't exist
> ---------------------------------------------------------
>
>                 Key: SOLR-765
>                 URL: https://issues.apache.org/jira/browse/SOLR-765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: SOLR-765.patch, SOLR-765.patch
>
>
> Running "ant example" when there's no example/work directory causes the build to fail because the task tries to delete the (non-existent) directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.