Skip to content

Commit aa5ed1f

Browse files
committed
Add ruby-shadow to build
1. In Chef 18.x, chef/chef#11659 modified the Chef user provider to require the `ruby-shadow` gem anytime the NGINX user exists. This was introduced in order to update `/etc/shadow` with an expiration date, if present. 2. Previously it was not required because we don't set a password for the user: https://github.com/chef/chef/blob/v17.10.15/lib/chef/provider/user.rb#L69 3. The Chef Omnibus package ships with `ruby-shadow`, as it is listed in the `Gemfile`: https://github.com/chef/chef/blob/3c35bd0e1d17a5bfd779fab3cc7860ea1923dec6/Gemfile#L43 4. This gem isn't listed in the `.gemspec`, so Ruby doesn't include it as an explicit requirement. However, Omnibus GitLab now needs this. Relates to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17417
1 parent 10c817c commit aa5ed1f

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.custom_sources.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,6 @@ ncurses:
154154
pgbouncer:
155155
remote: "[email protected]:omnibus-mirror/pgbouncer.git"
156156
alternative: "https://gitlab.com/gitlab-org/build/omnibus-mirror/pgbouncer.git"
157+
ruby-shadow:
158+
remote: "[email protected]:omnibus-mirror/ruby-shadow.git"
159+
alternative: "https://gitlab.com/gitlab-org/build/omnibus-mirror/ruby-shadow.git"

config/software/chef-gem.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
dependency 'rubygems'
3333
dependency 'libffi'
3434
dependency 'rb-readline'
35+
dependency 'ruby-shadow'
3536

3637
build do
3738
patch source: "license/add-license-file.patch"

config/software/ruby-shadow.rb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# Copyright 2012-2015 Chef Software, Inc.
3+
# Copyright 2017-2023 GitLab Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
name 'ruby-shadow'
19+
# From https://github.com/chef/chef/blob/3c35bd0e1d17a5bfd779fab3cc7860ea1923dec6/Gemfile#L41-L44
20+
version = Gitlab::Version.new('ruby-shadow', '3b8ea40b0e943b5de721d956741308ce805a5c3c')
21+
default_version version.print(false)
22+
display_version version.print(false)
23+
24+
license 'Apache-2.0'
25+
license_file 'LICENSE'
26+
27+
skip_transitive_dependency_licensing true
28+
29+
dependency 'rubygems'
30+
31+
source git: version.remote
32+
33+
relative_path 'ruby-shadow'
34+
35+
build do
36+
env = with_standard_compiler_flags(with_embedded_path)
37+
38+
# Remove existing built gems in case they exist in the current dir
39+
delete 'ruby-shadow-*.gem'
40+
41+
gem 'build ruby-shadow.gemspec', env: env
42+
gem 'install ruby-shadow-*.gem --no-document', env: env
43+
end

0 commit comments

Comments
 (0)