You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/07/23 15:24:19 UTC

[1/9] git commit: refs/heads/master - Fix DECREF name clash

Repository: lucy
Updated Branches:
  refs/heads/master ac8f8ecae -> b6ccb300b


Fix DECREF name clash

MinGW's winnt.h also defines DECREF.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/479c2778
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/479c2778
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/479c2778

Branch: refs/heads/master
Commit: 479c2778add617cc7d1f90b6fd10f3e7c44d470c
Parents: ac8f8ec
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 21 21:46:11 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 21 21:46:11 2014 +0200

----------------------------------------------------------------------
 core/Lucy/Store/FSDirHandle.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/479c2778/core/Lucy/Store/FSDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSDirHandle.c b/core/Lucy/Store/FSDirHandle.c
index f17ea15..f231471 100644
--- a/core/Lucy/Store/FSDirHandle.c
+++ b/core/Lucy/Store/FSDirHandle.c
@@ -179,7 +179,7 @@ FSDH_Next_IMP(FSDirHandle *self) {
     }
     else if ((FindNextFile(dirhandle, find_data) == 0)) {
         // Iterator exhausted.  Verify that no errors were encountered.
-        DECREF(ivars->entry);
+        CFISH_DECREF(ivars->entry);
         ivars->entry = NULL;
         if (GetLastError() != ERROR_NO_MORE_FILES) {
             char *win_error = Err_win_error();
@@ -197,7 +197,7 @@ FSDH_Next_IMP(FSDirHandle *self) {
         return FSDH_Next(self);
     }
     else {
-        DECREF(ivars->entry);
+        CFISH_DECREF(ivars->entry);
         ivars->entry = Str_new_from_utf8(find_data->cFileName, len);
         return true;
     }


[8/9] git commit: refs/heads/master - Regen charmonizer for robust removal on Win.

Posted by nw...@apache.org.
Regen charmonizer for robust removal on Win.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/8b9f18ec
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/8b9f18ec
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/8b9f18ec

Branch: refs/heads/master
Commit: 8b9f18ecd61d632569b93445e39c0dc046e41127
Parents: 538654e
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jul 22 15:52:51 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Tue Jul 22 15:52:51 2014 -0700

----------------------------------------------------------------------
 common/charmonizer.c | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/8b9f18ec/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/common/charmonizer.c b/common/charmonizer.c
index 3318d79..e811bc1 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -4458,6 +4458,7 @@ chaz_Make_list_files(const char *dir, const char *ext,
 #include <string.h>
 #include <stdarg.h>
 #include <ctype.h>
+#include <time.h>
 
 /* #include "Charmonizer/Core/Compiler.h" */
 /* #include "Charmonizer/Core/Util.h" */
@@ -4584,13 +4585,15 @@ chaz_OS_remove(const char *name) {
      * fail. As a workaround, files are renamed to a random name
      * before deletion.
      */
-    int retval;
+    int retval = 0;
 
     static const size_t num_random_chars = 16;
 
     size_t  name_len = strlen(name);
     size_t  i;
     char   *temp_name = (char*)malloc(name_len + num_random_chars + 1);
+    const char *working_name = name;
+    clock_t start, now;
 
     strcpy(temp_name, name);
     for (i = 0; i < num_random_chars; i++) {
@@ -4598,12 +4601,30 @@ chaz_OS_remove(const char *name) {
     }
     temp_name[name_len+num_random_chars] = '\0';
 
-    if (rename(name, temp_name) == 0) {
-        retval = !remove(temp_name);
+    /* Try over and over again for around 1 second to rename the file.
+     * Ideally we would sleep between attempts, but sleep functionality is not
+     * portable. */
+    start = now = clock();
+    while (now - start < CLOCKS_PER_SEC) {
+        now = clock();
+        if (!rename(name, temp_name)) {
+            /* The rename succeeded. */
+            working_name = temp_name;
+            break;
+        }
+        else if (errno == ENOENT) {
+            /* No such file or directory, so no point in trying to remove it.
+             * (Technically ENOENT is POSIX but hopefully this works.) */
+            free(temp_name);
+            return 0;
+        }
     }
-    else {
-        // Error during rename, remove using old name.
-        retval = !remove(name);
+
+    /* Try over and over again for around 1 second to delete the file. */
+    start = now = clock();
+    while (!retval && now - start < CLOCKS_PER_SEC) {
+        now = clock();
+        retval = !remove(working_name);
     }
 
     free(temp_name);


[2/9] git commit: refs/heads/master - Regenerate charmonizer.c for MinGW

Posted by nw...@apache.org.
Regenerate charmonizer.c for MinGW


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/3c9015bf
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/3c9015bf
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/3c9015bf

Branch: refs/heads/master
Commit: 3c9015bf6cadd0986a23c91c50752fd1b223d24b
Parents: 479c277
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 21 22:34:48 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 21 22:34:48 2014 +0200

----------------------------------------------------------------------
 common/charmonizer.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/3c9015bf/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/common/charmonizer.c b/common/charmonizer.c
index 683dfe0..3318d79 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -6887,7 +6887,19 @@ chaz_SymbolVisibility_run(void) {
         if (chaz_CC_test_compile(code_buf)) {
             can_control_visibility = true;
             chaz_ConfWriter_add_def("EXPORT", export_win);
-            chaz_ConfWriter_add_def("IMPORT", "__declspec(dllimport)");
+            if (chaz_CC_gcc_version_num()) {
+                /*
+                 * Under MinGW, symbols with dllimport storage class aren't
+                 * constant. If a global variable is initialized to such a
+                 * symbol, an "initializer element is not constant" error
+                 * results. Omitting dllimport works, but has a small
+                 * performance penalty.
+                 */
+                chaz_ConfWriter_add_def("IMPORT", NULL);
+            }
+            else {
+                chaz_ConfWriter_add_def("IMPORT", "__declspec(dllimport)");
+            }
         }
     }
 


[3/9] git commit: refs/heads/master - Update .gitignore for MinGW

Posted by nw...@apache.org.
Update .gitignore for MinGW


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/7ac897cc
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/7ac897cc
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/7ac897cc

Branch: refs/heads/master
Commit: 7ac897cc335aa9d3e9e7df835ca233ae49c5b577
Parents: 3c9015b
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 21 22:45:44 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 21 22:45:44 2014 +0200

----------------------------------------------------------------------
 c/.gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/7ac897cc/c/.gitignore
----------------------------------------------------------------------
diff --git a/c/.gitignore b/c/.gitignore
index 6fc6f3f..bc7ef84 100644
--- a/c/.gitignore
+++ b/c/.gitignore
@@ -3,6 +3,7 @@
 /charmonizer
 /charmonizer.exe
 /charmony.h
+/liblucy-*.dll
 /liblucy.*.dylib
 /liblucy.dylib
 /liblucy.so


[6/9] git commit: refs/heads/master - Add missing chy_ prefix

Posted by nw...@apache.org.
Add missing chy_ prefix

Fixes Cygwin build.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/cfdefaf8
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/cfdefaf8
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/cfdefaf8

Branch: refs/heads/master
Commit: cfdefaf81be28806d4d9fc635ca4d362f91e737a
Parents: 3b1945e
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Jul 22 20:50:47 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Jul 22 20:50:47 2014 +0200

----------------------------------------------------------------------
 core/Lucy/Store/FSFileHandle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/cfdefaf8/core/Lucy/Store/FSFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSFileHandle.c b/core/Lucy/Store/FSFileHandle.c
index 74f5ffc..17b6a07 100644
--- a/core/Lucy/Store/FSFileHandle.c
+++ b/core/Lucy/Store/FSFileHandle.c
@@ -421,7 +421,7 @@ FSFH_Read_IMP(FSFileHandle *self, char *dest, int64_t offset, size_t len) {
     }
 
     // Read.
-    check_val = pread64(ivars->fd, dest, len, offset);
+    check_val = chy_pread64(ivars->fd, dest, len, offset);
     if (check_val != (int64_t)len) {
         if (check_val == -1) {
             Err_set_error(Err_new(Str_newf("Tried to read %u64 bytes, got %i64: %s",


[7/9] git commit: refs/heads/master - Update .gitignore for Cygwin

Posted by nw...@apache.org.
Update .gitignore for Cygwin


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/538654ed
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/538654ed
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/538654ed

Branch: refs/heads/master
Commit: 538654edda153481650233d78473b3f9cb7d584c
Parents: cfdefaf
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Jul 22 20:57:50 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Jul 22 20:57:50 2014 +0200

----------------------------------------------------------------------
 c/.gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/538654ed/c/.gitignore
----------------------------------------------------------------------
diff --git a/c/.gitignore b/c/.gitignore
index bc7ef84..7873433 100644
--- a/c/.gitignore
+++ b/c/.gitignore
@@ -3,6 +3,7 @@
 /charmonizer
 /charmonizer.exe
 /charmony.h
+/cyglucy-*.dll
 /liblucy-*.dll
 /liblucy.*.dylib
 /liblucy.dylib


[9/9] git commit: refs/heads/master - Replace dicey POD with comments.

Posted by nw...@apache.org.
Replace dicey POD with comments.

The pod-checker test didn't like the existing source, so use ordinary line
comments to disable code instead.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/b6ccb300
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/b6ccb300
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/b6ccb300

Branch: refs/heads/master
Commit: b6ccb300b071e73181e7d07f792e1c5a63e9ddd7
Parents: 8b9f18e
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Jul 23 03:28:12 2014 +0000
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Jul 23 03:28:12 2014 +0000

----------------------------------------------------------------------
 perl/lib/LucyX/Remote/SearchClient.pm | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/b6ccb300/perl/lib/LucyX/Remote/SearchClient.pm
----------------------------------------------------------------------
diff --git a/perl/lib/LucyX/Remote/SearchClient.pm b/perl/lib/LucyX/Remote/SearchClient.pm
index c71fbc7..5f79df0 100644
--- a/perl/lib/LucyX/Remote/SearchClient.pm
+++ b/perl/lib/LucyX/Remote/SearchClient.pm
@@ -73,11 +73,9 @@ sub _rpc {
     my $packed_len = pack( 'N', length($serialized) );
     print $sock "$packed_len$serialized" or confess $!;
 
-=begin disabled
-    my $check_val = $sock->syswrite("$packed_len$serialized");
-    confess $! if $check_val != length($serialized) + 4;
-
-=cut
+    # disabled
+    #my $check_val = $sock->syswrite("$packed_len$serialized");
+    #confess $! if $check_val != length($serialized) + 4;
 
     my $check_val;
 


[4/9] git commit: refs/heads/master - Fix intermittent test-only sort order bug.

Posted by nw...@apache.org.
Fix intermittent test-only sort order bug.

Lucy breaks ties by doc_id, but the test did not.  The bug only manifested
once every few hundred iterations because the collisions between scores
occurred rarely.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/6ea4ea2c
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/6ea4ea2c
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/6ea4ea2c

Branch: refs/heads/master
Commit: 6ea4ea2c483ac41c7c62a3fda979f3393a8355ba
Parents: 7ac897c
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jul 22 00:50:05 2014 +0000
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Tue Jul 22 00:50:05 2014 +0000

----------------------------------------------------------------------
 perl/t/505-hit_queue.t | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/6ea4ea2c/perl/t/505-hit_queue.t
----------------------------------------------------------------------
diff --git a/perl/t/505-hit_queue.t b/perl/t/505-hit_queue.t
index ed4d7a9..002a749 100644
--- a/perl/t/505-hit_queue.t
+++ b/perl/t/505-hit_queue.t
@@ -187,8 +187,9 @@ is_deeply( \@got, \@wanted, "sort by value when no reader set" );
 for ( 1 .. 30 ) {
     push @docs_and_scores, [ int( rand(10000) ) + 1, rand(10) ];
 }
-@docs_and_scores = sort { $b->[1] <=> $a->[1] } @docs_and_scores;
-@doc_ids         = map  { $_->[0] } @docs_and_scores;
+@docs_and_scores
+  = sort { $b->[1] <=> $a->[1] || $a->[0] <=> $b->[0] } @docs_and_scores;
+@doc_ids = map  { $_->[0] } @docs_and_scores;
 
 @match_docs = map {
     Lucy::Search::MatchDoc->new(


[5/9] git commit: refs/heads/master - Increase randomness of HitQueue test.

Posted by nw...@apache.org.
Increase randomness of HitQueue test.

Insert docs into HitQueue in random order to stress the heap sort, even
though they will be inserted in doc_id order in current Lucy.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/3b1945e0
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/3b1945e0
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/3b1945e0

Branch: refs/heads/master
Commit: 3b1945e02031116de2d4cebdc6fa67ef2f0aaa59
Parents: 6ea4ea2
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jul 22 00:58:29 2014 +0000
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Tue Jul 22 00:58:29 2014 +0000

----------------------------------------------------------------------
 perl/t/505-hit_queue.t | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/3b1945e0/perl/t/505-hit_queue.t
----------------------------------------------------------------------
diff --git a/perl/t/505-hit_queue.t b/perl/t/505-hit_queue.t
index 002a749..31acaa7 100644
--- a/perl/t/505-hit_queue.t
+++ b/perl/t/505-hit_queue.t
@@ -36,7 +36,7 @@ my @match_docs = map {
         doc_id => $_->[0],
         score  => $_->[1],
         )
-} @docs_and_scores;
+} shuffle(@docs_and_scores);
 
 my @correct_order = sort {
            $b->get_score <=> $a->get_score
@@ -196,7 +196,7 @@ for ( 1 .. 30 ) {
         doc_id => $_->[0],
         score  => $_->[1],
         )
-} sort { $a->[0] <=> $b->[0] } @docs_and_scores;
+} shuffle(@docs_and_scores);
 
 for my $size ( 0 .. $#match_docs ) {
     $hit_q = Lucy::Search::HitQueue->new( wanted => $size, );