svn commit: r1026049 - /websites/production/lucy/content/

2018-02-27 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 27 10:59:15 2018
New Revision: 1026049

Log:
Publishing svnmucc operation to lucy site by nwellnhof

Added:
websites/production/lucy/content/
  - copied from r1026048, websites/staging/lucy/trunk/content/



svn commit: r1825434 - in /lucy/site/trunk/content: download.mdtext index.mdtext

2018-02-27 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 27 08:35:23 2018
New Revision: 1825434

URL: http://svn.apache.org/viewvc?rev=1825434=rev
Log:
Clownfish 0.6.3, Lucy 0.6.2 releases

Modified:
lucy/site/trunk/content/download.mdtext
lucy/site/trunk/content/index.mdtext

Modified: lucy/site/trunk/content/download.mdtext
URL: 
http://svn.apache.org/viewvc/lucy/site/trunk/content/download.mdtext?rev=1825434=1825433=1825434=diff
==
--- lucy/site/trunk/content/download.mdtext (original)
+++ lucy/site/trunk/content/download.mdtext Tue Feb 27 08:35:23 2018
@@ -1,21 +1,21 @@
 Title: Apache Lucy Downloads
 
- Apache Lucy search engine library, release 0.6.1
+ Apache Lucy search engine library, release 0.6.2
 
