Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: protocolbuffers/protobuf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: mockingbirdnest/protobuf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Oct 30, 2018

  1. Merge .gitignore

    pleroy committed Oct 30, 2018
    Copy the full SHA
    d0ab981 View commit details
  2. All the MSVC changes needed to upgrade to v3.1.0.

    Change include paths
    
    Put the files in the right project, add dependencies.
    
    Inline dance.
    
    Separation between lite and tests.
    
    This might link.
    
    Get the exe at the right place.
    
    Test all the languages.
    
    Property sheet.
    
    Add new files to the various projects.
    
    remove redundant config
    
    x64
    
    IntDir
    
    OutDir
    
    props
    
    paths
    
    paths
    
    more protoc path
    
    protoc all the things
    
    Protoc and lite-test compiling.
    
    Everything links.
    
    Fix reference to plugin.
    
    /bigobj and fixes to directories.
    
    Relative paths.
    pleroy committed Oct 30, 2018
    Copy the full SHA
    9ddcb96 View commit details
  3. All the source changes needed to upgrade to v3.1.0.

    Source bit of b0527f16.
    
    Source bit of acada297.
    pleroy committed Oct 30, 2018
    Copy the full SHA
    19f6481 View commit details
  4. Copy the full SHA
    d209c31 View commit details
  5. Copy the full SHA
    fdce4eb View commit details
  6. Copy the full SHA
    115ea35 View commit details
  7. Check-in generated code.

    pleroy committed Oct 30, 2018
    Copy the full SHA
    b16a4d2 View commit details
  8. Remove silly MSVC warning.

    pleroy committed Oct 30, 2018
    Copy the full SHA
    59ea8b3 View commit details
  9. Copy the full SHA
    182393b View commit details
  10. copy project

    eggrobin authored and pleroy committed Oct 30, 2018
    Copy the full SHA
    aa6c1c6 View commit details
  11. missing cc, and make _dynamic a DLL

    eggrobin authored and pleroy committed Oct 30, 2018
    Copy the full SHA
    7e34133 View commit details
  12. consistency with glog

    eggrobin authored and pleroy committed Oct 30, 2018
    Copy the full SHA
    a432ad4 View commit details
  13. Copy the full SHA
    4357a70 View commit details
  14. Visual Studio 2017

    pleroy committed Oct 30, 2018
    Copy the full SHA
    c1bbb33 View commit details
  15. Fix references

    pleroy committed Oct 30, 2018
    Copy the full SHA
    a78e5e2 View commit details
  16. Copy the full SHA
    2e72885 View commit details
  17. lite-test project too

    pleroy committed Oct 30, 2018
    Copy the full SHA
    f2e3054 View commit details
  18. /GL and /LTCG in Release mode

    pleroy committed Oct 30, 2018
    Copy the full SHA
    d404f3e View commit details
  19. Compile the proto compiler.

    pleroy committed Oct 30, 2018
    Copy the full SHA
    4232a44 View commit details

Commits on Oct 31, 2018

  1. Remove nonexistent tests.

    pleroy committed Oct 31, 2018
    Copy the full SHA
    3c2d4e3 View commit details

Commits on Nov 2, 2018

  1. Copy the full SHA
    10ab0fe View commit details
  2. Remove Win32.

    pleroy committed Nov 2, 2018
    Copy the full SHA
    ce8010e View commit details
  3. Remove js_embed.

    pleroy committed Nov 2, 2018
    Copy the full SHA
    ac8f146 View commit details

Commits on Jan 6, 2019

  1. Copy the full SHA
    6cc64ed View commit details

Commits on Jun 9, 2019

  1. Compiler upgrade.

    pleroy committed Jun 9, 2019
    Copy the full SHA
    7b74eb5 View commit details
  2. Copy the full SHA
    5423ce2 View commit details
  3. Fix paths.

    pleroy committed Jun 9, 2019
    Copy the full SHA
    0538352 View commit details

Commits on Nov 30, 2019

  1. vectorcall

    eggrobin committed Nov 30, 2019
    Copy the full SHA
    f26f380 View commit details

