[3.19] user/gitlab-foss: upgrade to 16.6.0 #305

Merged
ayakael merged 6 commits from gitlab/upgrade-16.6.0 into v3.19 2023-11-29 01:57:07 +00:00
22 changed files with 719 additions and 215 deletions

View file

@ -2,15 +2,15 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=gitaly
pkgver=16.2.0
pkgrel=1
pkgver=16.6.0
pkgrel=0
pkgdesc="A Git RPC service for handling all the git calls made by GitLab"
url="https://gitlab.com/gitlab-org/gitaly/"
arch="all"
# GPL-2.0-only WITH GCC-exception-2.0: bundled libgit2
license="MIT AND GPL-2.0-only WITH GCC-exception-2.0"
depends="
git>=2.41
git>=2.42
"
makedepends="
bash
@ -80,7 +80,7 @@ praefect() {
}
sha512sums="
7576dd5ef690c42582703ba571bb9e6856e85d209025f32b0797c3cecca88e10b538dc75a27d8cd2a99e30e2e99d03d0a61c681a8af692e3e34420775792598a gitaly-v16.2.0.tar.gz
7760ee96abd45103a99e3c3fff31538aeac0e10254c88ab600bfc6fed04c0c34b43a4d54295463663a9707204622cfc06d1de672fe2826d22c017850ddac24e4 config.patch
c2c49b39cd978ca184547c101e3ea9cd68d96bafef070c34350986f0343766d740398631aa451d0c7b51ac90a383594a5de211b468babda39e7080b33a1588f4 gitaly-v16.6.0.tar.gz
55230e587839df8fc8c6daeee1e5a5fbd91d6d28966d9977d59e6fb3d75e269c9d4d119f3a06217a4c6c55733a50ec9affcdb132e77e1694df839269dcd292aa config.patch
c32105d921be16eaf559cf21d6840bc346cd92b5e37974cedecdb5a2d2ca1eb5e8fbb144f5fc8a1289bf9415102b313cf2d61ee510c80f08ab33a799f5ac7122 gitaly.initd
"

View file

@ -1,5 +1,5 @@
diff --git a/config.toml.example.orig b/config.toml.example
index 2ddb368..0a8a0e2 100644
index 3d454fb..52457df 100644
--- a/config.toml.example.orig
+++ b/config.toml.example
@@ -2,15 +2,15 @@
@ -78,17 +78,12 @@ index 2ddb368..0a8a0e2 100644
# # Additionally exceptions from the Go server can be reported to Sentry
# sentry_dsn = "https://<key>:<secret>@sentry.io/<project>"
@@ -72,14 +72,14 @@ dir = "/home/git/gitlab/log"
@@ -71,11 +71,11 @@ dir = "/home/git/gitlab/log"
# grpc_latency_buckets = [0.001, 0.005, 0.025, 0.1, 0.5, 1.0, 10.0, 30.0, 60.0, 300.0, 1500.0]
[gitlab-shell]
# The directory where gitlab-shell is installed
-dir = "/home/git/gitlab-shell"
+dir = "/usr/lib/gitlab-shell"
-[hooks]
[hooks]
-custom_hooks_dir = "/home/git/custom_hooks"
+# [hooks]
+# custom_hooks_dir = "/etc/gitlab/custom_hooks"
+custom_hooks_dir = "/etc/gitlab/custom_hooks"
[gitlab]
-secret_file = "/home/git/gitlab-shell/.gitlab_shell_secret"

View file

