Skip to content

centos7: fix package build error #799

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions fluent-package/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,10 @@ class BuildTask
rm_f(static_library)
end
end
Dir.glob("#{fluent_package_staging_dir}/**/libffi/**/*.py").each do |python_file|
# Remove unnecessary python file to avoid error in brp-python-bytecompile on CentOS 7
remove_files(python_file)
end
Dir.glob("#{fluent_package_staging_dir}/**/.git").each do |git_dir|
remove_files(git_dir, true)
end
Expand Down
13 changes: 13 additions & 0 deletions fluent-package/yum/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,23 @@ COPY qemu-* /usr/bin/

ARG DEBUG

RUN sed -i'' -e 's/^mirrorlist/#mirrorlist/g' \
-e 's/^#baseurl/baseurl/g' \
-e 's,mirror.centos.org/centos/$releasever,vault.centos.org/7.9.2009,g' \
/etc/yum.repos.d/CentOS-Base.repo

RUN \
quiet=$([ "${DEBUG}" = "yes" ] || echo "--quiet") && \
yum update -y ${quiet} && \
yum install -y ${quiet} centos-release-scl && \
sed -i'' -e 's/^mirrorlist/#mirrorlist/g' \
-e 's/^# baseurl/baseurl/g' \
-e 's,mirror.centos.org/centos/7,vault.centos.org/7.9.2009,g' \
/etc/yum.repos.d/CentOS-SCLo-scl.repo && \
sed -i'' -e 's/^mirrorlist/#mirrorlist/g' \
-e 's/^#baseurl/baseurl/g' \
-e 's,mirror.centos.org/centos/7,vault.centos.org/7.9.2009,g' \
/etc/yum.repos.d/CentOS-SCLo-scl-rh.repo && \
yum install -y ${quiet} epel-release && \
yum groupinstall -y ${quiet} "Development Tools" && \
yum install -y ${quiet} \
Expand Down
11 changes: 10 additions & 1 deletion lib/package-task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def run_docker(os, architecture=nil)
id = os
id = "#{id}-#{architecture}" if architecture
docker_tag = "#{@package}-#{id}"
# TODO: Fix docker tag name
docker_tag = "watson1978/#{docker_tag}" if os == "centos-7"
build_command_line = [
"docker",
"build",
Expand Down Expand Up @@ -149,7 +151,14 @@ def run_docker(os, architecture=nil)
build_command_line << docker_context
run_command_line.concat([docker_tag, "/host/build.sh"])

sh(*build_command_line)
if os == "centos-7"
if ENV["BUILD_DOCKER_IMAGE_ONLY"]
sh(*build_command_line)
exit
end
else
sh(*build_command_line)
end
sh(*run_command_line)
end

Expand Down
Loading