Skip to content

Commit 016b0a1

Browse files
committed
Move the workaround from spec script to Dockerfile
1 parent e02007e commit 016b0a1

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

platforms/Linux/amazonlinux/2/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n
2121
ADD swiftlang.spec /tmp/swiftlang.spec
2222
RUN touch /tmp/metadata.inc # fake metadata is okay for this optimization
2323
RUN cd /tmp && yum-builddep -y swiftlang.spec
24+
25+
# fix python six
26+
RUN mkdir -p /usr/local/lib/python3.7/site-packages/
27+
RUN easy_install-3.7 six

platforms/Linux/amazonlinux/2/build_rpm.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ cp patches/*.patch $HOME/rpmbuild/SOURCES/
3232
pushd $HOME/rpmbuild/SPECS
3333
# install all the dependencies needed to build Swift from the spec file itself
3434
yum-builddep -y ./swiftlang.spec
35-
# fix python six
36-
mkdir -p /usr/local/lib/python3.7/site-packages/
37-
easy_install-3.7 six
3835
# get the sources for Swift as defined in the spec file
3936
spectool -g -R ./swiftlang.spec
4037
# Now we proceed to build Swift. If this is successful, we

platforms/Linux/centos/7/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ RUN yum install -y epel-release centos-release-scl
2121
ADD swiftlang.spec /tmp/swiftlang.spec
2222
RUN touch /tmp/metadata.inc # fake metadata is okay for this optimization
2323
RUN cd /tmp && yum-builddep -y swiftlang.spec
24+
25+
# Workaround to support clang-3.5 or a later version
26+
RUN echo -e ". /opt/rh/sclo-git25/enable\n. /opt/rh/llvm-toolset-7/enable\n. /opt/rh/devtoolset-8/enable\n" >> $HOME/.bashrc
27+
RUN source $HOME/.bashrc
28+
RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h

platforms/Linux/centos/7/build_rpm.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ cp patches/*.patch $HOME/rpmbuild/SOURCES/
3232
pushd $HOME/rpmbuild/SPECS
3333
# install all the dependencies needed to build Swift from the spec file itself
3434
yum-builddep -y ./swiftlang.spec
35-
# Workaround to support clang-3.5 or a later version
36-
echo -e ". /opt/rh/sclo-git25/enable\n. /opt/rh/llvm-toolset-7/enable\n. /opt/rh/devtoolset-8/enable\n" >> $HOME/.bashrc
37-
source $HOME/.bashrc
38-
sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h
3935
# get the sources for Swift as defined in the spec file
4036
spectool -g -R ./swiftlang.spec
4137
# Now we proceed to build Swift. If this is successful, we

0 commit comments

Comments
 (0)