@ -3,13 +3,12 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=gitlab-foss
_pkgname=${pkgname%-foss}
pkgver=16.2.4
pkgver=16.6.0
_gittag=v$pkgver
pkgrel=0
pkgdesc="A version control for your server"
url="https://gitlab.com/gitlab-org/gitlab-foss"
# grpc needs fixing, due to protodev upgrade
#arch="x86_64"
arch="x86_64 aarch64"
license="MIT"
# ruby-irb is needed only for Rails console (gitlab-rails console)
depends="
@ -17,9 +16,9 @@ depends="
ca-certificates
cmd:dpkg-deb
exiftool
git>=2.40.0
gitaly~=16.2
gitlab-shell~=14.24
git>=2.42.0
gitaly~=16.6
gitlab-shell~=14.30
graphicsmagick
http-parser
procps
@ -34,6 +33,7 @@ depends="
ruby3.0-irb
ruby3.0-json
ruby3.0-rake
ruby3.0-rdoc
ruby3.0-webrick
shared-mime-info
tzdata
@ -56,7 +56,7 @@ makedepends="
protobuf-dev
re2-dev
ruby3.0-dev
ruby3.0-grpc~=1.55
ruby3.0-grpc~=1.58
ruby3.0-rugged
yarn>=1.2.0
"
@ -74,6 +74,7 @@ source="https://gitlab.com/gitlab-org/gitlab-foss/-/archive/$_gittag/gitlab-foss
$_pkgname.confd
$_pkgname.logrotate
bin-wrapper.in
remove-sys-filesystem-depend.patch
"
builddir="$srcdir/gitlab-foss-$_gittag"
@ -128,11 +129,12 @@ build() {
bundle config --local without "$bundle_without"
bundle config --local build.ffi --enable-system-libffi
bundle config --local build.gpgme --use-system-libraries
bundle config --local build.re2 --enable-system-libraries
bundle config --local build.nokogiri --use-system-libraries \
--with-xml2-include=/usr/include/libxml2 \
--with-xslt-include=/usr/include/libxslt
bundle config --local build.ruby-magic --enable-system-libraries
bundle config --local build.google-protobuf --with-cflags=-D__va_copy=va_copy
bundle config --local build.google-protobuf '-- --with-cflags=-D__va_copy=va_copy'
bundle config --local path "vendor/bundle"
bundle install --no-cache
@ -375,8 +377,8 @@ assets() {
}
sha512sums="
96d2146f81bcecae9e8a4a72ef1dd136a2203649af38dbcb560c8071ca9a409b54b7e220b7c233b66ce1ee9423700e8150e445902971f951282764bded2bc717 gitlab-foss-v16.2.4.tar.gz
cdba615287c0a024c6589b5142543856393c8e5df3d21d2158908b34857d3d56581fe0bd66fa31cd3ff756c60f9f65f235c8ec7615a0970f7a87bbeb41be93ed database-config.patch
ea83c490fdbfc7d32dc1b25fb17185f6552dfc72ab1766f7169e1298869589a12ea7b9285873be2c7b91303dd8eb486acaeb75e916177a9827139fb9b54ea232 gitlab-foss-v16.6.0.tar.gz
daa496f3d9146f9dbddff62477bf49d5c7bd2f2a4cdbadc70ee51c8230f3ef01dc950ef157154b31c7e7bef0beecc5cbac50fbac65a79d6d9099b27bcba8b2ab database-config.patch
55b0667d3969113ffd6860652ee8bdb9a534c25f413f33b2739e922c886988e7cea72c1c00c7eecf29fcff3682b1324156365605ffc6aae45d1e0ccddf96288b gitlab.initd
1f451b67a5d5e58650b0fe862a2b65cfb8bff5502b37d94ae90619c1ff9affbecf24428303a2849bebce5f94bef37078f0e5710e344bbab616134e910938384a gitlab.mailroom.initd
b6a6d9ba20557e61efa24f2d5a489873fefbb981f7d4465794a857b2971263c08ec29cc001c372522cdc0d48245e59751307c9f44f6ef4d87bf2e3ec5c23fb1c gitlab.rails.initd
@ -385,4 +387,5 @@ cb4ec100f0ea7ffcbb37aead8423e636629e2f4848b2974a7b2468e96cb1081ca732ac336417b08d
4dc00b16462f30591297fcb535fc364185d3ed76e9956597f0423a8dfd8a9a351f6ac29d9f0c73052c11324fba4768eb89a21c6bef4da99f15baaea8c9ab8407 gitlab.confd
57f258246925fbef0780caebdf005983c72fe3db1ab3242a1e00137bd322f5ec6c0fd958db7178b8fc22103d071f550d6f71f08422bcd9e859d2a734b2ecef00 gitlab.logrotate
a944c3886388ba1574bf8c96b6de4d9f24ef4a83f553c31a224e17a3b01f2a5c65b60c59b7ed7ca4b25670c60ea8dd41b96a8a623d909d2bb09bdf2520ed7f23 bin-wrapper.in
97e19d601365da710341eea83324987e2d61061a4c816972d957cdb3300f8d65d07ca53bc46d4cbe9a476e5e72255e7081bdebc5217e7f3e95b8165f114c7b5f remove-sys-filesystem-depend.patch
"

View file

@ -1,5 +1,5 @@
diff --git a/config/database.yml.postgresql.orig b/config/database.yml.postgresql
index b210b9c..9006120 100644
index da9f458..2d6d44e 100644
--- a/config/database.yml.postgresql.orig
+++ b/config/database.yml.postgresql
@@ -26,13 +26,6 @@ production:
@ -44,8 +44,8 @@ index b210b9c..9006120 100644
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
@@ -117,17 +96,3 @@ test: &test
prepared_statements: false
@@ -119,19 +98,3 @@ test: &test
reaping_frequency: nil
variables:
statement_timeout: 15s
- geo:
@ -55,6 +55,7 @@ index b210b9c..9006120 100644
- username: postgres
- password:
- host: localhost
- reaping_frequency: nil
- embedding:
- adapter: postgresql
- encoding: unicode
@ -62,3 +63,4 @@ index b210b9c..9006120 100644
- username: postgres
- password:
- host: localhost
- reaping_frequency: nil

View file

@ -0,0 +1,104 @@
diff --git a/Gemfile.orig b/Gemfile
index c1e9e34..a4448b7 100644
--- a/Gemfile.orig
+++ b/Gemfile
@@ -525,7 +525,6 @@ gem 'health_check', '~> 3.0' # rubocop:todo Gemfile/MissingFeatureCategory
# System information
gem 'vmstat', '~> 2.3.0' # rubocop:todo Gemfile/MissingFeatureCategory
-gem 'sys-filesystem', '~> 1.4.3' # rubocop:todo Gemfile/MissingFeatureCategory
# NTP client
gem 'net-ntp' # rubocop:todo Gemfile/MissingFeatureCategory
diff --git a/Gemfile.lock.orig b/Gemfile.lock
index e2ebb91..39b6df3 100644
--- a/Gemfile.lock.orig
+++ b/Gemfile.lock
@@ -1605,8 +1605,6 @@ GEM
attr_required (>= 0.0.5)
httpclient (>= 2.4)
sync (0.5.0)
- sys-filesystem (1.4.3)
- ffi (~> 1.1)
sysexits (1.2.0)
table_print (1.5.7)
tanuki_emoji (0.9.0)
@@ -2061,7 +2059,6 @@ DEPENDENCIES
ssh_data (~> 1.3)
stackprof (~> 0.2.25)
state_machines-activerecord (~> 0.8.0)
- sys-filesystem (~> 1.4.3)
tanuki_emoji (~> 0.9)
telesignenterprise (~> 2.2)
terser (= 1.0.2)
diff --git a/app/controllers/admin/system_info_controller.rb.orig b/app/controllers/admin/system_info_controller.rb
index 96fb73c..7b8435e 100644
--- a/app/controllers/admin/system_info_controller.rb.orig
+++ b/app/controllers/admin/system_info_controller.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+require 'open3'
class Admin::SystemInfoController < Admin::ApplicationController
feature_category :not_owned # rubocop:todo Gitlab/AvoidFeatureCategoryNotOwned
@@ -36,6 +37,11 @@ class Admin::SystemInfoController < Admin::ApplicationController
'vfat'
].freeze
+ MOUNT_REGEX = /(\S+) on (\S+) type (\S+) \(([^)]+)\)/
+
+ Mount = Struct.new('Mount', :name, :mount_point, :mount_type, :options)
+ FsStat = Struct.new('FsStats', :path, :bytes_total, :bytes_used)
+
def show
@cpus = begin
Vmstat.cpu
@@ -47,7 +53,6 @@ def show
rescue StandardError
nil
end
- mounts = Sys::Filesystem.mounts
@disks = []
mounts.each do |mount|
@@ -57,15 +62,38 @@ def show
next if (EXCLUDED_MOUNT_TYPES & [mount.mount_type]).any?
begin
- disk = Sys::Filesystem.stat(mount.mount_point)
+ disk = fs_stat(mount.mount_point)
@disks.push({
bytes_total: disk.bytes_total,
bytes_used: disk.bytes_used,
disk_name: mount.name,
mount_path: disk.path
})
- rescue Sys::Filesystem::Error
+ rescue IOError
end
end
end
+
+ def mounts
+ stdout, stderr, status = Open3.capture3('mount')
+ fail IOError, stderr unless status.success?
+
+ stdout.lines
+ .map { |line| MOUNT_REGEX.match(line) }
+ .compact
+ .map { |match| Mount.new(*match.captures) }
+ end
+
+ def fs_stat(mount_point)
+ stdout, status = Open3.capture2('stat', '-c', '%s %b %a', '-f', mount_point)
+ fail IOError unless status.success?
+
+ block_size, blocks_total, blocks_free = stdout.split(' ').map(&:to_i)
+
+ bytes_total = blocks_total * block_size
+ bytes_free = blocks_free * block_size
+ bytes_used = bytes_total - bytes_free
+
+ FsStat.new(mount_point, bytes_total, bytes_used)
+ end
end

View file

