Commit Graph

9181 Commits

Author SHA1 Message Date
Adam Cozzette
f59a5845a3 Add new unit test protos to setup.py 2022-03-03 22:25:43 +00:00
Adam Cozzette
839f0f8e06 Add missing GSON dependency 2022-03-03 22:03:15 +00:00
Thomas Van Lenten
bb4302e878 Add a generation option to control use of forward declarations in headers.
Swift importing ObjC drops methods/properties if the type is only a forward
declaration since the type is incomplete. Historically the generator has always
use forward declarations to reduce how much will have rebuild when a proto file
does change; but that puts it at odds with Swift. If ObjC Protos end up spanning
Swift modules, the Swift import behavior could become a problem; so this option
provides a control for the behavior. The current behavior is to continue forward
declarations, but eventually the default will be changed.

Generate the WKTs using imports instead of forward decls.
2022-03-03 16:05:18 -05:00
Adam Cozzette
e29b4e3bc2 Update Makefile.am with new Python files 2022-03-03 17:58:57 +00:00
Adam Cozzette
615d214ade Update CHANGES.txt 2022-03-03 17:25:11 +00:00
Adam Cozzette
b0f9799a7c Sync from Piper @432209397
PROTOBUF_SYNC_PIPER
2022-03-03 17:18:16 +00:00
kunhtkun
5f632bef38
[editors/emacs] Fix protobuf-mode definition (#9572)
Fix a few issues with the Emacs mode definition.

First, in 1ab7789f3 (2021-10-13, Emacs: Protobuf mode should be derived from
prog-mode) we made `protobuf-mode' a derived mode of `prog-mode' using the
`define-derived-mode' macro[1]. However, the definition body was not updated
accordingly. So in this commit, we:

- Remove the superfluous `(interactive)' form;
- Remove the unnecessary call of `kill-all-local-variables', which is already
  handled by `define-derived-mode' and could cause a few issues, for example,
  it prevents `prog-mode-hook' from being run;
- Remove forms that set `major-mode' and `mode-name', which are automatically
  set to the first and third arguments respectively;
- Remove forms that set key map, syntax table, and abbrev table, which are
  already handled automatically;
- Do not run `protobuf-mode-hook' explicitly in the body. It is already arranged
  to be run after the body.

Second, the call to `c-make-emacs-variables-local' is removed. It is called
inside `c-init-language-vars' already. Calling it again should do no harm now,
but to be future-proof it might be better to just remove it.

Finally, we move the `c-update-modeline' form to the :after-hook argument to
ensure it is run at the very end, so that the mode line will reflect all user
customizations done in various mode hooks. Similarly, we run
`c-mode-common-hook' also at the very end to leave a place for user
customizations (for example, set `imenu-generic-expression' in
`c-mode-common-hook').

[1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Derived-Modes.html

Re: https://github.com/protocolbuffers/protobuf/issues/7316
Re: https://github.com/protocolbuffers/protobuf/pull/9076
2022-03-03 09:16:46 -08:00
Adam Cozzette
038b479119
Merge pull request #9570 from acozzette/sync-stage
Integrate from Piper for C++, Java, and Python
2022-03-02 14:23:54 -08:00
Adam Cozzette
5faa6123d1 Reimplement the type sorter to avoid a ICE in gcc 4.8.2.
Thanks to @sbenzaquen for this fix.
2022-03-02 20:54:57 +00:00
Adam Cozzette
1c51f9fb39 Undo unintentional file list changes 2022-03-02 20:50:28 +00:00
Adam Cozzette
f7232f2aa3 Replace EasyMock dependency with Mockito and re-pin Bazel deps 2022-03-02 19:27:59 +00:00
Adam Cozzette
23b2fe6e39 Update CHANGES.txt 2022-03-02 17:44:18 +00:00
Adam Cozzette
76398dab31 Sync from Piper @431959314
PROTOBUF_SYNC_PIPER
2022-03-02 17:37:55 +00:00
Adam Cozzette
0ece18cf2e Merge tag 'refs/tags/sync-piper' into sync-stage 2022-03-02 17:37:55 +00:00
Arfrever
1d13b60904
cmake: Use linker version scripts (#9545)
Autotools build system already uses linker version scripts since
commit 13d165de9e.

Fixes: #6113
2022-03-01 17:06:14 -08:00
Joshua Haberman
2a001f792f
Merge pull request #9556 from ntkme/ruby-suppress-warning
Suppress warning for intentional circular require
2022-03-01 15:24:43 -08:00
Thomas Van Lenten
020e4e33d1 Simplify imports of the WKTs within the library itself.
Overdue followup to https://github.com/protocolbuffers/protobuf/pull/7173

Since all the files are at the same level as the runtime headers, there is no
need for things to be framework based imports, they should all just work like
the other headers do.

- Directly generate the bundled header imports into the preamble section when
  generating for a bundled proto.
- Update the preamble generation to skip the CPP wrapper when generating for a
  bundled proto file.
- Regenerate the WKTs.
- Update GPBProtocolBuffer.h/GPBWellKnownTypes.h to also skip the CPP wrapping.

GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS in the podspec and non bundled files still
has to exist because that comes into play for those files to find the runtime
headers.
2022-03-01 17:01:33 -05:00
deannagarcia
4b0871e205
Merge pull request #9560 from protocolbuffers/ktJvmOut
Add bazel rules to do Kotlin mvn exports
2022-03-01 10:53:24 -08:00
Thomas Van Lenten
76ba220c38 And an overload for ValidateObjCClassPrefixes().
This version defaults all the options, so folks don't have to pass it.

Since Options never had a PROTOC_EXPORT, it isn't immediately clear how well the
existing api worked for any shared lib cases, so this should give a simpler api
for the basic usage (if anyone wants to use it).
2022-03-01 10:46:27 -05:00
Thomas Van Lenten
d9048081b2 Remove the non prefix validation options from Options.
The other generation options never were in the Options structure and
ImportWriter was the only thing that needed some the non validation options and
it already required directly passing the options. So refine Options to just be
validation options and bundle all the File related generation options into
a new FileGenerator specific GenerationOptions.
2022-03-01 10:46:27 -05:00
Thomas Van Lenten
14e445bc34 Stop passing generation options thru the graph.
They never were needed below file, and they really are specific to two high
level case, so don't pass them every where else.
2022-03-01 10:46:27 -05:00
Deanna Garcia
933239f8c3 Update build files 2022-03-01 00:27:42 +00:00
deannagarcia
c578f59fc8
Merge pull request #9558 from protocolbuffers/exe-extensions
Change toolchain artifact name patterns
2022-02-28 12:51:03 -08:00
Deanna Garcia
93b4fa6fc7 Only exe extension for windows 2022-02-28 20:00:45 +00:00
Deanna Garcia
aafcb92f62 kotlin core maven export 2022-02-28 18:28:50 +00:00
なつき
6c8bda86fe Suppress warning for intentional circular require 2022-02-27 13:15:57 -08:00
Greg Miller
cbc9826db7
Merge pull request #9555 from devjgm/ignore-clangd-files 2022-02-26 15:15:52 -05:00
Greg Miller
ee429aea17 chore: gitignore ephemeral files that clangd uses
This PR tells git to ignore ephemeral files that are created when
developers use clangd.

clangd needs a `compile_commands.json` file at the root of the repo (or
in a `build/` directory) to tell it how to compile each file. CMake can
generate this file with something like the following:

```console
$ cmake -Scmake -B.build \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  -Dprotobuf_BUILD_TESTS=OFF
$ ln -sf .build/compile_commands.json .
```

Then clangd will compile and index files into the `.cache` directory.
2022-02-25 21:13:50 -05:00
Adam Cozzette
b44784cf30
Fix update_version.py script (#9554)
Two small fixes to update_version.py:
- The regex for updating SOVERSION in cmake files was not quite right. I
  fixed it to reflect that the value is a plain integer and not of the
  form x.y.z
- For some reason the code for updating PHP_PROTO_VERSION appeared 3
  times and led to a spurious warning, so I removed the extra calls
  there.
2022-02-25 15:30:07 -08:00
Jason Lunn
1a10c58c2f
Merge pull request #9549 from JasonLunn/jruby-release-bump
Update JRuby 9.2.19.0 -> 9.2.20.1 and 9.3.0.0 to 9.3.3.0.
2022-02-25 17:12:30 -05:00
deannagarcia
4738b8ee08
Merge pull request #9553 from protocolbuffers/deannagarcia-patch-2
Make protoc executable names consistent
2022-02-25 10:47:07 -08:00
deannagarcia
5b3f853d7d
Make protoc executable names consistent
Rename ppc64 cpu to ppcle_64 to match current release.
2022-02-25 10:45:28 -08:00
Dimitris Koutsogiorgas
89c40311db Rename proto_package_to_prefix_mappings_path to package_to_prefix_mappings_path. 2022-02-25 13:10:36 -05:00
deannagarcia
b9bcec8ac3
Merge pull request #9537 from protocolbuffers/deannagarcia-patch-1
Fix package naming rule
2022-02-25 09:47:41 -08:00
Jason Lunn
df0999141e Update JRuby 9.2.19.0 -> 9.2.20.1 and 9.3.0.0 to 9.3.3.0. 2022-02-25 14:11:12 +00:00
Thomas Van Lenten
6a77c9bab4 Make the ObjC support conditional to darwin.
Fixes #9392
2022-02-24 17:39:04 -05:00
Thomas Van Lenten
e8470340e0 Rename ExpectedPrefixesCollector to PackageToPrefixesCollector
Now that two files use the format, tweak the naming to the format for the file
vs. the usage(s).

Also add a "usage" param so the two places can provide a little context for any
error messages generated while parsing.
2022-02-24 16:11:10 -05:00
deannagarcia
a5168a6e96
Fix package naming rule
Remove quotes around CPU since we want the variable evaluated instead of the string. This will allow the win64 build to get the correct name.
2022-02-23 16:45:56 -08:00
Dimitris Koutsogiorgas
a112c4ab96 Add prefix_to_proto_package_mappings_path ObjC option. 2022-02-23 14:26:53 -05:00
Arfrever
d0c06bcd93
cmake: Set correct sonames for libprotobuf-lite.so and libprotoc.so (#9529)
Soname was set for libprotobuf.so in commit a9cf69a0ed,
but similar changes for libprotobuf-lite.so and libprotoc.so were missed.

Fixes: #8635

Co-authored-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@GMail.Com>
2022-02-22 15:53:14 -08:00
Dimitris Koutsogiorgas
db56692883 Revert "objective-c: Add objc_class_prefix generation option."
This reverts commit b5ab0b7a18.
2022-02-22 14:24:41 -05:00
Jorg Brown
2f91da585e
Merge pull request #9528 from dlj-NaN/sync-stage
Integrate from Piper for C++, Java, and Python
2022-02-18 15:32:19 -08:00
David L. Jones
951582e893 Update changelog 2022-02-18 14:07:43 -08:00
David L. Jones
7ba5fa3d96 Merge tag 'refs/tags/sync-piper' into sync-stage 2022-02-18 14:02:13 -08:00
David L. Jones
3ab97ce830 Sync from Piper @429642851
PROTOBUF_SYNC_PIPER
2022-02-18 14:02:12 -08:00
Jorg Brown
763d85293d
Merge pull request #9525 from dlj-NaN/sync-stage
Integrate from Piper for C++, Java, and Python
2022-02-18 12:15:58 -08:00
deannagarcia
ddfc233f57
Merge pull request #9524 from protocolbuffers/sysroot
Change sysroot flags
2022-02-18 11:02:52 -08:00
David L. Jones
20c5b6fd14 Update changelog 2022-02-17 18:01:44 -08:00
David L. Jones
2fbda76fad Sync from Piper @429445371
PROTOBUF_SYNC_PIPER
2022-02-17 18:00:38 -08:00
Deanna Garcia
cf05c9f84f Change sysroot flags 2022-02-18 00:39:23 +00:00