Skip to content

Commit 18cb56c

Browse files
committed
Suppress Ruby experimental features warning messages
The Remote Development codebase uses Ruby's experimental pattern matching syntax (https://docs.ruby-lang.org/en/3.0/syntax/pattern_matching_rdoc.html). As a result, booting `gitlab-rails console` shows a stream of these warnings at compile-time: ``` warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby! ``` Let's just squelch these warnings for now since they're development warnings, and CI should catch issues if this breaks. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/420811 Changelog: fixed
1 parent c17552f commit 18cb56c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

config/templates/gitlab-rails/bundle_exec_wrapper.erb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ else
4040
privilege_drop="-u ${gitlab_user}:${gitlab_group}"
4141
fi
4242

43-
exec <%= install_dir %>/embedded/bin/chpst -e <%= install_dir %>/etc/gitlab-rails/env ${privilege_drop} -U ${gitlab_user}:${gitlab_group} <%= install_dir %>/embedded/bin/bundle exec <%= command %>
43+
# Suppress one-line pattern matching warnings: https://gitlab.com/gitlab-org/gitlab/-/issues/420811
44+
rubyopt="RUBYOPT=-W:no-experimental"
45+
46+
exec <%= install_dir %>/embedded/bin/chpst -e <%= install_dir %>/etc/gitlab-rails/env ${privilege_drop} -U ${gitlab_user}:${gitlab_group} /usr/bin/env ${rubyopt} <%= install_dir %>/embedded/bin/bundle exec <%= command %>

0 commit comments

Comments
 (0)