@ -2,7 +2,7 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=gitlab-pages
pkgver=16.2.4
pkgver=16.6.0
_gittag="v$pkgver"
pkgrel=0
pkgdesc="A daemon used to serve static websites for GitLab users"
@ -29,7 +29,7 @@ package() {
}
sha512sums="
d05b99d48a88a008a729f15471284169ea7ce664aa19894c93f0c95e4259d79891c7e58d2204c21fa2d11bfb9c59c77ed2d3d7effa5235263e7aa046233f4acc gitlab-pages-v16.2.4.tar.gz
9574321d6d423a28b6d80aed5c9cc598b0d76b6b179ed515e8d4e6277d9d2bc9f9e18bc4e96b68f686f32502e279026c6891c46f329d4267ac1e8031bfd8c2f7 gitlab-pages-v16.6.0.tar.gz
710a9b652327e57e620c2bdb02bf912a6f61044eaaf61d36c6612284e9b951d2ac6f5eef77dfea16a0cde328bd4c556d9e47791c560139c27cb9659076f809b1 ungit-makefile.patch
20bc66c1c3548568ed353ca8d584f9108b9688f9375f212a18efc7b8386fdaafb3b2dc9e865f21c7f8fd31ada6e91842a8bb8d397f64851d853bb0de3e0e60bb gitlab-pages.initd
"

View file

@ -2,7 +2,7 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=gitlab-shell
pkgver=14.24.0
pkgver=14.30.1
pkgrel=0
pkgdesc="GitLab Shell handles git SSH sessions for GitLab"
url="https://gitlab.com/gitlab-org/gitlab-shell"
@ -59,7 +59,7 @@ package() {
}
sha512sums="
5a05217b1055c4658c3b7209c348253d590d4f99a877af012687cf9b60196d7f7051b615612bfc7d6992c9dc7d176b74da447ce22ca681f3703ce92379d15350 gitlab-shell-v14.24.0.tar.gz
5cd602ffc98fa2f6c5efbc9541bb6ff234253e299b690aa43feaefab2518b63fd0f69a8c3d79a4f04624c2a6daceaefc300be90ef2a29ff0b8a2392d0ae710cf gitlab-shell-v14.30.1.tar.gz
8cf13bf472e22b1c429bba5df98afb931c80b043ec83c8366d59f15a1e9b21daf09078f134e7aa622c87b32c774d1d5cf129878d5035102c06d0b12ead33f804 config.patch
499b3a46ea94a33a23b01f6a7509d74f5a6781b930619b3b8ae42bdeae8a052cc636578744d7992b4ae4f9b9f72b11ee3d3c0f5e50986fa3f7e35b979b08aada change-config-path.patch
c53da7f145593693392d9fa880ad5a1909bfc7504fd1c93d94a468c3e0f5cc80f712f41ee1dc8bf38105b410c1165658f208bd88a70c4674104c78af33d8d09c gitconfig

View file

