Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only build valgrind if needed #2363

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ RUN pip3 install compiledb || pip3 install compiledb --break-system-packages
RUN gem install bundler --no-doc

# Valgrind on our docker image is too old to handle compressed debug symbols or some such.
WORKDIR /tmp
RUN wget https://sourceware.org/pub/valgrind/valgrind-3.24.0.tar.bz2 && \
ARG NEED_VALGRIND=false
RUN if [ "$NEED_VALGRIND" = "true" ]; then \
cd /tmp && \
wget https://sourceware.org/pub/valgrind/valgrind-3.24.0.tar.bz2 && \
tar xvf valgrind-3.24.0.tar.bz2 && \
cd valgrind-3.24.0 && \
./configure && \
make -j 4 && \
make install
make install; \
fi

ENV LC_ALL=C.UTF-8
ENV LLVM_CONFIG=/usr/lib/llvm-14/bin/llvm-config
Expand Down
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ task :docker_build_clang_release do
'--build-arg CXX=clang++ ' \
'--build-arg NAT_CXX_FLAGS=-DNAT_GC_GUARD ' \
'--build-arg NAT_BUILD_MODE=release ' \
"--build-arg NEED_VALGRIND=#{ENV.fetch('NEED_VALGRIND', 'false')} " \
'.'
end

Expand Down Expand Up @@ -391,7 +392,9 @@ task docker_test_all_ruby_spec_nightly: :docker_build_clang do
"natalie_clang_#{ruby_version_string} test_all_ruby_spec_nightly"
end

task docker_test_perf: :docker_build_clang_release do
task :docker_test_perf do
ENV['NEED_VALGRIND'] = 'true'
Rake::Task['docker_build_clang_release'].invoke
sh "docker run #{docker_run_flags} " \
"-e STATS_API_SECRET=#{(ENV['STATS_API_SECRET'] || '').inspect} " \
"-e GIT_SHA=#{(ENV['LAST_COMMIT_SHA'] || '').inspect} " \
Expand Down
Loading