Ensure Ruby default gem directories are preserved in cache
Default gems such as `ruby2_keywords` create blank directories. For example, `ruby2_keywords` in Ruby 3.2 creates: ``` root@build:/# ls -al /opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/ruby2_keywords-0.0.5 total 8 drwxr-xr-x 2 root root 4096 Feb 22 23:22 . drwxr-xr-x 89 root root 4096 Feb 22 23:22 .. ``` Omnibus uses a Git cache that runs `git add -A -f --worktree=/opt/gitlab`. Because these directories are blank, the Omnibus Git cache doesn't preserve them. This doesn't seem to cause problems because Bundler ultimately cares whether the `.gemspec` file exists, but it is confusing. We should preserve these directories as they were created by Ruby. Fix this by adding a blank `.gitkeep` to all subdirectories inside `/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems` for Ruby 3.2. Relates to https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8935 Changelog: fixed
Please register or sign in to comment