Summary: Adds a new flag to allow for a mode where #include statements in generated c++ will include path context information. For example, if my .thrift file includes "foo/bar/baz.thrift", the generated source files will contain #include statements like:
#include "foo/bar/gen-cpp/baz_types.h"
instead of just:
#include "baz_types.h"
-cpp_use_include_prefix is OFF by default.
Reviewed By: dreiss
Test Plan: Tested against multiple thrift input files both with and without the new flag.
Revert: OK
DiffCamp Revision: 5522
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665431 13f79535-47bb-0310-9956-ffa450edef68
Summary: Otherwise you're liable to get forward declaration problems in the generated C++ code.
Reviewed By: dreiss
Test Plan: Generate some code that mixes exceptions/structs and has methods potentially return a list of exceptions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665423 13f79535-47bb-0310-9956-ffa450edef68
Summary:
C# generator, library, and MS Build task contributed by imeem.
Reviewed By: mcslee
Test Plan:
Built the Thrift compiler and generated some C# code.
I'd love to say I installed Mono or Portable.NET and built the C# code,
but I did not.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665421 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Todd Berman from imeem has contributed a patch that allows
the Thrift compiler to be built with MinGW and run on Windows.
Reviewed By: mcslee
Test Plan:
Built the compiler from scratch on Linux.
If my changes messed up the MinGW build, I'm sure Todd will yell at me.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665420 13f79535-47bb-0310-9956-ffa450edef68
Summary: Submitted by Dan Sully, reviewed by Kevin Clark
Reviewed By: dreiss
Test Plan: New ruby generated code with default vals, and new test scripts
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665418 13f79535-47bb-0310-9956-ffa450edef68
Summary: If in a container, use Byte not byte
Reviewed By: dreiss
Test Plan: Generate a list of bytes
Other Notes: based upon Kyle's submission
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665417 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Ben Maurer suggested that it would make sense for Thrift to build as
a single project, with one configure.ac and multiple Makefile.am.
He was also kind enough to do the heavy lifting, and this commit
is the application of his patch (with minor modifications).
The most significant visible change from this diff is that
in order to buidl one of the thrift sub-projects (i.e.: the compiler,
the C++ library, or the Python library) you must run bootstrap.sh
and configure in the Thrift root, then make in the specific project.
Users who want to build and install the Python library but
can't run configure because they don't have Boost can simply
run setup.py directly.
Reviewed By: mcslee
Test Plan: Built Thrift from scratch.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665409 13f79535-47bb-0310-9956-ffa450edef68
Summary: ... The main interface function has the same name, but as an escaped atom
(ie 'CapitalizedFun'(Arg1, Arg2) -> is the function sig)
Reviewed by: dweatherford
Test Plan: tested with the following thrift
service foo {
Struct1 CapitalizedFun(1: list<Struct2> param);
}
Generated erlang code now compiles
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665408 13f79535-47bb-0310-9956-ffa450edef68
Summary: All the subclasses do that so it causes warnings not to and is dumb because copy constructing std::string is dumb
Reviewed By: kholst
Test Plan: Generate some codes, compile with -Werror
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665405 13f79535-47bb-0310-9956-ffa450edef68
Summary: Solution, dummy static class var to use instanceof
Reviewed By: dweatherford
Test Plan: Regen'd some mobile code in trunk using this
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665401 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: mcslee
Test Plan: Thrifted ThriftTest.thrift and looked at the output.
Revert Plan: ok
Other Notes:
Based on a patch from Jon Dugan.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665399 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The Java generator wasn't setting default values for base types
in the zero argument constructor. This check was probably brought over
from the C++ generator, where base types are given their default values
in the member variable initializer list (or whatever that thing is called).
Blame Rev: Somewhere in the mysterious past. I tried to find it, but failed.
Reviewed By: mcslee
Test Plan: Recompiled Thrift and thrifted a file that showed the bug.
Revert Plan: ok
Other Notes:
Bug reported by Jake Luciani.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665398 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: mcslee
Test Plan: Built the compiler.
Revert Plan: ok
Other Notes:
Contributed by Ben Matasar.
Signed off by Patrick Collison.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665391 13f79535-47bb-0310-9956-ffa450edef68
Summary: The code would either not generate, or generate code with errors, if you did this beforehand. Now it's a die-fast stop hard error since this is absolultely always a wrong thing to do.
Reviewed By: dreiss
Test Plan: Test compiling a .thrift file with a repeated field identifier in a struct or arglist.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665379 13f79535-47bb-0310-9956-ffa450edef68
Summary: PHP is undebatably the worst programming language in the world. Class names are case insensitive, so new $tHiNg = new $THing. Garbase. Now autoload has to deal with the fallout.
Reviewed By: dreiss
Test Plan: autoload enabled falcon code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665375 13f79535-47bb-0310-9956-ffa450edef68
Summary: Potentailly breaks Java serialization for protocols that care about container termination.
Reviewed By: dreiss
Test Plan: Generate code, veirfy writeListEnd/writeSetEnd is in the apporpriate place
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665366 13f79535-47bb-0310-9956-ffa450edef68
Summary: That's just silly
Reviewed By: peter, dreiss
Test Plan: Generate PHP from a .thrift with no constants. Notice there is no _constants.php generated.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665355 13f79535-47bb-0310-9956-ffa450edef68
Summary: * move type field to tException from subclasses
* add backtrace to tException
* add oop:is_a
* on exit, wrap exceptions in {thrift_exception, E} ... otherwise can't distinguish e.g. exit:{{tBinProtException, {tException, ...}}, Stack} vs. exit:{tBinProtException, {tException, ...} -- I hate erlang
* all throws/exits to tException:throw which does the wrapping described above
Reviewed By: eletuchy
Test Plan: been using this code on my live server ^_^
Revert: OK
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665350 13f79535-47bb-0310-9956-ffa450edef68
Summary: Include thrift/autoload.php and use -phpa flag to generated code that works with autoload. Good for services with lots of methods that are typically not all invoked.
Reviewed By: dreiss
Test Plan: Falcon, baby, falcon.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665349 13f79535-47bb-0310-9956-ffa450edef68
Summary: If you reference enum types from an include you need to fully qualify their namespace in the generated C++ code.
Reviewed By: pfung
Test Plan: fbtypes code that pfung is using
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665345 13f79535-47bb-0310-9956-ffa450edef68
Summary: only return `ok' if it's an async, otherwise return the value of recv_
Reviewed By: cvarenhorst
Test Plan: my server works now
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665344 13f79535-47bb-0310-9956-ffa450edef68
Summary: Apparently adding the static array costs overhead since it must get preinitialized or something? It's unclear exactly what's going on here, but let's test to see if explicit lazy instantiation helps here.
Reviewed By: dreiss
Test Plan: See if this speeds up falcon loading
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665334 13f79535-47bb-0310-9956-ffa450edef68
Summary: Chopping the amount of code generated by Thrift for PHP services by two orders of magnitude (approx 25% of the previous size). This is done via putting more logic in a dynamic base class and taking it out of the generated code. Hopefully this wins back the CPU cycles paid just to load code from APC at the cost of a marginal increase in dynamic execution runtime.
Reviewed By: sgrimm, dreiss
Test Plan: Ran all the tests in trunk/test/php, also tested the API generate code and Falcon, etc. in my sandbox
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665328 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: root
Test Plan: Generate PHP code for a .thrift file with an include in it
Other Notes: Reviewed by Todd Lipcon from AmieStreet
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665325 13f79535-47bb-0310-9956-ffa450edef68
Summary:
How many times has no one else been able to use your awesome Python script
because the Thrift generated files are in a directory that they can't access?
Never again! We now create directories with mode 0777.
Of course, your process umask will ensure that they are actually created
with mode 0755. (This is how the mkdir command works.)
Reviewed By: mcslee
Test Plan:
Rebuilt thrift, then did this:
dreiss@dreiss-vmware:dir_mode:thrift/test$ rm -rf gen-*
dreiss@dreiss-vmware:dir_mode:thrift/test$ thrift -cpp -java -php -py ThriftTest.thrift
dreiss@dreiss-vmware:dir_mode:thrift/test$ ls -ld gen-*
drwx------ 2 dreiss dreiss 4096 2007-10-18 12:20 gen-cpp
drwx------ 3 dreiss dreiss 4096 2007-10-18 12:20 gen-java
drwx------ 2 dreiss dreiss 4096 2007-10-18 12:20 gen-php
drwx------ 3 dreiss dreiss 4096 2007-10-18 12:20 gen-py
dreiss@dreiss-vmware:dir_mode:thrift/test$ rm -rf gen-*
dreiss@dreiss-vmware:dir_mode:thrift/test$ ../compiler/cpp/thrift -cpp -java -php -py ThriftTest.thrift
dreiss@dreiss-vmware:dir_mode:thrift/test$ ls -ld gen-*
drwxr-xr-x 2 dreiss dreiss 4096 2007-10-18 12:20 gen-cpp
drwxr-xr-x 3 dreiss dreiss 4096 2007-10-18 12:20 gen-java
drwxr-xr-x 2 dreiss dreiss 4096 2007-10-18 12:20 gen-php
drwxr-xr-x 3 dreiss dreiss 4096 2007-10-18 12:20 gen-py
dreiss@dreiss-vmware:dir_mode:thrift/test$
Revert Plan: ok
Other Notes:
With some help from external contributor Ben Maurer.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665317 13f79535-47bb-0310-9956-ffa450edef68
Summary: if "cond and cond ->" is not valid erlang,
if "cond andalso cond ->" is.
Reviewed By: cpiro
Test Plan: generated erlang from and thrift file with structs ...
generated code compiles
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665314 13f79535-47bb-0310-9956-ffa450edef68
Summary: Adds php code generation to take advantage of the php
'thrift_protocol' extension (currently for deserialization only)
Requires you to swap your protocol for a TBinaryProtocolAccelerated
(which just inherits TBinaryProtocol without actually adding any
new functionality) and that you use a TFramedTransport or wrap your
transport in a TBufferedTransport.
TBinaryProtocolAccelerated is currently only in tfb/www/lib (or will
be momentarily).
Reviewed By: mcslee
Test Plan: synapse_feed uses this in my sandbox, works fine
Revert: svn
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665313 13f79535-47bb-0310-9956-ffa450edef68
Summary: Allows setting the output directory via the new '-o dir' cmdline option.
TSCons is updated to use this to put the output in the right place no matter
the cwd, so doing dependent builds from different directories won't break.
Reviewed By: martin
Test Plan: mkdir /tmp/honk; thrift -cpp -java -javabean -php -phpi -py -rb -xsd -perl -erl -ocaml -hs -cocoa -o /tmp/honk Tablet.thrift
Revert: svn
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665311 13f79535-47bb-0310-9956-ffa450edef68
Summary: This was still sending/expecting the old style (no version field); should be fixed now.
Reviewed By: mcslee
Test Plan: build and use Tablemaster and Tablet interfaces with gen-phpi
Revert: svn
DiffCamp Revision: 1435
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665306 13f79535-47bb-0310-9956-ffa450edef68
Summary: the client structures aren't oop objects, they're vanilla records ... adjust accordingly
Reviewed By: eletuchy
Test Plan: ok
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665300 13f79535-47bb-0310-9956-ffa450edef68