Commits on Apr 10, 2020

  1. principia_make

    eggrobin committed Apr 10, 2020
    Copy the full SHA
    cbfc5a3 View commit details
  2. remove empty override

    eggrobin committed Apr 10, 2020
    Copy the full SHA
    157c7de View commit details
  3. Merge pull request #4 from eggrobin/principia_make

    principia_make
    eggrobin authored Apr 10, 2020
    Copy the full SHA
    8b10697 View commit details

Commits on Jun 6, 2021

  1. Get glog from the right path.

    pleroy committed Jun 6, 2021
    Copy the full SHA
    a7d80fb View commit details

Commits on Jul 11, 2021

  1. Copy the full SHA
    a837ac9 View commit details

Commits on Apr 7, 2023

  1. Upgrade to VS2022.

    pleroy committed Apr 7, 2023
    Copy the full SHA
    b733262 View commit details
  2. Merge pull request #5 from mockingbirdnest/VS2022

    Upgrade to VS2022
    pleroy authored Apr 7, 2023
    Copy the full SHA
    ab14007 View commit details

Commits on May 14, 2023

  1. Build action

    pleroy committed May 14, 2023
    Copy the full SHA
    2f8c8eb View commit details
  2. Typo

    pleroy committed May 14, 2023
    Copy the full SHA
    e1020d1 View commit details
  3. Bad artifact name

    pleroy committed May 14, 2023
    Copy the full SHA
    02dcf15 View commit details
  4. Try with better globs

    pleroy committed May 14, 2023
    Copy the full SHA
    a79625f View commit details
  5. Try with better globs

    pleroy committed May 14, 2023
    Copy the full SHA
    e98191e View commit details
  6. Try with better globs

    pleroy committed May 14, 2023
    Copy the full SHA
    5a2a681 View commit details
  7. Try with better globs

    pleroy committed May 14, 2023
    Copy the full SHA
    067748c View commit details
  8. Try with better globs

    pleroy committed May 14, 2023
    Copy the full SHA
    86de436 View commit details
  9. Headers

    pleroy committed May 14, 2023
    Copy the full SHA
    7a7fb83 View commit details
  10. @main

    pleroy committed May 14, 2023
    Copy the full SHA
    d1c8ac0 View commit details
  11. Merge pull request #6 from mockingbirdnest/WF

    Build workflow
    pleroy authored May 14, 2023
    Copy the full SHA
    3e151d9 View commit details

Commits on May 18, 2023

  1. Signature

    pleroy committed May 18, 2023
    Copy the full SHA
    83204ae View commit details
  2. Review

    pleroy committed May 18, 2023
    Copy the full SHA
    38d0372 View commit details
  3. Merge pull request #7 from mockingbirdnest/WF

    Use the new actions
    pleroy authored May 18, 2023
    Copy the full SHA
    4c809c8 View commit details

Commits on Aug 20, 2023

  1. Add workflow_dispatch.

    pleroy authored Aug 20, 2023
    Copy the full SHA
    01c7e6f View commit details
