Skip to content

Commit

Permalink
www/gitlab-ce: make it working with ruby 3.1
Browse files Browse the repository at this point in the history
Ruby 3.1 did some breaking changes:
https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/

With the help of @yasu I added some work-arounds that should
make gitlab work again with ruby 3.1.
They can be removed after gitlab support ruby 3.1 upstream.

PR:		270252
  • Loading branch information
mfechner committed Mar 16, 2023
1 parent ce796be commit 078d7d3
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
1 change: 1 addition & 0 deletions textproc/Makefile
Expand Up @@ -1782,6 +1782,7 @@
SUBDIR += rubygem-phone
SUBDIR += rubygem-pretty-xml
SUBDIR += rubygem-psych
SUBDIR += rubygem-psych3
SUBDIR += rubygem-puppet-strings
SUBDIR += rubygem-raabro
SUBDIR += rubygem-rails-dom-testing
Expand Down
20 changes: 20 additions & 0 deletions textproc/rubygem-psych3/Makefile
@@ -0,0 +1,20 @@
PORTNAME= psych
PORTVERSION= 3.3.4
CATEGORIES= textproc rubygems
MASTER_SITES= RG
PKGNAMESUFFIX= 3

MAINTAINER= mfechner@FreeBSD.org
COMMENT= YAML parser and emitter
WWW= https://github.com/ruby/psych

LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

LIB_DEPENDS= libyaml.so:textproc/libyaml

USES= gem

PORTSCOUNT= limit:^3

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions textproc/rubygem-psych3/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1678956175
SHA256 (rubygem/psych-3.3.4.gem) = f0aae8574d0c86b711472e6a57cc036655e2549f02390ca7266f3b6d1814d1a0
SIZE (rubygem/psych-3.3.4.gem) = 93184
3 changes: 3 additions & 0 deletions textproc/rubygem-psych3/pkg-descr
@@ -0,0 +1,3 @@
Psych is a YAML parser and emitter. Psych leverages libyaml for its YAML parsing
and emitting capabilities. In addition to wrapping libyaml, Psych also knows how
to serialize and de-serialize most Ruby objects to and from the YAML format.
8 changes: 7 additions & 1 deletion www/gitlab-ce/Makefile
@@ -1,6 +1,6 @@
PORTNAME= gitlab-ce
PORTVERSION= 15.8.4
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= www devel

MAINTAINER= mfechner@FreeBSD.org
Expand All @@ -14,6 +14,9 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
# which makes maintaining this long list much easier!
# devel/rubygem-parser is required for database upgrade process
# see https://gitlab.com/gitlab-org/gitlab/-/issues/350866
# mail/rubygem-net-smtp is required as ruby 3.1 removed it
# textproc/rubygem-psych3 is required as ruby 3.1 applied an update to psych 4.0 which has breaking changes
# mail/rubygem-net-pop is required as ruby 3.1 removed it
MY_DEPENDS= git>=2.39.2:devel/git \
gitaly>=${PORTVERSION}:devel/gitaly \
gitlab-elasticsearch-indexer>=3.2.0:textproc/gitlab-elasticsearch-indexer \
Expand All @@ -26,6 +29,9 @@ MY_DEPENDS= git>=2.39.2:devel/git \
yarn>=1.10.0:www/yarn \
gtar>0:archivers/gtar \
bash>0:shells/bash \
rubygem-net-smtp>=0:mail/rubygem-net-smtp \
rubygem-net-pop>=0:mail/rubygem-net-pop \
rubygem-psych3>=3.1<4:textproc/rubygem-psych3 \
rubygem-rails61>=6.1.6.1<6.1.8:www/rubygem-rails61 \
rubygem-bootsnap115>=1.15.0<1.16:devel/rubygem-bootsnap115 \
rubygem-openssl2>=2.2.2<2.3:security/rubygem-openssl2 \
Expand Down
7 changes: 5 additions & 2 deletions www/gitlab-ce/files/patch-Gemfile
@@ -1,4 +1,4 @@
--- Gemfile.orig 2023-01-20 09:57:01 UTC
--- Gemfile.orig 2023-03-02 09:53:28 UTC
+++ Gemfile
@@ -13,13 +13,13 @@ gem 'bundler-checksum', '~> 0.1.0', path: 'vendor/gems
# NOTE: When incrementing the major or minor version here, also increment activerecord_version
Expand Down Expand Up @@ -202,12 +202,15 @@
gem 'json_schemer', '~> 0.2.18'
gem 'oj', '~> 3.13.21'
gem 'oj-introspect', '~> 0.7'
@@ -565,6 +469,8 @@ gem 'ed25519', '~> 1.3.0'
@@ -565,6 +469,11 @@ gem 'ed25519', '~> 1.3.0'
# Error Tracking OpenAPI client
# See https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/development/rake_tasks.md#update-openapi-client-for-error-tracking-feature
gem 'error_tracking_open_api', path: 'vendor/gems/error_tracking_open_api'
+
+gem 'parser'
+gem 'net-smtp'
+gem 'net-pop'
+gem 'psych', '~> 3.1'

# Vulnerability advisories
gem 'cvss-suite', '~> 3.0.1', require: 'cvss_suite'

0 comments on commit 078d7d3

Please sign in to comment.