@ -1,16 +1,12 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Keith Maxwell <keith.maxwell@gmail.com>
# Contributor: wener <wenermail@gmail.com>
# Maintainer: wener <wenermail@gmail.com>
pkgname=grpc
# This version is used in gitlab-foss 15.2.2.
pkgver=1.42.0
pkgrel=3
pkgver=1.58.0
pkgrel=0
pkgdesc="The C based gRPC"
url="https://grpc.io/"
# will fix later
#arch="all"
arch="all"
# BSD-3-Clause: third_party/upb, third_party/address_sorting
# MIT: third_party/upb/third_party/utf8_range
license="Apache-2.0 AND BSD-3-Clause AND MIT"
@ -24,23 +20,22 @@ _pythondepends="
python3-dev
py3-setuptools
"
# XXX: should also depend on ruby-google-protobuf=3.18
_rubydepends="
$pkgname=$pkgver-r$pkgrel
ruby3.0-etc
ruby3.0-google-protobuf>=3.19
"
makedepends="
abseil-cpp
abseil-cpp-dev
autoconf
automake
benchmark-dev
c-ares-dev
chrpath
cmake
libstdc++
libtool
linux-headers
openssl-dev
openssl-dev>3
protobuf-dev
re2-dev
ruby3.0-dev
@ -57,22 +52,29 @@ subpackages="
$pkgname-cpp
$pkgname-plugins
$pkgname-doc
py3-grpcio-pyc
py3-grpcio:grpcio
ruby3.0-grpc:_ruby
libaddress_sorting:lib
libgpr:lib
libgrpc:lib
libgrpc_authorization_provider:lib
libgrpc_unsecure:lib
libupb:lib
"
_googletest_rev=0e402173c97aea7a00749e825b194bfede4f2e45
# ruby-dont-strip-library.patch: abuild will dot the strip
source="https://github.com/grpc/grpc/archive/v$pkgver/grpc-v$pkgver.tar.gz
googletest-$_googletest_rev.tar.gz::https://github.com/google/googletest/archive/$_googletest_rev.tar.gz
fix-compiler-error.patch
minimal-fix-for-invalid-implicit-absl-string_view-nu.patch
01-chttp2-maybe-uninitialized.patch
ruby-use-shared-libs.patch
ruby-dont-strip-library.patch
find-dependency.patch
ruby-fix-protoc-path.patch
ruby-use-shared-libs.patch
ruby-use-system-certs.patch
makefile-use-system-abseil.patch
makefile-add-wrap-memcpy-flags.patch
"
options="!check" # sometimes hang indefinitely on builders
options="net !check" # sometimes hang indefinitely on builders
prepare() {
rm -r third_party/googletest
@ -109,11 +111,11 @@ prepare() {
}
build() {
cmake -B _build \
-DCMAKE_BUILD_TYPE=MinSizeRel \
export CFLAGS="$CFLAGS -flto=auto -DNDEBUG -O2"
export CXXFLAGS="$CXXFLAGS -flto=auto -DNDEBUG -O2"
cmake -B _build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_CXX_FLAGS="$CXXFLAGS -w" \
-DCMAKE_C_FLAGS="$CFLAGS -w" \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=True \
-DgRPC_INSTALL=ON \
@ -122,25 +124,24 @@ build() {
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_BENCHMARK_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DgRPC_BACKWARDS_COMPATIBILITY_MODE=OFF \
-DgRPC_BUILD_TESTS="$(want_check && echo ON || echo OFF)" \
-G Ninja
-DgRPC_BUILD_TESTS="$(want_check && echo ON || echo OFF)"
cmake --build _build
# XXX: Fails to build and I don't need it here, so screw it.
#GRPC_PYTHON_CFLAGS="-std=c++17" \
#GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 \
#GRPC_PYTHON_BUILD_SYSTEM_CARES=1 \
#GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 \
#GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 \
#GRPC_PYTHON_BUILD_SYSTEM_RE2=1 \
#GRPC_PYTHON_BUILD_SYSTEM_ABSL=1 \
#python3 setup.py build
GRPC_PYTHON_CFLAGS="-std=c++17" \
GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 \
GRPC_PYTHON_BUILD_SYSTEM_CARES=1 \
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 \
GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 \
GRPC_PYTHON_BUILD_SYSTEM_RE2=1 \
GRPC_PYTHON_BUILD_SYSTEM_ABSL=1 \
python3 setup.py build
# grpcio-tools
#cd tools/distrib/python
#python3 make_grpcio_tools.py
cd tools/distrib/python
python3 make_grpcio_tools.py
cd "$builddir"
gem build grpc.gemspec
@ -174,6 +175,7 @@ check() {
package() {
DESTDIR="$pkgdir" cmake --install _build
python3 setup.py install --skip-build --root="$pkgdir"
cd doc
find ./ -type f -print -exec install -Dm644 {} "$pkgdir"/usr/share/doc/grpc/{} \;
@ -213,8 +215,8 @@ cli() {
grpcio() {
pkgdesc="gRPC Python HTTP/2-based RPC framework"
depends="py3-six"
cd "$builddir"
python3 setup.py install --skip-build --prefix=/usr --root="$subpkgdir"
amove usr/lib/python3*
}
_ruby() {
@ -250,16 +252,20 @@ _ruby() {
spec/
}
lib() {
pkgdesc="$pkgdesc ($subpkgname library)"
depends="$pkgname=$pkgver-r$pkgrel"
amove usr/lib/$subpkgname.so.*
}
sha512sums="
39f37a41d1df6015dc36344f1b5e634be7f0edbc99723de73de8b81cdab6aa3e09cef6b3c6c9ecb2c9c9db9b8454474b2ac7fbe49fe23d17a6c78f999b459ce5 grpc-v1.42.0.tar.gz
fb2fd211a22dd777cf4df39a9dd72e5c8014f1546a89d3910b006503aac80a74d5797705e02911e9c07316ed973f71110b94cc0e86225f648d4ff91773748a43 grpc-v1.58.0.tar.gz
5c5eaf6ff9f3c1bca025b7ef0234ba97232ba85b43e6354a92f49b7208f5c47581ebaf18bf58618498e5d264f2620c2b6676e81bb0f7df77112b96ba271ececf googletest-0e402173c97aea7a00749e825b194bfede4f2e45.tar.gz
ce7b72169b22e6e92f31b74cacf6edf6395aeb7c70fd42d7e9eaa188395b4e6e4b3acad5edfbe75c8304b049049cee76ce5ceaaeed824bffb7defc103ef23580 fix-compiler-error.patch
95a88beb681616a9d793c3118c8e25473d9a8cb29733db38edc8b7af205ffea964dc27dc48d268f735f27fee84782be3eda0b7f398c2e568116e679febe563b7 minimal-fix-for-invalid-implicit-absl-string_view-nu.patch
7fa146ce86ddd4f160bb1ca9ff01cb7aca6b2b8c9aa50e4fa6b84504b9117b104be0d1e31ccb452d846549dfe1e9012ceccfcdc1f2357ed567621d71fb8b08c5 01-chttp2-maybe-uninitialized.patch
0bf65cca05b6d41c8259a5a59573e16a3f40913aa1c1a185b7dcd295d4ae7f1cedbbd465fcff33d6f8d8ee8735a77f744708a097a32a4598b9bfc4ecaf9414df ruby-use-shared-libs.patch
0a2560d22df71abbeea33a37f0cb42a811b244af25284d7fb564cb8ea0b944d23acf6601413bdb2613bcb87011340334489f1b40ab2f9024db013adde0d094e8 ruby-dont-strip-library.patch
6702e39c6a3c065fe4ff5ae48898057135c09bf6851e35fc958cf95ee5d77e9dd34e8c34d978efe60682384e46c4c4b2e51156d546b06a0eb1feed89adcc024b find-dependency.patch
4ea72d2acd8bee9c9022a4412aa0af0477faca7b0810d14decb3ad5d4da044247f51189512323bfee855b9b260a7f82b812310391451e5d8ee718297800d7a73 ruby-fix-protoc-path.patch
7123bf1bbc48ceb303ce1e9820ea45a06dabd25e20e3c1c116ef68e629e80f229cf20314c415d74f0c5c1725f23a00b446656e0cffba3dcd3cc766ae29d8fb2f ruby-use-shared-libs.patch
631af4b9ac29c1ebabb2c88394ea2993e36cec1beda38195e1587dbd9d3c8c9eef75a17d2326d3cd2e682de551401216075ba08fdc501c098b8092d718ded381 ruby-use-system-certs.patch
3c7e8e9a6c6009278569dccdf3e79fabdb266336b894a7fe65f2a57d3cfbef72364c331ec46d9e3a05bb0deaeb841194a39d6f77d98f9e9ce609de0636f675bd makefile-use-system-abseil.patch
66b709cd1fb291ab140ec87e584db13d15c308c0ea9f2ee0fa10ddb00cf33641f559235b1445137ff071dfbda9d7279bd482411fbf2f33dacbc5b14cd7f9ffa5 makefile-add-wrap-memcpy-flags.patch
89e260934da83eb45fa6b73884cba1b1c30f99c0eb883a726e2d36ee4788246f4c6fa1b201077038af956bcb58e625f83bedba4f186c711785ec240373ce4fc5 makefile-use-system-abseil.patch
"

View file

@ -0,0 +1,13 @@
without this find_dependency() doesn't exist
--
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
index 98d8c6d..5500ca2 100644
--- a/cmake/gRPCConfig.cmake.in
+++ b/cmake/gRPCConfig.cmake.in
@@ -1,5 +1,6 @@
# Module path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)
+include(CMakeFindDependencyMacro)
# Depend packages
@_gRPC_FIND_ZLIB@

View file

@ -1,23 +0,0 @@
Patch-Source: https://github.com/grpc/grpc/pull/28196
--
From 3991a4c0bcf57e5058a93c4c8255cc80cd0482ca Mon Sep 17 00:00:00 2001
From: Runming Wu <runmingwu@gmail.com>
Date: Tue, 23 Nov 2021 12:10:43 -0800
Subject: [PATCH] Fix compiler error for certain gcc version.
---
src/core/ext/xds/xds_api.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/core/ext/xds/xds_api.h b/src/core/ext/xds/xds_api.h
index 643febdf2203..f25a21f8f831 100644
--- a/src/core/ext/xds/xds_api.h
+++ b/src/core/ext/xds/xds_api.h
@@ -55,6 +55,7 @@ class XdsApi {
static const char* kEdsTypeUrl;
struct Duration {
+ Duration() {}
int64_t seconds = 0;
int32_t nanos = 0;
bool operator==(const Duration& other) const {

View file

@ -1,15 +0,0 @@
diff --git a/Makefile b/Makefile
index 6c9f22d..6f21708 100644
--- a/Makefile
+++ b/Makefile
@@ -1672,7 +1672,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else
- $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.20 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
+ $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.20 -Wl,-wrap,memcpy -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.20
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so
endif

View file

@ -1,6 +1,6 @@
--- a/Makefile
+++ b/Makefile
@@ -576,8 +576,8 @@
@@ -575,8 +575,8 @@
# Setup abseil dependency
@ -8,15 +8,15 @@
-GRPC_ABSEIL_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
+GRPC_ABSEIL_DEP = -labsl_base -labsl_int128 -labsl_strings -labsl_time -labsl_bad_optional_access -labsl_throw_delegate -labsl_str_format_internal
+GRPC_ABSEIL_MERGE_LIBS = -labsl_base -labsl_int128 -labsl_strings -labsl_time -labsl_bad_optional_access -labsl_throw_delegate -labsl_str_format_internal
ifeq ($(HOST_IS_X86_64),true)
ABSL_RANDOM_HWAES_FLAGS = -maes
else
@@ -2675,7 +2675,7 @@
# Setup re2 dependency
@@ -2809,7 +2809,7 @@
third_party/abseil-cpp/absl/types/bad_variant_access.cc \
-LIBGRPC_ABSEIL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_ABSEIL_SRC))))
+LIBGRPC_ABSEIL_OBJS =
$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g -Ithird_party/abseil-cpp

View file

@ -1,45 +0,0 @@
Patch-Source: https://src.fedoraproject.org/rpms/grpc/blob/f36/f/0001-Minimal-fix-for-invalid-implicit-absl-string_view-nu.patch
--
From 39d8f1440941ab56fe4bfa45ce4bd6177165f919 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Sun, 16 Jan 2022 09:47:21 -0500
Subject: [PATCH] Minimal fix for invalid implicit absl::string_view(nullptr_t)
---
.../client_channel/lb_policy/xds/xds_cluster_resolver.cc | 2 +-
test/core/security/evaluate_args_test.cc | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
index ff936b9100..a55d811527 100644
--- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
@@ -139,7 +139,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
// to use for LRS load reporting. Caller must ensure that config_ is set
// before calling.
std::pair<absl::string_view, absl::string_view> GetLrsClusterKey() const {
- if (!parent_->is_xds_uri_) return {parent_->server_name_, nullptr};
+ if (!parent_->is_xds_uri_) return {parent_->server_name_, absl::string_view()};
return {
parent_->config_->discovery_mechanisms()[index_].cluster_name,
parent_->config_->discovery_mechanisms()[index_].eds_service_name};
diff --git a/test/core/security/evaluate_args_test.cc b/test/core/security/evaluate_args_test.cc
index a8df9b3003..82fc26cd9d 100644
--- a/test/core/security/evaluate_args_test.cc
+++ b/test/core/security/evaluate_args_test.cc
@@ -32,9 +32,9 @@ class EvaluateArgsTest : public ::testing::Test {
TEST_F(EvaluateArgsTest, EmptyMetadata) {
EvaluateArgs args = util_.MakeEvaluateArgs();
- EXPECT_EQ(args.GetPath(), nullptr);
- EXPECT_EQ(args.GetMethod(), nullptr);
- EXPECT_EQ(args.GetHost(), nullptr);
+ EXPECT_EQ(args.GetPath(), std::string_view());
+ EXPECT_EQ(args.GetMethod(), std::string_view());
+ EXPECT_EQ(args.GetHost(), std::string_view());
EXPECT_THAT(args.GetHeaders(), ::testing::ElementsAre());
EXPECT_EQ(args.GetHeaderValue("some_key", nullptr), absl::nullopt);
}
--
2.33.1

View file

@ -1,30 +0,0 @@
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Wed, 24 Aug 2022 21:20:22 +0200
Subject: [PATCH] Don't strip the built library
abuild does it.
--- a/src/ruby/ext/grpc/extconf.rb
+++ b/src/ruby/ext/grpc/extconf.rb
@@ -94,21 +94,3 @@
output = File.join('grpc', 'grpc_c')
puts 'Generating Makefile for ' + output
create_makefile(output)
-
-strip_tool = RbConfig::CONFIG['STRIP']
-strip_tool += ' -x' if darwin
-
-if grpc_config == 'opt'
- File.open('Makefile.new', 'w') do |o|
- o.puts 'hijack: all strip'
- o.puts
- File.foreach('Makefile') do |i|
- o.puts i
- end
- o.puts
- o.puts 'strip: $(DLLIB)'
- o.puts "\t$(ECHO) Stripping $(DLLIB)"
- o.puts "\t$(Q) #{strip_tool} $(DLLIB)"
- end
- File.rename('Makefile.new', 'Makefile')
-end

View file

@ -6,52 +6,76 @@ Subject: [PATCH] Link with shared libraries, don't embed anything
- Don't build and statically link libgrpc, link shared libgrpc.
- Don't statically link libgcc and libstdc++.
diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb
index 98a8876..808ecfe 100644
--- a/src/ruby/ext/grpc/extconf.rb
+++ b/src/ruby/ext/grpc/extconf.rb
@@ -45,9 +45,9 @@
ENV['ARFLAGS'] = '-o'
@@ -69,11 +69,11 @@ if apple_toolchain && !cross_compiling
end
-ENV['EMBED_OPENSSL'] = 'true'
-ENV['EMBED_ZLIB'] = 'true'
-ENV['EMBED_CARES'] = 'true'
# Don't embed on TruffleRuby (constant-time crypto is unsafe with Sulong, slow build times)
-ENV['EMBED_OPENSSL'] = (RUBY_ENGINE != 'truffleruby').to_s
+ENV['EMBED_OPENSSL'] = 'false'
# Don't embed on TruffleRuby (the system zlib is already linked for the zlib C extension, slow build times)
-ENV['EMBED_ZLIB'] = (RUBY_ENGINE != 'truffleruby').to_s
+ENV['EMBED_ZLIB'] = 'false'
-ENV['EMBED_CARES'] = 'true'
+ENV['EMBED_CARES'] = 'false'
ENV['ARCH_FLAGS'] = RbConfig::CONFIG['ARCH_FLAG']
if darwin && !cross_compiling
@@ -65,23 +65,15 @@
output_dir = File.expand_path(RbConfig::CONFIG['topdir'])
grpc_lib_dir = File.join(output_dir, 'libs', grpc_config)
ENV['BUILDDIR'] = output_dir
+$LDFLAGS << ' -L' + ENV.fetch('TOPDIR', '.')
if apple_toolchain && !cross_compiling
@@ -97,32 +97,7 @@
strip_tool = RbConfig::CONFIG['STRIP']
strip_tool += ' -x' if apple_toolchain
-unless windows
- puts 'Building internal gRPC into ' + grpc_lib_dir
- nproc = 4
- nproc = Etc.nprocessors * 2 if Etc.respond_to? :nprocessors
- nproc = Etc.nprocessors if Etc.respond_to? :nprocessors
- nproc_override = ENV['GRPC_RUBY_BUILD_PROCS']
- unless nproc_override.nil? or nproc_override.size == 0
- nproc = nproc_override
- puts "Overriding make parallelism to #{nproc}"
- end
- make = bsd ? 'gmake' : 'make'
- system("#{make} -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config} Q=")
- cmd = "#{make} -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config} Q="
- puts "Building grpc native library: #{cmd}"
- system(cmd)
- exit 1 unless $? == 0
-end
-
$CFLAGS << ' -I' + File.join(grpc_root, 'include')
- if grpc_config == 'opt'
- rm_obj_cmd = "rm -rf #{File.join(output_dir, 'objs')}"
- puts "Removing grpc object files: #{rm_obj_cmd}"
- system(rm_obj_cmd)
- exit 1 unless $? == 0
- strip_cmd = "#{strip_tool} #{grpc_lib_dir}/*.a"
- puts "Stripping grpc native library: #{strip_cmd}"
- system(strip_cmd)
- exit 1 unless $? == 0
- end
-end
+$LDFLAGS << ' -L' + ENV.fetch('TOPDIR', '.')
ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', 'ext-export')
$CFLAGS << ' -DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
$CFLAGS << ' -I' + File.join(grpc_root, 'include')
@@ -118,7 +103,7 @@ ext_export_file += '-truffleruby' if RUBY_ENGINE == 'truffleruby'
$LDFLAGS << ' -Wl,--version-script="' + ext_export_file + '.gcc"' if linux
$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"' if darwin
$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"' if apple_toolchain
-$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows
+$LDFLAGS << ' -Wl,-wrap,memcpy -lgrpc' unless windows
if grpc_config == 'gcov'
$CFLAGS << ' -O0 -fprofile-arcs -ftest-coverage'
$LDFLAGS << ' -fprofile-arcs -ftest-coverage -rdynamic'
@@ -92,7 +84,6 @@
@@ -129,10 +114,6 @@ if grpc_config == 'dbg'
end
$LDFLAGS << ' -Wl,-wrap,memcpy' if linux
-$LDFLAGS << ' -static-libgcc -static-libstdc++' if linux
-# Do not statically link standard libraries on TruffleRuby as this does not work when compiling to bitcode
-if linux && RUBY_ENGINE != 'truffleruby'
- $LDFLAGS << ' -static-libgcc -static-libstdc++'
-end
$LDFLAGS << ' -static' if windows
$CFLAGS << ' -std=c99 '
$CFLAGS << ' -std=c11 '

168
user/protobuf/APKBUILD Normal file
View file

@ -0,0 +1,168 @@
# Contributor: Sheila Aman <sheila@vulpine.house>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=protobuf
_gemname=google-protobuf
pkgver=23.4
_rubyver=3.23.4
pkgrel=1
pkgdesc="Library for extensible, efficient structure packing"
url="https://github.com/protocolbuffers/protobuf"
arch="all"
license="BSD-3-Clause"
depends="
protoc=$pkgver-r$pkgrel
libprotoc=$pkgver-r$pkgrel
libprotobuf=$pkgver-r$pkgrel
libprotobuf-lite=$pkgver-r$pkgrel
"
depends_dev="
protoc=$pkgver-r$pkgrel
zlib-dev
"
makedepends="
$depends_dev
abseil-cpp-dev
cmake
ruby3.0
ruby3.0-dev
ruby3.0-rake
samurai
"
checkdepends="gtest-dev"
subpackages="
ruby3.0-$_gemname:_ruby
$pkgname-dev
$pkgname-vim::noarch
protoc
libprotoc
libprotobuf
libprotobuf-lite
"
# exclude.patch
source="$pkgname-$pkgver.tar.gz::https://github.com/protocolbuffers/protobuf/archive/refs/tags/v$pkgver.tar.gz
exclude.patch
protoc-cmake.patch
ruby-fix-cflags.patch
skip-failing-tests.patch
soversion.patch
trim-rakefile.patch
"
# fails some
case "$CARCH" in
armhf) options="$options !check" ;;
esac
build() {
export CFLAGS="$CFLAGS -DNDEBUG -O2 -flto=auto"
export CXXFLAGS="$CXXFLAGS -DNDEBUG -O2 -flto=auto -Wno-deprecated-declarations"
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=ON \
-Dprotobuf_BUILD_TESTS="$(want_check && echo ON || echo OFF)" \
-Dprotobuf_BUILD_LIBPROTOC=ON \
-Dprotobuf_ABSL_PROVIDER="package" \
-Dprotobuf_ALLOW_CCACHE=ON \
-Dprotobuf_USE_EXTERNAL_GTEST=ON
cmake --build build
cd "$builddir"/ruby
export PATH="$PATH:$builddir/build"
# Generate proto files for built-in protocols.
rake genproto
gem build $_gemname.gemspec
gem install --local \
--install-dir dist \
--ignore-dependencies \
--no-document \
--verbose \
$_gemname
}
# TODO: Run tests for ruby gem.
check() {
ctest --test-dir build --output-on-failure
}
package() {
DESTDIR="$pkgdir" cmake --install build
sed -i \
-e "/Requires:/s|;| |g" \
-e "/Requires:/s|::|_|g" \
"$pkgdir"/usr/lib/pkgconfig/protobuf.pc
install -Dm644 editors/proto.vim \
"$pkgdir"/usr/share/vim/vimfiles/syntax/proto.vim
local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
cd ruby/dist
mkdir -p "$gemdir"
cp -r extensions gems specifications "$gemdir"/
# Remove duplicated .so libs (should be only in extensions directory).
find "$gemdir"/gems/ -name "*.so" -delete
# Remove unnecessary files.
cd "$gemdir"/gems/$_gemname-$_rubyver
rm -r ext/
}
_ruby() {
depends=""
pkgdesc="Ruby bindings to Google's data interchange format"
amove usr/lib/ruby/gems
}
vim() {
pkgdesc="Vim syntax for $pkgname"
depends=""
install_if="$pkgname=$pkgver-r$pkgrel vim"
amove usr/share/vim/vimfiles/syntax/proto.vim
}
libprotoc() {
depends=""
pkgdesc="Runtime library for Protocol Buffer compiler"
amove usr/lib/libprotoc.so.*
}
protoc() {
depends=""
pkgdesc="Protocol buffer compiler binary and library"
amove usr/bin/protoc*
}
libprotobuf() {
depends=""
pkgdesc="Runtime library for C++ users of protocol buffers"
amove usr/lib/libprotobuf.so.*
}
lite() {
depends=""
pkgdesc="Runtime library for C++ users with 'lite runtime' setting of protocol buffers"
amove usr/lib/libprotobuf-lite.so.*
}
sha512sums="
b93a4e0339ecbe085796de5b6c61feae35229d40db9019c043090bcaa483a1cce78a99487c5638482c68832fcede5579a0e5ec731221a88359b80db9bb6dc566 protobuf-23.4.tar.gz
0d46d105a0670ab5cfcb04ed534927a71613234a88efede0b20d426e1caaa708e6ff275a09c5dab7786fe26e69e0882f022b893302e4869006b4ac55fc6172e5 exclude.patch
16b8ee0e50dbb2144ddb83654a63e410b4218e667b6b8b77c7b6f9797508f63c3e8be0f9711841bb6ebbed0883cda2394b219a62b468240f65f4dac418b5a56e protoc-cmake.patch
0cb202a6151ae3746c09e85f2e4ce9abb0d810d4a3c84cb647fde407cf8d13894d3c9b340e06d7a3a85669da1899db265d26d8309d59249f841a40a66e045c83 ruby-fix-cflags.patch
b5070f8e150920c316130ba40f46c66eefddc634844f5d6b8ee11f6824a3707b3e74f68aa0612c16305bf096050214c6120e693225e07e0cea80e68a7830f863 skip-failing-tests.patch
850dc1d6fd3ea01f1689fd700ac35e7da0882092ab34c616702e01bdf4b5327b8ab27381ecf291431a94f54c89d31707a4a171929937e880543974cb64f9e685 soversion.patch
13514a456a50d7243baa23fe43586fc4544cda87b9e2a5afe9d2fac8afca8e8853f9b42232c3fff4c5cf2df443af32f944f451daa1d604d80fd03ee4e7abed3e trim-rakefile.patch
"

View file

@ -0,0 +1,40 @@
don't install the utf8_range lib into disk.
also remove it from .pc/cmake, it's statically linked into protobuf and never needed on disk after
--
diff --git a/cmake/install.cmake b/cmake/install.cmake
index e7eb210..73e1897 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -4,7 +4,6 @@ foreach(_target IN LISTS protobuf_ABSL_USED_TARGETS)
string(REPLACE :: _ _modified_target ${_target})
list(APPEND _pc_targets ${_modified_target})
endforeach()
-list(APPEND _pc_targets "utf8_range")
set(_protobuf_PC_REQUIRES "")
set(_sep "")
diff --git a/cmake/protobuf-config.cmake.in b/cmake/protobuf-config.cmake.in
index 44805c7..1a8d243 100644
--- a/cmake/protobuf-config.cmake.in
+++ b/cmake/protobuf-config.cmake.in
@@ -4,7 +4,6 @@ include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake")
# Depend packages
@_protobuf_FIND_ZLIB@
@_protobuf_FIND_ABSL@
-@_protobuf_FIND_UTF8_RANGE@
# Imported targets
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake")
diff --git a/cmake/utf8_range.cmake b/cmake/utf8_range.cmake
index f411a8c..770f94c 100644
--- a/cmake/utf8_range.cmake
+++ b/cmake/utf8_range.cmake
@@ -8,7 +8,7 @@ if (NOT TARGET utf8_range)
endif()
set(utf8_range_ENABLE_INSTALL ${protobuf_INSTALL} CACHE BOOL "Set install")
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range third_party/utf8_range)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range third_party/utf8_range EXCLUDE_FROM_ALL)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range)
endif ()

View file

@ -0,0 +1,27 @@
Patch-Source: https://github.com/protocolbuffers/protobuf/pull/13206
--
From 2e62ef1eaa2e712afc5f87aa2c55d478fe96230d Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Wed, 5 Jul 2023 13:03:11 +0200
Subject: [PATCH] Handle BUILD_TYPE=None in protobuf-module.cmake
Fixes Protobuf_PROTOC_EXECUTABLE being undefined in that case.
---
cmake/protobuf-module.cmake.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in
index 0bb05e38fad..e5b2b2e4b3a 100644
--- a/cmake/protobuf-module.cmake.in
+++ b/cmake/protobuf-module.cmake.in
@@ -153,6 +153,10 @@ if(NOT Protobuf_PROTOC_EXECUTABLE AND TARGET protobuf::protoc)
get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
IMPORTED_LOCATION_NOCONFIG)
endif()
+ if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
+ get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
+ IMPORTED_LOCATION_NONE)
+ endif()
endif()
# Version info variable

View file

@ -0,0 +1,18 @@
Using builder flags
diff --git a/ruby/ext/google/protobuf_c/extconf.rb b/ruby/ext/google/protobuf_c/extconf.rb
index b7c439b..0bbc15c 100755
--- a/ruby/ext/google/protobuf_c/extconf.rb
+++ b/ruby/ext/google/protobuf_c/extconf.rb
@@ -7,9 +7,9 @@ ext_name = "google/protobuf_c"
dir_config(ext_name)
if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ || RUBY_PLATFORM =~ /freebsd/
- $CFLAGS += " -std=gnu99 -O3 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement"
+ $CFLAGS += " -std=gnu99 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement"
else
- $CFLAGS += " -std=gnu99 -O3 -DNDEBUG"
+ $CFLAGS += " -std=gnu99 -DNDEBUG"
end
if RUBY_PLATFORM =~ /linux/

View file

@ -0,0 +1,99 @@
diff --git a/src/google/protobuf/any_test.cc b/src/google/protobuf/any_test.cc
index 8b544d9..0f27dbe 100644
--- a/src/google/protobuf/any_test.cc
+++ b/src/google/protobuf/any_test.cc
@@ -62,13 +62,6 @@ TEST(AnyTest, TestPackAndUnpack) {
EXPECT_EQ(12345, submessage.int32_value());
}
-TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {
- protobuf_unittest::TestAny submessage;
- submessage.mutable_text()->resize(INT_MAX, 'a');
- protobuf_unittest::TestAny message;
- EXPECT_FALSE(message.mutable_any_value()->PackFrom(submessage));
-}
-
TEST(AnyTest, TestUnpackWithTypeMismatch) {
protobuf_unittest::TestAny payload;
payload.set_int32_value(13);
diff --git a/src/google/protobuf/arena_unittest.cc b/src/google/protobuf/arena_unittest.cc
index 4832cff..aa45a25 100644
--- a/src/google/protobuf/arena_unittest.cc
+++ b/src/google/protobuf/arena_unittest.cc
@@ -1392,11 +1392,11 @@ TEST(ArenaTest, SpaceAllocated_and_Used) {
options.initial_block_size = arena_block.size();
Arena arena_2(options);
EXPECT_EQ(1024, arena_2.SpaceAllocated());
- EXPECT_EQ(0, arena_2.SpaceUsed());
+// EXPECT_EQ(0, arena_2.SpaceUsed());
EXPECT_EQ(1024, arena_2.Reset());
Arena::CreateArray<char>(&arena_2, 55);
EXPECT_EQ(1024, arena_2.SpaceAllocated());
- EXPECT_EQ(Align8(55), arena_2.SpaceUsed());
+// EXPECT_EQ(Align8(55), arena_2.SpaceUsed());
EXPECT_EQ(1024, arena_2.Reset());
}
@@ -1460,11 +1460,11 @@ TEST(ArenaTest, BlockSizeSmallerThanAllocation) {
*Arena::Create<int64_t>(&arena) = 42;
EXPECT_GE(arena.SpaceAllocated(), 8);
- EXPECT_EQ(8, arena.SpaceUsed());
+// EXPECT_EQ(8, arena.SpaceUsed());
*Arena::Create<int64_t>(&arena) = 42;
EXPECT_GE(arena.SpaceAllocated(), 16);
- EXPECT_EQ(16, arena.SpaceUsed());
+// EXPECT_EQ(16, arena.SpaceUsed());
}
}
diff --git a/src/google/protobuf/extension_set_unittest.cc b/src/google/protobuf/extension_set_unittest.cc
index ccd1c9b..f420da3 100644
--- a/src/google/protobuf/extension_set_unittest.cc
+++ b/src/google/protobuf/extension_set_unittest.cc
@@ -871,17 +871,17 @@ TEST(ExtensionSetTest, SpaceUsedExcludingSelf) {
} while (0)
TEST_REPEATED_EXTENSIONS_SPACE_USED(int32, int32_t, 101);
- TEST_REPEATED_EXTENSIONS_SPACE_USED(int64, int64_t, 102);
+ //TEST_REPEATED_EXTENSIONS_SPACE_USED(int64, int64_t, 102);
TEST_REPEATED_EXTENSIONS_SPACE_USED(uint32, uint32_t, 103);
- TEST_REPEATED_EXTENSIONS_SPACE_USED(uint64, uint64_t, 104);
+ //TEST_REPEATED_EXTENSIONS_SPACE_USED(uint64, uint64_t, 104);
TEST_REPEATED_EXTENSIONS_SPACE_USED(sint32, int32_t, 105);
- TEST_REPEATED_EXTENSIONS_SPACE_USED(sint64, int64_t, 106);
+ //TEST_REPEATED_EXTENSIONS_SPACE_USED(sint64, int64_t, 106);
TEST_REPEATED_EXTENSIONS_SPACE_USED(fixed32, uint32_t, 107);
- TEST_REPEATED_EXTENSIONS_SPACE_USED(fixed64, uint64_t, 108);
+ //TEST_REPEATED_EXTENSIONS_SPACE_USED(fixed64, uint64_t, 108);
TEST_REPEATED_EXTENSIONS_SPACE_USED(sfixed32, int32_t, 109);
- TEST_REPEATED_EXTENSIONS_SPACE_USED(sfixed64, int64_t, 110);
+ //TEST_REPEATED_EXTENSIONS_SPACE_USED(sfixed64, int64_t, 110);
TEST_REPEATED_EXTENSIONS_SPACE_USED(float, float, 111);
- TEST_REPEATED_EXTENSIONS_SPACE_USED(double, double, 112);
+ //TEST_REPEATED_EXTENSIONS_SPACE_USED(double, double, 112);
TEST_REPEATED_EXTENSIONS_SPACE_USED(bool, bool, true);
TEST_REPEATED_EXTENSIONS_SPACE_USED(nested_enum, int,
unittest::TestAllTypes::FOO);
diff --git a/src/google/protobuf/wire_format_unittest.inc b/src/google/protobuf/wire_format_unittest.inc
index 4c7d047..7906cfa 100644
--- a/src/google/protobuf/wire_format_unittest.inc
+++ b/src/google/protobuf/wire_format_unittest.inc
@@ -1537,6 +1537,7 @@ TEST_F(Utf8ValidationTest, ParseRepeatedString) {
// Test the old VerifyUTF8String() function, which may still be called by old
// generated code.
+#if 0
TEST_F(Utf8ValidationTest, OldVerifyUTF8String) {
std::string data(kInvalidUTF8String);
@@ -1555,7 +1556,7 @@ TEST_F(Utf8ValidationTest, OldVerifyUTF8String) {
WireFormat::SERIALIZE);
}
}
-
+#endif
TEST(RepeatedVarint, Int32) {
RepeatedField<int32_t> v;

View file

@ -0,0 +1,39 @@
Patch-Source: https://gitlab.archlinux.org/archlinux/packaging/packages/protobuf/-/blob/e93df92fead2d46cc2825a866af3f402d498439c/soversion.patch
use an soversion that actually makes sense and not just the full pkgver
--
diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake
index 9b1de677b4f..276c99c489e 100644
--- a/cmake/libprotobuf-lite.cmake
+++ b/cmake/libprotobuf-lite.cmake
@@ -30,6 +30,7 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf-lite PROPERTIES
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protobuf-lite
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)
diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake
index aa3efc9a68a..0f34d20b97d 100644
--- a/cmake/libprotobuf.cmake
+++ b/cmake/libprotobuf.cmake
@@ -33,6 +33,7 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf PROPERTIES
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protobuf
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf ALIAS libprotobuf)
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake
index 72b4a1abb92..91e8bbeb04e 100644
--- a/cmake/libprotoc.cmake
+++ b/cmake/libprotoc.cmake
@@ -24,6 +24,7 @@ endif()
set_target_properties(libprotoc PROPERTIES
COMPILE_DEFINITIONS LIBPROTOC_EXPORTS
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protoc
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotoc ALIAS libprotoc)

View file

@ -0,0 +1,79 @@
diff --git a/ruby/Rakefile b/ruby/Rakefile
index c05e115..20144b7 100644
--- a/ruby/Rakefile
+++ b/ruby/Rakefile
@@ -1,6 +1,4 @@
require "rubygems"
-require "rubygems/package_task"
-require "rake/extensiontask" unless RUBY_PLATFORM == "java"
require "rake/testtask"
spec = Gem::Specification.load("google-protobuf.gemspec")
@@ -95,57 +93,6 @@ else
FileUtils.cp(utf8_root+"/range2-neon.c", "ext/google/protobuf_c")
FileUtils.cp(utf8_root+"/range2-sse.c", "ext/google/protobuf_c")
end
-
- Rake::ExtensionTask.new("protobuf_c", spec) do |ext|
- unless RUBY_PLATFORM =~ /darwin/
- # TODO: also set "no_native to true" for mac if possible. As is,
- # "no_native" can only be set if the RUBY_PLATFORM doing
- # cross-compilation is contained in the "ext.cross_platform" array.
- ext.no_native = true
- end
- ext.ext_dir = "ext/google/protobuf_c"
- ext.lib_dir = "lib/google"
- ext.cross_compile = true
- ext.cross_platform = [
- 'x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt',
- 'x86_64-linux', 'x86-linux',
- 'x86_64-darwin', 'arm64-darwin',
- ]
- end
-
- task 'gem:java' do
- sh "rm Gemfile.lock"
- require 'rake_compiler_dock'
- # Specify the repo root as the working and mount directory to provide access
- # to the java directory
- repo_root = File.realdirpath File.join(Dir.pwd, '..')
- RakeCompilerDock.sh <<-"EOT", platform: 'jruby', rubyvm: :jruby, mountdir: repo_root, workdir: repo_root
- sudo apt-get install maven -y && \
- cd java && mvn install -Dmaven.test.skip=true && cd ../ruby && \
- bundle && \
- IN_DOCKER=true rake compile gem
- EOT
- end
-
- task 'gem:windows' do
- sh "rm Gemfile.lock"
- require 'rake_compiler_dock'
- ['x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt', 'x86_64-linux', 'x86-linux'].each do |plat|
- RakeCompilerDock.sh <<-"EOT", platform: plat
- bundle && \
- IN_DOCKER=true rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem RUBY_CC_VERSION=3.1.0:3.0.0:2.7.0:2.6.0
- EOT
- end
- end
-
- if RUBY_PLATFORM =~ /darwin/
- task 'gem:native' do
- system "rake genproto"
- system "rake cross native gem RUBY_CC_VERSION=3.1.0:3.0.0:2.7.0:2.6.0"
- end
- else
- task 'gem:native' => [:genproto, 'gem:windows', 'gem:java']
- end
end
task :genproto => genproto_output
@@ -154,9 +101,6 @@ task :clean do
sh "rm -f #{genproto_output.join(' ')}"
end
-Gem::PackageTask.new(spec) do |pkg|
-end
-
# Skip build/genproto in Bazel builds, where we expect this to
# be done already.
Rake::TestTask.new(:test => ENV['BAZEL'] == 'true' ? [] : [:build, :genproto]) do |t|