Showing with 52,954 additions and 36 deletions.
  1. +29 −0 .gitattributes
  2. +53 −0 .github/workflows/build.yaml
  3. +38 −0 .gitignore
  4. +3 −22 generate_descriptor_proto.sh
  5. +15 −0 principia_make.sh
  6. +1 −1 src/google/protobuf/arena.h
  7. +1 −0 src/google/protobuf/compiler/command_line_interface_unittest.cc
  8. +27 −8 src/google/protobuf/compiler/cpp/cpp_file.cc
  9. +5 −5 src/google/protobuf/io/zero_copy_stream_unittest.cc
  10. +6 −0 src/google/protobuf/wire_format_lite.h
  11. +440 −0 src/tmp/google/protobuf/any.pb.cc
  12. +323 −0 src/tmp/google/protobuf/any.pb.h
  13. +1,608 −0 src/tmp/google/protobuf/api.pb.cc
  14. +1,165 −0 src/tmp/google/protobuf/api.pb.h
  15. +1,773 −0 src/tmp/google/protobuf/compiler/plugin.pb.cc
  16. +1,361 −0 src/tmp/google/protobuf/compiler/plugin.pb.h
  17. +14,157 −0 src/tmp/google/protobuf/descriptor.pb.cc
  18. +11,497 −0 src/tmp/google/protobuf/descriptor.pb.h
  19. +431 −0 src/tmp/google/protobuf/duration.pb.cc
  20. +232 −0 src/tmp/google/protobuf/duration.pb.h
  21. +342 −0 src/tmp/google/protobuf/empty.pb.cc
  22. +190 −0 src/tmp/google/protobuf/empty.pb.h
  23. +373 −0 src/tmp/google/protobuf/field_mask.pb.cc
  24. +267 −0 src/tmp/google/protobuf/field_mask.pb.h
  25. +381 −0 src/tmp/google/protobuf/source_context.pb.cc
  26. +243 −0 src/tmp/google/protobuf/source_context.pb.h
  27. +1,475 −0 src/tmp/google/protobuf/struct.pb.cc
  28. +1,030 −0 src/tmp/google/protobuf/struct.pb.h
  29. +431 −0 src/tmp/google/protobuf/timestamp.pb.cc
  30. +232 −0 src/tmp/google/protobuf/timestamp.pb.h
  31. +2,844 −0 src/tmp/google/protobuf/type.pb.cc
  32. +2,383 −0 src/tmp/google/protobuf/type.pb.h
  33. +2,796 −0 src/tmp/google/protobuf/wrappers.pb.cc
  34. +1,487 −0 src/tmp/google/protobuf/wrappers.pb.h
  35. +31 −0 vsprojects/config.h
  36. +15 −0 vsprojects/google_glog.props
  37. +15 −0 vsprojects/google_googlemock_main.props
  38. +16 −0 vsprojects/google_googletest.props
  39. +16 −0 vsprojects/google_googletest_main.props
  40. +207 −0 vsprojects/libprotobuf-lite.vcxproj
  41. +183 −0 vsprojects/libprotobuf-lite.vcxproj.filters
  42. +324 −0 vsprojects/libprotobuf.vcxproj
  43. +522 −0 vsprojects/libprotobuf.vcxproj.filters
  44. +110 −0 vsprojects/libprotobuf_dynamic.rc
  45. +330 −0 vsprojects/libprotobuf_dynamic.vcxproj
  46. +530 −0 vsprojects/libprotobuf_dynamic.vcxproj.filters
  47. +335 −0 vsprojects/libprotoc.vcxproj
  48. +549 −0 vsprojects/libprotoc.vcxproj.filters
  49. +314 −0 vsprojects/lite-test.vcxproj
  50. +76 −0 vsprojects/lite-test.vcxproj.filters
  51. +14 −0 vsprojects/portability_macros.props
  52. +70 −0 vsprojects/protobuf.sln
  53. +182 −0 vsprojects/protoc.vcxproj
  54. +22 −0 vsprojects/protoc.vcxproj.filters
  55. +14 −0 vsprojects/resource.h
  56. +217 −0 vsprojects/test_plugin.vcxproj
  57. +32 −0 vsprojects/test_plugin.vcxproj.filters
  58. +800 −0 vsprojects/tests.vcxproj
  59. +391 −0 vsprojects/tests.vcxproj.filters
29 changes: 29 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

# Test data files
**/testdata/*.txt eol=lf

# Generated files
**/descriptor.pb.* eol=lf
**/plugin.pb.* eol=lf
53 changes: 53 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build

on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
workflow_dispatch:

env:
PRINCIPIA_HEADERS_PROTOBUF: src
PRINCIPIA_MSVC_PROTOBUF: vsprojects

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Debug, Release]
steps:
- name: Checkout source files
uses: actions/checkout@v3

- name: Initialize build environment
uses: mockingbirdnest/actions/windows/initialize_build@main
with:
configuration: ${{ matrix.configuration }}

