Skip to content

Prune unneeded gitlab-glfm-markdown precompiled libraries

Stan Hu requested to merge sh-cleanup-gitlab-glfm-markdown-libs into master

What does this MR do?

gitlab-glfm-markdown ships with precompiled shared libraries for all supported Ruby versions. Just as we do with nokogiri and other gems, keep only the version needed for the current Ruby version. This saves about 28 MB of disk space.

Omnibus MR: gitlab-org/omnibus-gitlab!7408 (merged)

Related issues

Test plan

  1. Deploy registry.gitlab.com/gitlab-org/build/cng/gitlab-rails-ee:sh-cleanup-gitlab-glfm-markdown-libs
  2. From bin/rails console: GLFMMarkdown.to_html('# header', options: {sourcepos: true}):
irb(main):001:0> GLFMMarkdown.to_html('# header', options: {sourcepos: true})
=> "<h1 data-sourcepos=\"1:1-1:8\">header</h1>\n"
  1. Check /srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux.

Before

$ du -h /srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux
16K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/ext/glfm_markdown/src
28K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/ext/glfm_markdown
32K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/ext
7.1M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/3.0
7.1M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/2.7
7.1M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/3.2
7.1M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/3.1
7.1M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/3.3
36M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown
36M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib
36M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux

After

$ du -h /srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux
16K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/ext/glfm_markdown/src
28K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/ext/glfm_markdown
32K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/ext
7.1M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/3.1
4.0K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/3.2
4.0K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/2.7
4.0K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/3.0
4.0K	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown/3.3
7.2M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib/glfm_markdown
7.2M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux/lib
7.2M	/srv/gitlab/vendor/bundle/ruby/3.1.0/gems/gitlab-glfm-markdown-0.0.12-x86_64-linux

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
  • New dependencies are managed with dependencies.io
Edited by Stan Hu

Merge request reports