From 34d43969343ee3d62e4af690499bcfd3cbbeaff7 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 9 Mar 2023 14:26:01 -0500 Subject: [PATCH] user/gitlab-foss: upgrade to ruby 3.1 --- user/gitlab-foss/APKBUILD | 62 +++--- user/gitlab-foss/database-config.patch | 42 ++-- user/gitlab-foss/libgit-1.4-compat.patch | 11 - user/gitlab-foss/openssl3-compat.patch | 259 +++++++++++++++++++++++ 4 files changed, 307 insertions(+), 67 deletions(-) delete mode 100644 user/gitlab-foss/libgit-1.4-compat.patch create mode 100644 user/gitlab-foss/openssl3-compat.patch diff --git a/user/gitlab-foss/APKBUILD b/user/gitlab-foss/APKBUILD index 1b23500..50a8f31 100644 --- a/user/gitlab-foss/APKBUILD +++ b/user/gitlab-foss/APKBUILD @@ -3,13 +3,12 @@ # Contributor: Antoine Martin (ayakael) pkgname=gitlab-foss _pkgname=${pkgname%-foss} -pkgver=15.8.0 +pkgver=15.9.2 _gittag=v$pkgver -pkgrel=0 +pkgrel=2 pkgdesc="A version control for your server" url="https://gitlab.com/gitlab-org/gitlab-foss" -# Disable due to Openssl3 not being supported -#arch="x86_64" +arch="x86_64" license="MIT" # ruby-irb is needed only for Rails console (gitlab-rails console) depends=" @@ -19,34 +18,35 @@ depends=" exiftool git>=2.18.0 gitaly~=15.3 - gitlab-shell~=14.14 + gitlab-shell~=14.17 graphicsmagick http-parser procps py-docutils python3 redis>=2.8 - ruby2.7 - ruby2.7-bigdecimal - ruby2.7-bundler - ruby2.7-fiddle - ruby2.7-io-console - ruby2.7-irb - ruby2.7-json - ruby2.7-rake - ruby2.7-webrick + ruby + ruby-bigdecimal + ruby-bundler + ruby-fiddle + ruby-io-console + ruby-irb + ruby-json + ruby-rake + ruby-webrick shared-mime-info tzdata " makedepends=" cmd:chrpath + cmake file-dev go gpgme-dev icu-dev libffi-dev libgcrypt-dev - libgit2-dev~=1.4 + libgit2-dev libpq-dev libxml2-dev libxslt-dev @@ -55,17 +55,17 @@ makedepends=" openssl-dev protobuf-dev re2-dev - ruby2.7-dev - ruby2.7-grpc + ruby-dev + ruby-grpc yarn>=1.2.0 " pkgusers="git" pkggroups="git www-data" install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade" -subpackages="$pkgname-assets::noarch" +subpackages="$pkgname-assets::noarch $pkgname-openrc" source="https://gitlab.com/gitlab-org/gitlab-foss/-/archive/$_gittag/gitlab-foss-$_gittag.tar.gz - libgit-1.4-compat.patch database-config.patch + openssl3-compat.patch $_pkgname.initd $_pkgname.mailroom.initd $_pkgname.rails.initd @@ -89,8 +89,6 @@ prepare() { default_prepare - cd "$builddir" - # The default log level is very chatty. sed -i 's/^\(\s*config.log_level\s*=\).*$/\1 :warn/' \ config/environments/production.rb @@ -129,20 +127,14 @@ build() { --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.rugged --use-system-libraries + # compatibility with libgit 1.5.1 has issues + # bundle config --local build.rugged --use-system-libraries # https://github.com/protocolbuffers/protobuf/issues/2335#issuecomment-579913357 bundle config --local build.google-protobuf --with-cflags=-D__va_copy=va_copy bundle config --local path "vendor/bundle" bundle install --no-cache - # Fix https://github.com/funny-falcon/murmurhash3-ruby/pull/9 - ( - cd vendor/bundle/ruby/*/extensions/*/*/murmurhash3-* - mkdir -p murmurhash3 - mv native.so murmurhash3/ - ) - # Replace bundled CA bundle with symlink. ( cd vendor/bundle/ruby/*/gems/aws-sdk-core-*/ @@ -216,8 +208,6 @@ package() { local datadir="$pkgdir/var/lib/gitlab" local file dest - cd "$builddir" - install -d -m755 "$destdir" "$destdir"/bin install -d -m755 -o git -g git \ @@ -251,7 +241,7 @@ package() { # Install application files. # Note: *VERSION files and doc directory are required (Help in GitLab # menu refers to the doc directory). - cp -rl .bundle config.ru Gemfile* INSTALLATION_TYPE Rakefile *VERSION \ + cp -rl .bundle config.ru Gemfile* INSTALLATION_TYPE Rakefile ./*VERSION \ app data db doc fixtures config lib locale metrics_server public sidekiq_cluster vendor \ "$destdir"/ @@ -272,7 +262,7 @@ package() { rm -r app/assets rm -r vendor/assets find public/assets -name '*.vue' -delete - find public/assets -type d | xargs rmdir --ignore-fail-on-non-empty + find public/assets -type d -exec rmdir --ignore-fail-on-non-empty '{}' \; # These load gems in the assets group. rm config/initializers/gettext_rails_i18n_patch.rb rm config/initializers/sprockets.rb @@ -381,9 +371,9 @@ assets() { } sha512sums=" -5e1d92f52eab08c16fcba10f57df4539b3f2739f93fa0f3c4792a00b76f5f0ec4aee0d846532d2f892da38463f144b4c1ae920b5b98e2ac15aad97122ba348b9 gitlab-foss-v15.8.0.tar.gz -80e27697772c4529720f2ec65d314641cd5f437070d0fefd3c521852ff6dad8c9127534e379a5c0bcee4bbae8d5a373d131bf91a58606d02c89104e34a88baac libgit-1.4-compat.patch -dd984ae890c10119df6c510be1bd22e3d18652115ccaec6cb3e0a7c49d00cc72ec1c7c2414c29e6a13171c0a139626c8227e0ba3020f0ec3fe2c318b47101248 database-config.patch +8b99a892515fdeedbded148c31455b373af6d8ba1802d920decfcb4afd4316f8d12ea74134a3ab6a9863e8fbe99b9d58016aa22689324ecc04d380f84ea5c4f7 gitlab-foss-v15.9.2.tar.gz +f8b6855445e4086b4a4059a6359fafe7ca78ccf9ed6953a5b2a606d02add9519bb98ccf5f4a3bb750b94cfc44e660e70186813f7c7296fac343377e922e8a54a database-config.patch +931e738f53c95933b87161f4095d7b9d93653feec5395e474aa7be3b6db791c3542222a8db8709954e44fd25f5484966d4ffe3b754cda03305f1d79e604909bd openssl3-compat.patch 55b0667d3969113ffd6860652ee8bdb9a534c25f413f33b2739e922c886988e7cea72c1c00c7eecf29fcff3682b1324156365605ffc6aae45d1e0ccddf96288b gitlab.initd 1f451b67a5d5e58650b0fe862a2b65cfb8bff5502b37d94ae90619c1ff9affbecf24428303a2849bebce5f94bef37078f0e5710e344bbab616134e910938384a gitlab.mailroom.initd b6a6d9ba20557e61efa24f2d5a489873fefbb981f7d4465794a857b2971263c08ec29cc001c372522cdc0d48245e59751307c9f44f6ef4d87bf2e3ec5c23fb1c gitlab.rails.initd diff --git a/user/gitlab-foss/database-config.patch b/user/gitlab-foss/database-config.patch index fe53c26..1d5a717 100644 --- a/user/gitlab-foss/database-config.patch +++ b/user/gitlab-foss/database-config.patch @@ -1,11 +1,11 @@ -diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql -index 5329a8e..a4daab1 100644 ---- a/config/database.yml.postgresql +diff --git a/config/database.yml.postgresql.orig b/config/database.yml.postgresql +index c1b1247..dbe5b77 100644 +--- a/config/database.yml.postgresql.orig +++ b/config/database.yml.postgresql -@@ -18,13 +18,6 @@ production: - # port: 8600 - # record: secondary.postgresql.service.consul - # interval: 300 +@@ -26,14 +26,7 @@ production: + # username: git + # password: "secure password" + # host: localhost - geo: - adapter: postgresql - encoding: unicode @@ -13,13 +13,15 @@ index 5329a8e..a4daab1 100644 - username: git - password: "secure password" - host: localhost - +- ++ # # Development specific -@@ -39,13 +32,6 @@ development: - host: localhost - variables: - statement_timeout: 15s + # +@@ -57,13 +50,6 @@ development: + # host: localhost + # variables: + # statement_timeout: 15s - geo: - adapter: postgresql - encoding: unicode @@ -30,10 +32,10 @@ index 5329a8e..a4daab1 100644 # # Staging specific -@@ -58,13 +44,6 @@ staging: - username: git - password: "secure password" - host: localhost +@@ -84,13 +70,6 @@ staging: + # username: git + # password: "secure password" + # host: localhost - geo: - adapter: postgresql - encoding: unicode @@ -44,10 +46,10 @@ index 5329a8e..a4daab1 100644 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". -@@ -80,10 +59,3 @@ test: &test - prepared_statements: false - variables: - statement_timeout: 15s +@@ -117,10 +96,3 @@ test: &test + # prepared_statements: false + # variables: + # statement_timeout: 15s - geo: - adapter: postgresql - encoding: unicode diff --git a/user/gitlab-foss/libgit-1.4-compat.patch b/user/gitlab-foss/libgit-1.4-compat.patch deleted file mode 100644 index a70d2dc..0000000 --- a/user/gitlab-foss/libgit-1.4-compat.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Gemfile.lock -+++ b/Gemfile.lock -@@ -1215 +1215 @@ -- rugged (1.2.0) -+ rugged (1.4.4) -@@ -1411 +1411 @@ -- undercover (0.4.4) -+ undercover (0.4.5) -@@ -1414 +1414 @@ -- rugged (>= 0.27, < 1.3) -+ rugged (>= 0.27, < 1.6) diff --git a/user/gitlab-foss/openssl3-compat.patch b/user/gitlab-foss/openssl3-compat.patch new file mode 100644 index 0000000..e13a1a9 --- /dev/null +++ b/user/gitlab-foss/openssl3-compat.patch @@ -0,0 +1,259 @@ +diff --git a/Gemfile.orig b/Gemfile +index 9e4fd6c..c54e0d0 100644 +--- a/Gemfile.orig ++++ b/Gemfile +@@ -19,7 +19,7 @@ gem 'bootsnap', '~> 1.16.0', require: false + + # Pin openssl to match the version bundled with our supported Rubies. + # See https://stdgems.org/openssl/#gem-version. +-gem 'openssl', '2.2.2' ++gem 'openssl', '~> 3.0' + # This gem was originally bundled with Ruby 2.7, but is unbundled as of Ruby 3. + # Since the latest version caused problems with GitLab, we pin this to an older + # version for now. +@@ -72,9 +72,7 @@ gem 'omniauth-saml', '~> 2.0.0' + gem 'omniauth-twitter', '~> 1.4' + gem 'omniauth_crowd', '~> 2.4.0', path: 'vendor/gems/omniauth_crowd' # See vendor/gems/omniauth_crowd/README.md + gem 'omniauth_openid_connect', '~> 0.6.1' +-# Locked until Ruby 3.0 upgrade since upgrading will pull in an updated net-smtp gem. +-# See https://docs.gitlab.com/ee/development/emails.html#rationale. +-gem 'openid_connect', '= 1.3.0' ++gem 'openid_connect', '~> 1.3.1' + gem 'omniauth-salesforce', '~> 1.0.5', path: 'vendor/gems/omniauth-salesforce' # See gem README.md + gem 'omniauth-atlassian-oauth2', '~> 0.2.0' + gem 'rack-oauth2', '~> 1.21.3' +@@ -544,10 +542,7 @@ gem 'retriable', '~> 3.1.2' + # LRU cache + gem 'lru_redux' + +-# Locked as long as quoted-printable encoding issues are not resolved +-# Monkey-patched in `config/initializers/mail_encoding_patch.rb` +-# See https://gitlab.com/gitlab-org/gitlab/issues/197386 +-gem 'mail', '= 2.7.1' ++gem 'mail', '~> 2.8' + gem 'mail-smtp_pool', '~> 0.1.0', path: 'vendor/gems/mail-smtp_pool', require: false + + gem 'microsoft_graph_mailer', '~> 0.1.0', path: 'vendor/gems/microsoft_graph_mailer' +@@ -593,3 +588,6 @@ gem 'app_store_connect' + + # For phone verification + gem 'telesignenterprise', '~> 2.2' ++ ++# Temp fix for ruby3.1 ++gem 'psych', '< 4' +diff --git a/Gemfile.lock.orig b/Gemfile.lock +index 2e548c4..c009e81 100644 +--- a/Gemfile.lock.orig ++++ b/Gemfile.lock +@@ -198,7 +198,7 @@ GEM + autoprefixer-rails (10.2.5.1) + execjs (> 0) + awesome_print (1.9.2) +- awrence (1.1.1) ++ awrence (1.2.1) + aws-eventstream (1.2.0) + aws-partitions (1.703.0) + aws-sdk-cloudformation (1.41.0) +@@ -242,7 +242,7 @@ GEM + coderay (>= 1.0.0) + erubi (>= 1.0.0) + rack (>= 0.9.0) +- bindata (2.4.11) ++ bindata (2.4.15) + binding_ninja (0.2.3) + bootsnap (1.16.0) + msgpack (~> 1.2) +@@ -294,13 +294,13 @@ GEM + coderay (1.1.3) + colored2 (3.1.2) + commonmarker (0.23.6) +- concurrent-ruby (1.2.0) ++ concurrent-ruby (1.2.2) + connection_pool (2.3.0) + cork (0.3.0) + colored2 (~> 3.1) +- cose (1.0.0) ++ cose (1.3.0) + cbor (~> 0.5.9) +- openssl-signature_algorithm (~> 0.4.0) ++ openssl-signature_algorithm (~> 1.0) + countries (4.0.1) + i18n_data (~> 0.13.0) + sixarm_ruby_unaccent (~> 1.1) +@@ -330,6 +330,7 @@ GEM + danger + gitlab (~> 4.2, >= 4.2.0) + database_cleaner (1.7.0) ++ date (3.3.3) + dead_end (3.1.1) + deckar01-task_list (2.3.2) + html-pipeline +@@ -898,8 +899,11 @@ GEM + zeitwerk (~> 2.5) + lru_redux (1.1.0) + lumberjack (1.2.7) +- mail (2.7.1) ++ mail (2.8.1) + mini_mime (>= 0.1.1) ++ net-imap ++ net-pop ++ net-smtp + marcel (1.0.2) + marginalia (1.11.1) + actionpack (>= 5.2) +@@ -943,10 +947,19 @@ GEM + nenv (0.3.0) + net-http-persistent (4.0.1) + connection_pool (~> 2.2) ++ net-imap (0.3.4) ++ date ++ net-protocol + net-ldap (0.17.1) + net-ntp (2.1.3) ++ net-pop (0.1.2) ++ net-protocol ++ net-protocol (0.2.1) ++ timeout + net-scp (3.0.0) + net-ssh (>= 2.6.5, < 7.0.0) ++ net-smtp (0.3.3) ++ net-protocol + net-ssh (6.0.0) + netrc (0.11.0) + nio4r (2.5.8) +@@ -1029,19 +1042,20 @@ GEM + omniauth (>= 1.9, < 3) + openid_connect (~> 1.1) + open4 (1.3.4) +- openid_connect (1.3.0) ++ openid_connect (1.3.1) + activemodel + attr_required (>= 1.0.0) + json-jwt (>= 1.5.0) ++ net-smtp + rack-oauth2 (>= 1.6.1) + swd (>= 1.0.0) + tzinfo + validate_email + validate_url + webfinger (>= 1.0.1) +- openssl (2.2.2) +- ipaddr +- openssl-signature_algorithm (0.4.0) ++ openssl (3.0.2) ++ openssl-signature_algorithm (1.3.0) ++ openssl (> 2.0) + opentracing (0.5.0) + optimist (3.0.1) + org-ruby (0.9.12) +@@ -1110,7 +1124,8 @@ GEM + pry (>= 0.13.0) + tty-markdown + tty-prompt +- public_suffix (5.0.0) ++ psych (3.3.4) ++ public_suffix (5.0.1) + puma (5.6.5) + nio4r (~> 2.0) + puma_worker_killer (0.3.1) +@@ -1119,7 +1134,7 @@ GEM + pyu-ruby-sasl (0.0.3.3) + raabro (1.4.0) + racc (1.6.2) +- rack (2.2.6.2) ++ rack (2.2.6.3) + rack-accept (0.4.5) + rack (>= 0.4) + rack-attack (6.6.1) +@@ -1335,7 +1350,6 @@ GEM + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + sd_notify (0.1.1) +- securecompare (1.0.0) + seed-fu (2.3.7) + activerecord (>= 3.1) + activesupport (>= 3.1) +@@ -1466,15 +1480,17 @@ GEM + thrift (0.16.0) + tilt (2.0.11) + timeliness (0.3.10) ++ timeout (0.3.2) + timfel-krb5-auth (0.8.3) + tins (1.31.1) + sync + toml-rb (2.2.0) + citrus (~> 3.0, > 3.0) + tomlrb (1.3.0) +- tpm-key_attestation (0.9.0) ++ tpm-key_attestation (0.11.0) + bindata (~> 2.4) +- openssl-signature_algorithm (~> 0.4.0) ++ openssl (> 2.0, < 3.1) ++ openssl-signature_algorithm (~> 1.0) + trailblazer-option (0.1.2) + train-core (3.4.9) + addressable (~> 2.5) +@@ -1547,19 +1563,19 @@ GEM + warden (1.2.9) + rack (>= 2.0.9) + warning (1.3.0) +- webauthn (2.3.0) ++ webauthn (2.5.2) + android_key_attestation (~> 0.3.0) + awrence (~> 1.1) + bindata (~> 2.4) + cbor (~> 0.5.9) +- cose (~> 1.0) +- openssl (~> 2.0) ++ cose (~> 1.1) ++ openssl (>= 2.2, < 3.1) + safety_net_attestation (~> 0.4.0) +- securecompare (~> 1.0) +- tpm-key_attestation (~> 0.9.0) +- webfinger (1.2.0) ++ tpm-key_attestation (~> 0.11.0) ++ webfinger (2.0.0) + activesupport +- httpclient (>= 2.4) ++ faraday (~> 1.7) ++ faraday_middleware (~> 1.1) + webmock (3.9.1) + addressable (>= 2.3.6) + crack (>= 0.3.2) +@@ -1581,7 +1597,7 @@ GEM + nokogiri (~> 1.8) + yajl-ruby (1.4.3) + yard (0.9.26) +- zeitwerk (2.6.6) ++ zeitwerk (2.6.7) + + PLATFORMS + ruby +@@ -1748,7 +1764,7 @@ DEPENDENCIES + loofah (~> 2.19.1) + lookbook (~> 1.5, >= 1.5.3) + lru_redux +- mail (= 2.7.1) ++ mail (~> 2.8) + mail-smtp_pool (~> 0.1.0)! + marginalia (~> 1.11.1) + memory_profiler (~> 1.0) +@@ -1782,8 +1798,8 @@ DEPENDENCIES + omniauth-twitter (~> 1.4) + omniauth_crowd (~> 2.4.0)! + omniauth_openid_connect (~> 0.6.1) +- openid_connect (= 1.3.0) +- openssl (= 2.2.2) ++ openid_connect (~> 1.3.1) ++ openssl (~> 3.0) + org-ruby (~> 0.9.12) + pact (~> 1.63) + parallel (~> 1.19) +@@ -1797,6 +1813,7 @@ DEPENDENCIES + pry-byebug + pry-rails (~> 0.3.9) + pry-shell (~> 0.6.1) ++ psych (< 4) + puma (~> 5.6.5) + puma_worker_killer (~> 0.3.1) + rack (~> 2.2.6, >= 2.2.6.2)