- name: Download glog artifact
uses: mockingbirdnest/actions/windows/download_artifact@main
with:
name: glog
configuration: ${{ matrix.configuration }}

- name: Download googletest artifact
uses: mockingbirdnest/actions/windows/download_artifact@main
with:
name: googletest
configuration: ${{ matrix.configuration }}

- name: Rebuild ${{ matrix.configuration }}
uses: mockingbirdnest/actions/windows/rebuild@main
with:
configuration: ${{ matrix.configuration }}
solution_directory: ${{ env.PRINCIPIA_MSVC_PROTOBUF }}

- name: Upload artifact
uses: mockingbirdnest/actions/windows/upload_artifact@main
with:
name: protobuf
configuration: ${{ matrix.configuration }}
headers_directory: ${{ env.PRINCIPIA_HEADERS_PROTOBUF }}
solution_directory: ${{ env.PRINCIPIA_MSVC_PROTOBUF }}
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
# Windows junk files
[Tt]humbs.db
*.DS_Store

# Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.unsuccessfulbuild
*.vc.opendb
*.VC.db
ipch/
[Oo]bj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/

# Protobuf generated files.
*.pb.h
*.pb.cc

# autogen.sh-generated files
Makefile.in
src/Makefile.in
25 changes: 3 additions & 22 deletions generate_descriptor_proto.sh
Original file line number Diff line number Diff line change
@@ -51,7 +51,8 @@ while [ $# -gt 0 ]; do
esac
shift
done
TMP=$(mktemp -d)
TMP=tmp
mkdir ${TMP}
echo "Updating descriptor protos..."
while [ $CORE_PROTO_IS_CORRECT -ne 1 ]
do
@@ -62,12 +63,7 @@ do
PROTOC=$BOOTSTRAP_PROTOC
BOOTSTRAP_PROTOC=""
else
make $@ protoc
if test $? -ne 0; then
echo "Failed to build protoc."
exit 1
fi
PROTOC="./protoc"
PROTOC="../vsprojects/Debug/Win32/protoc.exe"
fi

$PROTOC --cpp_out=dllexport_decl=PROTOBUF_EXPORT:$TMP ${RUNTIME_PROTO_FILES[@]} && \
@@ -98,18 +94,3 @@ do
PROCESS_ROUND=$((PROCESS_ROUND + 1))
done
cd ..

if test -x objectivec/generate_well_known_types.sh; then
echo "Generating messages for objc."
objectivec/generate_well_known_types.sh $@
fi

if test -x csharp/generate_protos.sh; then
echo "Generating messages for C#."
csharp/generate_protos.sh $@
fi

if test -x php/generate_descriptor_protos.sh; then
echo "Generating messages for PHP."
php/generate_descriptor_protos.sh $@
fi
15 changes: 15 additions & 0 deletions principia_make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
./autogen.sh

# NOTE(Norgg): Really definitely needs to run twice on Ubuntu for some reason.
# See
# https://github.com/mockingbirdnest/Principia/commit/8be8f78eee44f384e1658f546,
# https://github.com/mockingbirdnest/Principia/commit/00f9d280a9054894dd22e1170.
./autogen.sh

./configure \
CC=clang \
CXX=clang++ \
CXXFLAGS="${CXX_FLAGS?}" \
LDFLAGS="${LD_FLAGS?}" \
LIBS="-lc++ -lc++abi"
make -j8
2 changes: 1 addition & 1 deletion src/google/protobuf/arena.h
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ struct ArenaOptions {
max_block_size(kDefaultMaxBlockSize),
initial_block(NULL),
initial_block_size(0),
block_alloc(&::operator new),
block_alloc(+[](size_t size) { return ::operator new(size); }),
block_dealloc(&internal::arena_free),
on_arena_init(NULL),
on_arena_reset(NULL),
Original file line number Diff line number Diff line change
@@ -320,6 +320,7 @@ void CommandLineInterfaceTest::RunWithArgs(std::vector<string> args) {
".libs/test_plugin.exe", // Win32 w/autotool (Cygwin / MinGW)
"test_plugin.exe", // Other Win32 (MSVC)
"test_plugin", // Unix
SOLUTION_DIR CONFIGURATION "\\" PLATFORM_NAME "\\test_plugin.exe",
};
for (int i = 0; i < GOOGLE_ARRAYSIZE(possible_paths); i++) {
if (access(possible_paths[i], F_OK) == 0) {
35 changes: 27 additions & 8 deletions src/google/protobuf/compiler/cpp/cpp_file.cc
Original file line number Diff line number Diff line change
@@ -809,13 +809,6 @@ void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) {
"\n",
message_generators_.size());

// Now generate the AddDescriptors() function.
format(
"::$proto_ns$::internal::DescriptorTable $1$ = {\n"
" false, $init_defaults$, \n",
UniqueName("descriptor_table", file_, options_));
format.Indent();

// Embed the descriptor. We simply serialize the entire
// FileDescriptorProto
// and embed it as a string literal, which is parsed and built into real
@@ -825,7 +818,33 @@ void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) {
string file_data;
file_proto.SerializeToString(&file_data);

{
if (file_data.size() > 65535) {
// Workaround for MSVC: "Error C1091: compiler limit: string exceeds 65535
// bytes in length". Declare a static array of characters rather than use
// a string literal. Only write 25 bytes per line.
static const int kBytesPerLine = 25;
format("const char $assign_desc_table$_char[] = {\n");
format.Indent();
for (int i = 0; i < file_data.size();) {
for (int j = 0; j < kBytesPerLine && i < file_data.size(); ++i, ++j) {
format("'$1$', ", CEscape(file_data.substr(i, 1)));
}
format("\n");
}
format("'\\0' };\n\n");
format.Outdent();
}

// Now generate the AddDescriptors() function.
format(
"::$proto_ns$::internal::DescriptorTable $1$ = {\n"
" false, $init_defaults$, \n",
UniqueName("descriptor_table", file_, options_));
format.Indent();

if (file_data.size() > 65535) {
format("$assign_desc_table$_char");
} else {
// Only write 40 bytes per line.
static const int kBytesPerLine = 40;
for (int i = 0; i < file_data.size(); i += kBytesPerLine) {
10 changes: 5 additions & 5 deletions src/google/protobuf/io/zero_copy_stream_unittest.cc
Original file line number Diff line number Diff line change
@@ -799,11 +799,11 @@ class MsvcDebugDisabler {
old_mode_ = _CrtSetReportMode(_CRT_ASSERT, old_mode_);
}

static void MyHandler(const wchar_t *expr,
const wchar_t *func,
const wchar_t *file,
unsigned int line,
uintptr_t pReserved) {
static void __cdecl MyHandler(const wchar_t *expr,
const wchar_t *func,
const wchar_t *file,
unsigned int line,
uintptr_t pReserved) {
// do nothing
}

6 changes: 6 additions & 0 deletions src/google/protobuf/wire_format_lite.h
Original file line number Diff line number Diff line change
@@ -878,7 +878,10 @@ inline uint32 WireFormatLite::ZigZagEncode32(int32 n) {

inline int32 WireFormatLite::ZigZagDecode32(uint32 n) {
// Note: Using unsigned types prevent undefined behavior
#pragma warning(push)
#pragma warning(disable : 4146)
return static_cast<int32>((n >> 1) ^ (~(n & 1) + 1));
#pragma warning(pop)
}

inline uint64 WireFormatLite::ZigZagEncode64(int64 n) {
@@ -889,7 +892,10 @@ inline uint64 WireFormatLite::ZigZagEncode64(int64 n) {

inline int64 WireFormatLite::ZigZagDecode64(uint64 n) {
// Note: Using unsigned types prevent undefined behavior
#pragma warning(push)
#pragma warning(disable : 4146)
return static_cast<int64>((n >> 1) ^ (~(n & 1) + 1));
#pragma warning(pop)
}

// String is for UTF-8 text only, but, even so, ReadString() can simply
Loading