- - 
[apache-lucy-0.6.1.tar.gz](http://www.apache.org/dyn/closer.cgi?path=/lucy/apache-lucy-0.6.1.tar.gz)
- - [[OpenPGP]](https://www.apache.org/dist/lucy/apache-lucy-0.6.1.tar.gz.asc)
- - [[MD5]](https://www.apache.org/dist/lucy/apache-lucy-0.6.1.tar.gz.md5)
- - [[SHA512]](https://www.apache.org/dist/lucy/apache-lucy-0.6.1.tar.gz.sha)
- - [CHANGES](http://www.apache.org/dyn/closer.cgi?path=/lucy/CHANGES-0.6.1.txt)
+ - 
[apache-lucy-0.6.2.tar.gz](http://www.apache.org/dyn/closer.cgi?path=/lucy/apache-lucy-0.6.2.tar.gz)
+ - [[OpenPGP]](https://www.apache.org/dist/lucy/apache-lucy-0.6.2.tar.gz.asc)
+ - [[MD5]](https://www.apache.org/dist/lucy/apache-lucy-0.6.2.tar.gz.md5)
+ - [[SHA512]](https://www.apache.org/dist/lucy/apache-lucy-0.6.2.tar.gz.sha512)
+ - [CHANGES](http://www.apache.org/dyn/closer.cgi?path=/lucy/CHANGES-0.6.2.txt)
  - [KEYS](https://www.apache.org/dist/lucy/KEYS)
 
- Apache Clownfish symbiotic object system, release 0.6.2
+ Apache Clownfish symbiotic object system, release 0.6.3
 
- - 
[apache-clownfish-0.6.2.tar.gz](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/apache-clownfish-0.6.2.tar.gz)
- - 
[[OpenPGP]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.asc)
- - 
[[MD5]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.md5)
- - 
[[SHA512]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.sha512)
- - 
[CHANGES](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/CHANGES-0.6.2.txt)
+ - 
[apache-clownfish-0.6.3.tar.gz](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/apache-clownfish-0.6.3.tar.gz)
+ - 
[[OpenPGP]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.3.tar.gz.asc)
+ - 
[[MD5]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.3.tar.gz.md5)
+ - 
[[SHA512]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.3.tar.gz.sha512)
+ - 
[CHANGES](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/CHANGES-0.6.3.txt)
  - [KEYS](https://www.apache.org/dist/lucy/KEYS)
 
  Verifying downloaded files

Modified: lucy/site/trunk/content/index.mdtext
URL: 
http://svn.apache.org/viewvc/lucy/site/trunk/content/index.mdtext?rev=1825434=1825433=1825434=diff
==
--- lucy/site/trunk/content/index.mdtext (original)
+++ lucy/site/trunk/content/index.mdtext Tue Feb 27 08:35:23 2018
@@ -10,7 +10,7 @@ Lucene™](http://lucene.apache.org/)
 
  Download
 
-The current release of Apache Lucy is [0.6.1](/download.html).
+The current release of Apache Lucy is [0.6.2](/download.html).
 It requires the [Apache Clownfish](/download.html) symbiotic object system.
 
 --




svn commit: r25304 - /dev/lucy/apache-lucy-0.6.2-rc1/ /release/lucy/

2018-02-27 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 27 08:19:54 2018
New Revision: 25304

Log:
Publish Apache Lucy 0.6.2

Added:
release/lucy/CHANGES-0.6.2.txt
  - copied unchanged from r25303, 
dev/lucy/apache-lucy-0.6.2-rc1/CHANGES-0.6.2.txt
release/lucy/apache-lucy-0.6.2.tar.gz
  - copied unchanged from r25303, 
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz
release/lucy/apache-lucy-0.6.2.tar.gz.asc
  - copied unchanged from r25303, 
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.asc
release/lucy/apache-lucy-0.6.2.tar.gz.md5
  - copied unchanged from r25303, 
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.md5
release/lucy/apache-lucy-0.6.2.tar.gz.sha512
  - copied unchanged from r25303, 
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.sha512
Removed:
dev/lucy/apache-lucy-0.6.2-rc1/CHANGES-0.6.2.txt
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.asc
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.md5
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.sha512



svn commit: r25306 - in /release/lucy: CHANGES-0.6.1.txt apache-lucy-0.6.1.tar.gz apache-lucy-0.6.1.tar.gz.asc apache-lucy-0.6.1.tar.gz.md5 apache-lucy-0.6.1.tar.gz.sha

2018-02-27 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 27 08:20:35 2018
New Revision: 25306

Log:
Remove Apache Lucy 0.6.1

Removed:
release/lucy/CHANGES-0.6.1.txt
release/lucy/apache-lucy-0.6.1.tar.gz
release/lucy/apache-lucy-0.6.1.tar.gz.asc
release/lucy/apache-lucy-0.6.1.tar.gz.md5
release/lucy/apache-lucy-0.6.1.tar.gz.sha



svn commit: r25305 - /dev/lucy/apache-lucy-0.6.2-rc1/

2018-02-27 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 27 08:20:08 2018
New Revision: 25305

Log:
Remove apache-lucy-0.6.2-rc1 directory

Removed:
dev/lucy/apache-lucy-0.6.2-rc1/



[lucy] Git Push Summary

2018-02-27 Thread nwellnhof
Repository: lucy
Updated Tags:  refs/tags/v0.6.2-rc1 [deleted] 490d27031


[lucy] Git Push Summary

2018-02-27 Thread nwellnhof
Repository: lucy
Updated Tags:  refs/tags/rel/v0.6.2 [created] 490d27031


svn commit: r25302 - in /release/lucy/clownfish: CHANGES-0.6.2.txt apache-clownfish-0.6.2.tar.gz apache-clownfish-0.6.2.tar.gz.asc apache-clownfish-0.6.2.tar.gz.md5 apache-clownfish-0.6.2.tar.gz.sha51

2018-02-27 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 27 08:16:47 2018
New Revision: 25302

Log:
Remove Apache Clownfish 0.6.2

Removed:
release/lucy/clownfish/CHANGES-0.6.2.txt
release/lucy/clownfish/apache-clownfish-0.6.2.tar.gz
release/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.asc
release/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.md5
release/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.sha512



svn commit: r25301 - /dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/

2018-02-27 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 27 08:15:57 2018
New Revision: 25301

Log:
Remove apache-clownfish-0.6.3-rc1 directory

Removed:
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/



svn commit: r25300 - /dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/ /release/lucy/clownfish/

2018-02-27 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 27 08:15:37 2018
New Revision: 25300

Log:
Publish Apache Clownfish 0.6.3

Added:
release/lucy/clownfish/CHANGES-0.6.3.txt
  - copied unchanged from r25299, 
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/CHANGES-0.6.3.txt
release/lucy/clownfish/apache-clownfish-0.6.3.tar.gz
  - copied unchanged from r25299, 
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/apache-clownfish-0.6.3.tar.gz
release/lucy/clownfish/apache-clownfish-0.6.3.tar.gz.asc
  - copied unchanged from r25299, 
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/apache-clownfish-0.6.3.tar.gz.asc
release/lucy/clownfish/apache-clownfish-0.6.3.tar.gz.md5
  - copied unchanged from r25299, 
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/apache-clownfish-0.6.3.tar.gz.md5
release/lucy/clownfish/apache-clownfish-0.6.3.tar.gz.sha512
  - copied unchanged from r25299, 
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/apache-clownfish-0.6.3.tar.gz.sha512
Removed:
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/CHANGES-0.6.3.txt
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/apache-clownfish-0.6.3.tar.gz

dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/apache-clownfish-0.6.3.tar.gz.asc

dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/apache-clownfish-0.6.3.tar.gz.md5

dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/apache-clownfish-0.6.3.tar.gz.sha512



[lucy-clownfish] Git Push Summary

2018-02-27 Thread nwellnhof
Repository: lucy-clownfish
Updated Tags:  refs/tags/v0.6.3-rc1 [deleted] ec493add2


[lucy-clownfish] Git Push Summary

2018-02-27 Thread nwellnhof
Repository: lucy-clownfish
Updated Tags:  refs/tags/rel/v0.6.3 [created] ec493add2


[lucy] Git Push Summary

2018-02-20 Thread nwellnhof
Repository: lucy
Updated Tags:  refs/tags/v0.6.2-rc1 [created] 490d27031


[1/2] lucy git commit: Updating CHANGES and version number for release 0.6.2

2018-02-20 Thread nwellnhof
Repository: lucy
Updated Branches:
  refs/heads/0.6 5c61bd4ec -> ea11db11f


http://git-wip-us.apache.org/repos/asf/lucy/blob/ea11db11/perl/lib/Lucy/Util/StringHelper.pm
--
diff --git a/perl/lib/Lucy/Util/StringHelper.pm 
b/perl/lib/Lucy/Util/StringHelper.pm
index ed5b461..d93cad7 100644
--- a/perl/lib/Lucy/Util/StringHelper.pm
+++ b/perl/lib/Lucy/Util/StringHelper.pm
@@ -15,7 +15,7 @@
 
 package Lucy::Util::StringHelper;
 use Lucy;
-our $VERSION = '0.006001';
+our $VERSION = '0.006002';
 $VERSION = eval $VERSION;
 
 1;

http://git-wip-us.apache.org/repos/asf/lucy/blob/ea11db11/perl/lib/LucyX/Index/ByteBufDocReader.pm
--
diff --git a/perl/lib/LucyX/Index/ByteBufDocReader.pm 
b/perl/lib/LucyX/Index/ByteBufDocReader.pm
index aa369f3..28ffa7c 100644
--- a/perl/lib/LucyX/Index/ByteBufDocReader.pm
+++ b/perl/lib/LucyX/Index/ByteBufDocReader.pm
@@ -19,7 +19,7 @@ use warnings;
 package LucyX::Index::ByteBufDocReader;
 use base qw( Lucy::Index::DocReader );
 use Lucy::Document::HitDoc;
-our $VERSION = '0.006001';
+our $VERSION = '0.006002';
 $VERSION = eval $VERSION;
 use Carp;
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/ea11db11/perl/lib/LucyX/Index/ByteBufDocWriter.pm
--
diff --git a/perl/lib/LucyX/Index/ByteBufDocWriter.pm 
b/perl/lib/LucyX/Index/ByteBufDocWriter.pm
index e39e394..30e224b 100644
--- a/perl/lib/LucyX/Index/ByteBufDocWriter.pm
+++ b/perl/lib/LucyX/Index/ByteBufDocWriter.pm
@@ -18,7 +18,7 @@ use warnings;
 
 package LucyX::Index::ByteBufDocWriter;
 use base qw( Lucy::Index::DataWriter );
-our $VERSION = '0.006001';
+our $VERSION = '0.006002';
 $VERSION = eval $VERSION;
 use Carp;
 use Scalar::Util qw( blessed );

http://git-wip-us.apache.org/repos/asf/lucy/blob/ea11db11/perl/lib/LucyX/Index/LongFieldSim.pm
--
diff --git a/perl/lib/LucyX/Index/LongFieldSim.pm 
b/perl/lib/LucyX/Index/LongFieldSim.pm
index bc00c9e..79960c8 100644
--- a/perl/lib/LucyX/Index/LongFieldSim.pm
+++ b/perl/lib/LucyX/Index/LongFieldSim.pm
@@ -18,7 +18,7 @@ use warnings;
 
 package LucyX::Index::LongFieldSim;
 use base qw( Lucy::Index::Similarity );
-our $VERSION = '0.006001';
+our $VERSION = '0.006002';
 $VERSION = eval $VERSION;
 
 sub length_norm {

http://git-wip-us.apache.org/repos/asf/lucy/blob/ea11db11/perl/lib/LucyX/Index/ZlibDocReader.pm
--
diff --git a/perl/lib/LucyX/Index/ZlibDocReader.pm 
b/perl/lib/LucyX/Index/ZlibDocReader.pm
index af3bcbe..d978baf 100644
--- a/perl/lib/LucyX/Index/ZlibDocReader.pm
+++ b/perl/lib/LucyX/Index/ZlibDocReader.pm
@@ -18,7 +18,7 @@ use warnings;
 
 package LucyX::Index::ZlibDocReader;
 use base qw( Lucy::Index::DocReader );
-our $VERSION = '0.006001';
+our $VERSION = '0.006002';
 $VERSION = eval $VERSION;
 use Lucy::Util::StringHelper qw( utf8_valid utf8_flag_on );
 use Compress::Zlib qw( uncompress );

http://git-wip-us.apache.org/repos/asf/lucy/blob/ea11db11/perl/lib/LucyX/Index/ZlibDocWriter.pm
--
diff --git a/perl/lib/LucyX/Index/ZlibDocWriter.pm 
b/perl/lib/LucyX/Index/ZlibDocWriter.pm
index e048402..7dd7955 100644
--- a/perl/lib/LucyX/Index/ZlibDocWriter.pm
+++ b/perl/lib/LucyX/Index/ZlibDocWriter.pm
@@ -25,7 +25,7 @@ use Clownfish;
 use bytes;
 no bytes;
 
-our $VERSION = '0.006001';
+our $VERSION = '0.006002';
 $VERSION = eval $VERSION;
 
 # Inside-out member vars.

http://git-wip-us.apache.org/repos/asf/lucy/blob/ea11db11/perl/lib/LucyX/Remote/ClusterSearcher.pm
--
diff --git a/perl/lib/LucyX/Remote/ClusterSearcher.pm 
b/perl/lib/LucyX/Remote/ClusterSearcher.pm
index ddb37d2..74a3b94 100644
--- a/perl/lib/LucyX/Remote/ClusterSearcher.pm
+++ b/perl/lib/LucyX/Remote/ClusterSearcher.pm
@@ -18,7 +18,7 @@ use warnings;
 
 package LucyX::Remote::ClusterSearcher;
 BEGIN { our @ISA = qw( Lucy::Search::Searcher ) }
-our $VERSION = '0.006001';
+our $VERSION = '0.006002';
 $VERSION = eval $VERSION;
 use Carp;
 use Storable qw( nfreeze thaw );

http://git-wip-us.apache.org/repos/asf/lucy/blob/ea11db11/perl/lib/LucyX/Remote/SearchClient.pm
--
diff --git a/perl/lib/LucyX/Remote/SearchClient.pm 
b/perl/lib/LucyX/Remote/SearchClient.pm
index 0a02319..3e815ed 100644
--- a/perl/lib/LucyX/Remote/SearchClient.pm
+++ b/perl/lib/LucyX/Remote/SearchClient.pm
@@ -18,7 +18,7 @@ use warnings;
 
 package LucyX::Remote::SearchClient;
 BEGIN { our @ISA = qw( Lucy::Search::Searcher ) }
-our $VERSION = '0.006001';
+our $VERSION = '0.006002';
 $VERSION = eval $VERSION;
 use Carp;
 use Storable qw( nfreeze thaw );


[2/2] lucy git commit: Updating CHANGES and version number for release 0.6.2

2018-02-20 Thread nwellnhof
Updating CHANGES and version number for release 0.6.2


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

Branch: refs/heads/0.6
Commit: ea11db11fdfc3bb39dae4a073bcedca3477e73df
Parents: 5c61bd4
Author: Nick Wellnhofer 
Authored: Tue Feb 20 16:46:25 2018 +0100
Committer: Nick Wellnhofer 
Committed: Tue Feb 20 16:46:25 2018 +0100

--
 CHANGES |  9 
 c/install.sh|  2 +-
 common/charmonizer.c|  2 +-
 common/charmonizer.main |  2 +-
 core/Lucy.cfp   |  2 +-
 perl/Build.PL   | 12 +++---
 perl/buildlib/Lucy/Build.pm |  2 +-
 perl/buildlib/Lucy/Build/Binding/Analysis.pm|  2 +-
 perl/buildlib/Lucy/Build/Binding/Document.pm|  2 +-
 perl/buildlib/Lucy/Build/Binding/Highlight.pm   |  2 +-
 perl/buildlib/Lucy/Build/Binding/Index.pm   |  2 +-
 perl/buildlib/Lucy/Build/Binding/Misc.pm|  2 +-
 perl/buildlib/Lucy/Build/Binding/Object.pm  |  2 +-
 perl/buildlib/Lucy/Build/Binding/Plan.pm|  2 +-
 perl/buildlib/Lucy/Build/Binding/Search.pm  |  2 +-
 perl/buildlib/Lucy/Build/Binding/Store.pm   |  2 +-
 perl/buildlib/Lucy/Build/Binding/Util.pm|  2 +-
 perl/buildlib/Lucy/Test/TestUtils.pm|  2 +-
 perl/buildlib/LucyX/Build/Binding/Search.pm |  2 +-
 perl/lib/Lucy.pm| 44 ++--
 perl/lib/Lucy.pod   |  2 +-
 perl/lib/Lucy/Analysis/Analyzer.pm  |  2 +-
 perl/lib/Lucy/Analysis/CaseFolder.pm|  2 +-
 perl/lib/Lucy/Analysis/EasyAnalyzer.pm  |  2 +-
 perl/lib/Lucy/Analysis/Inversion.pm |  2 +-
 perl/lib/Lucy/Analysis/Normalizer.pm|  2 +-
 perl/lib/Lucy/Analysis/PolyAnalyzer.pm  |  2 +-
 perl/lib/Lucy/Analysis/RegexTokenizer.pm|  2 +-
 perl/lib/Lucy/Analysis/SnowballStemmer.pm   |  2 +-
 perl/lib/Lucy/Analysis/SnowballStopFilter.pm|  2 +-
 perl/lib/Lucy/Analysis/StandardTokenizer.pm |  2 +-
 perl/lib/Lucy/Analysis/Token.pm |  2 +-
 perl/lib/Lucy/Document/Doc.pm   |  2 +-
 perl/lib/Lucy/Document/HitDoc.pm|  2 +-
 perl/lib/Lucy/Highlight/HeatMap.pm  |  2 +-
 perl/lib/Lucy/Highlight/Highlighter.pm  |  2 +-
 perl/lib/Lucy/Index/BackgroundMerger.pm |  2 +-
 perl/lib/Lucy/Index/DataReader.pm   |  2 +-
 perl/lib/Lucy/Index/DataWriter.pm   |  2 +-
 perl/lib/Lucy/Index/DeletionsReader.pm  |  2 +-
 perl/lib/Lucy/Index/DeletionsWriter.pm  |  2 +-
 perl/lib/Lucy/Index/DocReader.pm|  2 +-
 perl/lib/Lucy/Index/DocVector.pm|  2 +-
 perl/lib/Lucy/Index/DocWriter.pm|  2 +-
 perl/lib/Lucy/Index/FilePurger.pm   |  2 +-
 perl/lib/Lucy/Index/HighlightReader.pm  |  2 +-
 perl/lib/Lucy/Index/HighlightWriter.pm  |  2 +-
 perl/lib/Lucy/Index/IndexManager.pm |  2 +-
 perl/lib/Lucy/Index/IndexReader.pm  |  2 +-
 perl/lib/Lucy/Index/Indexer.pm  |  2 +-
 perl/lib/Lucy/Index/Inverter.pm |  2 +-
 perl/lib/Lucy/Index/Lexicon.pm  |  2 +-
 perl/lib/Lucy/Index/LexiconReader.pm|  2 +-
 perl/lib/Lucy/Index/LexiconWriter.pm|  2 +-
 perl/lib/Lucy/Index/PolyLexicon.pm  |  2 +-
 perl/lib/Lucy/Index/PolyReader.pm   |  2 +-
 perl/lib/Lucy/Index/Posting.pm  |  2 +-
 perl/lib/Lucy/Index/Posting/MatchPosting.pm |  2 +-
 perl/lib/Lucy/Index/Posting/RichPosting.pm  |  2 +-
 perl/lib/Lucy/Index/Posting/ScorePosting.pm |  2 +-
 perl/lib/Lucy/Index/PostingList.pm  |  2 +-
 perl/lib/Lucy/Index/PostingListReader.pm|  2 +-
 perl/lib/Lucy/Index/PostingListWriter.pm|  2 +-
 perl/lib/Lucy/Index/SegLexicon.pm   |  2 +-
 perl/lib/Lucy/Index/SegPostingList.pm   |  2 +-
 perl/lib/Lucy/Index/SegReader.pm|  2 +-
 perl/lib/Lucy/Index/SegWriter.pm|  2 +-
 perl/lib/Lucy/Index/Segment.pm  |  2 +-
 perl/lib/Lucy/Index/Similarity.pm   |  2 +-
 perl/lib/Lucy/Index/Snapshot.pm |  2 +-
 perl/lib/Lucy/Index/SortCache.pm|  2 +-
 perl/lib/Lucy/Index/SortReader.pm   |  2 +-
 perl/lib/Lucy/Index/SortWriter.pm   |  2 +-
 perl/lib/Lucy/Index/TermInfo.pm |  2 +-
 perl/lib/Lucy/Index/TermVector.pm   |  2 +-
 perl/lib/Lucy/Object/BitVector.pm   

svn commit: r25165 - in /dev/lucy/apache-lucy-0.6.2-rc1: CHANGES-0.6.2.txt apache-lucy-0.6.2.tar.gz apache-lucy-0.6.2.tar.gz.asc apache-lucy-0.6.2.tar.gz.md5 apache-lucy-0.6.2.tar.gz.sha512

2018-02-20 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 20 15:48:30 2018
New Revision: 25165

Log:
Add apache-lucy-0.6.2 artifacts

Added:
dev/lucy/apache-lucy-0.6.2-rc1/CHANGES-0.6.2.txt
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz   (with props)
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.asc
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.md5
dev/lucy/apache-lucy-0.6.2-rc1/apache-lucy-0.6.2.tar.gz.sha512

Added: dev/lucy/apache-lucy-0.6.2-rc1/CHANGES-0.6.2.txt
==
--- dev/lucy/apache-lucy-0.6.2-rc1/CHANGES-0.6.2.txt (added)
+++ dev/lucy/apache-lucy-0.6.2-rc1/CHANGES-0.6.2.txt Tue Feb 20 15:48:30 2018
@@ -0,0 +1,281 @@
+Revision history for Lucy
+
+0.6.2  2018-02-20
+
+  Bugfixes:
+
+* Fix rpath issue with ELF linkers using new dtags
+* Fix build issue with recent Go versions
+* [LUCY-325] - QueryParser mishandles trailing double quote
+* [LUCY-327] - t/core/035-json.t aborts when compiled with lemon 3.22.0
+
+0.6.1  2016-12-09
+
+  Bugfixes:
+
+* [LUCY-286] - Remote::SearchClient::DESTROY shouldn't throw exceptions
+* [LUCY-309] - BSD make doesn't support pattern rules
+* [LUCY-310] - CPAN dist includes Lucy/Test.xs
+* [LUCY-311] - Non-ASCII error messages from strerror cause exceptions
+* [LUCY-312] - Remote searcher tests fail if port is in use
+* [LUCY-315] - Memory leak in HitQueue with SortSpec
+* [LUCY-316] - Don't regenerate POD when building CPAN distro
+* [LUCY-317] - Compile failure on FreeBSD 10.1
+* [LUCY-318] - Indexing fails with "input n too high" in S_fibonacci
+
+0.6.0  2016-09-24
+
+  Tasks:
+
+* [LUCY-301] - Change Read_C32/etc to explicitly signed
+   Read_CI32/CU32/etc
+* [LUCY-302] - Widen array index type and fix conversion warnings in
+   NumberUtils.
+
+  Bugfixes:
+
+* [LUCY-297] - Perl 5.10 build broken: "token_re is not a qr// entity"
+* [LUCY-298] - Random numeric junk in tempfile name
+* [LUCY-300] - Restrict max field length to 2 GB
+* [LUCY-303] - "make test" broken on Cygwin
+* [LUCY-307] - Lucy::Simple's `search` stopped supporting `sort_spec`
+
+0.5.1  2016-04-14
+
+  Bugfixes:
+
+* [LUCY-297] - Perl 5.10 build broken: "token_re is not a qr// entity"
+* [LUCY-298] - Random numeric junk in tempfile name
+
+0.5.0  2016-03-04
+
+  New features:
+
+* [LUCY-275] - Proof-of-concept Go bindings
+
+  Bugfixes:
+
+* [LUCY-273] - Require specific version of Clownfish
+* [LUCY-287] - Mismatch between required Clownfish versions
+* [LUCY-288] - Add Clownfish to configure_requires
+
+  Improvements:
+
+* [LUCY-274] - Refcounting needs to use functions rather than methods
+* [LUCY-277] - Autogenerate Go Bindings
+* [LUCY-279] - Prepare for removal of Obj methods
+* [LUCY-281] - Port host-specific Lucy code to Go/CGO
+* [LUCY-282] - Refine and test Go bindings
+* [LUCY-284] - Support multiple Go types as document
+* [LUCY-285] - Run core tests under Go bindings
+* [LUCY-289] - Check for incompatible Clownfish major version
+
+  Tasks:
+
+* [LUCY-290] - Review generated C API documentation
+
+
+0.4.4  2016-01-31
+
+  Bugfixes:
+
+* [LUCY-287] - Mismatch between required Clownfish versions
+* [LUCY-288] - Add Clownfish to configure_requires
+* Fix Windows build for some CPAN Testers setups (see CLOWNFISH-3).
+
+
+0.4.3  2016-01-09
+
+  Improvements:
+
+* Check for incompatible Clownfish major version.
+* Improve build and installation scripts for C library.
+
+
+0.4.2  2014-11-18
+
+  Bugfixes:
+
+* [LUCY-272] - Wrong encoding of extremely small similarity values
+
+
+0.4.1  2014-09-25
+
+  Bugfixes:
+
+* [LUCY-269] - Field names with underscores break query parser
+* [LUCY-270] - RegexTokenizer broken in C bindings
+
+
+0.4.0  2014-08-21
+
+  Bugfixes:
+
+* [LUCY-199] - Highlighting/excerpt on URLs
+* [LUCY-211] - MSVC 6 support
+* [LUCY-234] - Brittle object struct ABI
+* [LUCY-240] - Build Broken on clang
+* [LUCY-254] - Creation of Charmonizer temp files sometimes fails on
+   Windows
+* [LUCY-261] - Include paths for benchmark scripts
+* [LUCY-263] - MemoryPool's Release_All() should free
+* [LUCY-265] - Index lockfiles left behind
+
+  New features:
+
+* [LUCY-250] - Add delete_by_doc_id to Lucy::Index::Indexer
+
+  Tasks:
+
+* [LUCY-201] - Port CFC tests to C
+* [LUCY-212] - The "language" parameter to PolyAnalyzer#new is deprecated
+* [LUCY-214] - Port terminfo tests to C
+* [LUCY-222] - Port span tests to C
+* [LUCY-246] - Migrate Apache Lucy to Git
+* [LUCY-257] - Separate Clownfish from Lucy
+
+
+0.3.3  2013-07-22
+
+  Bugfixes:
+
+* [LUCY-239] - Simplify JSON Parser Y File
+* [LUCY-243] - Trap remove errno and warn
+* [LUCY-245] - Cha

svn commit: r25164 - /dev/lucy/apache-lucy-0.6.2-rc1/

2018-02-20 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 20 15:47:35 2018
New Revision: 25164

Log:
Create RC dir for apache-lucy-0.6.2-rc1

Added:
dev/lucy/apache-lucy-0.6.2-rc1/



[lucy-clownfish] Git Push Summary

2018-02-20 Thread nwellnhof
Repository: lucy-clownfish
Updated Tags:  refs/tags/v0.6.3-rc1 [created] ec493add2


lucy-clownfish git commit: Updating CHANGES and version number for release 0.6.3

2018-02-20 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/0.6 3849665e7 -> 32812bf5e


Updating CHANGES and version number for release 0.6.3


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

Branch: refs/heads/0.6
Commit: 32812bf5eaad6f3d05be2d3dfe821cdd7020381b
Parents: 3849665
Author: Nick Wellnhofer 
Authored: Tue Feb 20 16:33:42 2018 +0100
Committer: Nick Wellnhofer 
Committed: Tue Feb 20 16:33:42 2018 +0100

--
 CHANGES   |  7 +++
 compiler/common/charmonizer.c |  2 +-
 compiler/common/charmonizer.main  |  2 +-
 compiler/perl/Build.PL|  2 +-
 compiler/perl/buildlib/Clownfish/CFC/Build.pm |  2 +-
 .../perl/buildlib/Clownfish/CFC/Test/TestUtils.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC.pm|  4 ++--
 compiler/perl/lib/Clownfish/CFC/Base.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Core.pm   |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Core/Aliases.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Core/Class.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Core/File.pm  |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Core/Function.pm   |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Core/Method.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Perl.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm |  2 +-
 .../lib/Clownfish/CFC/Binding/Perl/Constructor.pm |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Perl/Method.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Perl/Pod.pm   |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Perl/Subroutine.pm |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Perl/TypeMap.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/CBlock.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Class.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/DocuComment.pm  |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/File.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/FileSpec.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Function.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Hierarchy.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Method.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/ParamList.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Parcel.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Prereq.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Symbol.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Type.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Variable.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Version.pm  |  2 +-
 compiler/perl/lib/Clownfish/CFC/Parser.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm |  6 +++---
 .../perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Test.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Util.pm   |  2 +-
 compiler/python/setup.py  |  2 +-
 runtime/c/install.sh  |  2 +-
 runtime/common/charmonizer.c  |  2 +-
 runtime/common/charmonizer.main   |  2 +-
 runtime/core/Clownfish.cfp|  2 +-
 runtime/core/Clownfish/Docs/WritingClasses.md |  2 +-
 runtime/perl/Build.PL |  6 +++---
 runtime/perl/buildlib/Clownfish/Build.pm  |  2 +-
 runtime/perl/buildlib/Clownfish/Build/Binding.pm  |  2 +-
 runtime/perl/lib/Clownfish.pm | 14 +++---
 runtime/perl/lib/Clownfish/Blob.pm|  2 +-
 runtime/perl/lib/Clownfish/Boolean.pm |  2 +-
 runtime/perl/lib/Clownfish/ByteBuf.pm |  2 +-
 runtime/perl/lib/Clownfish/CharBuf.pm |  2 +-
 runtime/perl/lib/Clownfish/Class.pm   |  2 +-
 runtime/perl/lib/Clownfish/Err.pm |  2 +-
 runtime/perl/lib/Clownfish/Float.pm   |  2 +-
 runtime/perl/lib/Clownfish/Hash.pm|  2 +-
 runtime/perl/lib/Clownfish/HashIterator.pm|  2 +-
 runtime/perl/lib/Clownfish/Integer.pm |  2 +-
 runtime/perl/lib/Clownfish/Obj.pm |  2 +-
 runtime/perl/lib/Clownfish/String.pm  |  2 +-
 runtime/perl/lib/Clownfish/Test.pm|  4 ++--
 runtime/perl/lib/Clownfish/Vector.pm  |  2 +-
 runtime/python/setup.py   |  2 +-
 runtime/test/TestClownfish.cfp

svn commit: r25162 - /dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/

2018-02-20 Thread nwellnhof
Author: nwellnhof
Date: Tue Feb 20 15:34:52 2018
New Revision: 25162

Log:
Create RC dir for apache-clownfish-0.6.3-rc1

Added:
dev/lucy/clownfish/apache-clownfish-0.6.3-rc1/



lucy git commit: Cherry-pick Charmonizer rpath fix

2018-02-19 Thread nwellnhof
Repository: lucy
Updated Branches:
  refs/heads/0.6 4eb33a717 -> 5c61bd4ec


Cherry-pick Charmonizer rpath fix


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

Branch: refs/heads/0.6
Commit: 5c61bd4ec5aa7defef7b63e5e5aac526f6877db1
Parents: 4eb33a7
Author: Nick Wellnhofer 
Authored: Mon Feb 19 15:07:05 2018 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 19 15:07:05 2018 +0100

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


http://git-wip-us.apache.org/repos/asf/lucy/blob/5c61bd4e/common/charmonizer.c
--
diff --git a/common/charmonizer.c b/common/charmonizer.c
index 0108c12..999c4aa 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -2039,7 +2039,15 @@ chaz_CFlags_add_rpath(chaz_CFlags *flags, const char 
*path) {
 if (chaz_CC_binary_format() != CHAZ_CC_BINFMT_ELF) { return; }
 
 if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-string = chaz_Util_join("", "-Wl,-rpath,", path, NULL);
+/* If "new dtags" are enabled by default, DT_RUNPATH is set instead of
+ * DT_RPATH. Unfortunately, DT_RUNPATH is not applied transitively
+ * when searching for indirect dependencies. See
+ *
+ * https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1253638
+ * https://sourceware.org/bugzilla/show_bug.cgi?id=13945
+ */
+string = chaz_Util_join("", "-Wl,--disable-new-dtags -Wl,-rpath,",
+path, NULL);
 }
 else if (flags->style == CHAZ_CFLAGS_STYLE_SUN_C) {
 string = chaz_Util_join(" ", "-R", path, NULL);



[3/5] lucy git commit: Run Travis tests with PERL_USE_UNSAFE_INC=0

2018-02-08 Thread nwellnhof
Run Travis tests with PERL_USE_UNSAFE_INC=0

This makes sure that Test::Harness doesn't set PERL_USE_UNSAFE_INC to 1
and that the tests are actually run without . in @INC.


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

Branch: refs/heads/0.6
Commit: 480527e604dd6a9fc4dbb32aebf1620cbcaacda1
Parents: 47c750f
Author: Nick Wellnhofer 
Authored: Thu Feb 8 13:34:41 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:13:52 2018 +0100

--
 devel/bin/travis-test.sh | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/480527e6/devel/bin/travis-test.sh
--
diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh
index 080a1bf..b60f993 100755
--- a/devel/bin/travis-test.sh
+++ b/devel/bin/travis-test.sh
@@ -43,6 +43,9 @@ test_c() {
 }
 
 test_perl() {
+# Test::Harness defaults to PERL_USE_UNSAFE_INC=1
+export PERL_USE_UNSAFE_INC=0
+
 source ~/perl5/perlbrew/etc/bashrc
 perlbrew switch $PERL_VERSION
 perlbrew list



[4/5] lucy git commit: Don't pass negative token id to Lemon parser

2018-02-08 Thread nwellnhof
Don't pass negative token id to Lemon parser

Newer Lemon versions throw an assertion if they encounter invalid
token ids.

Fixes LUCY-327. Thanks to Petr Pisar for the report.


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

Branch: refs/heads/0.6
Commit: 3a9128ce1f957140a14ad1aaf0bc7bdcfe41f9b5
Parents: 480527e
Author: Nick Wellnhofer 
Authored: Thu Feb 8 14:29:11 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:14:01 2018 +0100

--
 core/Lucy/Util/Json.c | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/3a9128ce/core/Lucy/Util/Json.c
--
diff --git a/core/Lucy/Util/Json.c b/core/Lucy/Util/Json.c
index 46a0b89..be19660 100644
--- a/core/Lucy/Util/Json.c
+++ b/core/Lucy/Util/Json.c
@@ -479,6 +479,12 @@ S_do_parse_json(void *json_parser, const char *json, 
size_t len) {
 }
 break;
 }
+if (token_type < 0) {
+// Clear out parser and return.
+LucyParseJson(json_parser, 0, NULL, );
+SET_ERROR("JSON syntax error", save, end);
+return NULL;
+}
 LucyParseJson(json_parser, token_type, value, );
 if (state.errors) {
 SET_ERROR("JSON syntax error", save, end);



[2/5] lucy git commit: Add sha512 explicit algorithm to file extension

2018-02-08 Thread nwellnhof
Add sha512 explicit algorithm to file extension


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

Branch: refs/heads/0.6
Commit: 47c750ff279d8d2eced12eada94166aa5eee3965
Parents: 9e2b55a
Author: Peter Karman 
Authored: Wed Aug 16 09:33:27 2017 -0500
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:13:43 2018 +0100

--
 devel/bin/release_commands.pl | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/47c750ff/devel/bin/release_commands.pl
--
diff --git a/devel/bin/release_commands.pl b/devel/bin/release_commands.pl
index 91cdc5f..24c3266 100755
--- a/devel/bin/release_commands.pl
+++ b/devel/bin/release_commands.pl
@@ -118,7 +118,7 @@ say qq|perl -MDigest -e '\$d = Digest->new("SHA-512"); open 
\$fh, |
 . qq|"addfile(\$fh); print \$d->hexdigest; |
 . qq|print "  apache-lucy-$x_y_z_version.tar.gz\\n"' > |
-. qq| apache-lucy-$x_y_z_version.tar.gz.sha\n|;
+. qq| apache-lucy-$x_y_z_version.tar.gz.sha512\n|;
 
 say qq|# Sign the release.|;
 say qq|gpg --armor --output apache-lucy-$x_y_z_version.tar.gz.asc |
@@ -128,7 +128,7 @@ say qq|# Add the artifacts and commit to the dev area on 
dist.apache.org.|;
 say qq|svn add |
 . qq|apache-lucy-$x_y_z_version.tar.gz |
 . qq|apache-lucy-$x_y_z_version.tar.gz.md5 |
-. qq|apache-lucy-$x_y_z_version.tar.gz.sha |
+. qq|apache-lucy-$x_y_z_version.tar.gz.sha512 |
 . qq|apache-lucy-$x_y_z_version.tar.gz.asc |
 . qq|CHANGES-$x_y_z_version.txt |;
 say qq|svn ci -m "Add apache-lucy-$x_y_z_version artifacts"\n|;
@@ -173,8 +173,8 @@ say qq|svnmucc -m "Publish Apache Lucy $x_y_z_version" |
 . qq|release/lucy/apache-lucy-$x_y_z_version.tar.gz |
 . qq|mv 
dev/lucy/apache-lucy-$full_rc_version/apache-lucy-$x_y_z_version.tar.gz.md5 |
 . qq|release/lucy/apache-lucy-$x_y_z_version.tar.gz.md5 |
-. qq|mv 
dev/lucy/apache-lucy-$full_rc_version/apache-lucy-$x_y_z_version.tar.gz.sha |
-. qq|release/lucy/apache-lucy-$x_y_z_version.tar.gz.sha |
+. qq|mv 
dev/lucy/apache-lucy-$full_rc_version/apache-lucy-$x_y_z_version.tar.gz.sha512 |
+. qq|release/lucy/apache-lucy-$x_y_z_version.tar.gz.sha512 |
 . qq|mv 
dev/lucy/apache-lucy-$full_rc_version/apache-lucy-$x_y_z_version.tar.gz.asc |
 . qq|release/lucy/apache-lucy-$x_y_z_version.tar.gz.asc |
 . qq|mv dev/lucy/apache-lucy-$full_rc_version/CHANGES-$x_y_z_version.txt |
@@ -191,7 +191,7 @@ if ( $micro > 0 ) {
 . qq|-U https://dist.apache.org/repos/dist/release/lucy/ |
 . qq|rm apache-lucy-$prev.tar.gz |
 . qq|rm apache-lucy-$prev.tar.gz.md5 |
-. qq|rm apache-lucy-$prev.tar.gz.sha |
+. qq|rm apache-lucy-$prev.tar.gz.sha512 |
 . qq|rm apache-lucy-$prev.tar.gz.asc |
 . qq|rm CHANGES-$prev.txt |;
 }



[1/5] lucy git commit: Fix handling of trailing double quotes in QueryParser

2018-02-08 Thread nwellnhof
Repository: lucy
Updated Branches:
  refs/heads/0.6 779c0f628 -> a1c773bae


Fix handling of trailing double quotes in QueryParser

Fixes LUCY-325.


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

Branch: refs/heads/0.6
Commit: 9e2b55a04292a843ff7e408d905cdde4750360c7
Parents: 779c0f6
Author: Nick Wellnhofer 
Authored: Sat May 20 16:01:30 2017 +0200
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:13:34 2018 +0100

--
 core/Lucy/Search/QueryParser.c|  5 +
 test/Lucy/Test/Search/TestQueryParserSyntax.c | 11 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/9e2b55a0/core/Lucy/Search/QueryParser.c
--
diff --git a/core/Lucy/Search/QueryParser.c b/core/Lucy/Search/QueryParser.c
index f17e131..569bd75 100644
--- a/core/Lucy/Search/QueryParser.c
+++ b/core/Lucy/Search/QueryParser.c
@@ -885,6 +885,11 @@ QParser_Expand_Leaf_IMP(QueryParser *self, Query *query) {
 StrIter_Recede(tail, 1);
 }
 }
+if (StrIter_Compare_To(top, (Obj*)tail) > 0) {
+DECREF(tail);
+DECREF(top);
+return NULL;
+}
 String *source_text = StrIter_crop(top, tail);
 
 // Either use LeafQuery's field or default to Parser's list.

http://git-wip-us.apache.org/repos/asf/lucy/blob/9e2b55a0/test/Lucy/Test/Search/TestQueryParserSyntax.c
--
diff --git a/test/Lucy/Test/Search/TestQueryParserSyntax.c 
b/test/Lucy/Test/Search/TestQueryParserSyntax.c
index 1cc4680..f3d8755 100644
--- a/test/Lucy/Test/Search/TestQueryParserSyntax.c
+++ b/test/Lucy/Test/Search/TestQueryParserSyntax.c
@@ -334,6 +334,14 @@ syntax_test_double_colon() {
 return TestQP_new("PHP::Interpreter", tree, NULL, 0);
 }
 
+static TestQueryParser*
+syntax_test_trailing_quote() {
+Query *mies = make_leaf_query(NULL, "mies");
+Query *quote = make_leaf_query(NULL, "\" ");
+Query *tree = make_poly_query(BOOLOP_OR, mies, quote, NULL);
+return TestQP_new("mies\" ", tree, NULL, 0);
+}
+
 /***/
 
 typedef TestQueryParser*
@@ -371,6 +379,7 @@ static LUCY_TestQPSyntax_Test_t syntax_test_funcs[] = {
 syntax_test_escaped_quotes_inside,
 syntax_test_identifier_field_name,
 syntax_test_double_colon,
+syntax_test_trailing_quote,
 NULL
 };
 
@@ -445,7 +454,7 @@ test_query_parser_syntax(TestBatchRunner *runner) {
 
 void
 TestQPSyntax_Run_IMP(TestQueryParserSyntax *self, TestBatchRunner *runner) {
-TestBatchRunner_Plan(runner, (TestBatch*)self, 68);
+TestBatchRunner_Plan(runner, (TestBatch*)self, 70);
 test_query_parser_syntax(runner);
 }
 



[5/5] lucy git commit: Fix Travis Perl versions

2018-02-08 Thread nwellnhof
Fix Travis Perl versions

The Perl versions available under Travis have changed and many older
releases were removed. Make perlbrew build releases that aren't
installed. Reduce the number of tested versions, but add test with
blead.


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

Branch: refs/heads/0.6
Commit: a1c773baed7d9869cbee6b8eb398c4003ee10238
Parents: 3a9128c
Author: Nick Wellnhofer 
Authored: Thu Feb 8 15:53:57 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:14:09 2018 +0100

--
 .travis.yml  | 9 +++--
 devel/bin/travis-test.sh | 3 ++-
 2 files changed, 5 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/a1c773ba/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 052e274..cb804d8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,13 +21,10 @@ script: devel/bin/travis-test.sh
 env:
   - LUCY_DEBUG=1 CLOWNFISH_HOST=c
   - LUCY_DEBUG=1 CLOWNFISH_HOST=go
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.20
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.18
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.16
+  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=blead
+  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.24-extras
   - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.14
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.12
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.10
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.8
+  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.8.3
 git:
   depth: 10
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/a1c773ba/devel/bin/travis-test.sh
--
diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh
index b60f993..631d6a0 100755
--- a/devel/bin/travis-test.sh
+++ b/devel/bin/travis-test.sh
@@ -47,7 +47,8 @@ test_perl() {
 export PERL_USE_UNSAFE_INC=0
 
 source ~/perl5/perlbrew/etc/bashrc
-perlbrew switch $PERL_VERSION
+perlbrew switch $PERL_VERSION ||
+perlbrew install --switch --notest --noman --thread $PERL_VERSION
 perlbrew list
 export PERL5LIB="$install_dir/lib/perl5"
 



[1/4] lucy git commit: Fix Travis Perl versions

2018-02-08 Thread nwellnhof
Repository: lucy
Updated Branches:
  refs/heads/master a1a61b728 -> 4c6d5a41f


Fix Travis Perl versions

The Perl versions available under Travis have changed and many older
releases were removed. Make perlbrew build releases that aren't
installed. Reduce the number of tested versions, but add test with
blead.


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

Branch: refs/heads/master
Commit: 4c6d5a41fd86418342a25238e36787b74471cb84
Parents: d8baf24
Author: Nick Wellnhofer 
Authored: Thu Feb 8 15:53:57 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:07:13 2018 +0100

--
 .travis.yml  | 9 +++--
 devel/bin/travis-test.sh | 3 ++-
 2 files changed, 5 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/4c6d5a41/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 052e274..cb804d8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,13 +21,10 @@ script: devel/bin/travis-test.sh
 env:
   - LUCY_DEBUG=1 CLOWNFISH_HOST=c
   - LUCY_DEBUG=1 CLOWNFISH_HOST=go
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.20
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.18
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.16
+  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=blead
+  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.24-extras
   - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.14
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.12
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.10
-  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.8
+  - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.8.3
 git:
   depth: 10
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/4c6d5a41/devel/bin/travis-test.sh
--
diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh
index 0927a29..d1a05cd 100755
--- a/devel/bin/travis-test.sh
+++ b/devel/bin/travis-test.sh
@@ -49,7 +49,8 @@ test_perl() {
 export PERL_USE_UNSAFE_INC=0
 
 source ~/perl5/perlbrew/etc/bashrc
-perlbrew switch $PERL_VERSION
+perlbrew switch $PERL_VERSION ||
+perlbrew install --switch --notest --noman --thread $PERL_VERSION
 perlbrew list
 export PERL5LIB="$install_dir/lib/perl5"
 



[2/4] lucy git commit: Don't pass negative token id to Lemon parser

2018-02-08 Thread nwellnhof
Don't pass negative token id to Lemon parser

Newer Lemon versions throw an assertion if they encounter invalid
token ids.

Fixes LUCY-327. Thanks to Petr Pisar for the report.


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

Branch: refs/heads/master
Commit: e011b963e34890921f87942d0073b56a81e2c6cf
Parents: d09e6d2
Author: Nick Wellnhofer 
Authored: Thu Feb 8 14:29:11 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:07:13 2018 +0100

--
 core/Lucy/Util/Json.c | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/e011b963/core/Lucy/Util/Json.c
--
diff --git a/core/Lucy/Util/Json.c b/core/Lucy/Util/Json.c
index 46a0b89..be19660 100644
--- a/core/Lucy/Util/Json.c
+++ b/core/Lucy/Util/Json.c
@@ -479,6 +479,12 @@ S_do_parse_json(void *json_parser, const char *json, 
size_t len) {
 }
 break;
 }
+if (token_type < 0) {
+// Clear out parser and return.
+LucyParseJson(json_parser, 0, NULL, );
+SET_ERROR("JSON syntax error", save, end);
+return NULL;
+}
 LucyParseJson(json_parser, token_type, value, );
 if (state.errors) {
 SET_ERROR("JSON syntax error", save, end);



[4/4] lucy git commit: Run Travis tests with PERL_USE_UNSAFE_INC=0

2018-02-08 Thread nwellnhof
Run Travis tests with PERL_USE_UNSAFE_INC=0

This makes sure that Test::Harness doesn't set PERL_USE_UNSAFE_INC to 1
and that the tests are actually run without . in @INC.


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

Branch: refs/heads/master
Commit: d09e6d27692d105182241c6788fb6907789ec492
Parents: a1a61b7
Author: Nick Wellnhofer 
Authored: Thu Feb 8 13:34:41 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:07:13 2018 +0100

--
 devel/bin/travis-test.sh | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/d09e6d27/devel/bin/travis-test.sh
--
diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh
index bb7ce13..0927a29 100755
--- a/devel/bin/travis-test.sh
+++ b/devel/bin/travis-test.sh
@@ -45,6 +45,9 @@ test_c() {
 }
 
 test_perl() {
+# Test::Harness defaults to PERL_USE_UNSAFE_INC=1
+export PERL_USE_UNSAFE_INC=0
+
 source ~/perl5/perlbrew/etc/bashrc
 perlbrew switch $PERL_VERSION
 perlbrew list



[3/4] lucy git commit: Upgrade bundled Lemon parser to latest version

2018-02-08 Thread nwellnhof
Upgrade bundled Lemon parser to latest version

lemon.c is now at file 7f773532 from 2017-12-27
lempar.c is now at file da840fc8 from 2018-01-17


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

Branch: refs/heads/master
Commit: d8baf248bb14f4ae2dd358721b184d207412cdc5
Parents: e011b96
Author: Nick Wellnhofer 
Authored: Thu Feb 8 14:55:16 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:07:13 2018 +0100

--
 lemon/lemon.c  | 312 ++--
 lemon/lempar.c | 303 --
 2 files changed, 398 insertions(+), 217 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/d8baf248/lemon/lemon.c
--
diff --git a/lemon/lemon.c b/lemon/lemon.c
index 5f12460..96bbed7 100644
--- a/lemon/lemon.c
+++ b/lemon/lemon.c
@@ -168,12 +168,12 @@ static struct action *Action_new(void);
 static struct action *Action_sort(struct action *);
 
 /** From the file "build.h" /
-void FindRulePrecedences();
-void FindFirstSets();
-void FindStates();
-void FindLinks();
-void FindFollowSets();
-void FindActions();
+void FindRulePrecedences(struct lemon*);
+void FindFirstSets(struct lemon*);
+void FindStates(struct lemon*);
+void FindLinks(struct lemon*);
+void FindFollowSets(struct lemon*);
+void FindActions(struct lemon*);
 
 /* From the file "configlist.h" */
 void Configlist_init(void);
@@ -263,7 +263,8 @@ struct symbol {
   int useCnt;  /* Number of times used */
   char *destructor;/* Code which executes whenever this symbol is
** popped from the stack during error processing */
-  int destLineno;  /* Line number for start of destructor */
+  int destLineno;  /* Line number for start of destructor.  Set to
+   ** -1 for duplicate destructors. */
   char *datatype;  /* The data type of information held by this
** object. Only used if type==NONTERMINAL */
   int dtnum;   /* The data type number.  In the parser, the value
@@ -383,6 +384,12 @@ struct lemon {
   int nrule;   /* Number of rules */
   int nsymbol; /* Number of terminal and nonterminal symbols */
   int nterminal;   /* Number of terminal symbols */
+  int minShiftReduce;  /* Minimum shift-reduce action value */
+  int errAction;   /* Error action value */
+  int accAction;   /* Accept action value */
+  int noAction;/* No-op action value */
+  int minReduce;   /* Minimum reduce action */
+  int maxAction;   /* Maximum action value of any kind */
   struct symbol **symbols; /* Sorted array of pointers to symbols */
   int errorcnt;/* Number of errors */
   struct symbol *errsym;   /* The error symbol */
@@ -406,6 +413,7 @@ struct lemon {
   char *tokenprefix;   /* A prefix added to token names in the .h file */
   int nconflict;   /* Number of parsing conflicts */
   int nactiontab;  /* Number of entries in the yy_action[] table */
+  int nlookaheadtab;   /* Number of entries in yy_lookahead[] */
   int tablesize;   /* Total table size of all tables in bytes */
   int basisflag;   /* Print only basis configurations */
   int has_fallback;/* True if any %fallback is seen in the grammar */
@@ -456,7 +464,7 @@ struct state *State_new(void);
 void State_init(void);
 int State_insert(struct state *, struct config *);
 struct state *State_find(struct config *);
-struct state **State_arrayof(/*  */);
+struct state **State_arrayof(void);
 
 /* Routines used for efficiency in Configlist_add */
 
@@ -560,8 +568,8 @@ void Action_add(
 ** default action for the state_number is returned.
 **
 ** All actions associated with a single state_number are first entered
-** into aLookahead[] using multiple calls to acttab_action().  Then the 
-** actions for that single state_number are placed into the aAction[] 
+** into aLookahead[] using multiple calls to acttab_action().  Then the
+** actions for that single state_number are placed into the aAction[]
 ** array with a single call to acttab_insert().  The acttab_insert() call
 ** also resets the aLookahead[] array in preparation for the next
 ** state number.
@@ -582,10 +590,12 @@ struct acttab {
   int mxLookahead; /* Maximum aLookahead[].lookahead */
   int nLookahead;  /* Used slots in aLookahead[] */
   int 

lucy-clownfish git commit: Run Travis tests with PERL_USE_UNSAFE_INC=0

2018-02-08 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/0.6 d5a9a6868 -> c39c5df6a


Run Travis tests with PERL_USE_UNSAFE_INC=0

This makes sure that Test::Harness doesn't set PERL_USE_UNSAFE_INC to 1
and that the tests are actually run without . in @INC.


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

Branch: refs/heads/0.6
Commit: c39c5df6a3b4bb0935a804eb8afd8221b71435ac
Parents: d5a9a68
Author: Nick Wellnhofer 
Authored: Thu Feb 8 13:25:51 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 16:04:45 2018 +0100

--
 devel/bin/travis-test.sh | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c39c5df6/devel/bin/travis-test.sh
--
diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh
index 226d1b1..e9d7a51 100755
--- a/devel/bin/travis-test.sh
+++ b/devel/bin/travis-test.sh
@@ -31,6 +31,9 @@ test_c() {
 }
 
 test_perl() {
+# Test::Harness defaults to PERL_USE_UNSAFE_INC=1
+export PERL_USE_UNSAFE_INC=0
+
 source ~/perl5/perlbrew/etc/bashrc
 perlbrew list
 perlbrew switch $PERL_VERSION ||



[1/2] lucy-clownfish git commit: Run Travis tests with PERL_USE_UNSAFE_INC=0

2018-02-08 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 15e36c4f7 -> 137f74977


Run Travis tests with PERL_USE_UNSAFE_INC=0

This makes sure that Test::Harness doesn't set PERL_USE_UNSAFE_INC to 1
and that the tests are actually run without . in @INC.


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

Branch: refs/heads/master
Commit: 147e90e91bbaeafa9d886bf1a1ec02cf68a551b8
Parents: 15e36c4
Author: Nick Wellnhofer 
Authored: Thu Feb 8 13:25:51 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 13:32:53 2018 +0100

--
 devel/bin/travis-test.sh | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/147e90e9/devel/bin/travis-test.sh
--
diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh
index 78750eb..c33095c 100755
--- a/devel/bin/travis-test.sh
+++ b/devel/bin/travis-test.sh
@@ -35,6 +35,9 @@ test_c() {
 }
 
 test_perl() {
+# Test::Harness defaults to PERL_USE_UNSAFE_INC=1
+export PERL_USE_UNSAFE_INC=0
+
 source ~/perl5/perlbrew/etc/bashrc
 perlbrew list
 perlbrew switch $PERL_VERSION ||



[2/2] lucy-clownfish git commit: Fix -Wclobbered warnings

2018-02-08 Thread nwellnhof
Fix -Wclobbered warnings


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

Branch: refs/heads/master
Commit: 137f74977d7acc0d5314485eab1bdd537ffde71d
Parents: 147e90e
Author: Nick Wellnhofer 
Authored: Thu Feb 8 13:54:07 2018 +0100
Committer: Nick Wellnhofer 
Committed: Thu Feb 8 13:54:07 2018 +0100

--
 compiler/src/CFCTestClass.c| 9 -
 compiler/src/CFCTestMethod.c   | 9 -
 compiler/src/CFCTestSymbol.c   | 7 +++
 compiler/src/CFCTestType.c | 7 +++
 compiler/src/CFCTestVariable.c | 7 +++
 5 files changed, 17 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/137f7497/compiler/src/CFCTestClass.c
--
diff --git a/compiler/src/CFCTestClass.c b/compiler/src/CFCTestClass.c
index e894bc0..524ad48 100644
--- a/compiler/src/CFCTestClass.c
+++ b/compiler/src/CFCTestClass.c
@@ -50,16 +50,15 @@ const CFCTestBatch CFCTEST_BATCH_CLASS = {
 
 static char*
 S_try_create(CFCParcel *parcel, const char *name, const char *nickname) {
-CFCClass *klass = NULL;
-char *error;
+char *error;
 
 CFCUTIL_TRY {
-klass = CFCClass_create(parcel, NULL, name, nickname, NULL, NULL, NULL,
-false, false, false);
+CFCClass *klass = CFCClass_create(parcel, NULL, name, nickname, NULL,
+  NULL, NULL, false, false, false);
+CFCBase_decref((CFCBase*)klass);
 }
 CFCUTIL_CATCH(error);
 
-CFCBase_decref((CFCBase*)klass);
 return error;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/137f7497/compiler/src/CFCTestMethod.c
--
diff --git a/compiler/src/CFCTestMethod.c b/compiler/src/CFCTestMethod.c
index c0cf67b..eebe1ed 100644
--- a/compiler/src/CFCTestMethod.c
+++ b/compiler/src/CFCTestMethod.c
@@ -65,16 +65,15 @@ S_run_tests(CFCTest *test) {
 static char*
 S_try_new_method(const char *name, CFCType *return_type,
  CFCParamList *param_list, CFCClass *klass) {
-CFCMethod *method = NULL;
-char  *error;
+char *error;
 
 CFCUTIL_TRY {
-method = CFCMethod_new(NULL, name, return_type, param_list, NULL,
-   klass, 0, 0);
+CFCMethod *method = CFCMethod_new(NULL, name, return_type, param_list,
+  NULL, klass, 0, 0);
+CFCBase_decref((CFCBase*)method);
 }
 CFCUTIL_CATCH(error);
 
-CFCBase_decref((CFCBase*)method);
 return error;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/137f7497/compiler/src/CFCTestSymbol.c
--
diff --git a/compiler/src/CFCTestSymbol.c b/compiler/src/CFCTestSymbol.c
index e21f847..4d14a3f 100644
--- a/compiler/src/CFCTestSymbol.c
+++ b/compiler/src/CFCTestSymbol.c
@@ -40,15 +40,14 @@ const CFCTestBatch CFCTEST_BATCH_SYMBOL = {
 
 static char*
 S_try_new_symbol(const char *name) {
-CFCSymbol *symbol = NULL;
-char  *error;
+char *error;
 
 CFCUTIL_TRY {
-symbol = CFCSymbol_new("parcel", name);
+CFCSymbol *symbol = CFCSymbol_new("parcel", name);
+CFCBase_decref((CFCBase*)symbol);
 }
 CFCUTIL_CATCH(error);
 
-CFCBase_decref((CFCBase*)symbol);
 return error;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/137f7497/compiler/src/CFCTestType.c
--
diff --git a/compiler/src/CFCTestType.c b/compiler/src/CFCTestType.c
index 9c77aaf..eee0dd8 100644
--- a/compiler/src/CFCTestType.c
+++ b/compiler/src/CFCTestType.c
@@ -264,15 +264,14 @@ S_run_void_tests(CFCTest *test) {
 
 static char*
 S_try_new_object(CFCParcel *parcel, const char *specifier, int indirection) {
-CFCType *type = NULL;
-char*error;
+char *error;
 
 CFCUTIL_TRY {
-type = CFCType_new_object(0, parcel, specifier, indirection);
+CFCType *type = CFCType_new_object(0, parcel, specifier, indirection);
+CFCBase_decref((CFCBase*)type);
 }
 CFCUTIL_CATCH(error);
 
-CFCBase_decref((CFCBase*)type);
 return error;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/137f7497/compiler/src/CFCTestVariable.c
--
diff --git a/compiler/src/CFCTestVariable.c b/compiler/src/CFCTestVariable.c
index c088b85..c005a54 100644
--- 

[1/2] lucy-clownfish git commit: Fix Perl build if "." is not in @INC

2017-11-24 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master e96564cdb -> 15e36c4f7


Fix Perl build if "." is not in @INC

Perl 5.26 doesn't put "." in @INC anymore. Add "." to a localized @INC
when loading Charmony.pm and the binding .pm files.

Fixes CLOWNFISH-119.


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

Branch: refs/heads/master
Commit: 7238ced291cd7e393a7e4ce60995e30bf04a4c03
Parents: e96564c
Author: Nick Wellnhofer 
Authored: Fri Nov 24 14:43:28 2017 +0100
Committer: Nick Wellnhofer 
Committed: Fri Nov 24 15:17:31 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm   | 1 +
 compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm | 1 +
 2 files changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/7238ced2/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
--
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm 
b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
index 7d1a506..35c6a2a 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -227,6 +227,7 @@ sub _compile_clownfish {
 $hierarchy->read_host_data_json;
 
 # Process all Binding classes in buildlib.
+local @INC = ( @INC, '.' );
 my $pm_filepaths = $self->rscan_dir( $BUILDLIB_DIR, qr/\.pm$/ );
 for my $pm_filepath (@$pm_filepaths) {
 next unless $pm_filepath =~ /Binding/;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/7238ced2/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
--
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm 
b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
index bcd9d46..f109e94 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
@@ -138,6 +138,7 @@ my $config;
 sub charmony {
 my ( undef, $key ) = @_;
 if (!$config) {
+local @INC = ( @INC, '.' );
 eval { require 'Charmony.pm'; };
 if ( !$@ ) {
 $config = Charmony->config;



[1/2] lucy-clownfish git commit: Fix Perl build if "." is not in @INC

2017-11-24 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/0.6 6555ea20b -> d5a9a6868


Fix Perl build if "." is not in @INC

Perl 5.26 doesn't put "." in @INC anymore. Add "." to a localized @INC
when loading Charmony.pm and the binding .pm files.

Fixes CLOWNFISH-119.


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

Branch: refs/heads/0.6
Commit: 59d5cac1ce71f575d255144895c6860fa22a9895
Parents: 6555ea2
Author: Nick Wellnhofer 
Authored: Fri Nov 24 14:43:28 2017 +0100
Committer: Nick Wellnhofer 
Committed: Fri Nov 24 14:43:28 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm   | 1 +
 compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm | 1 +
 2 files changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/59d5cac1/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
--
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm 
b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
index a4ac266..f4d6971 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -227,6 +227,7 @@ sub _compile_clownfish {
 $hierarchy->read_host_data_json;
 
 # Process all Binding classes in buildlib.
+local @INC = ( @INC, '.' );
 my $pm_filepaths = $self->rscan_dir( $BUILDLIB_DIR, qr/\.pm$/ );
 for my $pm_filepath (@$pm_filepaths) {
 next unless $pm_filepath =~ /Binding/;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/59d5cac1/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
--
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm 
b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
index 35c0e22..343f768 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
@@ -131,6 +131,7 @@ my $config;
 sub charmony {
 my ( undef, $key ) = @_;
 if (!$config) {
+local @INC = ( @INC, '.' );
 eval { require 'Charmony.pm'; };
 if ( !$@ ) {
 $config = Charmony->config;



[2/2] lucy-clownfish git commit: Disable thread support under Perl 5.8

2017-11-24 Thread nwellnhof
Disable thread support under Perl 5.8

We got some mysterious CPAN Testers failures with several 5.8 releases
when calling Err_get_error from a thread. Disable thread support under
Perl 5.8, even if 5.8.9 seems to work. (Note that version 5.10.0 has
already been blacklisted.)

http://matrix.cpantesters.org/?dist=Clownfish+0.6.2
http://www.cpantesters.org/cpan/report/4c2e4fd2-cf8c-11e7-b8bd-809199b835e7
http://www.cpantesters.org/cpan/report/a93c273a-cf8c-11e7-b8bd-809199b835e7


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

Branch: refs/heads/0.6
Commit: d5a9a6868cf241561fc3b3388f5859f2d277d154
Parents: 59d5cac
Author: Nick Wellnhofer 
Authored: Fri Nov 24 14:53:11 2017 +0100
Committer: Nick Wellnhofer 
Committed: Fri Nov 24 15:03:12 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d5a9a686/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
--
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm 
b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
index 343f768..c897376 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
@@ -101,7 +101,9 @@ sub ACTION_charmony {
 }
 # Perl 5.8.7 added support for CLONE_SKIP.
 # Thread support in 5.10.0 seems completely broken (CLOWNFISH-107).
-if ( !$self->config('usethreads') || $^V lt v5.8.7 || $^V eq v5.10.0 ) {
+# We also got some mysterious, thread-related CPAN Testers failures with
+# several 5.8 releases, so disable thread support for 5.10.0 and earlier.
+if ( !$self->config('usethreads') || $^V le v5.10.0 ) {
 push @command, '--disable-threads';
 }
 push @command, (



[2/2] lucy-clownfish git commit: Disable thread support under Perl 5.8

2017-11-24 Thread nwellnhof
Disable thread support under Perl 5.8

We got some mysterious CPAN Testers failures with several 5.8 releases
when calling Err_get_error from a thread. Disable thread support under
Perl 5.8, even if 5.8.9 seems to work. (Note that version 5.10.0 has
already been blacklisted.)

http://matrix.cpantesters.org/?dist=Clownfish+0.6.2
http://www.cpantesters.org/cpan/report/4c2e4fd2-cf8c-11e7-b8bd-809199b835e7
http://www.cpantesters.org/cpan/report/a93c273a-cf8c-11e7-b8bd-809199b835e7


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

Branch: refs/heads/master
Commit: 15e36c4f7fddb31db54ff7f1c4eeefe859f910ff
Parents: 7238ced
Author: Nick Wellnhofer 
Authored: Fri Nov 24 14:53:11 2017 +0100
Committer: Nick Wellnhofer 
Committed: Fri Nov 24 15:17:40 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/15e36c4f/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
--
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm 
b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
index f109e94..5bcf4c8 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
@@ -108,7 +108,9 @@ sub ACTION_charmony {
 }
 # Perl 5.8.7 added support for CLONE_SKIP.
 # Thread support in 5.10.0 seems completely broken (CLOWNFISH-107).
-if ( !$self->config('usethreads') || $^V lt v5.8.7 || $^V eq v5.10.0 ) {
+# We also got some mysterious, thread-related CPAN Testers failures with
+# several 5.8 releases, so disable thread support for 5.10.0 and earlier.
+if ( !$self->config('usethreads') || $^V le v5.10.0 ) {
 push @command, '--disable-threads';
 }
 push @command, (



svn commit: r1021215 - /websites/production/lucy/content/

2017-11-22 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 22 12:46:21 2017
New Revision: 1021215

Log:
Publishing svnmucc operation to lucy site by nwellnhof

Added:
websites/production/lucy/content/
  - copied from r1021214, websites/staging/lucy/trunk/content/



svn commit: r1816052 - /lucy/site/trunk/content/download.mdtext

2017-11-22 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 22 12:45:45 2017
New Revision: 1816052

URL: http://svn.apache.org/viewvc?rev=1816052=rev
Log:
Fix link to Clownfish SHA512

Modified:
lucy/site/trunk/content/download.mdtext

Modified: lucy/site/trunk/content/download.mdtext
URL: 
http://svn.apache.org/viewvc/lucy/site/trunk/content/download.mdtext?rev=1816052=1816051=1816052=diff
==
--- lucy/site/trunk/content/download.mdtext (original)
+++ lucy/site/trunk/content/download.mdtext Wed Nov 22 12:45:45 2017
@@ -14,7 +14,7 @@ Title: Apache Lucy Downloads
  - 
[apache-clownfish-0.6.2.tar.gz](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/apache-clownfish-0.6.2.tar.gz)
  - 
[[OpenPGP]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.asc)
  - 
[[MD5]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.md5)
- - 
[[SHA512]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.sha)
+ - 
[[SHA512]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.sha512)
  - 
[CHANGES](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/CHANGES-0.6.2.txt)
  - [KEYS](https://www.apache.org/dist/lucy/KEYS)
 




svn commit: r1021213 - /websites/production/lucy/content/

2017-11-22 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 22 12:43:12 2017
New Revision: 1021213

Log:
Publishing svnmucc operation to lucy site by nwellnhof

Added:
websites/production/lucy/content/
  - copied from r1021212, websites/staging/lucy/trunk/content/



svn commit: r1816049 - /lucy/site/trunk/content/download.mdtext

2017-11-22 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 22 12:40:45 2017
New Revision: 1816049

URL: http://svn.apache.org/viewvc?rev=1816049=rev
Log:
Update download links for Clownfish 0.6.2 release

Modified:
lucy/site/trunk/content/download.mdtext

Modified: lucy/site/trunk/content/download.mdtext
URL: 
http://svn.apache.org/viewvc/lucy/site/trunk/content/download.mdtext?rev=1816049=1816048=1816049=diff
==
--- lucy/site/trunk/content/download.mdtext (original)
+++ lucy/site/trunk/content/download.mdtext Wed Nov 22 12:40:45 2017
@@ -9,13 +9,13 @@ Title: Apache Lucy Downloads
  - [CHANGES](http://www.apache.org/dyn/closer.cgi?path=/lucy/CHANGES-0.6.1.txt)
  - [KEYS](https://www.apache.org/dist/lucy/KEYS)
 
- Apache Clownfish symbiotic object system, release 0.6.1
+ Apache Clownfish symbiotic object system, release 0.6.2
 
- - 
[apache-clownfish-0.6.1.tar.gz](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/apache-clownfish-0.6.1.tar.gz)
- - 
[[OpenPGP]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.1.tar.gz.asc)
- - 
[[MD5]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.1.tar.gz.md5)
- - 
[[SHA512]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.1.tar.gz.sha)
- - 
[CHANGES](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/CHANGES-0.6.1.txt)
+ - 
[apache-clownfish-0.6.2.tar.gz](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/apache-clownfish-0.6.2.tar.gz)
+ - 
[[OpenPGP]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.asc)
+ - 
[[MD5]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.md5)
+ - 
[[SHA512]](https://www.apache.org/dist/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.sha)
+ - 
[CHANGES](http://www.apache.org/dyn/closer.cgi?path=/lucy/clownfish/CHANGES-0.6.2.txt)
  - [KEYS](https://www.apache.org/dist/lucy/KEYS)
 
  Verifying downloaded files




svn commit: r23249 - in /release/lucy/clownfish: CHANGES-0.6.1.txt apache-clownfish-0.6.1.tar.gz apache-clownfish-0.6.1.tar.gz.asc apache-clownfish-0.6.1.tar.gz.md5 apache-clownfish-0.6.1.tar.gz.sha

2017-11-22 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 22 12:28:31 2017
New Revision: 23249

Log:
Remove Apache Clownfish 0.6.1

Removed:
release/lucy/clownfish/CHANGES-0.6.1.txt
release/lucy/clownfish/apache-clownfish-0.6.1.tar.gz
release/lucy/clownfish/apache-clownfish-0.6.1.tar.gz.asc
release/lucy/clownfish/apache-clownfish-0.6.1.tar.gz.md5
release/lucy/clownfish/apache-clownfish-0.6.1.tar.gz.sha



svn commit: r23248 - /dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/

2017-11-22 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 22 12:27:50 2017
New Revision: 23248

Log:
Remove apache-clownfish-0.6.2-rc1 directory

Removed:
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/



svn commit: r23247 - /dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/ /release/lucy/clownfish/

2017-11-22 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 22 12:27:07 2017
New Revision: 23247

Log:
Publish Apache Clownfish 0.6.2

Added:
release/lucy/clownfish/CHANGES-0.6.2.txt
  - copied unchanged from r23246, 
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/CHANGES-0.6.2.txt
release/lucy/clownfish/apache-clownfish-0.6.2.tar.gz
  - copied unchanged from r23246, 
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz
release/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.asc
  - copied unchanged from r23246, 
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.asc
release/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.md5
  - copied unchanged from r23246, 
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.md5
release/lucy/clownfish/apache-clownfish-0.6.2.tar.gz.sha512
  - copied unchanged from r23246, 
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.sha512
Removed:
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/CHANGES-0.6.2.txt
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz

dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.asc

dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.md5

dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.sha512



[lucy-clownfish] Git Push Summary

2017-11-22 Thread nwellnhof
Repository: lucy-clownfish
Updated Tags:  refs/tags/v0.6.2-rc1 [deleted] 8c0463566


[lucy-clownfish] Git Push Summary

2017-11-22 Thread nwellnhof
Repository: lucy-clownfish
Updated Tags:  refs/tags/rel/v0.6.2 [created] 8c0463566


[lucy-clownfish] Git Push Summary

2017-11-15 Thread nwellnhof
Repository: lucy-clownfish
Updated Tags:  refs/tags/v0.6.2-rc1 [created] 8c0463566


lucy-clownfish git commit: Updating CHANGES and version number for release 0.6.2

2017-11-15 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/0.6 287f7ba06 -> 6555ea20b


Updating CHANGES and version number for release 0.6.2


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

Branch: refs/heads/0.6
Commit: 6555ea20b0242f75914ee9567685cca15929a5bc
Parents: 287f7ba
Author: Nick Wellnhofer 
Authored: Wed Nov 15 16:25:16 2017 +0100
Committer: Nick Wellnhofer 
Committed: Wed Nov 15 16:25:16 2017 +0100

--
 CHANGES   |  6 ++
 compiler/common/charmonizer.c |  2 +-
 compiler/common/charmonizer.main  |  2 +-
 compiler/go/INSTALL.md|  2 +-
 compiler/perl/Build.PL|  2 +-
 compiler/perl/buildlib/Clownfish/CFC/Build.pm |  2 +-
 .../perl/buildlib/Clownfish/CFC/Test/TestUtils.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC.pm|  4 ++--
 compiler/perl/lib/Clownfish/CFC/Base.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Core.pm   |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Core/Aliases.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Core/Class.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Core/File.pm  |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Core/Function.pm   |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Core/Method.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Perl.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm |  2 +-
 .../lib/Clownfish/CFC/Binding/Perl/Constructor.pm |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Perl/Method.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Binding/Perl/Pod.pm   |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Perl/Subroutine.pm |  2 +-
 .../perl/lib/Clownfish/CFC/Binding/Perl/TypeMap.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/CBlock.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Class.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/DocuComment.pm  |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/File.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/FileSpec.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Function.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Hierarchy.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Method.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/ParamList.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Parcel.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Prereq.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Symbol.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Type.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Variable.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Model/Version.pm  |  2 +-
 compiler/perl/lib/Clownfish/CFC/Parser.pm |  2 +-
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm |  6 +++---
 .../perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm|  2 +-
 compiler/perl/lib/Clownfish/CFC/Test.pm   |  2 +-
 compiler/perl/lib/Clownfish/CFC/Util.pm   |  2 +-
 compiler/python/setup.py  |  2 +-
 runtime/c/install.sh  |  2 +-
 runtime/common/charmonizer.c  |  2 +-
 runtime/common/charmonizer.main   |  2 +-
 runtime/core/Clownfish.cfp|  2 +-
 runtime/core/Clownfish/Docs/WritingClasses.md |  2 +-
 runtime/perl/Build.PL |  6 +++---
 runtime/perl/buildlib/Clownfish/Build.pm  |  2 +-
 runtime/perl/buildlib/Clownfish/Build/Binding.pm  |  2 +-
 runtime/perl/lib/Clownfish.pm | 14 +++---
 runtime/perl/lib/Clownfish/Blob.pm|  2 +-
 runtime/perl/lib/Clownfish/Boolean.pm |  2 +-
 runtime/perl/lib/Clownfish/ByteBuf.pm |  2 +-
 runtime/perl/lib/Clownfish/CharBuf.pm |  2 +-
 runtime/perl/lib/Clownfish/Class.pm   |  2 +-
 runtime/perl/lib/Clownfish/Err.pm |  2 +-
 runtime/perl/lib/Clownfish/Float.pm   |  2 +-
 runtime/perl/lib/Clownfish/Hash.pm|  2 +-
 runtime/perl/lib/Clownfish/HashIterator.pm|  2 +-
 runtime/perl/lib/Clownfish/Integer.pm |  2 +-
 runtime/perl/lib/Clownfish/Obj.pm |  2 +-
 runtime/perl/lib/Clownfish/String.pm  |  2 +-
 runtime/perl/lib/Clownfish/Test.pm|  4 ++--
 runtime/perl/lib/Clownfish/Vector.pm  |  2 +-
 runtime/python/setup.py

svn commit: r23113 - in /dev/lucy/clownfish/apache-clownfish-0.6.2-rc1: CHANGES-0.6.2.txt apache-clownfish-0.6.2.tar.gz apache-clownfish-0.6.2.tar.gz.asc apache-clownfish-0.6.2.tar.gz.md5 apache-clown

2017-11-15 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 15 15:47:57 2017
New Revision: 23113

Log:
Add apache-clownfish-0.6.2 artifacts

Added:
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/CHANGES-0.6.2.txt
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz 
  (with props)

dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.asc

dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.md5

dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/apache-clownfish-0.6.2.tar.gz.sha512

Added: dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/CHANGES-0.6.2.txt
==
--- dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/CHANGES-0.6.2.txt (added)
+++ dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/CHANGES-0.6.2.txt Wed Nov 15 
15:47:57 2017
@@ -0,0 +1,163 @@
+Revision history for Apache Clownfish
+
+0.6.2  2017-11-15
+
+  Improvements:
+
+* [CLOWNFISH-118] - Prepare for CV-in-stash optimization in Perl 5.28
+
+0.6.1  2016-12-09
+
+  Bugfixes:
+
+* [CLOWNFISH-104] - BSD make doesn't support pattern rules
+* [CLOWNFISH-105] - CPAN dist includes Clownfish/Test.xs
+* [CLOWNFISH-106] - CFC needs more recent Module::Build
+* [CLOWNFISH-107] - Threaded error tests segfault under Perl 5.10.0
+* [CLOWNFISH-108] - Clownfish::Test shouldn't be listed in META.yml
+* [CLOWNFISH-111] - Compilation fails with ccache
+
+0.6.0  2016-09-24
+
+  Bugfixes:
+
+* [CLOWNFISH-36] - Handle circular references in Perl array and hash
+   conversion
+* [CLOWNFISH-78] - Bootstrap process isn't thread-safe
+* [CLOWNFISH-88] - Travis Perl setup broken
+* [CLOWNFISH-90] - Unsafe usage of ctype.h functions
+* [CLOWNFISH-92] - Skip threaded tests under Perl < 5.8.7
+* [CLOWNFISH-93] - Missing C API docs for inherited methods
+* [CLOWNFISH-96] - CB_VCatF allows invalid UTF-8 in patterns
+* [CLOWNFISH-98] - Fix HashIterator error message
+* [CLOWNFISH-99] - UTF-8 validator allows code points above 0x10
+* [CLOWNFISH-100] - Support building with MSYS make
+* [CLOWNFISH-101] - MinGW C build breaks in tls.c
+
+  Improvements:
+
+* [CLOWNFISH-14] - Test CFC exceptions in C
+* [CLOWNFISH-80] - Remove test code from binaries
+* [CLOWNFISH-83] - Install host alias and exclusion data for prereq
+   parcels
+* [CLOWNFISH-87] - Use system cmark if possible
+* [CLOWNFISH-91] - Changelog missing from CPAN tarball
+* [CLOWNFISH-94] - Remove C API documentation for Destroy method
+* [CLOWNFISH-95] - Improve test coverage
+* [CLOWNFISH-97] - Don't print errors to stderr
+* [CLOWNFISH-102] - Better directory layout for installed Clownfish
+headers
+* [CLOWNFISH-103] - Rename Clownfish C library to libclownfish
+
+  Tasks:
+
+* [CLOWNFISH-76] - Move most string helpers to Lucy
+
+0.5.1  2016-04-14
+
+  Bugfixes:
+
+* [CLOWNFISH-77] - Failed test 'reject bad name' on Strawberry Perl
+* [CLOWNFISH-88] - Travis Perl setup broken
+* [CLOWNFISH-89] - Stale .cfh files can cause build failures
+
+0.5.0  2016-03-04
+
+  New features:
+
+* [CLOWNFISH-2] - Create iterator for Hash
+* [CLOWNFISH-19] - Go (golang) bindings for CFC
+* [CLOWNFISH-23] - Markdown for documentation
+* [CLOWNFISH-26] - Markdown for standalone documentation files
+* [CLOWNFISH-28] - Proof-of-concept Go bindings
+* [CLOWNFISH-46] - Travis CI with multiple host languages
+* [CLOWNFISH-64] - Autogenerate subroutine code samples in Perl POD
+* [CLOWNFISH-66] - Python-specific CFC
+* [CLOWNFISH-71] - Autogenerate HTML documentation for C API
+* [CLOWNFISH-72] - Document Clownfish internals like header file language
+* [CLOWNFISH-75] - Add Clownfish page to lucy.apache.org
+
+  Bugfixes:
+
+* [CLOWNFISH-3] - Charmonizer bombs out trying to set warnings as errors
+  with Strawberry Perl
+* [CLOWNFISH-9] - Make most Clownfish core types final
+* [CLOWNFISH-24] - Error handling in C bindings is not thread-safe
+* [CLOWNFISH-33] - Duplicate hash entries
+* [CLOWNFISH-37] - Order of refcount manipulation when overwriting
+* [CLOWNFISH-45] - Dynamically subclassing a final class should fail
+* [CLOWNFISH-47] - Tighten up final method code gen and optimization
+* [CLOWNFISH-62] - Crash when passing Perl variable as decremented arg
+* [CLOWNFISH-63] - Don't export private methods via Go
+* [CLOWNFISH-69] - Clownfish::CFC missing from CPAN prereqs
+* [CLOWNFISH-84] - Guarantee nul-terminated arg to strtod in Str_To_F64
+
+  Improvements:
+
+* [CLOWNFISH-7] - String-only keys for Hash
+* [CLOWNFISH-11] - Rework ByteBuf
+* [CLOWNFISH-15] - Method OFFSET vars should be uint32_t instead of
+   size_t
+* [CLOWNFISH-27] - Use functions rather than meth

svn commit: r23112 - /dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/

2017-11-15 Thread nwellnhof
Author: nwellnhof
Date: Wed Nov 15 15:44:13 2017
New Revision: 23112

Log:
Create RC dir for apache-clownfish-0.6.2-rc1

Added:
dev/lucy/clownfish/apache-clownfish-0.6.2-rc1/



[1/3] lucy-clownfish git commit: Prepare for CV-in-stash optimization in Perl 5.28.

2017-11-14 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/0.6 5f6cb2448 -> 287f7ba06


Prepare for CV-in-stash optimization in Perl 5.28.

Perl 5.28 will start to store subroutines in stashes as coderefs.

See

https://rt.perl.org/Public/Bug/Display.html?id=129916
https://rt.perl.org/Public/Bug/Display.html?id=132252
https://perl5.git.perl.org/perl.git/commitdiff/7d65f652cb


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

Branch: refs/heads/0.6
Commit: 52531b7884c5e65561dd3340f73bfb752a6734b8
Parents: 5f6cb24
Author: Nick Wellnhofer 
Authored: Fri Oct 27 15:03:40 2017 +0200
Committer: Nick Wellnhofer 
Committed: Tue Nov 14 15:05:43 2017 +0100

--
 runtime/perl/lib/Clownfish.pm | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/52531b78/runtime/perl/lib/Clownfish.pm
--
diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm
index b7e6e60..6cb38d9 100644
--- a/runtime/perl/lib/Clownfish.pm
+++ b/runtime/perl/lib/Clownfish.pm
@@ -80,9 +80,11 @@ sub error {$Clownfish::Err::error}
 my $stash = \%{"$package\::"};
 my $methods
 = Clownfish::Vector->new( capacity => scalar keys %$stash );
-while ( my ( $symbol, $glob ) = each %$stash ) {
-next if ref $glob;
-next unless *$glob{CODE};
+while ( my ( $symbol, $entry ) = each %$stash ) {
+# A subroutine is stored in the CODE slot of a typeglob. Since
+# Perl 5.28 it may also be stored as a coderef.
+next unless ref($entry) eq 'CODE'
+|| ( ref(\$entry) eq 'GLOB' && *$entry{CODE} );
 $methods->push( Clownfish::String->new($symbol) );
 }
 return $methods;



[2/3] lucy-clownfish git commit: Fix Travis Perl versions

2017-11-14 Thread nwellnhof
Fix Travis Perl versions

The Perl versions available under Travis have changed and many older
releases were removed. Make perlbrew build releases that aren't
installed. Reduce the number of tested versions, but add test with
blead.


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

Branch: refs/heads/0.6
Commit: 2bb466f227317877f6d40b22b000202bb812a2fb
Parents: 52531b7
Author: Nick Wellnhofer 
Authored: Tue Nov 14 14:09:06 2017 +0100
Committer: Nick Wellnhofer 
Committed: Tue Nov 14 15:05:48 2017 +0100

--
 .travis.yml  | 9 +++--
 devel/bin/travis-test.sh | 3 ++-
 2 files changed, 5 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2bb466f2/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 7bd87b7..f2d18e2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,13 +22,10 @@ matrix:
   include:
 - env: CLOWNFISH_HOST=c
 - env: CLOWNFISH_HOST=go
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.20-extras
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.18-extras
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.16
+- env: CLOWNFISH_HOST=perl PERL_VERSION=blead
+- env: CLOWNFISH_HOST=perl PERL_VERSION=5.24-extras
 - env: CLOWNFISH_HOST=perl PERL_VERSION=5.14
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.12
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.10
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.8
+- env: CLOWNFISH_HOST=perl PERL_VERSION=5.8.3
 #- env: CLOWNFISH_HOST=python
 #  addons:
 #apt:

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2bb466f2/devel/bin/travis-test.sh
--
diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh
index a41c7e6..226d1b1 100755
--- a/devel/bin/travis-test.sh
+++ b/devel/bin/travis-test.sh
@@ -32,8 +32,9 @@ test_c() {
 
 test_perl() {
 source ~/perl5/perlbrew/etc/bashrc
-perlbrew switch $PERL_VERSION
 perlbrew list
+perlbrew switch $PERL_VERSION ||
+perlbrew install --switch --notest --noman --thread $PERL_VERSION
 cd compiler/perl
 cpanm --quiet --installdeps --notest .
 perl Build.PL



lucy-clownfish git commit: Add sha512 explicit algorithm to file extension

2017-11-14 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 120ece10e -> e96564cdb


Add sha512 explicit algorithm to file extension


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

Branch: refs/heads/master
Commit: e96564cdb861f6886375b204261c8911841496c4
Parents: 120ece1
Author: Nick Wellnhofer 
Authored: Tue Nov 14 15:09:14 2017 +0100
Committer: Nick Wellnhofer 
Committed: Tue Nov 14 15:09:41 2017 +0100

--
 devel/bin/release_commands.pl | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/e96564cd/devel/bin/release_commands.pl
--
diff --git a/devel/bin/release_commands.pl b/devel/bin/release_commands.pl
index 9d0e993..f824379 100755
--- a/devel/bin/release_commands.pl
+++ b/devel/bin/release_commands.pl
@@ -106,7 +106,7 @@ say qq|perl -MDigest -e '\$d = Digest->new("SHA-512"); open 
\$fh, |
 . qq|"addfile(\$fh); print \$d->hexdigest; |
 . qq|print "  apache-clownfish-$x_y_z_version.tar.gz\\n"' > |
-. qq| apache-clownfish-$x_y_z_version.tar.gz.sha\n|;
+. qq| apache-clownfish-$x_y_z_version.tar.gz.sha512\n|;
 
 say qq|# Sign the release.|;
 say qq|gpg --armor --output apache-clownfish-$x_y_z_version.tar.gz.asc |
@@ -116,7 +116,7 @@ say qq|# Add the artifacts and commit to the dev area on 
dist.apache.org.|;
 say qq|svn add |
 . qq|apache-clownfish-$x_y_z_version.tar.gz |
 . qq|apache-clownfish-$x_y_z_version.tar.gz.md5 |
-. qq|apache-clownfish-$x_y_z_version.tar.gz.sha |
+. qq|apache-clownfish-$x_y_z_version.tar.gz.sha512 |
 . qq|apache-clownfish-$x_y_z_version.tar.gz.asc |
 . qq|CHANGES-$x_y_z_version.txt |;
 say qq|svn ci -m "Add apache-clownfish-$x_y_z_version artifacts"\n|;
@@ -161,8 +161,8 @@ say qq|svnmucc -m "Publish Apache Clownfish $x_y_z_version" 
|
 . qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz |
 . qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/apache-clownfish-$x_y_z_version.tar.gz.md5
 |
 . qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz.md5 |
-. qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/apache-clownfish-$x_y_z_version.tar.gz.sha
 |
-. qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz.sha |
+. qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/apache-clownfish-$x_y_z_version.tar.gz.sha512
 |
+. qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz.sha512 |
 . qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/apache-clownfish-$x_y_z_version.tar.gz.asc
 |
 . qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz.asc |
 . qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/CHANGES-$x_y_z_version.txt 
|
@@ -179,7 +179,7 @@ if ( $micro > 0 ) {
 . qq|-U https://dist.apache.org/repos/dist/release/lucy/clownfish |
 . qq|rm apache-clownfish-$prev.tar.gz |
 . qq|rm apache-clownfish-$prev.tar.gz.md5 |
-. qq|rm apache-clownfish-$prev.tar.gz.sha |
+. qq|rm apache-clownfish-$prev.tar.gz.sha512 |
 . qq|rm apache-clownfish-$prev.tar.gz.asc |
 . qq|rm CHANGES-$prev.txt |;
 }



[3/3] lucy-clownfish git commit: Add sha512 explicit algorithm to file extension

2017-11-14 Thread nwellnhof
Add sha512 explicit algorithm to file extension


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

Branch: refs/heads/0.6
Commit: 287f7ba063caf1f4141ea7199d56387a3405bdc4
Parents: 2bb466f
Author: Nick Wellnhofer 
Authored: Tue Nov 14 15:09:14 2017 +0100
Committer: Nick Wellnhofer 
Committed: Tue Nov 14 15:09:14 2017 +0100

--
 devel/bin/release_commands.pl | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/287f7ba0/devel/bin/release_commands.pl
--
diff --git a/devel/bin/release_commands.pl b/devel/bin/release_commands.pl
index 9d0e993..f824379 100755
--- a/devel/bin/release_commands.pl
+++ b/devel/bin/release_commands.pl
@@ -106,7 +106,7 @@ say qq|perl -MDigest -e '\$d = Digest->new("SHA-512"); open 
\$fh, |
 . qq|"addfile(\$fh); print \$d->hexdigest; |
 . qq|print "  apache-clownfish-$x_y_z_version.tar.gz\\n"' > |
-. qq| apache-clownfish-$x_y_z_version.tar.gz.sha\n|;
+. qq| apache-clownfish-$x_y_z_version.tar.gz.sha512\n|;
 
 say qq|# Sign the release.|;
 say qq|gpg --armor --output apache-clownfish-$x_y_z_version.tar.gz.asc |
@@ -116,7 +116,7 @@ say qq|# Add the artifacts and commit to the dev area on 
dist.apache.org.|;
 say qq|svn add |
 . qq|apache-clownfish-$x_y_z_version.tar.gz |
 . qq|apache-clownfish-$x_y_z_version.tar.gz.md5 |
-. qq|apache-clownfish-$x_y_z_version.tar.gz.sha |
+. qq|apache-clownfish-$x_y_z_version.tar.gz.sha512 |
 . qq|apache-clownfish-$x_y_z_version.tar.gz.asc |
 . qq|CHANGES-$x_y_z_version.txt |;
 say qq|svn ci -m "Add apache-clownfish-$x_y_z_version artifacts"\n|;
@@ -161,8 +161,8 @@ say qq|svnmucc -m "Publish Apache Clownfish $x_y_z_version" 
|
 . qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz |
 . qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/apache-clownfish-$x_y_z_version.tar.gz.md5
 |
 . qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz.md5 |
-. qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/apache-clownfish-$x_y_z_version.tar.gz.sha
 |
-. qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz.sha |
+. qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/apache-clownfish-$x_y_z_version.tar.gz.sha512
 |
+. qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz.sha512 |
 . qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/apache-clownfish-$x_y_z_version.tar.gz.asc
 |
 . qq|release/lucy/clownfish/apache-clownfish-$x_y_z_version.tar.gz.asc |
 . qq|mv 
dev/lucy/clownfish/apache-clownfish-$full_rc_version/CHANGES-$x_y_z_version.txt 
|
@@ -179,7 +179,7 @@ if ( $micro > 0 ) {
 . qq|-U https://dist.apache.org/repos/dist/release/lucy/clownfish |
 . qq|rm apache-clownfish-$prev.tar.gz |
 . qq|rm apache-clownfish-$prev.tar.gz.md5 |
-. qq|rm apache-clownfish-$prev.tar.gz.sha |
+. qq|rm apache-clownfish-$prev.tar.gz.sha512 |
 . qq|rm apache-clownfish-$prev.tar.gz.asc |
 . qq|rm CHANGES-$prev.txt |;
 }



[2/2] lucy-clownfish git commit: Fix Travis Perl versions

2017-11-14 Thread nwellnhof
Fix Travis Perl versions

The Perl versions available under Travis have changed and many older
releases were removed. Make perlbrew build releases that aren't
installed. Reduce the number of tested versions, but add test with
blead.


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

Branch: refs/heads/master
Commit: 120ece10e6bb414607a594cbafd398b4fc49a3a9
Parents: f30ed78
Author: Nick Wellnhofer 
Authored: Tue Nov 14 14:09:06 2017 +0100
Committer: Nick Wellnhofer 
Committed: Tue Nov 14 15:04:25 2017 +0100

--
 .travis.yml  | 9 +++--
 devel/bin/travis-test.sh | 3 ++-
 2 files changed, 5 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/120ece10/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 3c150d5..53f7736 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,13 +28,10 @@ matrix:
 - gcc-arm-linux-gnueabihf
 - libc6-dev-armhf-cross
 - env: CLOWNFISH_HOST=go
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.20-extras
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.18-extras
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.16
+- env: CLOWNFISH_HOST=perl PERL_VERSION=blead
+- env: CLOWNFISH_HOST=perl PERL_VERSION=5.24-extras
 - env: CLOWNFISH_HOST=perl PERL_VERSION=5.14
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.12
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.10
-- env: CLOWNFISH_HOST=perl PERL_VERSION=5.8
+- env: CLOWNFISH_HOST=perl PERL_VERSION=5.8.3
 #- env: CLOWNFISH_HOST=python
 #  addons:
 #apt:

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/120ece10/devel/bin/travis-test.sh
--
diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh
index f96f779..78750eb 100755
--- a/devel/bin/travis-test.sh
+++ b/devel/bin/travis-test.sh
@@ -36,8 +36,9 @@ test_c() {
 
 test_perl() {
 source ~/perl5/perlbrew/etc/bashrc
-perlbrew switch $PERL_VERSION
 perlbrew list
+perlbrew switch $PERL_VERSION ||
+perlbrew install --switch --notest --noman --thread $PERL_VERSION
 cd compiler/perl
 cpanm --quiet --installdeps --notest .
 perl Build.PL



[1/2] lucy-clownfish git commit: Prepare for CV-in-stash optimization in Perl 5.28.

2017-11-14 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 3b8ace378 -> 120ece10e


Prepare for CV-in-stash optimization in Perl 5.28.

Perl 5.28 will start to store subroutines in stashes as coderefs.

See

https://rt.perl.org/Public/Bug/Display.html?id=129916
https://rt.perl.org/Public/Bug/Display.html?id=132252
https://perl5.git.perl.org/perl.git/commitdiff/7d65f652cb


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

Branch: refs/heads/master
Commit: f30ed78acd52df8425914b618430fe8816f226c8
Parents: 3b8ace3
Author: Nick Wellnhofer 
Authored: Fri Oct 27 15:03:40 2017 +0200
Committer: Nick Wellnhofer 
Committed: Tue Nov 14 13:43:19 2017 +0100

--
 runtime/perl/lib/Clownfish.pm | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f30ed78a/runtime/perl/lib/Clownfish.pm
--
diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm
index 8873e4b..3209be2 100644
--- a/runtime/perl/lib/Clownfish.pm
+++ b/runtime/perl/lib/Clownfish.pm
@@ -80,9 +80,11 @@ sub error {$Clownfish::Err::error}
 my $stash = \%{"$package\::"};
 my $methods
 = Clownfish::Vector->new( capacity => scalar keys %$stash );
-while ( my ( $symbol, $glob ) = each %$stash ) {
-next if ref $glob;
-next unless *$glob{CODE};
+while ( my ( $symbol, $entry ) = each %$stash ) {
+# A subroutine is stored in the CODE slot of a typeglob. Since
+# Perl 5.28 it may also be stored as a coderef.
+next unless ref($entry) eq 'CODE'
+|| ( ref(\$entry) eq 'GLOB' && *$entry{CODE} );
 $methods->push( Clownfish::String->new($symbol) );
 }
 return $methods;



[1/2] lucy git commit: Regen charmonizer.c for --rpath fix

2017-05-20 Thread nwellnhof
Repository: lucy
Updated Branches:
  refs/heads/master 5535d25f8 -> 598b4d074


Regen charmonizer.c for --rpath fix


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

Branch: refs/heads/master
Commit: b22794165abfcd33d5fd4e578397a6a1926f9c6b
Parents: 5535d25
Author: Nick Wellnhofer 
Authored: Sat May 20 15:02:38 2017 +0200
Committer: Nick Wellnhofer 
Committed: Sat May 20 15:02:38 2017 +0200

--
 common/charmonizer.c | 73 +++
 1 file changed, 42 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/b2279416/common/charmonizer.c
--
diff --git a/common/charmonizer.c b/common/charmonizer.c
index 21641b1..84970d0 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -664,6 +664,7 @@ chaz_HeadCheck_size_of_type(const char *type, const char 
*includes, int hint);
 #define H_CHAZ_MAKE
 
 /* #include "Charmonizer/Core/CFlags.h" */
+/* #include "Charmonizer/Core/CLI.h" */
 
 typedef struct chaz_MakeFile chaz_MakeFile;
 typedef struct chaz_MakeVar chaz_MakeVar;
@@ -2107,7 +2108,15 @@ chaz_CFlags_add_rpath(chaz_CFlags *flags, const char 
*path) {
 if (chaz_CC_binary_format() != CHAZ_CC_BINFMT_ELF) { return; }
 
 if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-string = chaz_Util_join("", "-Wl,-rpath,", path, NULL);
+/* If "new dtags" are enabled by default, DT_RUNPATH is set instead of
+ * DT_RPATH. Unfortunately, DT_RUNPATH is not applied transitively
+ * when searching for indirect dependencies. See
+ *
+ * https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1253638
+ * https://sourceware.org/bugzilla/show_bug.cgi?id=13945
+ */
+string = chaz_Util_join("", "-Wl,--disable-new-dtags -Wl,-rpath,",
+path, NULL);
 }
 else if (flags->style == CHAZ_CFLAGS_STYLE_SUN_C) {
 string = chaz_Util_join(" ", "-R", path, NULL);
@@ -3590,39 +3599,41 @@ chaz_ConfWriterC_end_module(void) {
 }
 
 /* Write out short names. */
-fprintf(chaz_ConfWriterC.fh,
-"\n#if defined(CHY_USE_SHORT_NAMES) "
-"|| defined(CHAZ_USE_SHORT_NAMES)\n"
-);
-for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-switch (defs[i].type) {
-case CHAZ_CONFELEM_DEF:
-case CHAZ_CONFELEM_TYPEDEF:
-{
-const char *sym = defs[i].str1;
-const char *value = defs[i].str2;
-if (!value || strcmp(sym, value) != 0) {
-const char *prefix
-= chaz_ConfWriterC_sym_is_uppercase(sym)
-  ? "CHY_" : "chy_";
-fprintf(chaz_ConfWriterC.fh, "  #define %s %s%s\n",
-sym, prefix, sym);
+if (chaz_ConfWriterC.def_count > 0) {
+fprintf(chaz_ConfWriterC.fh,
+"\n#if defined(CHY_USE_SHORT_NAMES) "
+"|| defined(CHAZ_USE_SHORT_NAMES)\n"
+);
+for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
+switch (defs[i].type) {
+case CHAZ_CONFELEM_DEF:
+case CHAZ_CONFELEM_TYPEDEF:
+{
+const char *sym = defs[i].str1;
+const char *value = defs[i].str2;
+if (!value || strcmp(sym, value) != 0) {
+const char *prefix
+= chaz_ConfWriterC_sym_is_uppercase(sym)
+  ? "CHY_" : "chy_";
+fprintf(chaz_ConfWriterC.fh, "  #define %s %s%s\n",
+sym, prefix, sym);
+}
 }
-}
-break;
-case CHAZ_CONFELEM_GLOBAL_DEF:
-case CHAZ_CONFELEM_GLOBAL_TYPEDEF:
-case CHAZ_CONFELEM_SYS_INCLUDE:
-case CHAZ_CONFELEM_LOCAL_INCLUDE:
-/* no-op */
-break;
-default:
-chaz_Util_die("Internal error: bad element type %d",
-  (int)defs[i].type);
+break;
+case CHAZ_CONFELEM_GLOBAL_DEF:
+case CHAZ_CONFELEM_GLOBAL_TYPEDEF:
+case CHAZ_CONFELEM_SYS_INCLUDE:
+case CHAZ_CONFELEM_LOCAL_INCLUDE:
+/* no-op */
+break;
+default:
+

[2/2] lucy git commit: Fix handling of trailing double quotes in QueryParser

2017-05-20 Thread nwellnhof
Fix handling of trailing double quotes in QueryParser

Fixes LUCY-325.


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

Branch: refs/heads/master
Commit: 598b4d074029998d30ad9a3b85190cc95aa00e0a
Parents: b227941
Author: Nick Wellnhofer 
Authored: Sat May 20 16:01:30 2017 +0200
Committer: Nick Wellnhofer 
Committed: Sat May 20 16:01:30 2017 +0200

--
 core/Lucy/Search/QueryParser.c|  5 +
 test/Lucy/Test/Search/TestQueryParserSyntax.c | 11 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/598b4d07/core/Lucy/Search/QueryParser.c
--
diff --git a/core/Lucy/Search/QueryParser.c b/core/Lucy/Search/QueryParser.c
index f17e131..569bd75 100644
--- a/core/Lucy/Search/QueryParser.c
+++ b/core/Lucy/Search/QueryParser.c
@@ -885,6 +885,11 @@ QParser_Expand_Leaf_IMP(QueryParser *self, Query *query) {
 StrIter_Recede(tail, 1);
 }
 }
+if (StrIter_Compare_To(top, (Obj*)tail) > 0) {
+DECREF(tail);
+DECREF(top);
+return NULL;
+}
 String *source_text = StrIter_crop(top, tail);
 
 // Either use LeafQuery's field or default to Parser's list.

http://git-wip-us.apache.org/repos/asf/lucy/blob/598b4d07/test/Lucy/Test/Search/TestQueryParserSyntax.c
--
diff --git a/test/Lucy/Test/Search/TestQueryParserSyntax.c 
b/test/Lucy/Test/Search/TestQueryParserSyntax.c
index 1cc4680..f3d8755 100644
--- a/test/Lucy/Test/Search/TestQueryParserSyntax.c
+++ b/test/Lucy/Test/Search/TestQueryParserSyntax.c
@@ -334,6 +334,14 @@ syntax_test_double_colon() {
 return TestQP_new("PHP::Interpreter", tree, NULL, 0);
 }
 
+static TestQueryParser*
+syntax_test_trailing_quote() {
+Query *mies = make_leaf_query(NULL, "mies");
+Query *quote = make_leaf_query(NULL, "\" ");
+Query *tree = make_poly_query(BOOLOP_OR, mies, quote, NULL);
+return TestQP_new("mies\" ", tree, NULL, 0);
+}
+
 /***/
 
 typedef TestQueryParser*
@@ -371,6 +379,7 @@ static LUCY_TestQPSyntax_Test_t syntax_test_funcs[] = {
 syntax_test_escaped_quotes_inside,
 syntax_test_identifier_field_name,
 syntax_test_double_colon,
+syntax_test_trailing_quote,
 NULL
 };
 
@@ -445,7 +454,7 @@ test_query_parser_syntax(TestBatchRunner *runner) {
 
 void
 TestQPSyntax_Run_IMP(TestQueryParserSyntax *self, TestBatchRunner *runner) {
-TestBatchRunner_Plan(runner, (TestBatch*)self, 68);
+TestBatchRunner_Plan(runner, (TestBatch*)self, 70);
 test_query_parser_syntax(runner);
 }
 



lucy-charmonizer git commit: Add --disable-new-dtags option when setting rpath

2017-05-20 Thread nwellnhof
Repository: lucy-charmonizer
Updated Branches:
  refs/heads/master 0539a8ce8 -> 7c09817b4


Add --disable-new-dtags option when setting rpath

Some newer Linux systems enable the "new dtags" linker option by
default. With this option --rpath sets DT_RUNPATH instead of DT_RPATH.
Unfortunately, DT_RUNPATH is not applied transitively when searching
for indirect dependencies, breaking the Lucy test executable. See

https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1253638
https://sourceware.org/bugzilla/show_bug.cgi?id=13945


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

Branch: refs/heads/master
Commit: 7c09817b4fdcaa9dc1714bb5ed3101c8a2c931c8
Parents: 0539a8c
Author: Nick Wellnhofer 
Authored: Sat May 20 14:55:08 2017 +0200
Committer: Nick Wellnhofer 
Committed: Sat May 20 14:55:08 2017 +0200

--
 src/Charmonizer/Core/CFlags.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/7c09817b/src/Charmonizer/Core/CFlags.c
--
diff --git a/src/Charmonizer/Core/CFlags.c b/src/Charmonizer/Core/CFlags.c
index ab57fcc..c42b6bf 100644
--- a/src/Charmonizer/Core/CFlags.c
+++ b/src/Charmonizer/Core/CFlags.c
@@ -363,7 +363,15 @@ chaz_CFlags_add_rpath(chaz_CFlags *flags, const char 
*path) {
 if (chaz_CC_binary_format() != CHAZ_CC_BINFMT_ELF) { return; }
 
 if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-string = chaz_Util_join("", "-Wl,-rpath,", path, NULL);
+/* If "new dtags" are enabled by default, DT_RUNPATH is set instead of
+ * DT_RPATH. Unfortunately, DT_RUNPATH is not applied transitively
+ * when searching for indirect dependencies. See
+ *
+ * https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1253638
+ * https://sourceware.org/bugzilla/show_bug.cgi?id=13945
+ */
+string = chaz_Util_join("", "-Wl,--disable-new-dtags -Wl,-rpath,",
+path, NULL);
 }
 else if (flags->style == CHAZ_CFLAGS_STYLE_SUN_C) {
 string = chaz_Util_join(" ", "-R", path, NULL);



lucy-clownfish git commit: Normalize bools before passing them to Perl

2017-04-22 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 74c12c7ef -> 3b8ace378


Normalize bools before passing them to Perl


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

Branch: refs/heads/master
Commit: 3b8ace37815308cad216f6fde964e5a8b2506e14
Parents: 74c12c7
Author: Nick Wellnhofer 
Authored: Sat Apr 22 17:54:37 2017 +0200
Committer: Nick Wellnhofer 
Committed: Sat Apr 22 17:54:37 2017 +0200

--
 compiler/src/CFCPerlMethod.c  | 12 
 compiler/src/CFCPerlTypeMap.c |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b8ace37/compiler/src/CFCPerlMethod.c
--
diff --git a/compiler/src/CFCPerlMethod.c b/compiler/src/CFCPerlMethod.c
index 6a59313..7dceabd 100644
--- a/compiler/src/CFCPerlMethod.c
+++ b/compiler/src/CFCPerlMethod.c
@@ -472,10 +472,11 @@ S_callback_start(CFCMethod *method) {
 // Iterate over arguments, mapping them to Perl scalars.
 CFCVariable **arg_vars = CFCParamList_get_variables(param_list);
 for (int i = 1; arg_vars[i] != NULL; i++) {
-CFCVariable *var  = arg_vars[i];
-const char  *name = CFCVariable_get_name(var);
-CFCType *type = CFCVariable_get_type(var);
-const char  *c_type   = CFCType_to_c(type);
+CFCVariable *var   = arg_vars[i];
+const char  *name  = CFCVariable_get_name(var);
+CFCType *type  = CFCVariable_get_type(var);
+const char  *specifier = CFCType_get_specifier(type);
+const char  *c_type= CFCType_to_c(type);
 
 // Add labels when there are two or more parameters.
 if (num_args > 1) {
@@ -490,6 +491,9 @@ S_callback_start(CFCMethod *method) {
 params = CFCUtil_cat(params, "mPUSHs(XSBind_cfish_to_perl(",
  "aTHX_ (cfish_Obj*)", name, "));\n", NULL);
 }
+else if (strcmp(specifier, "bool") == 0) {
+params = CFCUtil_cat(params, "mPUSHi(!!", name, ");\n", NULL);
+}
 else if (CFCType_is_integer(type)) {
 // Convert primitive integer types to IV Perl scalars.
 int width = (int)CFCType_get_width(type);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b8ace37/compiler/src/CFCPerlTypeMap.c
--
diff --git a/compiler/src/CFCPerlTypeMap.c b/compiler/src/CFCPerlTypeMap.c
index a94ccdf..76884d4 100644
--- a/compiler/src/CFCPerlTypeMap.c
+++ b/compiler/src/CFCPerlTypeMap.c
@@ -180,7 +180,7 @@ CFCPerlTypeMap_to_perl(CFCType *type, const char *cf_var) {
 result = CFCUtil_sprintf("newSViv(%s)", cf_var);
 }
 else if (strcmp(specifier, "bool") == 0) {
-result = CFCUtil_sprintf("newSViv(%s)", cf_var);
+result = CFCUtil_sprintf("newSViv(!!%s)", cf_var);
 }
 else {
 FREEMEM(result);



lucy git commit: Fix previous merge of 'improve-locking' branch

2017-04-16 Thread nwellnhof
Repository: lucy
Updated Branches:
  refs/heads/master d7feb9970 -> 5535d25f8


Fix previous merge of 'improve-locking' branch

I accidentally merged the first version of the 'improve-locking' branch.
Add changes to the 'v2' branch as separate commit.


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

Branch: refs/heads/master
Commit: 5535d25f8a5b1ad86e2d5540589c6e46654e350e
Parents: d7feb99
Author: Nick Wellnhofer 
Authored: Sun Apr 16 12:43:57 2017 +0200
Committer: Nick Wellnhofer 
Committed: Sun Apr 16 12:43:57 2017 +0200

--
 core/Lucy/Index/FilePurger.c |  5 ++-
 core/Lucy/Index/PolyReader.c | 75 ---
 core/Lucy/Store/Lock.c   |  4 --
 core/Lucy/Store/Lock.cfh |  1 -
 core/Lucy/Store/LockFileLock.c   |  2 +
 core/Lucy/Store/LockFileLock.cfh |  1 +
 6 files changed, 49 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/5535d25f/core/Lucy/Index/FilePurger.c
--
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 211f0ea..6daa805 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -234,7 +234,10 @@ S_delete_entry(Folder *folder, String *folder_entry) {
 Folder *inner = Folder_Local_Find_Folder(folder, folder_entry);
 if (inner == NULL) { return false; }
 if (Folder_is_a(inner, COMPOUNDFILEREADER)) {
-inner = CFReader_Get_Real_Folder((CompoundFileReader*)inner);
+CompoundFileReader *cf_reader = (CompoundFileReader*)inner;
+inner = CFReader_Get_Real_Folder(cf_reader);
+// Close cf.dat to allow speedy deletion on Windows.
+CFReader_Close(cf_reader);
 }
 
 Vector *entries = Folder_List(inner, NULL);

http://git-wip-us.apache.org/repos/asf/lucy/blob/5535d25f/core/Lucy/Index/PolyReader.c
--
diff --git a/core/Lucy/Index/PolyReader.c b/core/Lucy/Index/PolyReader.c
index 572cc2b..f554193 100644
--- a/core/Lucy/Index/PolyReader.c
+++ b/core/Lucy/Index/PolyReader.c
@@ -330,47 +330,51 @@ PolyReader*
 PolyReader_do_open(PolyReader *self, Obj *index, Snapshot *snapshot,
IndexManager *manager) {
 PolyReaderIVARS *const ivars = PolyReader_IVARS(self);
-Folder   *folder = S_derive_folder(index);
-Err  *last_error = NULL;
-uint64_t  last_gen   = 0;
+Folder   *folder  = S_derive_folder(index);
+Err  *last_error  = NULL;
+String   *last_snapfile   = NULL;
+String   *target_snapfile = NULL;
 
 PolyReader_init(self, NULL, folder, snapshot, manager, NULL);
 DECREF(folder);
 
-while (1) {
-String *target_snap_file;
-
-// If a Snapshot was supplied, use its file.
-if (snapshot) {
-target_snap_file = Snapshot_Get_Path(snapshot);
-if (!target_snap_file) {
-THROW(ERR, "Supplied snapshot objects must not be empty");
-}
-else {
-target_snap_file = (String*)INCREF(target_snap_file);
-}
+// If a Snapshot was supplied, use its file.
+if (snapshot) {
+target_snapfile = (String*)INCREF(Snapshot_Get_Path(snapshot));
+if (!target_snapfile) {
+THROW(ERR, "Supplied snapshot objects must not be empty");
 }
-else {
-// Otherwise, pick the most recent snap file.
-target_snap_file = IxFileNames_latest_snapshot(folder);
+}
 
-// No snap file?  Looks like the index is empty.  We can stop now
-// and return NULL.
-if (!target_snap_file) { break; }
+while (1) {
+if (!snapshot) {
+// If no Snapshot was supplied, pick the most recent snap file.
+DECREF(target_snapfile);
+target_snapfile = IxFileNames_latest_snapshot(folder);
+
+// No snap file?  Looks like the index is empty.  We can stop now.
+if (!target_snapfile) {
+DECREF(last_error);
+last_error = NULL;
+break;
+}
 }
 
-// Derive "generation" of this snapshot file from its name.
-uint64_t gen = IxFileNames_extract_gen(target_snap_file);
-
-if (gen <= last_gen) {
+if (last_snapfile
+&& Str_Equals(target_snapfile, (Obj*)last_snapfile)) {
+// The target snapfile hasn't changed since the last iteration.
 // If a snapshot was supplied, 

[2/2] lucy-clownfish git commit: Don't create callbacks for excluded methods

2017-04-16 Thread nwellnhof
Don't create callbacks for excluded methods

Ideally, there should be a way to only omit the callback function
definition in order to allow custom implementations.


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

Branch: refs/heads/master
Commit: 74c12c7ef8a3a3d66d959c8a3b9f8b30efc61b77
Parents: 0bfeb23
Author: Nick Wellnhofer 
Authored: Fri Mar 24 14:48:46 2017 +0100
Committer: Nick Wellnhofer 
Committed: Sun Apr 16 12:17:19 2017 +0200

--
 compiler/src/CFCBindSpecs.c | 2 +-
 compiler/src/CFCPerl.c  | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/74c12c7e/compiler/src/CFCBindSpecs.c
--
diff --git a/compiler/src/CFCBindSpecs.c b/compiler/src/CFCBindSpecs.c
index b8c609a..19a03b4 100644
--- a/compiler/src/CFCBindSpecs.c
+++ b/compiler/src/CFCBindSpecs.c
@@ -339,7 +339,7 @@ S_add_novel_meth(CFCBindSpecs *self, CFCMethod *method, 
CFCClass *klass,
 const char *sep = meth_index == 0 ? "" : ",\n";
 
 char *full_override_sym;
-if (!CFCMethod_final(method)) {
+if (!CFCMethod_final(method) && !CFCMethod_excluded_from_host(method)) {
 full_override_sym = CFCMethod_full_override_sym(method, klass);
 }
 else {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/74c12c7e/compiler/src/CFCPerl.c
--
diff --git a/compiler/src/CFCPerl.c b/compiler/src/CFCPerl.c
index f43bc47..73c8d35 100644
--- a/compiler/src/CFCPerl.c
+++ b/compiler/src/CFCPerl.c
@@ -311,7 +311,9 @@ S_write_host_c(CFCPerl *self, CFCParcel *parcel) {
 CFCMethod *method = fresh_methods[meth_num];
 
 // Define callback.
-if (CFCMethod_novel(method) && !CFCMethod_final(method)) {
+if (CFCMethod_novel(method)
+&& !CFCMethod_final(method)
+&& !CFCMethod_excluded_from_host(method)) {
 char *cb_def = CFCPerlMethod_callback_def(method, klass);
 cb_defs = CFCUtil_cat(cb_defs, cb_def, "\n", NULL);
 FREEMEM(cb_def);



[12/16] lucy git commit: Release locks on destruction

2017-04-16 Thread nwellnhof
Release locks on destruction


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

Branch: refs/heads/master
Commit: d23b560dc34d1c1cbc731fdc745b4e72324d8717
Parents: 35388cd
Author: Nick Wellnhofer 
Authored: Sun Feb 19 14:09:02 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:51:30 2017 +0100

--
 core/Lucy/Index/BackgroundMerger.c |  2 --
 core/Lucy/Index/FilePurger.c   |  7 +
 core/Lucy/Index/IndexReader.c  |  6 +---
 core/Lucy/Index/Indexer.c  |  2 --
 core/Lucy/Index/PolyReader.c   |  1 -
 core/Lucy/Store/Lock.c |  2 +-
 core/Lucy/Store/Lock.cfh   |  2 +-
 test/Lucy/Test/Store/TestLock.c| 51 -
 8 files changed, 29 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/d23b560d/core/Lucy/Index/BackgroundMerger.c
--
diff --git a/core/Lucy/Index/BackgroundMerger.c 
b/core/Lucy/Index/BackgroundMerger.c
index be69d90..d326140 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -559,7 +559,6 @@ static void
 S_release_write_lock(BackgroundMerger *self) {
 BackgroundMergerIVARS *const ivars = BGMerger_IVARS(self);
 if (ivars->write_lock) {
-Lock_Release(ivars->write_lock);
 DECREF(ivars->write_lock);
 ivars->write_lock = NULL;
 }
@@ -569,7 +568,6 @@ static void
 S_release_merge_lock(BackgroundMerger *self) {
 BackgroundMergerIVARS *const ivars = BGMerger_IVARS(self);
 if (ivars->merge_lock) {
-Lock_Release(ivars->merge_lock);
 DECREF(ivars->merge_lock);
 ivars->merge_lock = NULL;
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/d23b560d/core/Lucy/Index/FilePurger.c
--
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 5795bb0..211f0ea 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -123,17 +123,12 @@ FilePurger_Purge_Snapshots_IMP(FilePurger *self, Snapshot 
*current) {
 }
 }
 
-// Release snapshot locks.
-for (size_t i = 0, max = Vec_Get_Size(locks); i < max; i++) {
-Lock_Release((Lock*)Vec_Fetch(locks, i));
-}
-
 DECREF(iter);
 DECREF(failures);
 DECREF(purged);
 DECREF(spared);
 DECREF(snapshots);
-DECREF(locks);
+DECREF(locks); // Will release locks.
 }
 
 void

http://git-wip-us.apache.org/repos/asf/lucy/blob/d23b560d/core/Lucy/Index/IndexReader.c
--
diff --git a/core/Lucy/Index/IndexReader.c b/core/Lucy/Index/IndexReader.c
index dabb3be..ce3a205 100644
--- a/core/Lucy/Index/IndexReader.c
+++ b/core/Lucy/Index/IndexReader.c
@@ -81,7 +81,6 @@ IxReader_Close_IMP(IndexReader *self) {
 Hash_Clear(ivars->components);
 }
 if (ivars->snapshot_lock) {
-Lock_Release(ivars->snapshot_lock);
 DECREF(ivars->snapshot_lock);
 ivars->snapshot_lock = NULL;
 }
@@ -91,10 +90,7 @@ void
 IxReader_Destroy_IMP(IndexReader *self) {
 IndexReaderIVARS *const ivars = IxReader_IVARS(self);
 DECREF(ivars->components);
-if (ivars->snapshot_lock) {
-Lock_Release(ivars->snapshot_lock);
-DECREF(ivars->snapshot_lock);
-}
+DECREF(ivars->snapshot_lock);
 DECREF(ivars->manager);
 SUPER_DESTROY(self, INDEXREADER);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/d23b560d/core/Lucy/Index/Indexer.c
--
diff --git a/core/Lucy/Index/Indexer.c b/core/Lucy/Index/Indexer.c
index 9190b93..fc6afec 100644
--- a/core/Lucy/Index/Indexer.c
+++ b/core/Lucy/Index/Indexer.c
@@ -587,7 +587,6 @@ static void
 S_release_write_lock(Indexer *self) {
 IndexerIVARS *const ivars = Indexer_IVARS(self);
 if (ivars->write_lock) {
-Lock_Release(ivars->write_lock);
 DECREF(ivars->write_lock);
 ivars->write_lock = NULL;
 }
@@ -597,7 +596,6 @@ static void
 S_release_merge_lock(Indexer *self) {
 IndexerIVARS *const ivars = Indexer_IVARS(self);
 if (ivars->merge_lock) {
-Lock_Release(ivars->merge_lock);
 DECREF(ivars->merge_lock);
 ivars->merge_lock = NULL;
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/d23b560d/core/Lucy/Index/PolyReader.c
--
diff --git a/core/Lucy/Index/PolyReader.c b/core/Lucy/Index/PolyReader.c
index 6b9e943..572cc2b 100644

[03/16] lucy git commit: Always check for stale locks in Is_Locked

2017-04-16 Thread nwellnhof
Always check for stale locks in Is_Locked

Note that checking for stale locks isn't necessary when requesting
shared locks.


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

Branch: refs/heads/master
Commit: 1a8e02df0a0257e4ba70de4a41504507b0ba8a47
Parents: bb83d0d
Author: Nick Wellnhofer 
Authored: Thu Feb 16 16:47:03 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:21 2017 +0100

--
 core/Lucy/Index/BackgroundMerger.c |  2 --
 core/Lucy/Index/FilePurger.c   |  5 
 core/Lucy/Index/Indexer.c  |  1 -
 core/Lucy/Index/PolyReader.c   |  2 --
 core/Lucy/Store/Lock.c | 48 +
 core/Lucy/Store/Lock.cfh   | 10 ---
 go/build.go|  1 -
 go/lucy/store.go   |  7 -
 go/lucy/store_test.go  |  5 
 perl/t/106-locking.t   |  1 -
 perl/t/110-shared_lock.t   |  5 ++--
 11 files changed, 14 insertions(+), 73 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/1a8e02df/core/Lucy/Index/BackgroundMerger.c
--
diff --git a/core/Lucy/Index/BackgroundMerger.c 
b/core/Lucy/Index/BackgroundMerger.c
index 661b9a6..e9a1ae8 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -529,7 +529,6 @@ static void
 S_obtain_write_lock(BackgroundMerger *self) {
 BackgroundMergerIVARS *const ivars = BGMerger_IVARS(self);
 Lock *write_lock = IxManager_Make_Write_Lock(ivars->manager);
-Lock_Clear_Stale(write_lock);
 if (Lock_Obtain_Exclusive(write_lock)) {
 // Only assign if successful, otherwise DESTROY unlocks -- bad!
 ivars->write_lock = write_lock;
@@ -543,7 +542,6 @@ static void
 S_obtain_merge_lock(BackgroundMerger *self) {
 BackgroundMergerIVARS *const ivars = BGMerger_IVARS(self);
 Lock *merge_lock = IxManager_Make_Merge_Lock(ivars->manager);
-Lock_Clear_Stale(merge_lock);
 if (Lock_Obtain_Exclusive(merge_lock)) {
 // Only assign if successful, same rationale as above.
 ivars->merge_lock = merge_lock;

http://git-wip-us.apache.org/repos/asf/lucy/blob/1a8e02df/core/Lucy/Index/FilePurger.c
--
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 3980c8f..161f030 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -78,7 +78,6 @@ FilePurger_Purge_Snapshots_IMP(FilePurger *self, Snapshot 
*current) {
 Lock *deletion_lock = IxManager_Make_Deletion_Lock(ivars->manager);
 
 // Obtain deletion lock, purge files, release deletion lock.
-Lock_Clear_Stale(deletion_lock);
 if (Lock_Obtain_Exclusive(deletion_lock)) {
 Folder *folder= ivars->folder;
 Hash   *failures  = Hash_new(16);
@@ -147,7 +146,6 @@ FilePurger_Purge_Aborted_Merge_IMP(FilePurger *self) {
 IndexManager *manager= ivars->manager;
 Lock *merge_lock = IxManager_Make_Merge_Lock(manager);
 
-Lock_Clear_Stale(merge_lock);
 if (!Lock_Is_Locked_Exclusive(merge_lock)) {
 Hash *merge_data = IxManager_Read_Merge_Data(manager);
 Obj  *cutoff = merge_data
@@ -213,9 +211,6 @@ S_discover_unused(FilePurger *self, Snapshot *current, Hash 
*spared,
 
 // DON'T obtain the lock -- only see whether another
 // entity holds a lock on the snapshot file.
-if (lock) {
-Lock_Clear_Stale(lock);
-}
 if (lock && Lock_Is_Locked(lock)) {
 // The snapshot file is locked, which means someone's using
 // that version of the index -- protect all of its entries.

http://git-wip-us.apache.org/repos/asf/lucy/blob/1a8e02df/core/Lucy/Index/Indexer.c
--
diff --git a/core/Lucy/Index/Indexer.c b/core/Lucy/Index/Indexer.c
index 97763e3..2381b26 100644
--- a/core/Lucy/Index/Indexer.c
+++ b/core/Lucy/Index/Indexer.c
@@ -97,7 +97,6 @@ Indexer_init(Indexer *self, Schema *schema, Obj *index,
 
 // Get a write lock for this folder.
 Lock *write_lock = IxManager_Make_Write_Lock(ivars->manager);
-Lock_Clear_Stale(write_lock);
 if (Lock_Obtain_Exclusive(write_lock)) {
 // Only assign if successful, otherwise DESTROY unlocks -- bad!
 ivars->write_lock = write_lock;

http://git-wip-us.apache.org/repos/asf/lucy/blob/1a8e02df/core/Lucy/Index/PolyReader.c

[09/16] lucy git commit: Don't hide I/O errors behind LockErr

2017-04-16 Thread nwellnhof
Don't hide I/O errors behind LockErr

Only return a LockErr if there's lock contention, not on unrelated
I/O errors.


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

Branch: refs/heads/master
Commit: e06cdbf63d3036c3a33e5265444d827065539e92
Parents: 38a33ba
Author: Nick Wellnhofer 
Authored: Fri Feb 17 20:26:13 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:22 2017 +0100

--
 core/Lucy/Store/Lock.c | 26 +++---
 1 file changed, 11 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/e06cdbf6/core/Lucy/Store/Lock.c
--
diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c
index 0879640..90a6aa0 100644
--- a/core/Lucy/Store/Lock.c
+++ b/core/Lucy/Store/Lock.c
@@ -263,16 +263,14 @@ S_request(LockFileLockIVARS *ivars, String *lock_path) {
 String *lock_dir_name = SSTR_WRAP_C("locks");
 if (!Folder_Exists(ivars->folder, lock_dir_name)) {
 if (!Folder_MkDir(ivars->folder, lock_dir_name)) {
-Err *mkdir_err = (Err*)CERTIFY(Err_get_error(), ERR);
-LockErr *err = LockErr_new(Str_newf("Can't create 'locks' 
directory: %o",
-Err_Get_Mess(mkdir_err)));
+Err *err = (Err*)INCREF(Err_get_error());
 // Maybe our attempt failed because another process succeeded.
 if (Folder_Find_Folder(ivars->folder, lock_dir_name)) {
 DECREF(err);
 }
 else {
 // Nope, everything failed, so bail out.
-Err_set_error((Err*)err);
+Err_set_error(err);
 return false;
 }
 }
@@ -302,25 +300,23 @@ S_request(LockFileLockIVARS *ivars, String *lock_path) {
 context.outstream = outstream;
 context.json = json;
 Err *json_error = Err_trap(S_write_lockfile_json, );
-bool wrote_json = !json_error;
 DECREF(outstream);
 DECREF(json);
-if (wrote_json) {
+if (json_error) {
+Err_set_error(json_error);
+}
+else {
 success = Folder_Hard_Link(ivars->folder, ivars->link_path,
lock_path);
 if (!success) {
+// TODO: Only return a LockErr if errno == EEXIST, otherwise
+// return a normal Err.
 Err *hard_link_err = (Err*)CERTIFY(Err_get_error(), ERR);
-Err_set_error((Err*)LockErr_new(Str_newf("Failed to obtain lock at 
'%o': %o",
- lock_path,
- 
Err_Get_Mess(hard_link_err;
+String *msg = Str_newf("Failed to obtain lock at '%o': %o",
+   lock_path, Err_Get_Mess(hard_link_err));
+Err_set_error((Err*)LockErr_new(msg));
 }
 }
-else {
-Err_set_error((Err*)LockErr_new(Str_newf("Failed to obtain lock at 
'%o': %o",
- lock_path,
- Err_Get_Mess(json_error;
-DECREF(json_error);
-}
 
 // Verify that our temporary file got zapped.
 bool deletion_failed = !Folder_Delete(ivars->folder, ivars->link_path);



[16/16] lucy git commit: Merge branch 'improve-locking'

2017-04-16 Thread nwellnhof
Merge branch 'improve-locking'

Fixes LUCY-323.

- Major rewrite of FilePurger, making it do less work.
- Eliminate global deletion lock, making PolyReader and FilePurger
  never wait for a lock.
- Redesign Lock API in preparation for native locks.
- Remove LockFactory.
- Fix locking bug with non-default merge lock timeout.
- Fix locking bug with concurrent BackgroundMergers.
- Port some tests to C.


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

Branch: refs/heads/master
Commit: d7feb997003ae1fc84a348e8584ea97b69b02d95
Parents: 7a64a28 a3cf33f
Author: Nick Wellnhofer 
Authored: Sun Apr 16 12:15:01 2017 +0200
Committer: Nick Wellnhofer 
Committed: Sun Apr 16 12:15:01 2017 +0200

--
 core/Lucy/Docs/Cookbook/FastUpdates.md|   2 +-
 core/Lucy/Docs/FileLocking.md |   5 +-
 core/Lucy/Index/BackgroundMerger.c|  34 +-
 core/Lucy/Index/FilePurger.c  | 328 ---
 core/Lucy/Index/FilePurger.cfh|  19 +-
 core/Lucy/Index/IndexManager.c|  88 +
 core/Lucy/Index/IndexManager.cfh  |  42 +--
 core/Lucy/Index/IndexReader.c |  16 +-
 core/Lucy/Index/IndexReader.cfh   |   3 +-
 core/Lucy/Index/Indexer.c |  61 ++--
 core/Lucy/Index/PolyReader.c  | 124 +++
 core/Lucy/Store/Lock.c| 258 ++-
 core/Lucy/Store/Lock.cfh  | 117 ++-
 core/Lucy/Store/LockFactory.c |  66 
 core/Lucy/Store/LockFactory.cfh   |  80 -
 core/Lucy/Store/LockFileLock.c| 363 +
 core/Lucy/Store/LockFileLock.cfh  |  49 +++
 core/Lucy/Store/SharedLock.c  | 173 --
 core/Lucy/Store/SharedLock.cfh|  77 -
 go/build.go   |   7 +-
 go/lucy/index_test.go |  32 +-
 go/lucy/store.go  |  35 +-
 go/lucy/store_test.go |  77 ++---
 perl/buildlib/Lucy/Build/Binding/Store.pm | 100 --
 perl/lib/Lucy/Store/Lock.pm   |  25 --
 perl/lib/Lucy/Store/LockFactory.pm|  25 --
 perl/t/105-folder.t   |  29 +-
 perl/t/106-locking.t  |  89 -
 perl/t/109-read_locking.t |  53 ++-
 perl/t/110-shared_lock.t  |  90 -
 perl/t/111-index_manager.t|  32 +-
 perl/t/core/106-lf_lock.t |  23 ++
 perl/t/core/233-background_merger.t   |  23 ++
 test/Lucy/Test.c  |   4 +
 test/Lucy/Test/Index/NoMergeManager.c |  42 +++
 test/Lucy/Test/Index/NoMergeManager.cfh   |  30 ++
 test/Lucy/Test/Index/TestBackgroundMerger.c   | 208 
 test/Lucy/Test/Index/TestBackgroundMerger.cfh |  29 ++
 test/Lucy/Test/Index/TestIndexManager.c   |   2 +-
 test/Lucy/Test/Index/TestSortWriter.c |  28 +-
 test/Lucy/Test/Index/TestSortWriter.cfh   |  15 -
 test/Lucy/Test/Store/TestLock.c   | 296 +
 test/Lucy/Test/Store/TestLock.cfh |  29 ++
 test/Lucy/Test/TestUtils.c|  17 +-
 44 files changed, 1531 insertions(+), 1714 deletions(-)
--




[07/16] lucy git commit: Remove Lock_Is_Locked

2017-04-16 Thread nwellnhof
Remove Lock_Is_Locked


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

Branch: refs/heads/master
Commit: 38a33badb310ba9fea5bf9a923277da4a82ec369
Parents: de14d4c
Author: Nick Wellnhofer 
Authored: Fri Feb 17 19:13:59 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:22 2017 +0100

--
 core/Lucy/Store/Lock.c   | 31 ++---
 core/Lucy/Store/Lock.cfh | 22 -
 go/lucy/store_test.go|  6 --
 perl/t/105-folder.t  |  7 ---
 perl/t/110-shared_lock.t | 45 ++-
 5 files changed, 41 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/38a33bad/core/Lucy/Store/Lock.c
--
diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c
index d187405..0879640 100644
--- a/core/Lucy/Store/Lock.c
+++ b/core/Lucy/Store/Lock.c
@@ -131,6 +131,12 @@ static bool
 S_request(LockFileLockIVARS *ivars, String *lock_path);
 
 static bool
+S_is_locked_exclusive(LockFileLockIVARS *ivars);
+
+static bool
+S_is_locked(LockFileLockIVARS *ivars);
+
+static bool
 S_is_shared_lock_file(LockFileLockIVARS *ivars, String *entry);
 
 static bool
@@ -194,7 +200,7 @@ LFLock_Request_Shared_IMP(LockFileLock *self) {
 // race condition. We could protect the whole process with an internal
 // exclusive lock.
 
-if (LFLock_Is_Locked_Exclusive(self)) {
+if (S_is_locked_exclusive(ivars)) {
 String *msg = Str_newf("'%o.lock' is locked", ivars->name);
 Err_set_error((Err*)LockErr_new(msg));
 return false;
@@ -232,8 +238,8 @@ LFLock_Request_Exclusive_IMP(LockFileLock *self) {
 // exclusive lock.
 
 if (ivars->exclusive_only
-? LFLock_Is_Locked_Exclusive(self)
-: LFLock_Is_Locked(self)
+? S_is_locked_exclusive(ivars)
+: S_is_locked(ivars)
) {
 String *msg = Str_newf("'%o.lock' is locked", ivars->name);
 Err_set_error((Err*)LockErr_new(msg));
@@ -352,24 +358,15 @@ LFLock_Release_IMP(LockFileLock *self) {
 ivars->state = LFLOCK_STATE_UNLOCKED;
 }
 
-bool
-LFLock_Is_Locked_Exclusive_IMP(LockFileLock *self) {
-LockFileLockIVARS *const ivars = LFLock_IVARS(self);
-
+static bool
+S_is_locked_exclusive(LockFileLockIVARS *ivars) {
 return Folder_Exists(ivars->folder, ivars->lock_path)
&& !S_maybe_delete_file(ivars, ivars->lock_path, false, true);
 }
 
-bool
-LFLock_Is_Locked_IMP(LockFileLock *self) {
-LockFileLockIVARS *const ivars = LFLock_IVARS(self);
-
-// Check for exclusive lock.
-if (Folder_Exists(ivars->folder, ivars->lock_path)
-&& !S_maybe_delete_file(ivars, ivars->lock_path, false, true)
-   ) {
-return true;
-}
+static bool
+S_is_locked(LockFileLockIVARS *ivars) {
+if (S_is_locked_exclusive(ivars)) { return true; }
 
 // Check for shared lock.
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/38a33bad/core/Lucy/Store/Lock.cfh
--
diff --git a/core/Lucy/Store/Lock.cfh b/core/Lucy/Store/Lock.cfh
index fb813e1..6688e95 100644
--- a/core/Lucy/Store/Lock.cfh
+++ b/core/Lucy/Store/Lock.cfh
@@ -96,22 +96,6 @@ abstract class Lucy::Store::Lock inherits Clownfish::Obj {
 public abstract void
 Release(Lock *self);
 
-/** Indicate whether the resource identified by this lock's name is
- * currently locked in shared or exclusive mode.
- *
- * @return true if the resource is locked, false otherwise.
- */
-public abstract bool
-Is_Locked(Lock *self);
-
-/** Indicate whether the resource identified by this lock's name is
- * currently locked in exclusive mode.
- *
- * @return true if the resource is locked, false otherwise.
- */
-public abstract bool
-Is_Locked_Exclusive(Lock *self);
-
 String*
 Get_Name(Lock *self);
 
@@ -147,12 +131,6 @@ class Lucy::Store::LockFileLock nickname LFLock
 public void
 Release(LockFileLock *self);
 
-public bool
-Is_Locked(LockFileLock *self);
-
-public bool
-Is_Locked_Exclusive(LockFileLock *self);
-
 String*
 Get_Lock_Path(LockFileLock *self);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/38a33bad/go/lucy/store_test.go
--
diff --git a/go/lucy/store_test.go b/go/lucy/store_test.go
index 89f5057..ae70069 100644
--- a/go/lucy/store_test.go
+++ b/go/lucy/store_test.go
@@ -663,9 +663,6 @@ func TestLockFileLockAll(t *testing.T) {
if err != 

[13/16] lucy git commit: Move host ivar from Lock to LockFileLock

2017-04-16 Thread nwellnhof
Move host ivar from Lock to LockFileLock


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

Branch: refs/heads/master
Commit: 2bd2bc611325ee643f325ecfd11d5227319949a8
Parents: d23b560
Author: Nick Wellnhofer 
Authored: Sun Feb 19 16:21:00 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:51:32 2017 +0100

--
 core/Lucy/Store/Lock.c   | 10 +-
 core/Lucy/Store/Lock.cfh |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/2bd2bc61/core/Lucy/Store/Lock.c
--
diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c
index c4542a6..e716099 100644
--- a/core/Lucy/Store/Lock.c
+++ b/core/Lucy/Store/Lock.c
@@ -30,8 +30,8 @@
 #include "Lucy/Util/Sleep.h"
 
 Lock*
-Lock_init(Lock *self, Folder *folder, String *name,
-  String *host, int32_t timeout, int32_t interval) {
+Lock_init(Lock *self, Folder *folder, String *name, int32_t timeout,
+  int32_t interval) {
 LockIVARS *const ivars = Lock_IVARS(self);
 
 // Validate.
@@ -58,7 +58,6 @@ Lock_init(Lock *self, Folder *folder, String *name,
 ivars->folder   = (Folder*)INCREF(folder);
 ivars->timeout  = timeout;
 ivars->name = Str_Clone(name);
-ivars->host = Str_Clone(host);
 ivars->interval = interval;
 
 // Derive.
@@ -71,7 +70,6 @@ void
 Lock_Destroy_IMP(Lock *self) {
 LockIVARS *const ivars = Lock_IVARS(self);
 DECREF(ivars->folder);
-DECREF(ivars->host);
 DECREF(ivars->name);
 DECREF(ivars->lock_path);
 SUPER_DESTROY(self, LOCK);
@@ -145,8 +143,9 @@ LockFileLock*
 LFLock_init(LockFileLock *self, Folder *folder, String *name, String *host,
 int32_t timeout, int32_t interval, bool exclusive_only) {
 int pid = PID_getpid();
-Lock_init((Lock*)self, folder, name, host, timeout, interval);
+Lock_init((Lock*)self, folder, name, timeout, interval);
 LockFileLockIVARS *const ivars = LFLock_IVARS(self);
+ivars->host  = (String*)INCREF(host);
 ivars->link_path = Str_newf("%o.%o.%i64", ivars->lock_path, host,
 (int64_t)pid);
 ivars->exclusive_only = exclusive_only;
@@ -455,6 +454,7 @@ void
 LFLock_Destroy_IMP(LockFileLock *self) {
 LockFileLockIVARS *const ivars = LFLock_IVARS(self);
 if (ivars->state != LFLOCK_STATE_UNLOCKED) { LFLock_Release(self); }
+DECREF(ivars->host);
 DECREF(ivars->link_path);
 SUPER_DESTROY(self, LOCKFILELOCK);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2bd2bc61/core/Lucy/Store/Lock.cfh
--
diff --git a/core/Lucy/Store/Lock.cfh b/core/Lucy/Store/Lock.cfh
index 6a4b719..11f31c0 100644
--- a/core/Lucy/Store/Lock.cfh
+++ b/core/Lucy/Store/Lock.cfh
@@ -32,7 +32,6 @@ abstract class Lucy::Store::Lock inherits Clownfish::Obj {
 Folder  *folder;
 String  *name;
 String  *lock_path;
-String  *host;
 int32_t  timeout;
 int32_t  interval;
 
@@ -47,8 +46,8 @@ abstract class Lucy::Store::Lock inherits Clownfish::Obj {
  * @param interval Time in milliseconds between retries.
  */
 public inert Lock*
-init(Lock *self, Folder *folder, String *name,
- String *host, int32_t timeout = 0, int32_t interval = 100);
+init(Lock *self, Folder *folder, String *name, int32_t timeout = 0,
+ int32_t interval = 100);
 
 /** Call [](.Request_Shared) once per `interval` until [](.Request_Shared)
  * returns success or the `timeout` has been reached.
@@ -103,6 +102,7 @@ abstract class Lucy::Store::Lock inherits Clownfish::Obj {
 class Lucy::Store::LockFileLock nickname LFLock
 inherits Lucy::Store::Lock {
 
+String *host;
 String *shared_lock_path;
 String *link_path;
 int state;



[06/16] lucy git commit: Separate purging of snapshots and aborted merges

2017-04-16 Thread nwellnhof
Separate purging of snapshots and aborted merges

Purge aborted merge when starting an Indexer/BGMerger session and
purge snapshots at the end of Commit.

Rework FilePurger to use a single hash for purged and spared files
when purging snapshots. Optimize Folder handling assuming that
Snapshots only contain entries local to the index folder.

Make sure to list the contents of the real directory, not the
virtual compound file directory. CFReaderDirHandle lists both real
and virtual files which might be a bug in itself.

Port BGMerger tests to C.

TODO: Move Perl BGMerge test to t/binding.


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

Branch: refs/heads/master
Commit: 2051451de456f51e35345f12206ca4cb0040dd7c
Parents: 5f15a92
Author: Nick Wellnhofer 
Authored: Wed Feb 15 05:10:07 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:21 2017 +0100

--
 core/Lucy/Index/BackgroundMerger.c|   6 +-
 core/Lucy/Index/FilePurger.c  | 210 ++---
 core/Lucy/Index/FilePurger.cfh|  15 +-
 core/Lucy/Index/Indexer.c |  17 +-
 go/lucy/index_test.go |   5 +-
 perl/t/core/233-background_merger.t   |  23 +++
 test/Lucy/Test.c  |   2 +
 test/Lucy/Test/Index/NoMergeManager.c |  42 +
 test/Lucy/Test/Index/NoMergeManager.cfh   |  30 +++
 test/Lucy/Test/Index/TestBackgroundMerger.c   | 208 
 test/Lucy/Test/Index/TestBackgroundMerger.cfh |  29 +++
 test/Lucy/Test/Index/TestSortWriter.c |  28 +--
 test/Lucy/Test/Index/TestSortWriter.cfh   |  15 --
 test/Lucy/Test/TestUtils.c|  17 +-
 14 files changed, 462 insertions(+), 185 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/2051451d/core/Lucy/Index/BackgroundMerger.c
--
diff --git a/core/Lucy/Index/BackgroundMerger.c 
b/core/Lucy/Index/BackgroundMerger.c
index c729bda..8f36050 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -109,8 +109,8 @@ BGMerger_init(BackgroundMerger *self, Obj *index, 
IndexManager *manager) {
 }
 
 // Create FilePurger. Zap detritus from previous sessions.
-ivars->file_purger = FilePurger_new(folder, ivars->snapshot, 
ivars->manager);
-FilePurger_Purge(ivars->file_purger);
+ivars->file_purger = FilePurger_new(folder, ivars->manager);
+FilePurger_Purge_Aborted_Merge(ivars->file_purger);
 
 // Open a PolyReader, passing in the IndexManager so we get a read lock on
 // the Snapshot's files -- so that Indexers don't zap our files while
@@ -518,7 +518,7 @@ BGMerger_Commit_IMP(BackgroundMerger *self) {
 
 if (ivars->needs_commit) {
 // Purge obsolete files.
-FilePurger_Purge(ivars->file_purger);
+FilePurger_Purge_Snapshots(ivars->file_purger, ivars->snapshot);
 }
 
 // Release the write lock.

http://git-wip-us.apache.org/repos/asf/lucy/blob/2051451d/core/Lucy/Index/FilePurger.c
--
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 8c71678..55ade17 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -15,55 +15,52 @@
  */
 
 #define C_LUCY_FILEPURGER
-#include 
 #include "Lucy/Util/ToolSet.h"
 
 #include "Lucy/Index/FilePurger.h"
 #include "Clownfish/Boolean.h"
+#include "Clownfish/HashIterator.h"
 #include "Lucy/Index/IndexManager.h"
 #include "Lucy/Index/Segment.h"
 #include "Lucy/Index/Snapshot.h"
-#include "Lucy/Plan/Schema.h"
+#include "Lucy/Store/CompoundFileReader.h"
 #include "Lucy/Store/DirHandle.h"
 #include "Lucy/Store/Folder.h"
 #include "Lucy/Store/Lock.h"
 #include "Lucy/Util/Json.h"
 
-// Place unused files into purgables array and obsolete Snapshots into
-// snapshots array.
+// Add unused files to purged hash, used files to spared hash, and
+// obsolete snapshots to snapshots array.
 static void
-S_discover_unused(FilePurger *self, Vector **purgables, Vector **snapshots);
+S_discover_unused(FilePurger *self, Snapshot *current, Hash *spared,
+  Hash *purged, Vector *snapshots);
 
-// Clean up after a failed background merge session, adding all dead files to
-// the list of candidates to be zapped.
+// Add filepath entries referenced by a snapshot to a Hash. Note that
+// it's assumed that snapshots only list entries local to the index
+// folder.
 static void
-S_zap_dead_merge(FilePurger *self, Hash *candidates);

[14/16] lucy git commit: Move LockFileLock to separate file

2017-04-16 Thread nwellnhof
Move LockFileLock to separate file


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

Branch: refs/heads/master
Commit: 6e8538a8834a49da7e8cce8b94decc130467b0f3
Parents: 2bd2bc6
Author: Nick Wellnhofer 
Authored: Sun Feb 19 17:01:50 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:51:32 2017 +0100

--
 core/Lucy/Index/IndexManager.c   |   2 +-
 core/Lucy/Store/Lock.c   | 376 ++
 core/Lucy/Store/Lock.cfh |  33 +--
 core/Lucy/Store/LockFileLock.c   | 363 
 core/Lucy/Store/LockFileLock.cfh |  49 +
 test/Lucy/Test/Store/TestLock.c  |   2 +-
 6 files changed, 437 insertions(+), 388 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/6e8538a8/core/Lucy/Index/IndexManager.c
--
diff --git a/core/Lucy/Index/IndexManager.c b/core/Lucy/Index/IndexManager.c
index bd3aa30..8e56509 100644
--- a/core/Lucy/Index/IndexManager.c
+++ b/core/Lucy/Index/IndexManager.c
@@ -25,7 +25,7 @@
 #include "Lucy/Index/Snapshot.h"
 #include "Lucy/Store/DirHandle.h"
 #include "Lucy/Store/Folder.h"
-#include "Lucy/Store/Lock.h"
+#include "Lucy/Store/LockFileLock.h"
 #include "Lucy/Util/IndexFileNames.h"
 #include "Lucy/Util/Json.h"
 #include "Lucy/Util/StringHelper.h"

http://git-wip-us.apache.org/repos/asf/lucy/blob/6e8538a8/core/Lucy/Store/Lock.c
--
diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c
index e716099..7a4a060 100644
--- a/core/Lucy/Store/Lock.c
+++ b/core/Lucy/Store/Lock.c
@@ -15,18 +15,12 @@
  */
 
 #define C_LUCY_LOCK
-#define C_LUCY_LOCKFILELOCK
 #include "Lucy/Util/ToolSet.h"
 
-#include 
 #include 
 
 #include "Lucy/Store/Lock.h"
-#include "Lucy/Store/DirHandle.h"
 #include "Lucy/Store/Folder.h"
-#include "Lucy/Store/OutStream.h"
-#include "Lucy/Util/Json.h"
-#include "Lucy/Util/ProcessID.h"
 #include "Lucy/Util/Sleep.h"
 
 Lock*
@@ -76,6 +70,26 @@ Lock_Destroy_IMP(Lock *self) {
 }
 
 bool
+Lock_make_lock_dir(Folder *folder) {
+String *lock_dir_name = SSTR_WRAP_C("locks");
+
+if (!Folder_MkDir(folder, lock_dir_name)) {
+Err *err = (Err*)INCREF(Err_get_error());
+// Maybe our attempt failed because another process succeeded.
+if (Folder_Find_Folder(folder, lock_dir_name)) {
+DECREF(err);
+}
+else {
+// Nope, everything failed, so bail out.
+Err_set_error(err);
+return false;
+}
+}
+
+return true;
+}
+
+bool
 Lock_Obtain_Shared_IMP(Lock *self) {
 LockIVARS *const ivars = Lock_IVARS(self);
 int32_t time_left = ivars->interval == 0 ? 0 : ivars->timeout;
@@ -111,356 +125,6 @@ Lock_Obtain_Exclusive_IMP(Lock *self) {
 
 /***/
 
-#define LFLOCK_STATE_UNLOCKED  0
-#define LFLOCK_STATE_LOCKED_SHARED 1
-#define LFLOCK_STATE_LOCKED_EXCLUSIVE  2
-
-static bool
-S_request(LockFileLockIVARS *ivars, String *lock_path);
-
-static bool
-S_is_locked_exclusive(LockFileLockIVARS *ivars);
-
-static bool
-S_is_locked(LockFileLockIVARS *ivars);
-
-static bool
-S_is_shared_lock_file(LockFileLockIVARS *ivars, String *entry);
-
-static bool
-S_maybe_delete_file(LockFileLockIVARS *ivars, String *path,
-bool delete_mine, bool delete_other);
-
-LockFileLock*
-LFLock_new(Folder *folder, String *name, String *host, int32_t timeout,
-   int32_t interval, bool exclusive_only) {
-LockFileLock *self = (LockFileLock*)Class_Make_Obj(LOCKFILELOCK);
-return LFLock_init(self, folder, name, host, timeout, interval,
-   exclusive_only);
-}
-
-LockFileLock*
-LFLock_init(LockFileLock *self, Folder *folder, String *name, String *host,
-int32_t timeout, int32_t interval, bool exclusive_only) {
-int pid = PID_getpid();
-Lock_init((Lock*)self, folder, name, timeout, interval);
-LockFileLockIVARS *const ivars = LFLock_IVARS(self);
-ivars->host  = (String*)INCREF(host);
-ivars->link_path = Str_newf("%o.%o.%i64", ivars->lock_path, host,
-(int64_t)pid);
-ivars->exclusive_only = exclusive_only;
-return self;
-}
-
-struct lockfile_context {
-OutStream *outstream;
-String *json;
-};
-
-static void
-S_write_lockfile_json(void *context) {
-struct lockfile_context *stuff = (struct lockfile_context*)context;
-size_t size = Str_Get_Size(stuff->json);
-OutStream_Write_Bytes(stuff->outstream, 

[15/16] lucy git commit: Merge branch 'master' into improve-locking

2017-04-16 Thread nwellnhof
Merge branch 'master' into improve-locking


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

Branch: refs/heads/master
Commit: a3cf33f1efc796a284d6a5761142f89a1319ac52
Parents: 6e8538a 7a64a28
Author: Nick Wellnhofer 
Authored: Fri Mar 17 17:10:51 2017 +0100
Committer: Nick Wellnhofer 
Committed: Fri Mar 17 17:10:51 2017 +0100

--
 core/Lucy/Analysis/Analyzer.cfh  |   2 +
 core/Lucy/Index/BackgroundMerger.c   |  43 ++--
 core/Lucy/Index/IndexManager.c   |  27 ---
 core/Lucy/Index/IndexManager.cfh |   7 -
 core/Lucy/Index/Indexer.c|  25 +--
 core/Lucy/Index/Indexer.cfh  |   1 +
 core/Lucy/Store/FSFileHandle.c   |   7 +-
 core/Lucy/Store/FSFolder.c   | 241 +++---
 core/Lucy/Util/IndexFileNames.c  |   8 +
 core/Lucy/Util/IndexFileNames.cfh|   6 +
 go/build.go  |   1 -
 go/lucy/index.go |  12 --
 go/lucy/index_test.go|   5 -
 perl/buildlib/Lucy/Build/Binding/Analysis.pm |  59 +-
 perl/t/051-fsfile.t  |   1 +
 perl/t/240-custom-analyzer.t |  69 +++
 16 files changed, 350 insertions(+), 164 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/a3cf33f1/core/Lucy/Index/BackgroundMerger.c
--

http://git-wip-us.apache.org/repos/asf/lucy/blob/a3cf33f1/core/Lucy/Index/IndexManager.c
--
diff --cc core/Lucy/Index/IndexManager.c
index 8e56509,24eed1d..b99254d
--- a/core/Lucy/Index/IndexManager.c
+++ b/core/Lucy/Index/IndexManager.c
@@@ -25,10 -25,10 +25,9 @@@
  #include "Lucy/Index/Snapshot.h"
  #include "Lucy/Store/DirHandle.h"
  #include "Lucy/Store/Folder.h"
 -#include "Lucy/Store/Lock.h"
 -#include "Lucy/Store/LockFactory.h"
 +#include "Lucy/Store/LockFileLock.h"
  #include "Lucy/Util/IndexFileNames.h"
  #include "Lucy/Util/Json.h"
- #include "Lucy/Util/StringHelper.h"
  
  #include 
  

http://git-wip-us.apache.org/repos/asf/lucy/blob/a3cf33f1/core/Lucy/Index/IndexManager.cfh
--

http://git-wip-us.apache.org/repos/asf/lucy/blob/a3cf33f1/core/Lucy/Index/Indexer.c
--

http://git-wip-us.apache.org/repos/asf/lucy/blob/a3cf33f1/go/build.go
--

http://git-wip-us.apache.org/repos/asf/lucy/blob/a3cf33f1/go/lucy/index_test.go
--
diff --cc go/lucy/index_test.go
index a47c364,0049ee4..341bf64
--- a/go/lucy/index_test.go
+++ b/go/lucy/index_test.go
@@@ -212,11 -222,7 +211,7 @@@ func TestIndexManagerMergeData(t *testi
  }
  
  func TestIndexManagerMisc(t *testing.T) {
 -  manager := NewIndexManager("", nil)
 +  manager := NewIndexManager("")
-   manager.SetFolder(NewRAMFolder(""))
-   if got, err := manager.MakeSnapshotFilename(); !strings.Contains(got, 
"snapshot") || err != nil {
-   t.Errorf("MakeSnapshotFilename: %s, %v", got, err)
-   }
snapshot := NewSnapshot()
snapshot.AddEntry("seg_4")
snapshot.AddEntry("seg_5")



[05/16] lucy git commit: Remove LockFactory and make Lock a private class

2017-04-16 Thread nwellnhof
Remove LockFactory and make Lock a private class

If there are users who really use custom locks, this can be reverted.


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

Branch: refs/heads/master
Commit: 3e2298650d8fc0213ce25078cadeb4f22d45bb5f
Parents: 1a8e02d
Author: Nick Wellnhofer 
Authored: Thu Feb 16 17:47:33 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:21 2017 +0100

--
 core/Lucy/Docs/Cookbook/FastUpdates.md  |   2 +-
 core/Lucy/Index/BackgroundMerger.c  |   2 +-
 core/Lucy/Index/FilePurger.c|   2 +-
 core/Lucy/Index/IndexManager.c  |  54 
 core/Lucy/Index/IndexManager.cfh|  10 +--
 core/Lucy/Index/Indexer.c   |   2 +-
 core/Lucy/Store/Lock.cfh|   2 +-
 core/Lucy/Store/LockFactory.c   |  57 -
 core/Lucy/Store/LockFactory.cfh |  65 ---
 go/lucy/index_test.go   |  14 ++--
 go/lucy/store_test.go   |  13 ---
 perl/buildlib/Lucy/Build/Binding/Store.pm   | 100 ---
 perl/lib/Lucy/Store/Lock.pm |  25 --
 perl/lib/Lucy/Store/LockFactory.pm  |  25 --
 perl/t/111-index_manager.t  |   9 +-
 test/Lucy/Test/Index/NoMergeManager.c   |   2 +-
 test/Lucy/Test/Index/TestBackgroundMerger.c |   2 +-
 test/Lucy/Test/Index/TestIndexManager.c |   2 +-
 18 files changed, 39 insertions(+), 349 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/3e229865/core/Lucy/Docs/Cookbook/FastUpdates.md
--
diff --git a/core/Lucy/Docs/Cookbook/FastUpdates.md 
b/core/Lucy/Docs/Cookbook/FastUpdates.md
index 03f152c..2a65b47 100644
--- a/core/Lucy/Docs/Cookbook/FastUpdates.md
+++ b/core/Lucy/Docs/Cookbook/FastUpdates.md
@@ -197,7 +197,7 @@ void indexing_process(Obj *index, Doc *doc) {
 
 void
 background_merge_process(Obj *index) {
-IndexManager *manager = IxManager_new(NULL, NULL);
+IndexManager *manager = IxManager_new(NULL);
 IxManager_Set_Write_Lock_Timeout(manager, 6);
 
 BackgroundMerger bg_merger = BGMerger_new(index, manager);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3e229865/core/Lucy/Index/BackgroundMerger.c
--
diff --git a/core/Lucy/Index/BackgroundMerger.c 
b/core/Lucy/Index/BackgroundMerger.c
index e9a1ae8..144139d 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -83,7 +83,7 @@ BGMerger_init(BackgroundMerger *self, Obj *index, 
IndexManager *manager) {
 ivars->manager = (IndexManager*)INCREF(manager);
 }
 else {
-ivars->manager = IxManager_new(NULL, NULL);
+ivars->manager = IxManager_new(NULL);
 IxManager_Set_Write_Lock_Timeout(ivars->manager, 1);
 }
 IxManager_Set_Folder(ivars->manager, folder);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3e229865/core/Lucy/Index/FilePurger.c
--
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 161f030..6811c33 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -58,7 +58,7 @@ FilePurger_init(FilePurger *self, Folder *folder, 
IndexManager *manager) {
 ivars->folder   = (Folder*)INCREF(folder);
 ivars->manager  = manager
  ? (IndexManager*)INCREF(manager)
- : IxManager_new(NULL, NULL);
+ : IxManager_new(NULL);
 IxManager_Set_Folder(ivars->manager, folder);
 
 return self;

http://git-wip-us.apache.org/repos/asf/lucy/blob/3e229865/core/Lucy/Index/IndexManager.c
--
diff --git a/core/Lucy/Index/IndexManager.c b/core/Lucy/Index/IndexManager.c
index 15cbbd9..82b9012 100644
--- a/core/Lucy/Index/IndexManager.c
+++ b/core/Lucy/Index/IndexManager.c
@@ -26,7 +26,6 @@
 #include "Lucy/Store/DirHandle.h"
 #include "Lucy/Store/Folder.h"
 #include "Lucy/Store/Lock.h"
-#include "Lucy/Store/LockFactory.h"
 #include "Lucy/Util/IndexFileNames.h"
 #include "Lucy/Util/Json.h"
 #include "Lucy/Util/StringHelper.h"
@@ -84,19 +83,17 @@ static const int32_t S_fibonacci[47] = {
 };
 
 IndexManager*
-IxManager_new(String *host, LockFactory *lock_factory) {
+IxManager_new(String *host) {
 IndexManager *self = (IndexManager*)Class_Make_Obj(INDEXMANAGER);
-return IxManager_init(self, host, 

[04/16] lucy git commit: Merge SharedLock into LockFileLock

2017-04-16 Thread nwellnhof
Merge SharedLock into LockFileLock

Supplying the lock type when requesting a lock better matches other
file lock APIs. Merging the implementations allows to convert
Maybe_Delete_File into a static function.

Make shared and exclusive locks check for locks of the other type
except for exclusive locks created with `exclusive_only`.

Clear_Stale is broken for shared locks but will be removed with the
following commit.


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

Branch: refs/heads/master
Commit: bb83d0d77bf99ed09b2bbad782c3c1d3b94f04a9
Parents: 2051451
Author: Nick Wellnhofer 
Authored: Thu Feb 16 15:58:45 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:21 2017 +0100

--
 core/Lucy/Docs/FileLocking.md |   5 +-
 core/Lucy/Index/BackgroundMerger.c|   4 +-
 core/Lucy/Index/FilePurger.c  |   4 +-
 core/Lucy/Index/IndexManager.c|  11 +-
 core/Lucy/Index/Indexer.c |   6 +-
 core/Lucy/Index/PolyReader.c  |   4 +-
 core/Lucy/Store/Lock.c| 326 +++--
 core/Lucy/Store/Lock.cfh  |  86 ---
 core/Lucy/Store/LockFactory.c |  15 +-
 core/Lucy/Store/LockFactory.cfh   |  21 +-
 core/Lucy/Store/SharedLock.c  | 173 -
 core/Lucy/Store/SharedLock.cfh|  77 --
 go/build.go   |   6 +-
 go/lucy/index_test.go |   2 +-
 go/lucy/store.go  |  28 ++-
 go/lucy/store_test.go |  62 +++--
 perl/buildlib/Lucy/Build/Binding/Store.pm |   2 +-
 perl/t/105-folder.t   |  34 +--
 perl/t/106-locking.t  |   9 +-
 perl/t/110-shared_lock.t  |  57 +++--
 perl/t/111-index_manager.t|  15 +-
 21 files changed, 449 insertions(+), 498 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/bb83d0d7/core/Lucy/Docs/FileLocking.md
--
diff --git a/core/Lucy/Docs/FileLocking.md b/core/Lucy/Docs/FileLocking.md
index 911df21..2a6f5b8 100644
--- a/core/Lucy/Docs/FileLocking.md
+++ b/core/Lucy/Docs/FileLocking.md
@@ -43,9 +43,8 @@ process will crash with a "Stale NFS filehandle" exception.
 
 Under normal circumstances, it is neither necessary nor desirable for
 IndexReaders to secure read locks against an index, but for NFS we have to
-make an exception.  LockFactory's [](lucy.LockFactory.Make_Shared_Lock) method 
exists for this
-reason; supplying an IndexManager instance to IndexReader's constructor
-activates an internal locking mechanism using 
[](lucy.LockFactory.Make_Shared_Lock) which
+make an exception.  Supplying an IndexManager instance to IndexReader's
+constructor activates an internal locking mechanism using shared locks which
 prevents concurrent indexing processes from deleting files that are needed
 by active readers.
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/bb83d0d7/core/Lucy/Index/BackgroundMerger.c
--
diff --git a/core/Lucy/Index/BackgroundMerger.c 
b/core/Lucy/Index/BackgroundMerger.c
index 8f36050..661b9a6 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -530,7 +530,7 @@ S_obtain_write_lock(BackgroundMerger *self) {
 BackgroundMergerIVARS *const ivars = BGMerger_IVARS(self);
 Lock *write_lock = IxManager_Make_Write_Lock(ivars->manager);
 Lock_Clear_Stale(write_lock);
-if (Lock_Obtain(write_lock)) {
+if (Lock_Obtain_Exclusive(write_lock)) {
 // Only assign if successful, otherwise DESTROY unlocks -- bad!
 ivars->write_lock = write_lock;
 }
@@ -544,7 +544,7 @@ S_obtain_merge_lock(BackgroundMerger *self) {
 BackgroundMergerIVARS *const ivars = BGMerger_IVARS(self);
 Lock *merge_lock = IxManager_Make_Merge_Lock(ivars->manager);
 Lock_Clear_Stale(merge_lock);
-if (Lock_Obtain(merge_lock)) {
+if (Lock_Obtain_Exclusive(merge_lock)) {
 // Only assign if successful, same rationale as above.
 ivars->merge_lock = merge_lock;
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/bb83d0d7/core/Lucy/Index/FilePurger.c
--
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 55ade17..3980c8f 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -79,7 +79,7 @@ FilePurger_Purge_Snapshots_IMP(FilePurger *self, Snapshot 

[11/16] lucy git commit: Port LockFileLock tests to C

2017-04-16 Thread nwellnhof
Port LockFileLock tests to C


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

Branch: refs/heads/master
Commit: 35388cd22600cb3c202cf11c8c9afd661c8f4fe4
Parents: e06cdbf
Author: Nick Wellnhofer 
Authored: Fri Feb 17 21:38:56 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:48:17 2017 +0100

--
 core/Lucy/Store/Lock.c|  18 --
 core/Lucy/Store/Lock.cfh  |   9 -
 go/lucy/store_test.go |  15 --
 perl/t/105-folder.t   |  36 +---
 perl/t/106-locking.t  |  89 --
 perl/t/110-shared_lock.t  |  93 ---
 perl/t/111-index_manager.t|  17 +-
 perl/t/core/106-lf_lock.t |  23 +++
 test/Lucy/Test.c  |   2 +
 test/Lucy/Test/Store/TestLock.c   | 297 +
 test/Lucy/Test/Store/TestLock.cfh |  29 
 11 files changed, 356 insertions(+), 272 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/35388cd2/core/Lucy/Store/Lock.c
--
diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c
index 90a6aa0..5cddcd9 100644
--- a/core/Lucy/Store/Lock.c
+++ b/core/Lucy/Store/Lock.c
@@ -77,16 +77,6 @@ Lock_Destroy_IMP(Lock *self) {
 SUPER_DESTROY(self, LOCK);
 }
 
-String*
-Lock_Get_Name_IMP(Lock *self) {
-return Lock_IVARS(self)->name;
-}
-
-String*
-Lock_Get_Host_IMP(Lock *self) {
-return Lock_IVARS(self)->host;
-}
-
 bool
 Lock_Obtain_Shared_IMP(Lock *self) {
 LockIVARS *const ivars = Lock_IVARS(self);
@@ -163,14 +153,6 @@ LFLock_init(LockFileLock *self, Folder *folder, String 
*name, String *host,
 return self;
 }
 
-String*
-LFLock_Get_Lock_Path_IMP(LockFileLock *self) {
-LockFileLockIVARS *const ivars = LFLock_IVARS(self);
-return ivars->shared_lock_path
-   ? ivars->shared_lock_path
-   : ivars->lock_path;
-}
-
 struct lockfile_context {
 OutStream *outstream;
 String *json;

http://git-wip-us.apache.org/repos/asf/lucy/blob/35388cd2/core/Lucy/Store/Lock.cfh
--
diff --git a/core/Lucy/Store/Lock.cfh b/core/Lucy/Store/Lock.cfh
index 6688e95..30940b4 100644
--- a/core/Lucy/Store/Lock.cfh
+++ b/core/Lucy/Store/Lock.cfh
@@ -96,12 +96,6 @@ abstract class Lucy::Store::Lock inherits Clownfish::Obj {
 public abstract void
 Release(Lock *self);
 
-String*
-Get_Name(Lock *self);
-
-String*
-Get_Host(Lock *self);
-
 public void
 Destroy(Lock *self);
 }
@@ -131,9 +125,6 @@ class Lucy::Store::LockFileLock nickname LFLock
 public void
 Release(LockFileLock *self);
 
-String*
-Get_Lock_Path(LockFileLock *self);
-
 public void
 Destroy(LockFileLock *self);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/35388cd2/go/lucy/store_test.go
--
diff --git a/go/lucy/store_test.go b/go/lucy/store_test.go
index ae70069..2b24ff4 100644
--- a/go/lucy/store_test.go
+++ b/go/lucy/store_test.go
@@ -652,21 +652,10 @@ func TestLockFileLockAll(t *testing.T) {
lock := NewLockFileLock(folder, "foo", "dev.example.com", 0, 1, false)
other := NewLockFileLock(folder, "foo", "dev.example.com", 0, 1, false)
 
-   if got := lock.getName(); got != "foo" {
-   t.Errorf("getName: %v", got)
-   }
-   if got := lock.getHost(); got != "dev.example.com" {
-   t.Errorf("getHost: %v", got)
-   }
-
err = lock.RequestShared()
if err != nil {
t.Errorf("Request: %v", err)
}
-   if got := lock.getLockPath(); len(got) == 0 {
-   // Lock path only valid when locked for shared locks.
-   t.Errorf("getLockPath should work")
-   }
err = other.RequestShared()
if err != nil {
t.Errorf("Shared lock Request should succeed: %v", err)
@@ -686,10 +675,6 @@ func TestLockFileLockAll(t *testing.T) {
if err != nil {
t.Errorf("Request: %v", err)
}
-   if got := lock.getLockPath(); len(got) == 0 {
-   // Lock path only valid when locked for shared locks.
-   t.Errorf("getLockPath should work")
-   }
err = other.RequestExclusive()
if err == nil {
t.Errorf("Request should fail for locked resource")

http://git-wip-us.apache.org/repos/asf/lucy/blob/35388cd2/perl/t/105-folder.t
--
diff --git a/perl/t/105-folder.t b/perl/t/105-folder.t

[08/16] lucy git commit: Improve merge lock handling

2017-04-16 Thread nwellnhof
Improve merge lock handling

Don't check the merge lock with Is_Locked in
FilePurger_Purge_Aborted_Merge. This prevented background mergers from
cleaning up because they already held the merge lock. Require that
callers hold the merge lock instead.

Don't check the merge lock with Is_Locked in Indexer_init. Since we
hold the write lock, and the merge.json file from aborted merge has
been removed, the presence of a merge.json file is a reliable indicator
that it belongs to an active background merger. Move the merge lock
request form S_maybe_merge to Indexer_init.

Also, S_maybe_merge used to Obtain the merge lock instead of merely
Requesting it. Waiting for a potentially long-running background merger
slows things down unnecessarily and increases the chance for write lock
contention. This didn't affect the default configuration which has a
zero merge lock timeout.


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

Branch: refs/heads/master
Commit: 4e6e5bbf2814e8e2a824b5ae1b91d068233cd248
Parents: 5270b98
Author: Nick Wellnhofer 
Authored: Fri Feb 17 18:25:35 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:22 2017 +0100

--
 core/Lucy/Index/FilePurger.c   | 53 -
 core/Lucy/Index/FilePurger.cfh |  6 +++--
 core/Lucy/Index/Indexer.c  | 39 ---
 3 files changed, 44 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/4e6e5bbf/core/Lucy/Index/FilePurger.c
--
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 433dec3..5795bb0 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -139,44 +139,37 @@ FilePurger_Purge_Snapshots_IMP(FilePurger *self, Snapshot 
*current) {
 void
 FilePurger_Purge_Aborted_Merge_IMP(FilePurger *self) {
 FilePurgerIVARS *const ivars = FilePurger_IVARS(self);
-IndexManager *manager= ivars->manager;
-Lock *merge_lock = IxManager_Make_Merge_Lock(manager);
-
-if (!Lock_Is_Locked_Exclusive(merge_lock)) {
-Hash *merge_data = IxManager_Read_Merge_Data(manager);
-Obj  *cutoff = merge_data
-   ? Hash_Fetch_Utf8(merge_data, "cutoff", 6)
-   : NULL;
-
-if (cutoff) {
-Folder *folder = ivars->folder;
-
-String *cutoff_seg = Seg_num_to_name(Json_obj_to_i64(cutoff));
-if (Folder_Local_Exists(folder, cutoff_seg)) {
-if (!S_delete_entry(folder, cutoff_seg)) {
-if (Folder_Local_Exists(folder, cutoff_seg)) {
-WARN("Couldn't delete '%o' from aborted merge",
- cutoff_seg);
-}
-}
-}
-
-String *merge_json = SSTR_WRAP_C("merge.json");
-if (!Folder_Local_Delete(folder, merge_json)) {
-if (Folder_Local_Exists(folder, merge_json)) {
+IndexManager *manager = ivars->manager;
+Hash *merge_data = IxManager_Read_Merge_Data(manager);
+Obj  *cutoff = merge_data
+   ? Hash_Fetch_Utf8(merge_data, "cutoff", 6)
+   : NULL;
+
+if (cutoff) {
+Folder *folder = ivars->folder;
+
+String *cutoff_seg = Seg_num_to_name(Json_obj_to_i64(cutoff));
+if (Folder_Local_Exists(folder, cutoff_seg)) {
+if (!S_delete_entry(folder, cutoff_seg)) {
+if (Folder_Local_Exists(folder, cutoff_seg)) {
 WARN("Couldn't delete '%o' from aborted merge",
- merge_json);
+ cutoff_seg);
 }
 }
+}
 
-DECREF(cutoff_seg);
+String *merge_json = SSTR_WRAP_C("merge.json");
+if (!Folder_Local_Delete(folder, merge_json)) {
+if (Folder_Local_Exists(folder, merge_json)) {
+WARN("Couldn't delete '%o' from aborted merge",
+ merge_json);
+}
 }
 
-DECREF(merge_data);
+DECREF(cutoff_seg);
 }
 
-DECREF(merge_lock);
-return;
+DECREF(merge_data);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy/blob/4e6e5bbf/core/Lucy/Index/FilePurger.cfh
--
diff --git a/core/Lucy/Index/FilePurger.cfh b/core/Lucy/Index/FilePurger.cfh
index 4f3923d..c781170 100644
--- a/core/Lucy/Index/FilePurger.cfh
+++ b/core/Lucy/Index/FilePurger.cfh
@@ -30,12 +30,14 @@ class 

[01/16] lucy git commit: Rework snapshot and deletion locks

2017-04-16 Thread nwellnhof
Repository: lucy
Updated Branches:
  refs/heads/master 7a64a288c -> d7feb9970


Rework snapshot and deletion locks

Request exclusive or shared snapshot locks instead of the global
deletion lock. This removes the need to retry lock requests and
reduces contention.


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

Branch: refs/heads/master
Commit: 5270b988c477a2e1c110e2069c66bb2d3f27a60f
Parents: 79161a4
Author: Nick Wellnhofer 
Authored: Fri Feb 17 17:19:43 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:21 2017 +0100

--
 core/Lucy/Index/FilePurger.c | 133 --
 core/Lucy/Index/IndexManager.c   |  43 +--
 core/Lucy/Index/IndexManager.cfh |  32 +---
 core/Lucy/Index/IndexReader.c|  18 ++---
 core/Lucy/Index/IndexReader.cfh  |   3 +-
 core/Lucy/Index/PolyReader.c | 123 ---
 go/lucy/index_test.go|  13 +---
 perl/t/109-read_locking.t|  53 ++
 perl/t/111-index_manager.t   |   7 +-
 9 files changed, 145 insertions(+), 280 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/5270b988/core/Lucy/Index/FilePurger.c
--
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 6811c33..433dec3 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -33,7 +33,7 @@
 // obsolete snapshots to snapshots array.
 static void
 S_discover_unused(FilePurger *self, Snapshot *current, Hash *spared,
-  Hash *purged, Vector *snapshots);
+  Hash *purged, Vector *snapshots, Vector *locks);
 
 // Add filepath entries referenced by a snapshot to a Hash. Note that
 // it's assumed that snapshots only list entries local to the index
@@ -75,69 +75,65 @@ FilePurger_Destroy_IMP(FilePurger *self) {
 void
 FilePurger_Purge_Snapshots_IMP(FilePurger *self, Snapshot *current) {
 FilePurgerIVARS *const ivars = FilePurger_IVARS(self);
-Lock *deletion_lock = IxManager_Make_Deletion_Lock(ivars->manager);
-
-// Obtain deletion lock, purge files, release deletion lock.
-if (Lock_Obtain_Exclusive(deletion_lock)) {
-Folder *folder= ivars->folder;
-Hash   *failures  = Hash_new(16);
-Hash   *spared= Hash_new(32);
-Hash   *purged= Hash_new(32);
-Vector *snapshots = Vec_new(16);
-
-// Don't allow the locks directory to be zapped.
-Hash_Store_Utf8(spared, "locks", 5, (Obj*)CFISH_TRUE);
-
-S_discover_unused(self, current, spared, purged, snapshots);
-
-// Attempt to delete entries -- if failure, no big deal, just try
-// again later.
-HashIterator *iter = HashIter_new(purged);
-while (HashIter_Next(iter)) {
-String *entry = HashIter_Get_Key(iter);
-if (Hash_Fetch(spared, entry)) { continue; }
-if (!S_delete_entry(folder, entry)) {
-if (Folder_Exists(folder, entry)) {
-Hash_Store(failures, entry, (Obj*)CFISH_TRUE);
-}
+
+Folder *folder= ivars->folder;
+Hash   *failures  = Hash_new(16);
+Hash   *spared= Hash_new(32);
+Hash   *purged= Hash_new(32);
+Vector *snapshots = Vec_new(16);
+Vector *locks = Vec_new(16);
+
+// Don't allow the locks directory to be zapped.
+Hash_Store_Utf8(spared, "locks", 5, (Obj*)CFISH_TRUE);
+
+S_discover_unused(self, current, spared, purged, snapshots, locks);
+
+// Attempt to delete entries -- if failure, no big deal, just try
+// again later.
+HashIterator *iter = HashIter_new(purged);
+while (HashIter_Next(iter)) {
+String *entry = HashIter_Get_Key(iter);
+if (Hash_Fetch(spared, entry)) { continue; }
+if (!S_delete_entry(folder, entry)) {
+if (Folder_Exists(folder, entry)) {
+Hash_Store(failures, entry, (Obj*)CFISH_TRUE);
 }
 }
+}
 
-for (size_t i = 0, max = Vec_Get_Size(snapshots); i < max; i++) {
-Snapshot *snapshot = (Snapshot*)Vec_Fetch(snapshots, i);
-bool snapshot_has_failures = false;
-if (Hash_Get_Size(failures)) {
-// Only delete snapshot files if all of their entries were
-// successfully deleted.
-Vector *entries = Snapshot_List(snapshot);
-for (size_t j = Vec_Get_Size(entries); j--;) {
-String *entry = (String*)Vec_Fetch(entries, j);
-if 

[10/16] lucy git commit: Change lock acquitision order in BGMerger_init

2017-04-16 Thread nwellnhof
Change lock acquitision order in BGMerger_init

Obtain the merge lock before the write lock so that an already running
background merger won't abort when failing to acquire the write lock
during commit.

Release the merge lock at the very end of BGMerger_Commit. It doesn't
really matter when we release the merge lock after we acquired the
write lock in BGMerger_Prepare_Commit. I think it makes the code
clearer to release it at the very end of BGMerger_Commit.


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

Branch: refs/heads/master
Commit: de14d4ca31ab27fc1569966c1b182fa4829afd40
Parents: 4e6e5bb
Author: Nick Wellnhofer 
Authored: Fri Feb 17 18:34:31 2017 +0100
Committer: Nick Wellnhofer 
Committed: Mon Feb 20 16:26:22 2017 +0100

--
 core/Lucy/Index/BackgroundMerger.c | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/de14d4ca/core/Lucy/Index/BackgroundMerger.c
--
diff --git a/core/Lucy/Index/BackgroundMerger.c 
b/core/Lucy/Index/BackgroundMerger.c
index 144139d..be69d90 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -88,14 +88,16 @@ BGMerger_init(BackgroundMerger *self, Obj *index, 
IndexManager *manager) {
 }
 IxManager_Set_Folder(ivars->manager, folder);
 
-// Obtain write lock (which we'll only hold briefly), then merge lock.
-S_obtain_write_lock(self);
-if (!ivars->write_lock) {
+// Obtain merge lock first so that a running background merger won't
+// abort when failing to acquire the write lock during commit.
+S_obtain_merge_lock(self);
+if (!ivars->merge_lock) {
 DECREF(self);
 RETHROW(INCREF(Err_get_error()));
 }
-S_obtain_merge_lock(self);
-if (!ivars->merge_lock) {
+// Obtain write lock (which we'll only hold briefly).
+S_obtain_write_lock(self);
+if (!ivars->write_lock) {
 DECREF(self);
 RETHROW(INCREF(Err_get_error()));
 }
@@ -512,8 +514,7 @@ BGMerger_Commit_IMP(BackgroundMerger *self) {
 DECREF(temp_snapfile);
 }
 
-// Release the merge lock and remove the merge data file.
-S_release_merge_lock(self);
+// Remove the merge data file.
 IxManager_Remove_Merge_Data(ivars->manager);
 
 if (ivars->needs_commit) {
@@ -521,8 +522,9 @@ BGMerger_Commit_IMP(BackgroundMerger *self) {
 FilePurger_Purge_Snapshots(ivars->file_purger, ivars->snapshot);
 }
 
-// Release the write lock.
+// Release write and merge locks.
 S_release_write_lock(self);
+S_release_merge_lock(self);
 }
 
 static void



[03/20] lucy-clownfish git commit: Use WeakPtr in CFCType

2017-03-18 Thread nwellnhof
Use WeakPtr in CFCType

Weaken the parcel pointer, allowing to store a class array in CFCParcel
later.


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

Branch: refs/heads/master
Commit: 7ce20fd218f45f2a647a102e5c1f0d3711f2ee05
Parents: e0c9d8b
Author: Nick Wellnhofer 
Authored: Mon Feb 27 16:58:47 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:02 2017 +0100

--
 compiler/src/CFCType.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/7ce20fd2/compiler/src/CFCType.c
--
diff --git a/compiler/src/CFCType.c b/compiler/src/CFCType.c
index 5dd3136..5df5705 100644
--- a/compiler/src/CFCType.c
+++ b/compiler/src/CFCType.c
@@ -37,7 +37,7 @@ struct CFCType {
 char*specifier;
 char*class_var;
 int  indirection;
-struct CFCParcel *parcel;
+CFCWeakPtr parcel;
 char*c_string;
 size_t   width;
 char*array;
@@ -92,7 +92,7 @@ CFCType*
 CFCType_init(CFCType *self, int flags, struct CFCParcel *parcel,
  const char *specifier, int indirection) {
 self->flags   = flags;
-self->parcel  = (CFCParcel*)CFCBase_incref((CFCBase*)parcel);
+self->parcel  = CFCWeakPtr_new((CFCBase*)parcel);
 self->specifier   = CFCUtil_strdup(specifier);
 self->indirection = indirection;
 self->c_string= NULL;
@@ -295,8 +295,9 @@ CFCType_resolve(CFCType *self) {
 
 char *specifier = self->specifier;
 if (CFCUtil_isupper(specifier[0])) {
+CFCParcel *src_parcel = CFCType_get_parcel(self);
 CFCParcel *parcel
-= CFCParcel_lookup_struct_sym(self->parcel, specifier);
+= CFCParcel_lookup_struct_sym(src_parcel, specifier);
 if (!parcel) {
 CFCUtil_die("No class found for type '%s'", specifier);
 }
@@ -313,7 +314,7 @@ CFCType_destroy(CFCType *self) {
 if (self->child) {
 CFCBase_decref((CFCBase*)self->child);
 }
-CFCBase_decref((CFCBase*)self->parcel);
+CFCWeakPtr_destroy(>parcel);
 FREEMEM(self->specifier);
 FREEMEM(self->c_string);
 FREEMEM(self->array);
@@ -396,7 +397,7 @@ CFCType_get_indirection(CFCType *self) {
 
 struct CFCParcel*
 CFCType_get_parcel(CFCType *self) {
-return self->parcel;
+return (CFCParcel*)CFCWeakPtr_deref(self->parcel);
 }
 
 const char*



[20/20] lucy-clownfish git commit: Merge branch 'cfc-parcel'

2017-03-18 Thread nwellnhof
Merge branch 'cfc-parcel'


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

Branch: refs/heads/master
Commit: d601b8b8b9736b7f0868d8881dcc3e8dc9862a4f
Parents: ab9d388 bea2a98
Author: Nick Wellnhofer 
Authored: Sat Mar 18 19:08:29 2017 +0100
Committer: Nick Wellnhofer 
Committed: Sat Mar 18 19:08:29 2017 +0100

--
 compiler/c/cfc.c|   1 -
 compiler/perl/lib/Clownfish/CFC.pm  |   5 +-
 compiler/perl/lib/Clownfish/CFC.xs  | 120 --
 compiler/perl/t/200-function.t  |   6 +-
 compiler/perl/t/201-method.t|  31 +--
 compiler/perl/t/202-overridden_method.t |   4 +-
 compiler/perl/t/203-final_method.t  |   2 +-
 compiler/perl/t/401-class.t |  33 ++-
 compiler/perl/t/403-parcel.t|  37 +--
 compiler/perl/t/404-file.t  |   2 -
 compiler/perl/t/500-hierarchy.t |   6 +-
 compiler/perl/t/600-parser.t|  11 +-
 compiler/src/CFCBase.c  |  61 -
 compiler/src/CFCBase.h  |  17 ++
 compiler/src/CFCBindCore.c  |  28 +--
 compiler/src/CFCBindMethod.c|  53 ++---
 compiler/src/CFCBindSpecs.c |   4 +-
 compiler/src/CFCC.c |  70 +++---
 compiler/src/CFCCHtml.c | 323 ++-
 compiler/src/CFCCMan.c  |  52 ++---
 compiler/src/CFCCallable.c  |   5 -
 compiler/src/CFCCallable.h  |   3 -
 compiler/src/CFCClass.c | 202 ++---
 compiler/src/CFCClass.h |  36 +--
 compiler/src/CFCGo.c|  20 +-
 compiler/src/CFCGoClass.c   |   8 +-
 compiler/src/CFCGoTypeMap.c |  31 +--
 compiler/src/CFCHierarchy.c | 147 +++-
 compiler/src/CFCHierarchy.h |   6 -
 compiler/src/CFCMethod.c|  96 +---
 compiler/src/CFCMethod.h|  16 +-
 compiler/src/CFCParcel.c| 304 +++--
 compiler/src/CFCParcel.h|  50 +++--
 compiler/src/CFCParseHeader.y   |  12 +-
 compiler/src/CFCParser.c|  36 +--
 compiler/src/CFCParser.h|  13 +-
 compiler/src/CFCPerl.c  | 146 ++--
 compiler/src/CFCPerlClass.c |  33 +--
 compiler/src/CFCPerlMethod.c|  23 +-
 compiler/src/CFCPerlPod.c   |  75 +++
 compiler/src/CFCPerlPod.h   |   8 +-
 compiler/src/CFCPerlTypeMap.c   |  63 +++---
 compiler/src/CFCPyMethod.c  |   6 +-
 compiler/src/CFCPython.c|  31 +--
 compiler/src/CFCRuby.c  |   4 +-
 compiler/src/CFCTestClass.c |  20 +-
 compiler/src/CFCTestDocuComment.c   | 103 -
 compiler/src/CFCTestFile.c  |   2 -
 compiler/src/CFCTestFunction.c  |  12 +-
 compiler/src/CFCTestHierarchy.c | 102 +
 compiler/src/CFCTestMethod.c|  81 ---
 compiler/src/CFCTestParamList.c |   1 -
 compiler/src/CFCTestParcel.c|  43 ++--
 compiler/src/CFCTestParser.c|  17 +-
 compiler/src/CFCTestType.c  |   2 -
 compiler/src/CFCTestVariable.c  |   1 -
 compiler/src/CFCType.c  |  39 ++--
 compiler/src/CFCType.h  |   7 +-
 compiler/src/CFCUri.c   |  95 ++--
 59 files changed, 1409 insertions(+), 1356 deletions(-)
--




[19/20] lucy-clownfish git commit: Remove classes array from CFCHierarchy

2017-03-18 Thread nwellnhof
Remove classes array from CFCHierarchy

Replaced by class array in CFCParcel.


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

Branch: refs/heads/master
Commit: 8fbf9c960b0bcfccedf15a83e6bb7ae1191e2e24
Parents: 859f5b8
Author: Nick Wellnhofer 
Authored: Tue Feb 28 15:18:21 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:05 2017 +0100

--
 compiler/src/CFCHierarchy.c | 43 
 compiler/src/CFCParcel.c|  3 +++
 2 files changed, 3 insertions(+), 43 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8fbf9c96/compiler/src/CFCHierarchy.c
--
diff --git a/compiler/src/CFCHierarchy.c b/compiler/src/CFCHierarchy.c
index 0b5100c..6393133 100644
--- a/compiler/src/CFCHierarchy.c
+++ b/compiler/src/CFCHierarchy.c
@@ -56,9 +56,6 @@ struct CFCHierarchy {
 size_t num_trees;
 CFCFile **files;
 size_t num_files;
-CFCClass **classes;
-size_t classes_cap;
-size_t num_classes;
 };
 
 typedef struct CFCFindFilesContext {
@@ -133,10 +130,6 @@ CFCHierarchy_init(CFCHierarchy *self, const char *dest) {
 self->num_trees= 0;
 self->files= (CFCFile**)CALLOCATE(1, sizeof(CFCFile*));
 self->num_files= 0;
-self->classes_cap  = 10;
-self->classes  = (CFCClass**)CALLOCATE(
-(self->classes_cap + 1), sizeof(CFCClass*));
-self->num_classes  = 0;
 self->parser   = CFCParser_new();
 
 self->inc_dest = CFCUtil_sprintf("%s" CHY_DIR_SEP "include", self->dest);
@@ -153,15 +146,11 @@ CFCHierarchy_destroy(CFCHierarchy *self) {
 for (size_t i = 0; self->files[i] != NULL; i++) {
 CFCBase_decref((CFCBase*)self->files[i]);
 }
-for (size_t i = 0; self->classes[i] != NULL; i++) {
-CFCBase_decref((CFCBase*)self->classes[i]);
-}
 CFCUtil_free_string_array(self->sources);
 CFCUtil_free_string_array(self->includes);
 CFCUtil_free_string_array(self->prereqs);
 FREEMEM(self->trees);
 FREEMEM(self->files);
-FREEMEM(self->classes);
 FREEMEM(self->dest);
 FREEMEM(self->inc_dest);
 FREEMEM(self->src_dest);
@@ -233,10 +222,6 @@ CFCHierarchy_build(CFCHierarchy *self) {
 S_find_doc_files(self->sources[i]);
 }
 
-for (int i = 0; self->classes[i] != NULL; i++) {
-CFCClass_resolve_types(self->classes[i]);
-}
-
 // It's important that prereq parcels are processed first.
 for (size_t i = 0; parcels[i] != NULL; i++) {
 CFCParcel_connect_and_sort_classes(parcels[i]);
@@ -454,7 +439,6 @@ S_parse_cf_files(CFCHierarchy *self, const char 
*source_dir, int is_included) {
 CFCBase_decref((CFCBase*)file_spec);
 FREEMEM(path_part);
 }
-self->classes[self->num_classes] = NULL;
 
 CFCUtil_free_string_array(context.paths);
 }
@@ -639,22 +623,6 @@ S_add_file(CFCHierarchy *self, CFCFile *file) {
 CFCUTIL_NULL_CHECK(file);
 CFCClass **classes = CFCFile_classes(file);
 
-for (size_t i = 0; self->files[i] != NULL; i++) {
-CFCFile *existing = self->files[i];
-CFCClass **existing_classes = CFCFile_classes(existing);
-for (size_t j = 0; classes[j] != NULL; j++) {
-const char *new_class_name = CFCClass_get_name(classes[j]);
-for (size_t k = 0; existing_classes[k] != NULL; k++) {
-const char *existing_class_name
-= CFCClass_get_name(existing_classes[k]);
-if (strcmp(new_class_name, existing_class_name) == 0) {
-CFCUtil_die("Class '%s' already registered",
-new_class_name);
-}
-}
-}
-}
-
 self->num_files++;
 size_t size = (self->num_files + 1) * sizeof(CFCFile*);
 self->files = (CFCFile**)REALLOCATE(self->files, size);
@@ -664,17 +632,6 @@ S_add_file(CFCHierarchy *self, CFCFile *file) {
 
 for (size_t i = 0; classes[i] != NULL; i++) {
 CFCClass *klass = classes[i];
-
-if (self->num_classes == self->classes_cap) {
-self->classes_cap += 10;
-self->classes = (CFCClass**)REALLOCATE(
-  self->classes,
-  (self->classes_cap + 1) * sizeof(CFCClass*));
-}
-self->classes[self->num_classes++]
-= (CFCClass*)CFCBase_incref((CFCBase*)klass);
-self->classes[self->num_classes] = NULL;
-
 const char *parent_name = 

[18/20] lucy-clownfish git commit: Rework setup of parent/child relationship

2017-03-18 Thread nwellnhof
Rework setup of parent/child relationship

Set up parent/child relationship of classes in CFCParcel. Connect and
sort classes in a single function.

Make sure that prereq parcels are registered first.


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

Branch: refs/heads/master
Commit: a3231bcc2fa05743b8b82c94a04f0df30bf06d97
Parents: 682278c
Author: Nick Wellnhofer 
Authored: Tue Feb 28 14:11:25 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:05 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC.xs | 12 -
 compiler/src/CFCClass.c| 32 ++
 compiler/src/CFCClass.h|  5 ---
 compiler/src/CFCHierarchy.c| 78 ++---
 compiler/src/CFCParcel.c   | 50 ++---
 compiler/src/CFCParcel.h   |  5 ++-
 6 files changed, 64 insertions(+), 118 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a3231bcc/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index 81504f4..b0205d9 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -264,7 +264,6 @@ ALIAS:
 get_exposure  = 2
 get_name  = 4
 get_nickname  = 6
-set_parent= 7
 get_parent= 8
 get_path_part = 10
 get_parent_class_name = 12
@@ -303,17 +302,6 @@ PPCODE:
 retval = newSVpvn(value, strlen(value));
 }
 break;
-case 7: {
-CFCClass *parent = NULL;
-if (SvOK(ST(1))
-&& sv_derived_from(ST(1), "Clownfish::CFC::Model::Class")
-   ) {
-IV objint = SvIV((SV*)SvRV(ST(1)));
-parent = INT2PTR(CFCClass*, objint);
-}
-CFCClass_set_parent(self, parent);
-break;
-}
 case 8: {
 CFCClass *parent = CFCClass_get_parent(self);
 retval = S_cfcbase_to_perlref(parent);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a3231bcc/compiler/src/CFCClass.c
--
diff --git a/compiler/src/CFCClass.c b/compiler/src/CFCClass.c
index 9d63055..0a16a6b 100644
--- a/compiler/src/CFCClass.c
+++ b/compiler/src/CFCClass.c
@@ -76,10 +76,6 @@ struct CFCClass {
 char *include_h;
 };
 
-// Link up parents and kids.
-static void
-S_establish_ancestry(CFCClass *self);
-
 // Pass down member vars to from parent to children.
 static void
 S_bequeath_member_vars(CFCClass *self);
@@ -365,16 +361,12 @@ CFCClass_add_child(CFCClass *self, CFCClass *child) {
 = (CFCClass*)CFCBase_incref((CFCBase*)child);
 self->children[self->num_kids] = NULL;
 
+// Set parent of child.
+CFCWeakPtr_set(>parent, (CFCBase*)self);
+
 // Add parcel dependency.
 CFCParcel *parcel   = CFCClass_get_parcel(self);
 CFCParcel *child_parcel = CFCClass_get_parcel(child);
-if (!CFCParcel_has_prereq(child_parcel, parcel)) {
-CFCUtil_die("Class '%s' inherits from '%s', but parcel '%s' is not a"
-" prerequisite of '%s'",
-child->name, self->name,
-CFCParcel_get_name(parcel),
-CFCParcel_get_name(child_parcel));
-}
 CFCParcel_add_inherited_parcel(child_parcel, parcel);
 }
 
@@ -569,18 +561,6 @@ S_bequeath_methods(CFCClass *self) {
 }
 }
 
-// Let the children know who their parent class is.
-static void
-S_establish_ancestry(CFCClass *self) {
-for (size_t i = 0; i < self->num_kids; i++) {
-CFCClass *child = self->children[i];
-// This is a circular reference and thus a memory leak, but we don't
-// care, because we have to have everything in memory at once anyway.
-CFCClass_set_parent(child, self);
-S_establish_ancestry(child);
-}
-}
-
 static CFCBase**
 S_copy_cfcbase_array(CFCBase **array, size_t num_elems) {
 CFCBase **copy = (CFCBase**)MALLOCATE((num_elems + 1) * sizeof(CFCBase*));
@@ -596,7 +576,6 @@ CFCClass_grow_tree(CFCClass *self) {
 if (self->tree_grown) {
 CFCUtil_die("Can't call grow_tree more than once");
 }
-S_establish_ancestry(self);
 
 // Copy fresh variabless for root class.
 self->member_vars
@@ -713,11 +692,6 @@ CFCClass_get_nickname(CFCClass *self) {
 return 

[11/20] lucy-clownfish git commit: Store class array in parcel

2017-03-18 Thread nwellnhof
Store class array in parcel

Store an array of all classes that belong to a parcel in CFCParcel.


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

Branch: refs/heads/master
Commit: 22e055c360f32e93103b04814de7c89c8d4c3211
Parents: bfd19d2
Author: Nick Wellnhofer 
Authored: Sun Feb 26 21:32:58 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:03 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC.xs |  8 +++---
 compiler/perl/t/401-class.t|  3 ++
 compiler/perl/t/403-parcel.t   | 17 +--
 compiler/perl/t/600-parser.t   |  2 +-
 compiler/src/CFCClass.c| 21 ++
 compiler/src/CFCParcel.c   | 50 +++--
 compiler/src/CFCParcel.h   |  3 +-
 compiler/src/CFCTestParcel.c   | 18 ++--
 compiler/src/CFCTestParser.c   |  4 +--
 9 files changed, 79 insertions(+), 47 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/22e055c3/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index c5ee7dd..588e585 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -1157,11 +1157,11 @@ CODE:
 OUTPUT: RETVAL
 
 void
-add_struct_sym(self, struct_sym)
-CFCParcel  *self;
-const char *struct_sym;
+add_class(self, klass)
+CFCParcel *self;
+CFCClass  *klass;
 PPCODE:
-CFCParcel_add_struct_sym(self, struct_sym);
+CFCParcel_add_class(self, klass);
 
 SV*
 lookup_struct_sym(self, struct_sym)

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/22e055c3/compiler/perl/t/401-class.t
--
diff --git a/compiler/perl/t/401-class.t b/compiler/perl/t/401-class.t
index 0649b16..b7e4af8 100644
--- a/compiler/perl/t/401-class.t
+++ b/compiler/perl/t/401-class.t
@@ -246,6 +246,7 @@ $class = $parser->parse($class_content);
 ok( $class->final, "final class_declaration" );
 
 Clownfish::CFC::Model::Class->_clear_registry();
+Clownfish::CFC::Model::Parcel->reap_singletons();
 
 {
 eval {
@@ -256,6 +257,7 @@ Clownfish::CFC::Model::Class->_clear_registry();
 like( $@, qr/inert class/i, "inert class can't inherit" );
 
 Clownfish::CFC::Model::Class->_clear_registry();
+Clownfish::CFC::Model::Parcel->reap_singletons();
 }
 
 {
@@ -267,5 +269,6 @@ Clownfish::CFC::Model::Class->_clear_registry();
 like( $@, qr/inert class/i, "can't inherit from inert class" );
 
 Clownfish::CFC::Model::Class->_clear_registry();
+Clownfish::CFC::Model::Parcel->reap_singletons();
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/22e055c3/compiler/perl/t/403-parcel.t
--
diff --git a/compiler/perl/t/403-parcel.t b/compiler/perl/t/403-parcel.t
index c298e55..efd86e6 100644
--- a/compiler/perl/t/403-parcel.t
+++ b/compiler/perl/t/403-parcel.t
@@ -192,9 +192,20 @@ Clownfish::CFC::Model::Parcel->reap_singletons();
 ok( $crust->has_prereq($crust), 'has_prereq self' );
 ok( !$crust->has_prereq($foo), 'has_prereq false' );
 
-$cfish->add_struct_sym('Swim');
-$crust->add_struct_sym('Pinch');
-$foo->add_struct_sym('Bar');
+Clownfish::CFC::Model::Class->create(
+parcel => $cfish,
+file_spec  => $cfish_file_spec,
+class_name => 'Clownfish::Swim',
+);
+Clownfish::CFC::Model::Class->create(
+parcel => $crust,
+class_name => 'Crustacean::Pinch',
+);
+Clownfish::CFC::Model::Class->create(
+parcel => $foo,
+file_spec  => $foo_file_spec,
+class_name => 'Foo::Bar',
+);
 my $found;
 $found = $crust->lookup_struct_sym('Swim');
 is( $found->get_name, 'Clownfish', 'lookup_struct_sym prereq' );

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/22e055c3/compiler/perl/t/600-parser.t
--
diff --git a/compiler/perl/t/600-parser.t b/compiler/perl/t/600-parser.t
index 19508f9..9530dfd 100644
--- a/compiler/perl/t/600-parser.t
+++ b/compiler/perl/t/600-parser.t
@@ -143,7 +143,7 @@ SKIP: {
 }
 
 is( $parser->parse("class $_ { }")->get_name, $_, "class_name: $_" )
-for (qw( Foo Foo::FooJr Foo::FooJr::FooIII Foo::FooJr::FooIII::Foo4th ));
+for (qw( Moo Moo::MooJr Moo::MooJr::MooIII Moo::MooJr::MooIII::Moo4th ));
 
 SKIP: {
 skip( "Can't recover from bad class name 

[08/20] lucy-clownfish git commit: Remove CFCHierarchy_ordered_classes

2017-03-18 Thread nwellnhof
Remove CFCHierarchy_ordered_classes


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

Branch: refs/heads/master
Commit: 8971263683dfdf730873ebec50235db5bb895995
Parents: e82ee76
Author: Nick Wellnhofer 
Authored: Mon Feb 27 01:23:14 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:03 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC.xs | 14 --
 compiler/perl/t/401-class.t|  5 +
 compiler/src/CFCClass.c| 29 -
 compiler/src/CFCClass.h|  6 --
 compiler/src/CFCHierarchy.c| 23 ---
 compiler/src/CFCHierarchy.h|  6 --
 compiler/src/CFCTestClass.c| 11 +--
 7 files changed, 2 insertions(+), 92 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/89712636/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index d174ecd..1153bfd 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -297,7 +297,6 @@ ALIAS:
 methods   = 36
 member_vars   = 38
 inert_vars= 40
-tree_to_ladder= 42
 fresh_methods = 44
 fresh_member_vars = 46
 privacy_symbol= 48
@@ -398,12 +397,6 @@ PPCODE:
 case 40:
 retval = 
S_array_of_cfcbase_to_av((CFCBase**)CFCClass_inert_vars(self));
 break;
-case 42: {
-CFCClass **ladder = CFCClass_tree_to_ladder(self);
-retval = S_array_of_cfcbase_to_av((CFCBase**)ladder);
-FREEMEM(ladder);
-break;
-}
 case 44: {
 CFCMethod **fresh = CFCClass_fresh_methods(self);
 retval = S_array_of_cfcbase_to_av((CFCBase**)fresh);
@@ -792,7 +785,6 @@ ALIAS:
 get_include_dest  = 4
 get_source_dest   = 6
 files = 8
-ordered_classes   = 10
 get_source_dirs   = 12
 get_include_dirs  = 14
 PPCODE:
@@ -817,12 +809,6 @@ PPCODE:
 retval = S_array_of_cfcbase_to_av(
 (CFCBase**)CFCHierarchy_files(self));
 break;
-case 10: {
-CFCClass **ladder = CFCHierarchy_ordered_classes(self);
-retval = S_array_of_cfcbase_to_av((CFCBase**)ladder);
-FREEMEM(ladder);
-}
-break;
 case 12: {
 const char **source_dirs = CFCHierarchy_get_source_dirs(self);
 retval = S_string_array_to_av(source_dirs);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/89712636/compiler/perl/t/401-class.t
--
diff --git a/compiler/perl/t/401-class.t b/compiler/perl/t/401-class.t
index b7e4af8..c51cd33 100644
--- a/compiler/perl/t/401-class.t
+++ b/compiler/perl/t/401-class.t
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 54;
+use Test::More tests => 53;
 use Clownfish::CFC::Model::Class;
 use Clownfish::CFC::Parser;
 
@@ -150,9 +150,6 @@ is_deeply( $foo_jr->fresh_member_vars, [], 
"fresh_member_vars" );
 is_deeply( $foo_jr->inert_vars,[], "don't inherit inert vars" );
 is_deeply( $final_foo->fresh_methods,  [], "fresh_methods" );
 
-is_deeply( $foo->tree_to_ladder, [ $foo, $foo_jr, $final_foo ],
-'tree_to_ladder' );
-
 ok( $parser->parse("$_ class Iam$_ { }")->$_, "class_modifier: $_" )
 for (qw( final inert ));
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/89712636/compiler/src/CFCClass.c
--
diff --git a/compiler/src/CFCClass.c b/compiler/src/CFCClass.c
index 685582e..cdfe096 100644
--- a/compiler/src/CFCClass.c
+++ b/compiler/src/CFCClass.c
@@ -655,15 +655,6 @@ S_establish_ancestry(CFCClass *self) {
 }
 }
 
-static size_t
-S_family_tree_size(CFCClass *self) {
-size_t count = 1; // self
-for (size_t i = 0; i < self->num_kids; i++) {
-count += S_family_tree_size(self->children[i]);
-}
-return count;
-}
-
 static CFCBase**
 S_copy_cfcbase_array(CFCBase **array, size_t num_elems) {
 CFCBase **copy = (CFCBase**)MALLOCATE((num_elems + 1) * sizeof(CFCBase*));
@@ -700,26 +691,6 @@ CFCClass_grow_tree(CFCClass *self) {
 self->tree_grown = 1;
 }
 
-// Return value is valid only so long as object persists (elements are not
-// refcounted).
-CFCClass**

[05/20] lucy-clownfish git commit: Add CFCParcel_class functions

2017-03-18 Thread nwellnhof
Add CFCParcel_class functions

Search classes in a parcel by name or struct symbol.

In most cases, it's important to only search classes in a parcel or
its direct prerequisites. Otherwise, classes from random other parcels
could be picked up.


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

Branch: refs/heads/master
Commit: c502223ab7e3c70529352afb42973c9d77e88805
Parents: 8971263
Author: Nick Wellnhofer 
Authored: Mon Feb 27 18:53:58 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:03 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC.xs | 25 --
 compiler/perl/t/401-class.t|  6 +--
 compiler/perl/t/403-parcel.t   | 14 +++---
 compiler/src/CFCGoClass.c  |  6 +--
 compiler/src/CFCParcel.c   | 88 ++---
 compiler/src/CFCParcel.h   | 25 +++---
 compiler/src/CFCPerlClass.c| 33 +++--
 compiler/src/CFCTestClass.c|  4 +-
 compiler/src/CFCTestParcel.c   | 14 +++---
 compiler/src/CFCType.c | 12 ++---
 10 files changed, 156 insertions(+), 71 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c502223a/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index 1153bfd..8abe174 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -1150,12 +1150,27 @@ PPCODE:
 CFCParcel_add_class(self, klass);
 
 SV*
-lookup_struct_sym(self, struct_sym)
-CFCParcel  *self;
-const char *struct_sym;
+_fetch_class(self, string)
+CFCParcel *self;
+const char *string;
+ALIAS:
+class  = 1
+class_by_short_sym = 2
+class_by_full_sym  = 3
 CODE:
-CFCParcel *parcel = CFCParcel_lookup_struct_sym(self, struct_sym);
-RETVAL = S_cfcbase_to_perlref(parcel);
+CFCClass *klass = NULL;
+switch (ix) {
+case 1:
+klass = CFCParcel_class(self, string);
+break;
+case 2:
+klass = CFCParcel_class_by_short_sym(self, string);
+break;
+case 3:
+klass = CFCParcel_class_by_full_sym(self, string);
+break;
+}
+RETVAL = S_cfcbase_to_perlref(klass);
 OUTPUT: RETVAL
 
 void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c502223a/compiler/perl/t/401-class.t
--
diff --git a/compiler/perl/t/401-class.t b/compiler/perl/t/401-class.t
index c51cd33..cafb70c 100644
--- a/compiler/perl/t/401-class.t
+++ b/compiler/perl/t/401-class.t
@@ -21,7 +21,7 @@ use Clownfish::CFC::Model::Class;
 use Clownfish::CFC::Parser;
 
 my $parser = Clownfish::CFC::Parser->new;
-$parser->parse('parcel Neato;');
+my $neato = $parser->parse('parcel Neato;');
 
 my $thing = Clownfish::CFC::Model::Variable->new(
 type => $parser->parse('Thing*'),
@@ -45,8 +45,8 @@ my $foo = 
Clownfish::CFC::Model::Class->create(%foo_create_args);
 $foo->add_function($tread_water);
 $foo->add_member_var($thing);
 $foo->add_inert_var($widget);
-my $should_be_foo = Clownfish::CFC::Model::Class->fetch_singleton('Foo');
-is( $$foo, $$should_be_foo, "fetch_singleton" );
+my $should_be_foo = $neato->class('Foo');
+is( $$foo, $$should_be_foo, "Fetch class from parcel" );
 
 eval { Clownfish::CFC::Model::Class->create(%foo_create_args) };
 like( $@, qr/two classes with name/i,

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c502223a/compiler/perl/t/403-parcel.t
--
diff --git a/compiler/perl/t/403-parcel.t b/compiler/perl/t/403-parcel.t
index efd86e6..47023de 100644
--- a/compiler/perl/t/403-parcel.t
+++ b/compiler/perl/t/403-parcel.t
@@ -206,13 +206,13 @@ Clownfish::CFC::Model::Parcel->reap_singletons();
 file_spec  => $foo_file_spec,
 class_name => 'Foo::Bar',
 );
-my $found;
-$found = $crust->lookup_struct_sym('Swim');
-is( $found->get_name, 'Clownfish', 'lookup_struct_sym prereq' );
-$found = $crust->lookup_struct_sym('Pinch');
-is( $found->get_name, 'Crustacean', 'lookup_struct_sym self' );
-$found = $crust->lookup_struct_sym('Bar');
-ok( !$found, 'lookup_struct_sym other' );
+my $class;
+$class = $crust->class_by_short_sym('Swim');
+is( $class->get_name, 'Clownfish::Swim', 'class_by_short_sym prereq' );
+$class = $crust->class_by_short_sym('Pinch');
+is( $class->get_name, 

[17/20] lucy-clownfish git commit: Stop tracking parcels that are inherited from

2017-03-18 Thread nwellnhof
Stop tracking parcels that are inherited from

This code was unused. The original idea was to allow circular
dependencies between parcels as long as they don't inherit classes
from each other. This is an unimportant feature that had to be solved
differently, now that we specify prereqs in .cfp files.


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

Branch: refs/heads/master
Commit: 859f5b88cde34e65e563d8a5d7b48a5586230eaa
Parents: a3231bc
Author: Nick Wellnhofer 
Authored: Tue Feb 28 14:49:02 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:05 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC.xs | 14 
 compiler/perl/t/403-parcel.t   |  6 +
 compiler/src/CFCClass.c|  5 -
 compiler/src/CFCParcel.c   | 39 -
 compiler/src/CFCParcel.h   | 12 --
 compiler/src/CFCTestParcel.c   | 12 +-
 6 files changed, 2 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/859f5b88/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index b0205d9..d46a1a0 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -1097,13 +1097,6 @@ CODE:
 RETVAL = S_array_of_cfcbase_to_av((CFCBase**)all_parcels);
 OUTPUT: RETVAL
 
-void
-add_inherited_parcel(self, inherited)
-CFCParcel *self;
-CFCParcel *inherited;
-PPCODE:
-CFCParcel_add_inherited_parcel(self, inherited);
-
 int
 has_prereq(self, parcel)
 CFCParcel *self;
@@ -1162,7 +1155,6 @@ ALIAS:
 get_prereqs   = 14
 included  = 16
 prereq_parcels= 20
-inherited_parcels = 22
 get_xs_module = 24
 get_classes   = 26
 PPCODE:
@@ -1212,12 +1204,6 @@ PPCODE:
 FREEMEM(parcels);
 }
 break;
-case 22: {
-CFCParcel **parcels = CFCParcel_inherited_parcels(self);
-retval = S_array_of_cfcbase_to_av((CFCBase**)parcels);
-FREEMEM(parcels);
-}
-break;
 case 24: {
 const char *xs_module = CFCParcel_get_host_module_name(self);
 retval = newSVpvn(xs_module, strlen(xs_module));

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/859f5b88/compiler/perl/t/403-parcel.t
--
diff --git a/compiler/perl/t/403-parcel.t b/compiler/perl/t/403-parcel.t
index 47023de..9892e4b 100644
--- a/compiler/perl/t/403-parcel.t
+++ b/compiler/perl/t/403-parcel.t
@@ -18,7 +18,7 @@ use warnings;
 use lib 'buildlib';
 
 use Clownfish::CFC::Test::TestUtils qw( test_files_dir );
-use Test::More tests => 32;
+use Test::More tests => 31;
 use File::Spec::Functions qw( catdir );
 
 BEGIN { use_ok('Clownfish::CFC::Model::Prereq') }
@@ -71,10 +71,6 @@ my $parcels = Clownfish::CFC::Model::Parcel->all_parcels;
 my @names = sort(map { $_->get_name } @$parcels);
 is_deeply( \@names, [ "Foo", "IncludedFoo" ], "all_parcels" );
 
-$foo->add_inherited_parcel($included_foo);
-my @inh_names = sort(map { $_->get_name } @{ $foo->inherited_parcels });
-is_deeply( \@inh_names, [ "IncludedFoo" ], "inherited_parcels" );
-
 my $json = qq|
 {
 "name": "Crustacean",

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/859f5b88/compiler/src/CFCClass.c
--
diff --git a/compiler/src/CFCClass.c b/compiler/src/CFCClass.c
index 0a16a6b..ff4b05c 100644
--- a/compiler/src/CFCClass.c
+++ b/compiler/src/CFCClass.c
@@ -363,11 +363,6 @@ CFCClass_add_child(CFCClass *self, CFCClass *child) {
 
 // Set parent of child.
 CFCWeakPtr_set(>parent, (CFCBase*)self);
-
-// Add parcel dependency.
-CFCParcel *parcel   = CFCClass_get_parcel(self);
-CFCParcel *child_parcel = CFCClass_get_parcel(child);
-CFCParcel_add_inherited_parcel(child_parcel, parcel);
 }
 
 void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/859f5b88/compiler/src/CFCParcel.c
--
diff --git a/compiler/src/CFCParcel.c b/compiler/src/CFCParcel.c
index 07c5ce6..0a24478 100644
--- a/compiler/src/CFCParcel.c
+++ b/compiler/src/CFCParcel.c
@@ -44,8 +44,6 @@ struct CFCParcel {
 char *PREFIX;
 char *privacy_sym;
 int is_installed;
-char **inherited_parcels;
-

[02/20] lucy-clownfish git commit: Add CFCClass_in_parcel and CFCClass_in_same_parcel

2017-03-18 Thread nwellnhof
Add CFCClass_in_parcel and CFCClass_in_same_parcel

Simple but useful helper functions.


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

Branch: refs/heads/master
Commit: bfd19d209bb8d7088aa42c7cd26b539c283a1005
Parents: 7ce20fd
Author: Nick Wellnhofer 
Authored: Tue Feb 28 16:25:15 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:02 2017 +0100

--
 compiler/src/CFCClass.c | 10 ++
 compiler/src/CFCClass.h |  6 ++
 2 files changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/bfd19d20/compiler/src/CFCClass.c
--
diff --git a/compiler/src/CFCClass.c b/compiler/src/CFCClass.c
index 360630a..e7a1aa1 100644
--- a/compiler/src/CFCClass.c
+++ b/compiler/src/CFCClass.c
@@ -885,6 +885,16 @@ CFCClass_needs_documentation(CFCClass *self) {
&& CFCParcel_is_installed(self->parcel);
 }
 
+int
+CFCClass_in_parcel(CFCClass *self, struct CFCParcel *parcel) {
+return CFCClass_get_parcel(self) == parcel;
+}
+
+int
+CFCClass_in_same_parcel(CFCClass *self, CFCClass *other) {
+return CFCClass_get_parcel(self) == CFCClass_get_parcel(other);
+}
+
 const char*
 CFCClass_get_struct_sym(CFCClass *self) {
 return self->struct_sym;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/bfd19d20/compiler/src/CFCClass.h
--
diff --git a/compiler/src/CFCClass.h b/compiler/src/CFCClass.h
index bf86f61..223306d 100644
--- a/compiler/src/CFCClass.h
+++ b/compiler/src/CFCClass.h
@@ -258,6 +258,12 @@ CFCClass_abstract(CFCClass *self);
 int
 CFCClass_needs_documentation(CFCClass *self);
 
+int
+CFCClass_in_parcel(CFCClass *self, struct CFCParcel *parcel);
+
+int
+CFCClass_in_same_parcel(CFCClass *self, CFCClass *other);
+
 const char*
 CFCClass_get_struct_sym(CFCClass *self);
 



[13/20] lucy-clownfish git commit: Rework URI resolution

2017-03-18 Thread nwellnhof
Rework URI resolution

Add CFCMethod_get_docucomment to get inherited CFCDocuComment.

Use correct base class when resolving URIs. Only search parcel and
prereqs for full struct symbols. Also search prereqs for short struct
symbols. Search all source parcels and their prereqs for standalone .md
documents.

Minor cleanups.


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

Branch: refs/heads/master
Commit: 81cdda1a5257b27c9f652f54a2e989f18394b150
Parents: a0e051a
Author: Nick Wellnhofer 
Authored: Mon Feb 27 23:46:41 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:04 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC.xs |   9 +-
 compiler/src/CFCCHtml.c| 218 
 compiler/src/CFCCMan.c |  52 
 compiler/src/CFCCallable.c |   5 -
 compiler/src/CFCCallable.h |   3 -
 compiler/src/CFCMethod.c   |  23 
 compiler/src/CFCMethod.h   |   7 +
 compiler/src/CFCParcel.c   |   5 +
 compiler/src/CFCParcel.h   |   3 +
 compiler/src/CFCPerlPod.c  |  75 ++-
 compiler/src/CFCPerlPod.h  |   8 +-
 compiler/src/CFCTestDocuComment.c  | 103 ++-
 compiler/src/CFCUri.c  |  95 +++---
 13 files changed, 394 insertions(+), 212 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/81cdda1a/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index b6b7939..775d46c 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -2423,17 +2423,18 @@ CODE:
 OUTPUT: RETVAL
 
 SV*
-_gen_subroutine_pod(func, alias, klass, code_sample, class_name, 
is_constructor)
+_gen_subroutine_pod(func, alias, klass, code_sample, class_name, 
is_constructor, docucomment, base_class)
 CFCCallable *func;
 const char *alias;
 CFCClass *klass;
 const char *code_sample;
-const char *class_name;
 int is_constructor;
+CFCDocuComment *docucomment;
+CFCClass *base_class;
 CODE:
 char *value = CFCPerlPod_gen_subroutine_pod(func, alias, klass,
-code_sample, class_name,
-is_constructor);
+code_sample, is_constructor,
+docucomment, base_class);
 RETVAL = S_sv_eat_c_string(value);
 OUTPUT: RETVAL
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/81cdda1a/compiler/src/CFCCHtml.c
--
diff --git a/compiler/src/CFCCHtml.c b/compiler/src/CFCCHtml.c
index 6383ada..6c39946 100644
--- a/compiler/src/CFCCHtml.c
+++ b/compiler/src/CFCCHtml.c
@@ -129,32 +129,31 @@ static int
 S_compare_doc_path(const void *va, const void *vb);
 
 static char*
-S_html_create_name(CFCClass *klass);
+S_html_create_name(CFCClass *klass, int dir_level);
 
 static char*
-S_html_create_synopsis(CFCClass *klass);
+S_html_create_description(CFCClass *klass, int dir_level);
 
 static char*
-S_html_create_description(CFCClass *klass);
+S_html_create_functions(CFCClass *klass, int dir_level);
 
 static char*
-S_html_create_functions(CFCClass *klass);
+S_html_create_methods(CFCClass *klass, int dir_level);
 
 static char*
-S_html_create_methods(CFCClass *klass);
+S_html_create_fresh_methods(CFCClass *klass, CFCClass *ancestor,
+int dir_level);
 
 static char*
-S_html_create_fresh_methods(CFCClass *klass, CFCClass *ancestor);
+S_html_create_func(CFCClass *klass, CFCCallable *func, const char *short_sym,
+   CFCDocuComment *docucomment, CFCClass *base_class,
+   int dir_level);
 
 static char*
-S_html_create_func(CFCClass *klass, CFCClass *doc_class, CFCCallable *func,
-   const char *prefix, const char *short_sym);
+S_html_create_param_list(CFCClass *klass, CFCCallable *func, int dir_level);
 
 static char*
-S_html_create_param_list(CFCClass *klass, CFCCallable *func);
-
-static char*
-S_html_create_inheritance(CFCClass *klass);
+S_html_create_inheritance(CFCClass *klass, int dir_level);
 
 static char*
 S_md_to_html(const char *md, CFCClass *klass, int dir_level);
@@ -169,19 +168,20 @@ static void
 S_transform_link(cmark_node *link, CFCClass *klass, int dir_level);
 
 static char*
-S_type_to_html(CFCType *type, const char *sep, CFCClass 

[01/20] lucy-clownfish git commit: Implement CFCWeakPtr

2017-03-18 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master ab9d38830 -> d601b8b8b


Implement CFCWeakPtr

We mostly avoided circular references in CFC so far, although it's
often useful to have pointers to a parent or ancestor in the tree
structures CFC operates on. Weak pointers allow to break circular
references when destroying objects.

Even after the upcoming changes, CFC won't reference objects through
weak pointers after the strong refcount dropped to zero. So we could
just use normal pointers and simply don't incref/decref them. The
WeakPtr mechanism serves mainly as annotation and safety net, making
sure that weak pointers are used as intended.


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

Branch: refs/heads/master
Commit: a86fab47c43ca08883e55e55ff9d10bfc5a5017f
Parents: 0e8aa92
Author: Nick Wellnhofer 
Authored: Mon Feb 27 13:01:16 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:06:38 2017 +0100

--
 compiler/src/CFCBase.c | 61 ++---
 compiler/src/CFCBase.h | 17 +
 2 files changed, 74 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a86fab47/compiler/src/CFCBase.c
--
diff --git a/compiler/src/CFCBase.c b/compiler/src/CFCBase.c
index bce7e70..f2a8858 100644
--- a/compiler/src/CFCBase.c
+++ b/compiler/src/CFCBase.c
@@ -22,13 +22,20 @@ CFCBase*
 CFCBase_allocate(const CFCMeta *meta) {
 CFCBase *self = (CFCBase*)CALLOCATE(meta->obj_alloc_size, 1);
 self->refcount = 1;
+self->weak_refcount = 0;
 self->meta = meta;
 return self;
 }
 
 void
 CFCBase_destroy(CFCBase *self) {
-FREEMEM(self);
+if (self->weak_refcount == 0) {
+FREEMEM(self);
+}
+else {
+// Let WeakPtr free the memory.
+self->refcount = 0;
+}
 }
 
 CFCBase*
@@ -42,11 +49,15 @@ CFCBase_incref(CFCBase *self) {
 unsigned
 CFCBase_decref(CFCBase *self) {
 if (!self) { return 0; }
-unsigned modified_refcount = --self->refcount;
-if (modified_refcount == 0) {
+if (self->refcount > 1) {
+return --self->refcount;
+}
+else {
+// Don't decrease refcount to 0 before calling `destroy`. This could
+// make WeakPtrs free the object.
 self->meta->destroy(self);
+return 0;
 }
-return modified_refcount;
 }
 
 unsigned
@@ -59,4 +70,46 @@ CFCBase_get_cfc_class(CFCBase *self) {
 return self->meta->cfc_class;
 }
 
+CFCWeakPtr
+CFCWeakPtr_new(CFCBase *base) {
+CFCWeakPtr self = { base };
+if (base) { base->weak_refcount += 1; }
+return self;
+}
+
+CFCBase*
+CFCWeakPtr_deref(CFCWeakPtr self) {
+if (self.ptr_ != NULL && self.ptr_->refcount == 0) {
+// CFC doesn't access WeakPtrs after the strong refcount went to
+// zero, so throw an exception.
+CFCUtil_die("Invalid WeakPtr deref");
+}
+return self.ptr_;
+}
+
+void
+CFCWeakPtr_set(CFCWeakPtr *self, CFCBase *base) {
+CFCBase *old_base = self->ptr_;
+if (old_base == base) { return; }
+if (old_base != NULL) {
+old_base->weak_refcount -= 1;
+if (old_base->refcount == 0 && old_base->weak_refcount == 0) {
+FREEMEM(old_base);
+}
+}
+self->ptr_ = base;
+if (base) { base->weak_refcount += 1; }
+}
+
+void
+CFCWeakPtr_destroy(CFCWeakPtr *self) {
+CFCBase *base = self->ptr_;
+if (base == NULL) { return; }
+base->weak_refcount -= 1;
+if (base->refcount == 0 && base->weak_refcount == 0) {
+FREEMEM(base);
+}
+self->ptr_ = NULL;
+}
+
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a86fab47/compiler/src/CFCBase.h
--
diff --git a/compiler/src/CFCBase.h b/compiler/src/CFCBase.h
index 09ee662..43ea774 100644
--- a/compiler/src/CFCBase.h
+++ b/compiler/src/CFCBase.h
@@ -28,12 +28,14 @@ extern "C" {
 
 typedef struct CFCBase CFCBase;
 typedef struct CFCMeta CFCMeta;
+typedef struct CFCWeakPtr CFCWeakPtr;
 typedef void (*CFCBase_destroy_t)(CFCBase *self);
 
 #ifdef CFC_NEED_BASE_STRUCT_DEF
 struct CFCBase {
 const CFCMeta *meta;
 unsigned refcount;
+unsigned weak_refcount;
 };
 #endif
 struct CFCMeta {
@@ -41,6 +43,9 @@ struct CFCMeta {
 size_t obj_alloc_size;
 CFCBase_destroy_t destroy;
 };
+struct CFCWeakPtr {
+CFCBase *ptr_;
+};
 
 /** Allocate a new CFC object.
  *
@@ -81,6 +86,18 @@ CFCBase_get_refcount(CFCBase *self);
 const char*
 

[16/20] lucy-clownfish git commit: Switch some code over to CFCClass_in_parcel

2017-03-18 Thread nwellnhof
Switch some code over to CFCClass_in_parcel


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

Branch: refs/heads/master
Commit: bea2a98f994e2a2f5d7cfe1dee1f957d3bb8042e
Parents: 821bf0d
Author: Nick Wellnhofer 
Authored: Tue Feb 28 16:42:08 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:05 2017 +0100

--
 compiler/src/CFCBindSpecs.c | 4 ++--
 compiler/src/CFCClass.c | 7 +++
 compiler/src/CFCGo.c| 2 +-
 compiler/src/CFCGoClass.c   | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/bea2a98f/compiler/src/CFCBindSpecs.c
--
diff --git a/compiler/src/CFCBindSpecs.c b/compiler/src/CFCBindSpecs.c
index ee10a50..b8c609a 100644
--- a/compiler/src/CFCBindSpecs.c
+++ b/compiler/src/CFCBindSpecs.c
@@ -160,7 +160,7 @@ CFCBindSpecs_add_class(CFCBindSpecs *self, CFCClass *klass) 
{
 parent_ptr = CFCUtil_strdup("NULL");
 }
 else {
-if (CFCClass_get_parcel(klass) == CFCClass_get_parcel(parent)) {
+if (CFCClass_in_same_parcel(klass, parent)) {
 parent_ptr
 = CFCUtil_sprintf("&%s", CFCClass_full_class_var(parent));
 }
@@ -379,7 +379,7 @@ S_parent_offset(CFCBindSpecs *self, CFCMethod *method, 
CFCClass *klass,
 char *parent_offset = NULL;
 char *parent_offset_sym = CFCMethod_full_offset_sym(method, parent);
 
-if (CFCClass_get_parcel(parent) == CFCClass_get_parcel(klass)) {
+if (CFCClass_in_same_parcel(klass, parent)) {
 parent_offset = CFCUtil_sprintf("&%s", parent_offset_sym);
 }
 else {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/bea2a98f/compiler/src/CFCClass.c
--
diff --git a/compiler/src/CFCClass.c b/compiler/src/CFCClass.c
index ff4b05c..5308d9d 100644
--- a/compiler/src/CFCClass.c
+++ b/compiler/src/CFCClass.c
@@ -239,7 +239,7 @@ CFCClass_do_create(CFCClass *self, struct CFCParcel *parcel,
 
 // Cache several derived symbols.
 
-const char *prefix = CFCClass_get_prefix(self);
+const char *prefix = CFCParcel_get_prefix(parcel);
 self->struct_sym= CFCUtil_strdup(struct_sym);
 self->full_struct_sym   = CFCUtil_sprintf("%s%s", prefix, struct_sym);
 self->ivars_struct  = CFCUtil_sprintf("%sIVARS", struct_sym);
@@ -251,7 +251,7 @@ CFCClass_do_create(CFCClass *self, struct CFCParcel *parcel,
 self->full_ivars_offset = CFCUtil_sprintf("%s_OFFSET",
   self->full_ivars_func);
 
-const char *PREFIX = CFCClass_get_PREFIX(self);
+const char *PREFIX = CFCParcel_get_PREFIX(parcel);
 size_t struct_sym_len = strlen(struct_sym);
 char *short_class_var = (char*)MALLOCATE(struct_sym_len + 1);
 size_t i;
@@ -663,11 +663,10 @@ CFCClass_num_member_vars(CFCClass *self) {
 // outside this package.
 size_t
 CFCClass_num_non_package_ivars(CFCClass *self) {
-CFCParcel *parcel   = CFCClass_get_parcel(self);
 CFCClass  *ancestor = CFCClass_get_parent(self);
 size_t num_non_package_members = 0;
 
-while (ancestor && CFCClass_get_parcel(ancestor) == parcel) {
+while (ancestor && CFCClass_in_same_parcel(ancestor, self)) {
 ancestor = CFCClass_get_parent(ancestor);
 }
 if (ancestor) {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/bea2a98f/compiler/src/CFCGo.c
--
diff --git a/compiler/src/CFCGo.c b/compiler/src/CFCGo.c
index 9502384..4a359cc 100644
--- a/compiler/src/CFCGo.c
+++ b/compiler/src/CFCGo.c
@@ -238,7 +238,7 @@ S_gen_autogen_go(CFCGo *self, CFCParcel *parcel) {
 CFCGoClass *class_binding = registry[i];
 CFCClass *client = CFCGoClass_get_client(class_binding);
 
-if (CFCClass_get_parcel(client) != parcel) {
+if (!CFCClass_in_parcel(client, parcel)) {
 continue;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/bea2a98f/compiler/src/CFCGoClass.c
--
diff --git a/compiler/src/CFCGoClass.c b/compiler/src/CFCGoClass.c
index 78b9e72..f62adea 100644
--- a/compiler/src/CFCGoClass.c
+++ b/compiler/src/CFCGoClass.c
@@ -281,7 +281,7 @@ CFCGoClass_gen_ctors(CFCGoClass *self) {
) {
 return CFCUtil_strdup("");
 }
-CFCParcel*parcel = CFCClass_get_parcel(self->client);
+CFCParcel*parcel = 

[14/20] lucy-clownfish git commit: Remove global class registry

2017-03-18 Thread nwellnhof
Remove global class registry

Replaced by the class array in CFCParcel.


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

Branch: refs/heads/master
Commit: 682278c45ec3f72ace0412317c5e68b16032ec0a
Parents: 81cdda1
Author: Nick Wellnhofer 
Authored: Tue Feb 28 00:45:46 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:04 2017 +0100

--
 compiler/c/cfc.c   |  1 -
 compiler/perl/lib/Clownfish/CFC.pm |  1 -
 compiler/perl/lib/Clownfish/CFC.xs | 16 ---
 compiler/perl/t/401-class.t|  3 --
 compiler/perl/t/404-file.t |  2 -
 compiler/perl/t/600-parser.t   |  1 -
 compiler/src/CFCClass.c| 74 -
 compiler/src/CFCClass.h| 20 -
 compiler/src/CFCHierarchy.c| 18 
 compiler/src/CFCParcel.c   | 26 
 compiler/src/CFCTestClass.c|  1 -
 compiler/src/CFCTestFile.c |  2 -
 compiler/src/CFCTestHierarchy.c|  6 ---
 compiler/src/CFCTestMethod.c   |  4 --
 compiler/src/CFCTestParamList.c|  1 -
 compiler/src/CFCTestParcel.c   |  1 -
 compiler/src/CFCTestParser.c   |  2 -
 compiler/src/CFCTestType.c |  2 -
 compiler/src/CFCTestVariable.c |  1 -
 19 files changed, 36 insertions(+), 146 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/682278c4/compiler/c/cfc.c
--
diff --git a/compiler/c/cfc.c b/compiler/c/cfc.c
index 21bd989..2d92659 100644
--- a/compiler/c/cfc.c
+++ b/compiler/c/cfc.c
@@ -263,7 +263,6 @@ main(int argc, char **argv) {
 FREEMEM(header);
 FREEMEM(footer);
 
-CFCClass_clear_registry();
 CFCDocument_clear_registry();
 CFCParcel_reap_singletons();
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/682278c4/compiler/perl/lib/Clownfish/CFC.pm
--
diff --git a/compiler/perl/lib/Clownfish/CFC.pm 
b/compiler/perl/lib/Clownfish/CFC.pm
index cd6dae0..3a11a78 100644
--- a/compiler/perl/lib/Clownfish/CFC.pm
+++ b/compiler/perl/lib/Clownfish/CFC.pm
@@ -22,7 +22,6 @@ $VERSION = eval $VERSION;
 our $MAJOR_VERSION = 0.006000;
 
 END {
-Clownfish::CFC::Model::Class->_clear_registry();
 Clownfish::CFC::Model::Parcel->reap_singletons();
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/682278c4/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index 775d46c..81504f4 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -183,22 +183,6 @@ CODE:
 CFCBase_decref((CFCBase*)self);
 OUTPUT: RETVAL
 
-SV*
-fetch_singleton(unused, class_name)
-SV *unused;
-const char *class_name;
-CODE:
-CHY_UNUSED_VAR(unused);
-CFCClass *klass = CFCClass_fetch_singleton(class_name);
-RETVAL = S_cfcbase_to_perlref(klass);
-OUTPUT: RETVAL
-
-void
-_clear_registry(...)
-PPCODE:
-CHY_UNUSED_VAR(items);
-CFCClass_clear_registry();
-
 void
 add_child(self, child)
 CFCClass *self;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/682278c4/compiler/perl/t/401-class.t
--
diff --git a/compiler/perl/t/401-class.t b/compiler/perl/t/401-class.t
index 26d4742..3dcc2d9 100644
--- a/compiler/perl/t/401-class.t
+++ b/compiler/perl/t/401-class.t
@@ -242,7 +242,6 @@ $class_content = qq|
 $class = $parser->parse($class_content);
 ok( $class->final, "final class_declaration" );
 
-Clownfish::CFC::Model::Class->_clear_registry();
 Clownfish::CFC::Model::Parcel->reap_singletons();
 
 {
@@ -253,7 +252,6 @@ Clownfish::CFC::Model::Parcel->reap_singletons();
 };
 like( $@, qr/inert class/i, "inert class can't inherit" );
 
-Clownfish::CFC::Model::Class->_clear_registry();
 Clownfish::CFC::Model::Parcel->reap_singletons();
 }
 
@@ -265,7 +263,6 @@ Clownfish::CFC::Model::Parcel->reap_singletons();
 };
 like( $@, qr/inert class/i, "can't inherit from inert class" );
 
-Clownfish::CFC::Model::Class->_clear_registry();
 Clownfish::CFC::Model::Parcel->reap_singletons();
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/682278c4/compiler/perl/t/404-file.t
--
diff --git a/compiler/perl/t/404-file.t b/compiler/perl/t/404-file.t
index b907d69..9faa1fb 100644
--- 

[12/20] lucy-clownfish git commit: Store CFCClass pointer in CFCMethod

2017-03-18 Thread nwellnhof
Store CFCClass pointer in CFCMethod

Store a weak pointer to the class containing the method.


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

Branch: refs/heads/master
Commit: a0e051a0d15658574482b24d328e326c8389670c
Parents: 1ff6ed0
Author: Nick Wellnhofer 
Authored: Wed Mar 1 14:52:23 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:04 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC.pm  |  4 +-
 compiler/perl/lib/Clownfish/CFC.xs  |  8 ++-
 compiler/perl/t/201-method.t| 25 ++
 compiler/perl/t/202-overridden_method.t |  4 +-
 compiler/perl/t/203-final_method.t  |  2 +-
 compiler/src/CFCMethod.c| 73 
 compiler/src/CFCMethod.h|  9 ++--
 compiler/src/CFCParseHeader.y   |  3 +-
 compiler/src/CFCTestMethod.c| 72 +--
 9 files changed, 91 insertions(+), 109 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a0e051a0/compiler/perl/lib/Clownfish/CFC.pm
--
diff --git a/compiler/perl/lib/Clownfish/CFC.pm 
b/compiler/perl/lib/Clownfish/CFC.pm
index 26cb4a4..cd6dae0 100644
--- a/compiler/perl/lib/Clownfish/CFC.pm
+++ b/compiler/perl/lib/Clownfish/CFC.pm
@@ -250,7 +250,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.6.0' ) }
 param_list  => undef,
 name=> undef,
 docucomment => undef,
-class_name  => undef,
+class   => undef,
 abstract=> undef,
 final   => undef,
 exposure=> 'parcel',
@@ -264,7 +264,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.6.0' ) }
 $args{final}||= 0;
 return _new(
 @args{
-qw( exposure name return_type param_list docucomment class_name
+qw( exposure name return_type param_list docucomment class
 final abstract )
 }
 );

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a0e051a0/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index 9bae35d..b6b7939 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -826,23 +826,21 @@ PPCODE:
 MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Method
 
 SV*
-_new(exposure_sv, name, return_type, param_list, docucomment, class_name_sv, 
is_final, is_abstract)
+_new(exposure_sv, name, return_type, param_list, docucomment, klass, is_final, 
is_abstract)
 SV *exposure_sv;
 const char *name;
 CFCType *return_type;
 CFCParamList *param_list;
 CFCDocuComment *docucomment;
-SV *class_name_sv;
+CFCClass *klass;
 int is_final;
 int is_abstract;
 CODE:
 const char *exposure =
 SvOK(exposure_sv) ? SvPV_nolen(exposure_sv) : NULL;
-const char *class_name =
-SvOK(class_name_sv) ? SvPV_nolen(class_name_sv) : NULL;
 CFCMethod *self
 = CFCMethod_new(exposure, name, return_type, param_list, docucomment,
-class_name, is_final, is_abstract);
+klass, is_final, is_abstract);
 RETVAL = S_cfcbase_to_perlref(self);
 CFCBase_decref((CFCBase*)self);
 OUTPUT: RETVAL

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a0e051a0/compiler/perl/t/201-method.t
--
diff --git a/compiler/perl/t/201-method.t b/compiler/perl/t/201-method.t
index 3c8a74c..6caa3a2 100644
--- a/compiler/perl/t/201-method.t
+++ b/compiler/perl/t/201-method.t
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 38;
+use Test::More tests => 30;
 
 BEGIN { use_ok('Clownfish::CFC::Model::Method') }
 use Clownfish::CFC::Parser;
@@ -24,10 +24,11 @@ use Clownfish::CFC::Parser;
 my $parser = Clownfish::CFC::Parser->new;
 $parser->parse('parcel Neato;')
 or die "failed to process parcel_definition";
+my $neato_foo = $parser->parse('class Neato::Foo {}');
 
 my %args = (
 return_type => $parser->parse('Obj*'),
-class_name  => 'Neato::Foo',
+class   => $neato_foo,
 param_list  => $parser->parse('(Foo *self, int32_t count = 0)'),
 name=> 'Return_An_Obj',
 );
@@ -48,24 +49,6 @@ eval {
 };
 like( $@, qr/name/, "Invalid name kills constructor" );
 
-for (qw( foo 1Foo Foo_Bar 1FOOBAR )) {
-eval {
-

[04/20] lucy-clownfish git commit: Use WeakPtr in CFCClass

2017-03-18 Thread nwellnhof
Use WeakPtr in CFCClass

Weaken the parcel pointer. This allows to store a class array in
CFCParcel later.

Also weaken the parent pointer, so that the circular reference doesn't
have to be broken manually.


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

Branch: refs/heads/master
Commit: e0c9d8b3d26a53379210f33b57a44bcfed38dec6
Parents: a86fab4
Author: Nick Wellnhofer 
Authored: Mon Feb 27 16:05:54 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:02 2017 +0100

--
 compiler/src/CFCClass.c | 33 -
 1 file changed, 12 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/e0c9d8b3/compiler/src/CFCClass.c
--
diff --git a/compiler/src/CFCClass.c b/compiler/src/CFCClass.c
index 1fb2041..360630a 100644
--- a/compiler/src/CFCClass.c
+++ b/compiler/src/CFCClass.c
@@ -45,13 +45,13 @@ S_register(CFCClass *self);
 
 struct CFCClass {
 CFCBase base;
-struct CFCParcel *parcel;
+CFCWeakPtr parcel;
 char *exposure;
 char *name;
 char *nickname;
 int tree_grown;
 CFCDocuComment *docucomment;
-struct CFCClass *parent;
+CFCWeakPtr parent;
 struct CFCClass **children;
 size_t num_kids;
 CFCFunction **functions;
@@ -225,12 +225,11 @@ CFCClass_do_create(CFCClass *self, struct CFCParcel 
*parcel,
 }
 
 // Assign.
-self->parcel  = (CFCParcel*)CFCBase_incref((CFCBase*)parcel);
+self->parcel  = CFCWeakPtr_new((CFCBase*)parcel);
 self->exposure= CFCUtil_strdup(exposure);
 self->name= CFCUtil_strdup(name);
 self->nickname= CFCUtil_strdup(real_nickname);
 self->tree_grown  = false;
-self->parent  = NULL;
 self->children= (CFCClass**)CALLOCATE(1, sizeof(CFCClass*));
 self->num_kids= 0;
 self->functions   = (CFCFunction**)CALLOCATE(1, sizeof(CFCFunction*));
@@ -326,12 +325,12 @@ S_free_cfcbase_array(CFCBase **array) {
 
 void
 CFCClass_destroy(CFCClass *self) {
-CFCBase_decref((CFCBase*)self->parcel);
+CFCWeakPtr_destroy(>parcel);
 FREEMEM(self->exposure);
 FREEMEM(self->name);
 FREEMEM(self->nickname);
 CFCBase_decref((CFCBase*)self->docucomment);
-CFCBase_decref((CFCBase*)self->parent);
+CFCWeakPtr_destroy(>parent);
 CFCBase_decref((CFCBase*)self->file_spec);
 S_free_cfcbase_array((CFCBase**)self->children);
 S_free_cfcbase_array((CFCBase**)self->functions);
@@ -425,13 +424,7 @@ CFCClass_fetch_by_struct_sym(const char *struct_sym) {
 void
 CFCClass_clear_registry(void) {
 for (size_t i = 0; i < registry_size; i++) {
-CFCClass *klass = registry[i];
-if (klass->parent) {
-// Break circular ref.
-CFCBase_decref((CFCBase*)klass->parent);
-klass->parent = NULL;
-}
-CFCBase_decref((CFCBase*)klass);
+CFCBase_decref((CFCBase*)registry[i]);
 }
 FREEMEM(registry);
 registry_size = 0;
@@ -840,14 +833,12 @@ CFCClass_get_nickname(CFCClass *self) {
 
 void
 CFCClass_set_parent(CFCClass *self, CFCClass *parent) {
-CFCClass *old_parent = self->parent;
-self->parent = (CFCClass*)CFCBase_incref((CFCBase*)parent);
-CFCBase_decref((CFCBase*)old_parent);
+CFCWeakPtr_set(>parent, (CFCBase*)parent);
 }
 
 CFCClass*
 CFCClass_get_parent(CFCClass *self) {
-return self->parent;
+return (CFCClass*)CFCWeakPtr_deref(self->parent);
 }
 
 const char*
@@ -951,22 +942,22 @@ CFCClass_include_h(CFCClass *self) {
 
 CFCParcel*
 CFCClass_get_parcel(CFCClass *self) {
-return self->parcel;
+return (CFCParcel*)CFCWeakPtr_deref(self->parcel);
 }
 
 const char*
 CFCClass_get_prefix(CFCClass *self) {
-return CFCParcel_get_prefix(self->parcel);
+return CFCParcel_get_prefix(CFCClass_get_parcel(self));
 }
 
 const char*
 CFCClass_get_Prefix(CFCClass *self) {
-return CFCParcel_get_Prefix(self->parcel);
+return CFCParcel_get_Prefix(CFCClass_get_parcel(self));
 }
 
 const char*
 CFCClass_get_PREFIX(CFCClass *self) {
-return CFCParcel_get_PREFIX(self->parcel);
+return CFCParcel_get_PREFIX(CFCClass_get_parcel(self));
 }
 
 const char*



[10/20] lucy-clownfish git commit: Add CFCType_get_class

2017-03-18 Thread nwellnhof
Add CFCType_get_class

Store a weak pointer to CFCClass in CFCType for object types.


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

Branch: refs/heads/master
Commit: 850d69bfff9f64dbf1a6a9929639b05bf9cc0fc7
Parents: c502223
Author: Nick Wellnhofer 
Authored: Mon Feb 27 19:45:52 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:03 2017 +0100

--
 compiler/src/CFCBindMethod.c  |  3 +--
 compiler/src/CFCCHtml.c   | 22 +-
 compiler/src/CFCGoTypeMap.c   | 31 ++-
 compiler/src/CFCPerlMethod.c  | 23 ++-
 compiler/src/CFCPerlTypeMap.c |  5 +++--
 compiler/src/CFCPyMethod.c|  6 --
 compiler/src/CFCType.c| 20 +---
 compiler/src/CFCType.h|  7 +++
 8 files changed, 45 insertions(+), 72 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/850d69bf/compiler/src/CFCBindMethod.c
--
diff --git a/compiler/src/CFCBindMethod.c b/compiler/src/CFCBindMethod.c
index d57a29e..e6880b4 100644
--- a/compiler/src/CFCBindMethod.c
+++ b/compiler/src/CFCBindMethod.c
@@ -165,8 +165,7 @@ char*
 CFCBindMeth_abstract_method_def(CFCMethod *method, CFCClass *klass) {
 CFCType*ret_type  = CFCMethod_get_return_type(method);
 const char *ret_type_str  = CFCType_to_c(ret_type);
-CFCType*type  = CFCMethod_self_type(method);
-const char *class_var = CFCType_get_class_var(type);
+const char *class_var = CFCClass_full_class_var(klass);
 const char *meth_name = CFCMethod_get_name(method);
 CFCParamList *param_list  = CFCMethod_get_param_list(method);
 const char *params= CFCParamList_to_c(param_list);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/850d69bf/compiler/src/CFCCHtml.c
--
diff --git a/compiler/src/CFCCHtml.c b/compiler/src/CFCCHtml.c
index 016c15b..6383ada 100644
--- a/compiler/src/CFCCHtml.c
+++ b/compiler/src/CFCCHtml.c
@@ -1071,19 +1071,15 @@ S_type_to_html(CFCType *type, const char *sep, CFCClass 
*doc_class) {
 char *specifier_html = NULL;
 
 if (CFCType_is_object(type)) {
-CFCClass   *klass = NULL;
-
-// Don't link to doc class.
-if (strcmp(specifier, CFCClass_full_struct_sym(doc_class)) != 0) {
-klass = CFCClass_fetch_by_struct_sym(specifier);
-if (!klass) {
-CFCUtil_warn("Class '%s' not found", specifier);
-}
-else if (!CFCClass_public(klass)) {
-CFCUtil_warn("Non-public class '%s' used in public method",
- specifier);
-klass = NULL;
-}
+CFCClass *klass = CFCType_get_class(type);
+if (klass == doc_class) {
+// Don't link to doc class.
+klass = NULL;
+}
+else if (!CFCClass_public(klass)) {
+CFCUtil_warn("Non-public class '%s' used in public method",
+ specifier);
+klass = NULL;
 }
 
 const char *underscore = strchr(specifier, '_');

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/850d69bf/compiler/src/CFCGoTypeMap.c
--
diff --git a/compiler/src/CFCGoTypeMap.c b/compiler/src/CFCGoTypeMap.c
index 281fb21..a9f65d1 100644
--- a/compiler/src/CFCGoTypeMap.c
+++ b/compiler/src/CFCGoTypeMap.c
@@ -24,6 +24,7 @@
 #include "CFCVariable.h"
 #include "CFCType.h"
 #include "CFCUtil.h"
+#include "CFCClass.h"
 
 #ifndef true
 #define true 1
@@ -109,32 +110,12 @@ CFCGoTypeMap_go_type_name(CFCType *type, CFCParcel 
*current_parcel) {
 }
 else if (CFCType_is_object(type)) {
 // Divide the specifier into prefix and struct name.
-const char *specifier  = CFCType_get_specifier(type);
-size_t  prefix_len = 0;
-for (size_t max = strlen(specifier); prefix_len < max; prefix_len++) {
-if (CFCUtil_isupper(specifier[prefix_len])) {
-break;
-}
-}
-if (!prefix_len) {
-CFCUtil_die("Can't convert object type name '%s'", specifier);
-}
-const char *struct_sym = specifier + prefix_len;
-
-// Find the parcel that the type lives in.
-CFCParcel** all_parcels = CFCParcel_all_parcels();
-CFCParcel *parcel = NULL;
-for (int i = 0; all_parcels[i] != NULL; i++) {
- 

[07/20] lucy-clownfish git commit: Sort class arrays of parcels

2017-03-18 Thread nwellnhof
Sort class arrays of parcels

Some of the code generators require that parent classes are processed
before subclasses. Sort the class array accordingly when building the
hierarchy.

Also sort subclasses by class name to guarantee a consistent order.
This should make the CFC output completely deterministic. (Except for
output that depends on the order of parcels in the global parcel
registry. I think the only example is the Perl typemap.)


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

Branch: refs/heads/master
Commit: e5b89002ee752aee8563a953b530d4ddafddcf85
Parents: 22e055c
Author: Nick Wellnhofer 
Authored: Sun Feb 26 23:11:47 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:03 2017 +0100

--
 compiler/src/CFCHierarchy.c |  3 ++
 compiler/src/CFCParcel.c| 75 
 compiler/src/CFCParcel.h| 10 ++
 3 files changed, 88 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/e5b89002/compiler/src/CFCHierarchy.c
--
diff --git a/compiler/src/CFCHierarchy.c b/compiler/src/CFCHierarchy.c
index 19a45ec..86ad2cc 100644
--- a/compiler/src/CFCHierarchy.c
+++ b/compiler/src/CFCHierarchy.c
@@ -256,6 +256,9 @@ CFCHierarchy_build(CFCHierarchy *self) {
 for (size_t i = 0; self->trees[i] != NULL; i++) {
 CFCClass_grow_tree(self->trees[i]);
 }
+for (size_t i = 0; parcels[i] != NULL; i++) {
+CFCParcel_sort_classes(parcels[i]);
+}
 
 FREEMEM(source_parcels);
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/e5b89002/compiler/src/CFCParcel.c
--
diff --git a/compiler/src/CFCParcel.c b/compiler/src/CFCParcel.c
index 2c134c5..96d5de8 100644
--- a/compiler/src/CFCParcel.c
+++ b/compiler/src/CFCParcel.c
@@ -609,6 +609,76 @@ CFCParcel_add_class(CFCParcel *self, CFCClass *klass) {
 self->num_classes = num_classes + 1;
 }
 
+static int
+S_compare_class_name(const void *va, const void *vb) {
+const char *a = CFCClass_get_name(*(CFCClass**)va);
+const char *b = CFCClass_get_name(*(CFCClass**)vb);
+
+return strcmp(a, b);
+}
+
+void
+CFCParcel_sort_classes(CFCParcel *self) {
+size_t num_classes = self->num_classes;
+size_t alloc_size  = (num_classes + 1) * sizeof(CFCClass*);
+CFCClass **classes = self->classes;
+CFCClass **sorted  = (CFCClass**)MALLOCATE(alloc_size);
+
+// Perform a depth-first search of the classes in the parcel, and store
+// the classes in the order that they were visited. This makes sure
+// that subclasses are sorted after their parents.
+//
+// To avoid a recursive algorithm, the end of the sorted array is used
+// as a stack for classes that have yet to be visited.
+//
+// Root and child classes are sorted by name to get a deterministic
+// order.
+
+// Find subtree roots in parcel.
+size_t todo = num_classes;
+for (size_t i = 0; i < num_classes; i++) {
+CFCClass *klass  = classes[i];
+CFCClass *parent = CFCClass_get_parent(klass);
+if (!parent || !CFCClass_in_parcel(parent, self)) {
+sorted[--todo] = klass;
+}
+}
+
+qsort([todo], num_classes - todo, sizeof(sorted[0]),
+  S_compare_class_name);
+
+size_t num_sorted = 0;
+while (todo < num_classes) {
+CFCClass *klass = sorted[todo++];
+sorted[num_sorted++] = klass;
+
+// Find children in parcel.
+CFCClass **children = CFCClass_children(klass);
+size_t prev_todo = todo;
+for (size_t i = 0; children[i]; i++) {
+CFCClass *child = children[i];
+if (CFCClass_in_parcel(child, self)) {
+if (todo <= num_sorted) {
+CFCUtil_die("Internal error in CFCParcel_sort_classes");
+}
+sorted[--todo] = child;
+}
+}
+
+qsort([todo], prev_todo - todo, sizeof(sorted[0]),
+  S_compare_class_name);
+}
+
+if (num_sorted != num_classes) {
+CFCUtil_die("Internal error in CFCParcel_sort_classes");
+}
+
+sorted[num_classes] = NULL;
+
+FREEMEM(self->classes);
+self->classes = sorted;
+}
+
 static CFCParcel*
 S_lookup_struct_sym(CFCParcel *self, const char *struct_sym) {
 for (size_t i = 0; self->classes[i]; ++i) {
@@ -647,6 +717,11 @@ CFCParcel_is_cfish(CFCParcel *self) {
 return !strcmp(self->prefix, "cfish_");
 }
 
+CFCClass**

[15/20] lucy-clownfish git commit: Simplify CFCBindMeth_method_def

2017-03-18 Thread nwellnhof
Simplify CFCBindMeth_method_def

Remove unneeded static functions.


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

Branch: refs/heads/master
Commit: 821bf0d0b8c31609ebbc54949f8262ef38393e3a
Parents: 8fbf9c9
Author: Nick Wellnhofer 
Authored: Tue Feb 28 16:41:14 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:05 2017 +0100

--
 compiler/src/CFCBindMethod.c | 50 +++
 1 file changed, 14 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/821bf0d0/compiler/src/CFCBindMethod.c
--
diff --git a/compiler/src/CFCBindMethod.c b/compiler/src/CFCBindMethod.c
index e6880b4..fad6fd5 100644
--- a/compiler/src/CFCBindMethod.c
+++ b/compiler/src/CFCBindMethod.c
@@ -32,44 +32,8 @@
   #define false 0
 #endif
 
-static char*
-S_method_def(CFCMethod *method, CFCClass *klass, int optimized_final_meth);
-
-/* Create a method invocation routine that resolves to a function name
- * directly, since this method may not be overridden.
- */
-static char*
-S_optimized_final_method_def(CFCMethod *method, CFCClass *klass) {
-return S_method_def(method, klass, true);
-}
-
-/* Create a method invocation routine which uses vtable dispatch.
- */
-static char*
-S_virtual_method_def(CFCMethod *method, CFCClass *klass) {
-return S_method_def(method, klass, false);
-}
-
 char*
 CFCBindMeth_method_def(CFCMethod *method, CFCClass *klass) {
-// If the method is final and the class where it is declared final is in
-// the same parcel as the invocant, we can optimize the call by resolving
-// to the implementing function directly.
-if (CFCMethod_final(method)) {
-CFCClass *ancestor = klass;
-while (ancestor && !CFCMethod_is_fresh(method, ancestor)) {
-ancestor = CFCClass_get_parent(ancestor);
-}
-if (CFCClass_get_parcel(ancestor) == CFCClass_get_parcel(klass)) {
-return S_optimized_final_method_def(method, klass);
-}
-}
-
-return S_virtual_method_def(method, klass);
-}
-
-static char*
-S_method_def(CFCMethod *method, CFCClass *klass, int optimized_final_meth) {
 CFCParamList *param_list = CFCMethod_get_param_list(method);
 const char *PREFIX = CFCClass_get_PREFIX(klass);
 const char *invoker_struct = CFCClass_full_struct_sym(klass);
@@ -95,6 +59,20 @@ S_method_def(CFCMethod *method, CFCClass *klass, int 
optimized_final_meth) {
 const char *ret_type_str = CFCType_to_c(return_type);
 const char *maybe_return = CFCType_is_void(return_type) ? "" : "return ";
 
+// If the method is final and the class where it is declared final is in
+// the same parcel as the invocant, we can optimize the call by resolving
+// to the implementing function directly.
+int optimized_final_meth = false;
+if (CFCMethod_final(method)) {
+CFCClass *ancestor = klass;
+while (ancestor && !CFCMethod_is_fresh(method, ancestor)) {
+ancestor = CFCClass_get_parent(ancestor);
+}
+if (CFCClass_in_same_parcel(ancestor, klass)) {
+optimized_final_meth = true;
+}
+}
+
 const char innards_pattern[] =
 "const %s method = (%s)cfish_obj_method(%s, %s);\n"
 "%smethod(%s);\n"



[09/20] lucy-clownfish git commit: Store CFCClass pointer in parser state

2017-03-18 Thread nwellnhof
Store CFCClass pointer in parser state

Store a CFCClass pointer instead of the class name.


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

Branch: refs/heads/master
Commit: 1ff6ed0f9ce59fce928d03f0807c47fc57fd501a
Parents: 850d69b
Author: Nick Wellnhofer 
Authored: Wed Mar 1 14:01:40 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 2 20:08:03 2017 +0100

--
 compiler/perl/lib/Clownfish/CFC.xs |  8 
 compiler/perl/t/200-function.t |  6 +-
 compiler/perl/t/201-method.t   |  6 +-
 compiler/perl/t/401-class.t| 16 +++
 compiler/perl/t/600-parser.t   |  8 ++--
 compiler/src/CFCParseHeader.y  | 11 +-
 compiler/src/CFCParser.c   | 36 ++---
 compiler/src/CFCParser.h   | 13 
 compiler/src/CFCTestClass.c|  4 ++--
 compiler/src/CFCTestFunction.c | 12 ++-
 compiler/src/CFCTestMethod.c   | 11 +-
 compiler/src/CFCTestParser.c   | 11 --
 12 files changed, 81 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1ff6ed0f/compiler/perl/lib/Clownfish/CFC.xs
--
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index 8abe174..9bae35d 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -2509,11 +2509,11 @@ PPCODE:
 CFCParser_set_parcel(self, parcel);
 
 void
-set_class_name(self, class_name)
-CFCParser  *self;
-const char *class_name;
+set_class(self, klass)
+CFCParser *self;
+CFCClass  *klass;
 PPCODE:
-CFCParser_set_class_name(self, class_name);
+CFCParser_set_class(self, klass);
 
 SV*
 get_parcel(self)

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1ff6ed0f/compiler/perl/t/200-function.t
--
diff --git a/compiler/perl/t/200-function.t b/compiler/perl/t/200-function.t
index 98455b8..8fc719d 100644
--- a/compiler/perl/t/200-function.t
+++ b/compiler/perl/t/200-function.t
@@ -44,7 +44,11 @@ like( $@, qr/extra_arg/, "Extra arg kills constructor" );
 eval { Clownfish::CFC::Model::Function->new( %args, name => 'Uh_Oh' ); };
 like( $@, qr/Uh_Oh/, "invalid name kills constructor" );
 
-$parser->set_class_name("Neato::Obj");
+my $neato_obj = Clownfish::CFC::Model::Class->create(
+parcel => "Neato",
+class_name => "Neato::Obj",
+);
+$parser->set_class($neato_obj);
 isa_ok(
 $parser->parse($_),
 "Clownfish::CFC::Model::Function",

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1ff6ed0f/compiler/perl/t/201-method.t
--
diff --git a/compiler/perl/t/201-method.t b/compiler/perl/t/201-method.t
index f3467a7..3c8a74c 100644
--- a/compiler/perl/t/201-method.t
+++ b/compiler/perl/t/201-method.t
@@ -133,7 +133,11 @@ for my $meth_meth (qw( short_method_sym full_method_sym 
full_offset_sym)) {
 like( $@, qr/invoker/, "$meth_meth requires invoker" );
 }
 
-$parser->set_class_name("Neato::Obj");
+my $neato_obj = Clownfish::CFC::Model::Class->create(
+parcel => "Neato",
+class_name => "Neato::Obj",
+);
+$parser->set_class($neato_obj);
 isa_ok(
 $parser->parse($_),
 "Clownfish::CFC::Model::Method",

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1ff6ed0f/compiler/perl/t/401-class.t
--
diff --git a/compiler/perl/t/401-class.t b/compiler/perl/t/401-class.t
index cafb70c..26d4742 100644
--- a/compiler/perl/t/401-class.t
+++ b/compiler/perl/t/401-class.t
@@ -99,24 +99,24 @@ is( $final_foo->get_parent_class_name, 'Foo::FooJr',
 "get_parent_class_name" );
 
 $parser->parse("parcel Neato;");
-$parser->set_class_name("Foo");
+$parser->set_class($foo);
 my $do_stuff = $parser->parse('void Do_Stuff(Foo *self);')
 or die "parsing failure";
 $foo->add_method($do_stuff);
 
-$parser->set_class_name("InertFoo");
-my $inert_do_stuff = $parser->parse('void Do_Stuff(InertFoo *self);')
-or die "parsing failure";
-$parser->set_class_name("");
-
 my %inert_args = (
 parcel => 'Neato',
 class_name => 'InertFoo',
 inert  => 1,
 );
+my $inert_foo = Clownfish::CFC::Model::Class->create(%inert_args);
+$parser->set_class($inert_foo);
+my $inert_do_stuff = $parser->parse('void Do_Stuff(InertFoo *self);')
+or die "parsing failure";
+$parser->set_class(undef);
+
 

lucy-clownfish git commit: Fix global destruction check again

2017-03-09 Thread nwellnhof
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 0e8aa921a -> ab9d38830


Fix global destruction check again

The best we can do is to check for PL_dirty and the refcount.


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

Branch: refs/heads/master
Commit: ab9d38830c696c9ec4169c40c79efbdcd343948c
Parents: 0e8aa92
Author: Nick Wellnhofer 
Authored: Tue Mar 7 19:17:16 2017 +0100
Committer: Nick Wellnhofer 
Committed: Thu Mar 9 22:22:12 2017 +0100

--
 .../perl/buildlib/Clownfish/Build/Binding.pm| 10 +++-
 runtime/perl/t/binding/019-obj.t| 24 +++-
 2 files changed, 32 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/ab9d3883/runtime/perl/buildlib/Clownfish/Build/Binding.pm
--
diff --git a/runtime/perl/buildlib/Clownfish/Build/Binding.pm 
b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
index dd976b5..9fa4942 100644
--- a/runtime/perl/buildlib/Clownfish/Build/Binding.pm
+++ b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
@@ -756,9 +756,17 @@ PPCODE:
  * objects remaining because of refcount leaks or circular references.
  * This can cause memory corruption with Clownfish objects, so better
  * leak instead of corrupting memory.
+ *
+ * Unfortunately, Perl's global destruction is still severely broken
+ * as of early 2017. Global "our" variables are destroyed in random
+ * order even without circular references. The following check will
+ * skip some objects that could be safely destroyed, but it's the
+ * best we can do.
+ *
+ * See https://rt.perl.org/Ticket/Display.html?id=32714
  */
 SV *inner = SvRV(sv);
-if (SvREFCNT(inner) <= 1) {
+if (!PL_dirty || SvREFCNT(inner) <= 1) {
 cfish_Obj *self = INT2PTR(cfish_Obj*, SvIV(inner));
 CFISH_Obj_Destroy(self);
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/ab9d3883/runtime/perl/t/binding/019-obj.t
--
diff --git a/runtime/perl/t/binding/019-obj.t b/runtime/perl/t/binding/019-obj.t
index 357984b..ee1be19 100644
--- a/runtime/perl/t/binding/019-obj.t
+++ b/runtime/perl/t/binding/019-obj.t
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 26;
+use Test::More tests => 27;
 use Clownfish::Test;
 
 package TestObj;
@@ -174,3 +174,25 @@ SKIP: {
 pass ( "Created circular reference" );
 }
 
+SKIP: {
+skip( "Global destruction check doesn't work reliably", 1 )
+if $ENV{CLOWNFISH_VALGRIND};
+
+{
+package LeakyObj;
+use base qw( Clownfish::Obj );
+
+sub DESTROY {
+# The assignment increases the object's refcount.
+my $self = shift;
+$self->SUPER::DESTROY;
+}
+}
+
+# Will unfortunately be destroyed during global destruction, not in the
+# END phase as one would expect.
+# See https://rt.perl.org/Ticket/Display.html?id=32714
+our $leaky = LeakyObj->new;
+pass( "Created LeakyObj" );
+}
+



[1/4] lucy git commit: Use Windows API to delete and rename files

2017-03-05 Thread nwellnhof
Repository: lucy
Updated Branches:
  refs/heads/master 291a32693 -> 7a64a288c


Use Windows API to delete and rename files

Delete files on Windows by calling CreateFile with
FILE_FLAG_DELETE_ON_CLOSE and closing the handle immediately. Unlike
DeleteFile, this allows files opened with FILE_SHARE_DELETE to be
(eventually) deleted.

Part of LUCY-324.


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

Branch: refs/heads/master
Commit: 3b1b63e8d8f7fcdf30d4c2af7c9ee519c662569a
Parents: de646e6
Author: Nick Wellnhofer 
Authored: Sun Mar 5 14:21:29 2017 +0100
Committer: Nick Wellnhofer 
Committed: Sun Mar 5 16:29:44 2017 +0100

--
 core/Lucy/Store/FSFileHandle.c |   4 +-
 core/Lucy/Store/FSFolder.c | 125 
 2 files changed, 102 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/3b1b63e8/core/Lucy/Store/FSFileHandle.c
--
diff --git a/core/Lucy/Store/FSFileHandle.c b/core/Lucy/Store/FSFileHandle.c
index fff9175..12769ec 100644
--- a/core/Lucy/Store/FSFileHandle.c
+++ b/core/Lucy/Store/FSFileHandle.c
@@ -388,15 +388,17 @@ S_init(FSFileHandleIVARS *ivars, String *path, uint32_t 
flags) {
 DWORD desired_access   = flags & FH_READ_ONLY
  ? GENERIC_READ
  : GENERIC_WRITE;
+DWORD share_mode   = FILE_SHARE_READ;
 DWORD creation_disposition = flags & FH_CREATE
  ? flags & FH_EXCLUSIVE
? CREATE_NEW
: OPEN_ALWAYS
  : OPEN_EXISTING;
 
+share_mode |= FILE_SHARE_DELETE;
 char *path_ptr = Str_To_Utf8(path);
 HANDLE handle
-= CreateFileA(path_ptr, desired_access, FILE_SHARE_READ, NULL,
+= CreateFileA(path_ptr, desired_access, share_mode, NULL,
   creation_disposition, FILE_ATTRIBUTE_NORMAL, NULL);
 FREEMEM(path_ptr);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3b1b63e8/core/Lucy/Store/FSFolder.c
--
diff --git a/core/Lucy/Store/FSFolder.c b/core/Lucy/Store/FSFolder.c
index d4d7f41..a1caf80 100644
--- a/core/Lucy/Store/FSFolder.c
+++ b/core/Lucy/Store/FSFolder.c
@@ -78,9 +78,17 @@ S_is_absolute(String *path);
 static String*
 S_absolutify(String *path);
 
+// Rename a directory or file.
+static bool
+S_rename(const char *from_path, const char *to_path);
+
 // Create a hard link.
 static bool
-S_hard_link(char *from_path, char *to_path);
+S_hard_link(const char *from_path, const char *to_path);
+
+// Delete a directory or file.
+static bool
+S_delete(const char *path);
 
 FSFolder*
 FSFolder_new(String *path) {
@@ -179,13 +187,10 @@ FSFolder_Local_Is_Directory_IMP(FSFolder *self, String 
*name) {
 
 bool
 FSFolder_Rename_IMP(FSFolder *self, String* from, String *to) {
+// TODO: Update Folder entries.
 char *from_path = S_fullpath_ptr(self, from);
 char *to_path   = S_fullpath_ptr(self, to);
-bool  retval= !rename(from_path, to_path);
-if (!retval) {
-ErrMsg_set_with_errno("rename from '%s' to '%s' failed",
-  from_path, to_path);
-}
+bool retval = S_rename(from_path, to_path);
 FREEMEM(from_path);
 FREEMEM(to_path);
 return retval;
@@ -194,27 +199,25 @@ FSFolder_Rename_IMP(FSFolder *self, String* from, String 
*to) {
 bool
 FSFolder_Hard_Link_IMP(FSFolder *self, String *from,
String *to) {
-char *from_path_ptr = S_fullpath_ptr(self, from);
-char *to_path_ptr   = S_fullpath_ptr(self, to);
-bool  retval= S_hard_link(from_path_ptr, to_path_ptr);
-FREEMEM(from_path_ptr);
-FREEMEM(to_path_ptr);
+// TODO: Update Folder entries.
+char *from_path = S_fullpath_ptr(self, from);
+char *to_path   = S_fullpath_ptr(self, to);
+bool  retval= S_hard_link(from_path, to_path);
+FREEMEM(from_path);
+FREEMEM(to_path);
 return retval;
 }
 
 bool
 FSFolder_Local_Delete_IMP(FSFolder *self, String *name) {
+// TODO: Delete should only delete files. We should add RmDir for
+// directories.
 FSFolderIVARS *const ivars = FSFolder_IVARS(self);
-
-char *path_ptr = S_fullpath_ptr(self, name);
-#ifdef CHY_REMOVE_ZAPS_DIRS
-bool result = !remove(path_ptr);
-#else
-bool result = !rmdir(path_ptr) || !remove(path_ptr);
-#endif
+char *path   = S_fullpath_ptr(self, name);
+bool  retval = S_delete(path);
 

[3/4] lucy git commit: Make FSFolder always use Windows API

2017-03-05 Thread nwellnhof
Make FSFolder always use Windows API

Fixes LUCY-324.


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

Branch: refs/heads/master
Commit: 54d5093f51b938e55fd734fbb1d3162f390452be
Parents: 3b1b63e
Author: Nick Wellnhofer 
Authored: Sun Mar 5 16:28:02 2017 +0100
Committer: Nick Wellnhofer 
Committed: Sun Mar 5 16:29:50 2017 +0100

--
 core/Lucy/Store/FSFolder.c | 116 +++-
 1 file changed, 68 insertions(+), 48 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/lucy/blob/54d5093f/core/Lucy/Store/FSFolder.c
--
diff --git a/core/Lucy/Store/FSFolder.c b/core/Lucy/Store/FSFolder.c
index a1caf80..c2d7d36 100644
--- a/core/Lucy/Store/FSFolder.c
+++ b/core/Lucy/Store/FSFolder.c
@@ -19,26 +19,6 @@
 
 #include "charmony.h"
 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#ifdef CHY_HAS_SYS_TYPES_H
-  #include 
-#endif
-
-// For rmdir, (hard) link.
-#ifdef CHY_HAS_UNISTD_H
-  #include 
-#endif
-
-// For mkdir, rmdir.
-#ifdef CHY_HAS_DIRECT_H
-  #include 
-#endif
-
 #include "Clownfish/CharBuf.h"
 #include "Lucy/Store/ErrorMessage.h"
 #include "Lucy/Store/FSFolder.h"
@@ -66,6 +46,10 @@ S_dir_ok(String *path);
 static bool
 S_create_dir(String *path);
 
+// Return true if the supplied path exists.
+static bool
+S_exists(const char *path);
+
 // Return true unless the supplied path contains a slash.
 static bool
 S_is_local_entry(String *path);
@@ -157,12 +141,8 @@ FSFolder_Local_Exists_IMP(FSFolder *self, String *name) {
 return false;
 }
 else {
-struct stat stat_buf;
 char *fullpath_ptr = S_fullpath_ptr(self, name);
-bool retval = false;
-if (stat(fullpath_ptr, _buf) != -1) {
-retval = true;
-}
+bool retval = S_exists(fullpath_ptr);
 FREEMEM(fullpath_ptr);
 return retval;
 }
@@ -327,13 +307,27 @@ S_fullpath_ptr(FSFolder *self, String *path) {
 }
 
 static bool
+S_is_local_entry(String *path) {
+return !Str_Contains_Utf8(path, "/", 1);
+}
+
+/***/
+
+#if (defined(CHY_HAS_WINDOWS_H) && !defined(__CYGWIN__))
+
+// Windows.h defines INCREF and DECREF, so we include it only at the end of
+// this file and undef those symbols.
+#undef INCREF
+#undef DECREF
+
+#include 
+
+static bool
 S_dir_ok(String *path) {
-bool retval = false;
 char *path_ptr = Str_To_Utf8(path);
-struct stat stat_buf;
-if (stat(path_ptr, _buf) != -1) {
-if (stat_buf.st_mode & S_IFDIR) { retval = true; }
-}
+DWORD attrs = GetFileAttributesA(path_ptr);
+bool retval = attrs != INVALID_FILE_ATTRIBUTES
+  && (attrs & FILE_ATTRIBUTE_DIRECTORY);
 FREEMEM(path_ptr);
 return retval;
 }
@@ -342,35 +336,26 @@ static bool
 S_create_dir(String *path) {
 bool retval = true;
 char *path_ptr = Str_To_Utf8(path);
-if (-1 == chy_makedir(path_ptr, 0777)) {
-ErrMsg_set_with_errno("Couldn't create directory '%o'", path);
+if (CreateDirectoryA(path_ptr, NULL) == 0) {
+ErrMsg_set_with_win_error("Couldn't create directory '%o'", path);
 retval = false;
 }
+SetFileAttributes(path_ptr, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
 FREEMEM(path_ptr);
 return retval;
 }
 
 static bool
-S_is_local_entry(String *path) {
-return !Str_Contains_Utf8(path, "/", 1);
+S_exists(const char *path) {
+return GetFileAttributesA(path) != INVALID_FILE_ATTRIBUTES;
 }
 
-/***/
-
-#if (defined(CHY_HAS_WINDOWS_H) && !defined(__CYGWIN__))
-
-// Windows.h defines INCREF and DECREF, so we include it only at the end of
-// this file and undef those symbols.
-#undef INCREF
-#undef DECREF
-
-#include 
-
 static bool
 S_is_absolute(String *path) {
 int32_t code_point = Str_Code_Point_At(path, 0);
 
-if (isalpha(code_point)) {
+if ((code_point >= 'A' && code_point <= 'Z')
+|| (code_point >= 'a' && code_point <= 'z')) {
 code_point = Str_Code_Point_At(path, 1);
 if (code_point != ':') { return false; }
 code_point = Str_Code_Point_At(path, 2);
@@ -383,9 +368,9 @@ static String*
 S_absolutify(String *path) {
 if (S_is_absolute(path)) { return Str_Clone(path); }
 
-DWORD  cwd_len = GetCurrentDirectory(0, NULL);
+DWORD  cwd_len = GetCurrentDirectoryA(0, NULL);
 char  *cwd = (char*)MALLOCATE(cwd_len);
-DWORD  res = GetCurrentDirectory(cwd_len, cwd);
+DWORD  res = 

[4/4] lucy git commit: Create files with FILE_ATTRIBUTE_NOT_CONTENT_INDEXED

2017-03-05 Thread nwellnhof
Create files with FILE_ATTRIBUTE_NOT_CONTENT_INDEXED

Might avoid problems with the Windows Search Service, although my
earlier testing suggests that the only reliable solution is to
exclude the folder via Indexing Options in Control Panel.


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

Branch: refs/heads/master
Commit: 7a64a288c36f7d3e3b30fd0f0605d7570e0c5a5a
Parents: 54d5093
Author: Nick Wellnhofer 
Authored: Sun Mar 5 16:31:36 2017 +0100
Committer: Nick Wellnhofer 
Committed: Sun Mar 5 16:36:49 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/lucy/blob/7a64a288/core/Lucy/Store/FSFileHandle.c
--
diff --git a/core/Lucy/Store/FSFileHandle.c b/core/Lucy/Store/FSFileHandle.c
index 12769ec..f1536d1 100644
--- a/core/Lucy/Store/FSFileHandle.c
+++ b/core/Lucy/Store/FSFileHandle.c
@@ -399,7 +399,8 @@ S_init(FSFileHandleIVARS *ivars, String *path, uint32_t 
flags) {
 char *path_ptr = Str_To_Utf8(path);
 HANDLE handle
 = CreateFileA(path_ptr, desired_access, share_mode, NULL,
-  creation_disposition, FILE_ATTRIBUTE_NORMAL, NULL);
+  creation_disposition, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,
+  NULL);
 FREEMEM(path_ptr);
 
 if (handle == INVALID_HANDLE_VALUE) {



  1   2   3   4   5   6   7   8   9   10   >