From 9978ec386c17af5f84ed3c5aae33f4dde3fe04ae Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Thu, 19 Jan 2023 18:08:00 -0800 Subject: [PATCH] Migrate utf8_range dependency to a git subtree (#11608) This will make the CMake workflow easier, where users won't need to either install utf8_range or initialize our submodules. Since this is a relatively small library that's owned by us, we can just bundle it with protobuf as a subtree Closes #11608 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/11608 from mkruskal-google:utf8_range_dep 57d5d91b68d6e5cb006fde22cac8bc3f2b106e36 PiperOrigin-RevId: 503314822 --- .github/workflows/codespell.yml | 2 +- .gitmodules | 3 --- cmake/utf8_range.cmake | 6 ++---- third_party/utf8_range | 1 - update_subtrees.sh | 8 ++++++++ 5 files changed, 11 insertions(+), 9 deletions(-) delete mode 160000 third_party/utf8_range create mode 100755 update_subtrees.sh diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index e7c63eed9a..cc4210c670 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -14,5 +14,5 @@ jobs: - uses: codespell-project/actions-codespell@master with: check_filenames: true - skip: ./.git,./conformance/third_party,*.snk,*.pb,*.pb.cc,*.pb.h,./src/google/protobuf/testdata,./objectivec/Tests,./python/compatibility_tests/v2.5.0/tests/google/protobuf/internal,./.github/workflows/codespell.yml + skip: ./.git,./third_party,./conformance/third_party,*.snk,*.pb,*.pb.cc,*.pb.h,./src/google/protobuf/testdata,./objectivec/Tests,./python/compatibility_tests/v2.5.0/tests/google/protobuf/internal,./.github/workflows/codespell.yml ignore_words_list: "alow,alse,ba,chec,cleare,copyable,cloneable,dedup,dur,errorprone,falsy,files',fo,fundementals,hel,importd,inout,leapyear,nd,nin,ois,ons,parseable,process',ro,te,testof,ue,unparseable,wasn,wee,gae,keyserver,objext,od,optin,streem,sur,falsy" diff --git a/.gitmodules b/.gitmodules index db938cf479..7a46a17f1a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,6 +9,3 @@ [submodule "third_party/jsoncpp"] path = third_party/jsoncpp url = https://github.com/open-source-parsers/jsoncpp.git -[submodule "third_party/utf8_range"] - path = third_party/utf8_range - url = https://github.com/protocolbuffers/utf8_range.git diff --git a/cmake/utf8_range.cmake b/cmake/utf8_range.cmake index 4dcfa4bcca..701de8d4d6 100644 --- a/cmake/utf8_range.cmake +++ b/cmake/utf8_range.cmake @@ -2,10 +2,8 @@ set(utf8_range_ENABLE_TESTS OFF CACHE BOOL "Disable utf8_range tests") if (NOT EXISTS "${protobuf_SOURCE_DIR}/third_party/utf8_range/CMakeLists.txt") message(FATAL_ERROR - "Cannot find third_party/utf8_range directory that's needed to " - "build conformance tests. If you use git, make sure you have cloned " - "submodules:\n" - " git submodule update --init --recursive\n") + "Cannot find third_party/utf8_range directory that's needed for " + "the protobuf runtime.\n") endif() set(utf8_range_ENABLE_INSTALL ${protobuf_INSTALL} CACHE BOOL "Set install") diff --git a/third_party/utf8_range b/third_party/utf8_range deleted file mode 160000 index de0b4a8ff9..0000000000 --- a/third_party/utf8_range +++ /dev/null @@ -1 +0,0 @@ -Subproject commit de0b4a8ff9b5d4c98108bdfe723291a33c52c54f diff --git a/update_subtrees.sh b/update_subtrees.sh new file mode 100755 index 0000000000..df75ba3f94 --- /dev/null +++ b/update_subtrees.sh @@ -0,0 +1,8 @@ +#! /bin/bash -eux + +set -eux + +cd $(dirname $0) + +git subtree pull --prefix third_party/utf8_range \ + https://github.com/protocolbuffers/utf8_range.git main --squash