Commit Graph
48 Commits
Author SHA1 Message Date
Konstantin Varlamov 046e2997ef Fix small issues in C++ serializer and port remaining tests (#4012)
These were discovered by running integration tests using the new `Serializer`.

Also, port all the missing tests from `FSTSerializerBetaTests.mm` (that I could find).
2019-10-11 15:34:18 -04:00
wu-hui 3f1e2189cb Port remaining serializer methods (#3992) 2019-10-09 13:18:12 -04:00
Konstantin Varlamov 893002541b Serializer: implement encoding and decoding of Target (#3932) 2019-10-03 19:05:05 -04:00
Gil f750f87f9f Add CMake support for FSTLocalSerializer (#3753)
* Add support for building Objective-C protos in CMake

* Add support for building FSTLocalSerializer to CMake

* Build ProtoSizer with CMake

* Build memory components with CMake

* Build LevelDB components with CMake
2019-09-05 09:10:15 -07:00
Gil 58cae6c573 Misc Objective-C cleanups (#3751)
* Clean up references to Firestore.pbrpc

We're no longer using Objective-C gRPC services and this is no longer generated.

* Remove no longer existing entries from xcgmock
2019-09-04 11:39:13 -07:00
Brian Chen 2c86f3a4d7 Update protos to include IN and ARRAY_CONTAINS_ANY (#3510) 2019-08-06 13:33:16 -07:00
Brian Chen 86b09fa469 Add IN and ARRAY_CONTAINS_ANY (not publicly exposed) (#3492) 2019-08-05 11:47:06 -07:00
Gil 53d3ca199a CMake: Upgrade nanopb to 0.3.9.2 (#2985)
* Update nanopb to 0.3.9.2

This matches google3, even though 0.3.9.3 is out

* Regenerate protos with nanopb 0.3.9.2
2019-05-13 08:24:54 -07:00
Paul Beusterien 145c111d1a Minimum osx to 10.11 (#2680) 2019-03-29 16:26:27 -07:00
Gil 6af931d4e8 Migrate Firestore to the v1 protocol (#2200)
* Use python executable directly

  * python2 is not guaranteed to exist
  * scripts aren't directly executable on Windows

* Add Firestore v1 protos

* Point cmake at Firestore v1 protos

* Regenerate protobuf-related sources

* Make local protos refer to v1 protos

* fixup! Regenerate protobuf-related sources

* Remove v1beta1 protos

* s/v1beta1/v1/g in source.

* s/v1beta1/v1/ in the Xcode project

* Remove stale bug comments.

This was fixed by adding an explicit FieldPath API rather than exposing
escaping to the end user.
2018-12-21 11:28:48 -08:00
Konstantin Varlamov 8b1efabd82 gRPC: replace Objective-C implementation with the new C++ implementation (#2068)
* Revert "Revert "gRPC: replace Objective-C implementation with the new C++ implementation (#1968)" (#2030)"

This reverts commit ea567dca47.

* gRPC: fix bugs found during testing (#2039)

All in `GrpcStream`:
* make sure there are no pending completions when "finish" operation is enqueued;
* always finish gRPC calls;
* when connectivity changes, reset not just the calls, but the underlying channel as well.

* Revert "Partially revert "Update CHANGELOG for Firestore v0.14.0 (#2025)" (#2031)"

This reverts commit b2437b80f6.

* Update changelog for v0.15.0.

* gRPC: add gRPC wrapper classes to CMake build (#2015)

* add a C++ equivalent of `FIRFirestoreVersionString`. This eliminates the only Objective-C dependency of `grpc_connection.mm` and allows making it a pure C++ file;
* open-source `binary_to_array.py` script and use it in the build to embed `roots.pem` certificate file from gRPC into the Firestore binary. The embedded char array is then used to load certificate at runtime.

* Revert local change -- do not enable sanitizers by default
2018-11-13 11:51:06 -08:00
Sebastian Schmidt ab57eed6c8 Adding base_writes proto field (#2066) 2018-11-12 17:00:04 -08:00
Sebastian Schmidt b508201c2a Adding Numeric Add Proto message (#2064)
* Adding Numeric Add Proto message

* Remove trailing whitespace
2018-11-12 14:54:28 -08:00
Gil 7e5befc303 Isolate Firestore nanopb messages in C++ namespaces (#2046)
* Add C++ namespaces and use C++ linkage for nanopb-generated sources.
* Regenerate nanopb sources as C++
* Add generated C++ nanopb sources to the podspec
2018-11-05 05:50:53 -08:00
Gil ea567dca47 Revert "gRPC: replace Objective-C implementation with the new C++ implementation (#1968)" (#2030)
This reverts commit a514bd957a.
2018-11-01 08:37:32 -07:00
Konstantin Varlamov a514bd957a gRPC: replace Objective-C implementation with the new C++ implementation (#1968)
* add support for SSL disabled to `GrpcConnection` (unfortunately, there
  currently is no way to verify this change actually works);
* make gRPC calls using the C++ implementation:
* make `FSTRemoteStore` create C++ streams instead of their Objective-C
  counterparts;
* port https://github.com/firebase/firebase-js-sdk/pull/1041: streams
  are now never recreated, only restarted;
* make `FSTDatastore` delegate server calls to the C++ implementation;
* port `MockWatchStream` and `MockWriteStream` to C++ (`FSTMockDatastore` is
  still in place, because `Datastore` is not fully ported yet);
* no longer generate Objective-C gRPC service definitions from protos;
* remove all references to Objective-C gRPC client;
* check in gRPC root certificates file and load it at runtime (the check-in part
  is temporary until gRPC-C++.podspec provides the certificate). This makes SSL
  work.
2018-10-25 20:13:03 -04:00
Sebastian Schmidt 91297fdec0 Update Firestore Generated Protos (#1972) 2018-10-19 13:27:58 -07:00
Sebastian Schmidt e219c93193 Adding unknownDocument (#1948) 2018-10-15 12:30:12 -07:00
rsgowman f98239755a Fix building of objc protos (#1858)
All proto targets (objc, cpp, nanopb) now depend on the proto sources,
so they'll be rebuilt if the proto sources change.

Also updated Firestore/Protos/README.md to reflect recent changes.

Also update travis config to build the protos. (Previously, cpp and
nanopb were rebuilt, since they're used in the cmake build. But objc was
not since it's not actually depended on by anything in cmake.)
2018-09-21 15:33:40 -04:00
zxu f999fffbb6 fix common typo (#1833) 2018-09-17 13:00:50 -04:00
Gil e3531eb3c8 Always use the bytes type in nanopb instead of string (#1790)
* use_bytes_for_strings

* Regenerate nanopb sources
2018-09-07 12:14:36 -07:00
Gil e060e7f7c0 Use anonymous unions for oneofs in nanopb (#1789)
* Use anonymous unions for oneofs if they're the only one in a message.

* Regenerate nanopb sources
2018-09-07 11:41:09 -07:00
Gil 13d5c9ebae Enable malloc support in nanopb and mark up dynamic fields (#1788)
* Mark all dynamic and repeated fields as requiring malloc

* Remove nanopb options files

* Don't pass options-file to nanopb_cpp_generator

* Regenerate nanopb sources

No pb_callback_t fields remain

* Enable dynamic allocation support in the nanopb decoder
2018-09-07 11:32:32 -07:00
Gil 8e9f1781e6 Add a protoc plugin for nanopb (#1781)
* Initial nanopb_cpp_generator

* Use custom generator in build_protos.py
2018-09-07 11:19:52 -07:00
Gil c21dc7cb39 Generate Objective-C and C++ protos via CMake (#1780)
* Generate Objective-C proto messages.

* Generate C++ protos

* Delete build-protos.sh

* Rework CMake integration to be able to generate from nothing

* Split protoc and nanopb python generation (#1795)
2018-09-07 11:02:35 -07:00
Gil 7a9b5f8018 Start rewriting build-protos.sh as build_protos.py (#1777)
* Initial build_protos.py can regenerate nanopb

* Delegate to build_protos.py for nanopb

* Simplify CMake integration:
   * Generate python in a single pass
   * Pass python includes to build_protos
   * Generate nanopb in-place

* Use --no-timestamp in nanopb output
2018-09-07 08:43:58 -07:00
rsgowman e07e7b4d56 Build descriptor_pb2.py (#1775) 2018-09-04 16:24:57 -04:00
rsgowman bb045a5b90 Create process to build proto sources (#1704)
* Rename nanopb/.../*.pb.c to nanopb/.../*.nanopb.c

This ensures that all generated nanopb files use the same (sub)
extension of nanopb. This matches up with nanopb's --extension
parameter (which will be enabled later in this PR.)

* Remove references to NANOPB_PROTOC_BIN

Which wasn't being used, and wasn't pointing to a valid protoc.

* Add ability to generate protos from cmake build.

Currently, it's an entirely manual process via 'generate_protos' target.
This target is not automatically run during a build.

See Firestore/Protos/build-protos.sh for expected usage.

* cleanup/update license in build-protos.sh

* Build grpc proto sources (objc only)

* Use 32bit nanopb fields (instead of 16)

To match xcode build, but also to allow google/api/annotations.proto to
compile. (A recent change to nanopb now enforces this.) This isn't
strictly necessary, since we don't make use of that proto, so we
could've simply removed it instead (and in fact, the objc protos do
exactly that) but matching the xcode build certainly seems worthwhile.

* Rebuild all proto sources

* Skip whitespace checks on protoc generated files
2018-09-04 12:26:28 -04:00
Gil cda87fa3af Convert grpc and protobuf CMake builds to add_subdirectory (#1537)
* Build zlib with grpc's add_subdirectory

* Build grpc and its children with add_subdirectory.

* Build c-ares with grpc's add_subdirectory

* Convert protobuf to a download-only ExternalProject

* Temporarily break protobuf within grpc

This works because libgrpc has no actual dependency on protobuf

* Update boringssl to master@{2018-07-10}
2018-07-16 08:50:53 -07:00
Gil fb9f24eaee Convert googletest and nanopb CMake builds to add_subdirectory (#1522)
* Add a download-only boringssl ExternalProject

Match boringssl version to grpc submodule version

Note: not yet in use

* Split grpc into separate download and build tasks

This allows other external targets to download into the gRPC source tree
before grpc is actually built.

* Convert grpc to an http download

* Build googletest with add_subdirectory

Also:
  * Revert library-name modifications in the abseil-cpp build
  * Move abseil-cpp add_subdirectory build into place

* Build nanopb with add_subdirectory

* Force nanopb first to work around ODR violations

This is a temporary work-around for b/111328563.
2018-07-13 11:09:44 -07:00
Gil 7fc953fc6f Firestore CMake cleanup (#1510)
* Pull out sanitizer options into a separate file

* Reorder packages

* Remove the extra "external/$target" directory from PREFIX

Instead of BINARY_DIR/external/foo/src/foo the contents will be in
BINARY_DIR/src/foo.

* Make libprotobuf-nanopb targets line up with nanopb's CMakeLists.txt

* Fix CMake style
2018-07-11 15:55:36 -07:00
Gil f23e21ce96 Check CMake files for copyrights (#1509)
* Check CMake files for copyrights

* Add missing copyright
2018-07-10 09:05:11 -07:00
Gil 3722deff12 Install protobuf during CMake build (#1460)
* Install protobuf

  * Use the built-in FindProtobuf.cmake
  * Add additional build configuration flags
  * Preserve generator configuration in the protobuf sub-build

    Without this, the build fails on Win64 because the default
    configuration builds a Win32 libprotobuf and the Win64 build rejects
    it.
  * Wire the installed protobuf into the gRPC build.

* Install nanopb
2018-06-26 15:05:28 -07:00
rsgowman ce61f4e0e6 Rename nanopb generated headers from foo.pb.h to foo.nanopb.h (#1371)
This avoids a collision with the libprotobuf generated files.

Also removes the "well-known" cpp protos, relying on libprotobuf to supply these instead.
2018-06-04 13:02:31 -04:00
rsgowman 6dfc142888 Adjust serializer test to verify via libprotobuf. (#1039)
Previously, the tests would compare serialization results against a
precomputed (via protoc) array of bytes. Now they serialize via our
nanopb based class and deserialize via libprotobuf (and vice versa) and
then ensure the result is the same as the input
2018-04-24 11:31:58 -04:00
Michael Lehenbauer 6f2ef7d389 Update protos. (#1075) 2018-04-12 09:08:18 -07:00
Michael Lehenbauer 09e4eddd82 Rebuild proto artifacts from existing sources and update README.md instructions. (#1058) 2018-04-11 08:55:42 -07:00
rsgowman a335d78a62 Only add nanopb proto headers to the -I path when depending on the nanopb protos. (#982)
This is motivated by wanting to use libprotobuf in the project too, but
it's also sensible by itself.
2018-03-27 13:43:17 -04:00
rsgowman fe19fca0e5 Serialize and deserialize null (#783)
* Build (grpc's) nanopb with -DPB_FIELD_16BIT

We require (at least) 16 bit fields. (By default, nanopb uses 8 bit
fields, ie allowing up to 256 field tags.)

Also note that this patch adds this to grpc's nanopb, rather than to our
nanopb. We'll need to eventually either:
a) we instruct grpc to use our nanopb
b) we rely on grpc's nanopb instead of using our own.

(^ marked as a TODO for now.)

* Add some dependant protos

Imported from protobuf. Nanopb requires these to be present (though
anything using libprotobuf does not, as these are already built into
that.)

* Add generated nanopb protos based off of newly added proto definitions

* Build the nanopb protos

* Serialize and deserialize null
2018-02-13 17:46:09 -05:00
Greg Soltis 5f5f808258 Keep track of number of queries in the query cache (#776)
* Implement schema versions

* Style fixes

* newlines, copyrights, assumptions

* Fix nullability

* Raw ptr -> shared_ptr

* kVersionTableGlobal -> kVersionGlobalTable

* Drop utils, move into static methods

* Drop extra include

* Add a few more comments

* Move version constant into migrations file

* formatting?

* Fix comment

* Split add and update queryData

* Work on adding targetCount

* More work on count

* Using shared_ptr

* Implement count for query cache

* use quotes

* Add cast

* Styling

* Revert year bump in copyright

* Add adversarial key to migration test

* Add comment

* Fix style
2018-02-13 11:12:17 -08:00
Rich Gowman fd0b332f46 Downgrade nanopb from 0.4.0-dev to 0.3.8.
Also regenerate the protos
2018-02-06 10:02:30 -05:00
Rich Gowman 9a71ce8e67 Import "well-known" protos (and generated nanopb files)
For use by nanopb (which otherwise doesn't know what to do with these.)
2018-02-06 10:02:30 -05:00
Rich Gowman 78e16f52a5 Add generated nanopb protos.
100% machine generated (except adding of the license).
2018-02-06 10:02:30 -05:00
Rich Gowman 11d28d80ff Add instructions for building nanopb protos
Currently only supported on osx
2018-02-06 10:02:30 -05:00
Gil 4acdbdbdf3 Revert "Fully qualify protoc-generated outputs (#626)" (#653)
This reverts commit bc74670afe.
2018-01-11 14:47:25 -08:00
Gil bc74670afe Fully qualify protoc-generated outputs (#626)
* Fully-qualify imports in the protocol compiler output

* pbxproj updates from running pod update

* New checked-in proto outputs
2018-01-08 08:52:37 -08:00
Gil 4fbc96904f Use fully qualified imports in Firestore (#467)
This simplifies the import process back into google3 and allows us to add additional directories to the project without needing to update the project files for each directory we add. This shows up most clearly in the change to Firestore/Example/Firestore.xcodeproj/project.pbxproj: this no longer needs to list essentially every directory in the project as a header search path.

* Clang-format configuration for C++ files
* Add support C++-only sources to the podspec
* Podspec support for fully qualified imports
* xcodeproj changes for fully-qualified imports
* Use fully-qualified imports in Firestore sources
2017-11-16 20:52:01 -08:00
Gil bde743ed25 Release 4.3.0 (#327)
Initial release of Firestore at 0.8.0
Bump FirebaseCommunity to 0.1.3
2017-10-03 08:55:22 -07:00