diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 235c4b87710de548e174cc0812a22458a9a8f79c..2f0700454b554cfb1996db3002b5db62199476dc 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -25,6 +25,7 @@ setup-test-env: - section_start "setup-test-env" "Setting up testing environment"; scripts/setup-test-env; section_end "setup-test-env"; - select_gitlab_workhorse_essentials - section_start "gitaly-test-build" "Compiling Gitaly binaries"; scripts/gitaly-test-build; section_end "gitaly-test-build"; # Do not use 'bundle exec' here + - strip_executable_binaries "${TMP_TEST_FOLDER}" artifacts: expire_in: 7d paths: diff --git a/doc/development/pipelines/performance.md b/doc/development/pipelines/performance.md index d9019e6053bb800c2c2011187c7a12312145631f..a7983971dfe093baf15c71d5640a7486c2fdd8a3 100644 --- a/doc/development/pipelines/performance.md +++ b/doc/development/pipelines/performance.md @@ -177,3 +177,11 @@ and `compile-production-assets` jobs to: This task is responsible for deciding if assets need to be compiled or not. It [compares the `HEAD` `SHA256` hexdigest from `$GITLAB_ASSETS_HASH` with the `master` hexdigest from `cached-assets-hash.txt`](https://gitlab.com/gitlab-org/gitlab/-/blob/c023191ef412e868ae957f3341208a41ca678403/lib/tasks/gitlab/assets.rake#L86). 1. If the hashes are the same, we don't compile anything. If they're different, we compile the assets. + +## Stripped binaries + +By default, `setup-test-env` creates an artifact which contains stripped +binaries to [save storage and speed-up artifact downloads](https://gitlab.com/gitlab-org/gitlab/-/issues/442029#note_1775193538) of subsequent CI jobs. + +To make debugging a crash from stripped binaries easier comment line with +`strip_executable_binaries` in the `setup-test-job` job and start a new pipeline. diff --git a/scripts/gitlab_component_helpers.sh b/scripts/gitlab_component_helpers.sh index 98688d3864381ed62bd29d846e8eb09b3d51f43b..3d9f996e7c034ed916fd07dcca066a85042624ef 100644 --- a/scripts/gitlab_component_helpers.sh +++ b/scripts/gitlab_component_helpers.sh @@ -91,6 +91,12 @@ function select_gitlab_workhorse_essentials() { mv ${tmp_path} ${TMP_TEST_FOLDER} } +function strip_executable_binaries() { + local path="$1" + + find "$path" -executable -type f ! -size 0 -print0 | xargs -0 grep -IL . | xargs strip || true +} + # Assets functions function gitlab_assets_archive_doesnt_exist() { archive_doesnt_exist "${GITLAB_ASSETS_PACKAGE_URL}"