Commit 43b7025c authored by Drew's avatar Drew

Snapshot swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a

* support libdispatch
* break up builds into more kinds of files
parent 34f65e21
FROM debian:latest
MAINTAINER Drew Crawford
ENV SWIFT_TAG="__TAG__" RUNTIME_PACKAGES="clang libedit2 libpython2.7 libxml2 libicu52" BUILDTIME_PACKAGES="git ca-certificates python ninja-build cmake uuid-dev libbsd-dev libicu-dev pkg-config libedit-dev file libxml2-dev python-dev libncurses5-dev libsqlite3-dev libreadline6-dev rsync"
#apply patches here
# ADD SR-437.patch /
# Create a directory to work in
RUN mkdir swift-dev
WORKDIR /swift-dev
# Install the runtime and build-time dependencies
RUN apt-get update
RUN apt-get install $RUNTIME_PACKAGES $BUILDTIME_PACKAGES -y --no-install-recommends
RUN git clone https://github.com/apple/swift.git
WORKDIR /swift-dev/swift
# submodules? Where we're going, we don't need submodules!
RUN ./utils/update-checkout --clone
# The silly update-checkout script does not understand matching the swift checkout ref
# In practice what you're supposed to do (I think! It's not documented!) is check out the same snapshot tag
# Not all the folders have them (where do some of them come from??) but we'll just try them all
# see http://stackoverflow.com/a/8213585/116834
ADD update-tags.sh /swift-dev/update-tags.sh
RUN bash /swift-dev/update-tags.sh
# Apply patches here
# cd ../swift-corelibs-foundation
# git apply < /SR-437.patch
# cat Foundation/NSPathUtilities.swift
# And now we build, like a good little linuxen.
# I believe this is what the linux build script does. In practice, this builds a system into /tmp/install and then tars it up.
RUN ./utils/build-script --preset=buildbot_linux install_destdir="/tmp/install" installable_package="/tmp/swift.tar.gz"
# Install our tarball to /usr/local
RUN tar xf /tmp/swift.tar.gz -C /usr/local --strip-components 1
# Clean up
WORKDIR /
RUN rm -rf /tmp/swift.tar.gz /swift-dev
RUN apt-get remove --purge -y $BUILDTIME_PACKAGES
RUN apt-get autoremove --purge -y
RUN apt-get clean -y
RUN apt-get autoclean -y
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["bash"]
This diff is collapsed.
From 05d4aa0ba616e7b0c92642dc50df3d65e2d4ba08 Mon Sep 17 00:00:00 2001
From: David Grove <groved@us.ibm.com>
Date: Fri, 5 Feb 2016 19:38:21 +0000
Subject: [PATCH] Next step in connecting libdispatch and foundation builds
Three small changes for building libdispatch and foundation together.
(1) Put libdispatch into PRODUCTS before foundation
(2) Pass path to swift down into libdispatch build
(3) Pass paths to libdispatch down into foundation build
---
utils/build-script-impl | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/utils/build-script-impl b/utils/build-script-impl
index 3e71cbb..e49abfc 100755
--- a/utils/build-script-impl
+++ b/utils/build-script-impl
@@ -926,12 +926,12 @@ fi
if [[ ! "${SKIP_BUILD_XCTEST}" ]] ; then
PRODUCTS=("${PRODUCTS[@]}" xctest)
fi
-if [[ ! "${SKIP_BUILD_FOUNDATION}" ]] ; then
- PRODUCTS=("${PRODUCTS[@]}" foundation)
-fi
if [[ ! "${SKIP_BUILD_LIBDISPATCH}" ]] ; then
PRODUCTS=("${PRODUCTS[@]}" libdispatch)
fi
+if [[ ! "${SKIP_BUILD_FOUNDATION}" ]] ; then
+ PRODUCTS=("${PRODUCTS[@]}" foundation)
+fi
SWIFT_STDLIB_TARGETS=()
SWIFT_PERFTEST_TARGETS=()
@@ -1801,6 +1801,12 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
LLVM_BIN="$(build_directory_bin ${deployment_target} llvm)"
NINJA_BIN="ninja"
+ # Staging: require opt-in for building with dispatch
+ if [[ ! "${SKIP_BUILD_LIBDISPATCH}" ]] ; then
+ LIBDISPATCH_BUILD_DIR="$(build_directory ${deployment_target} libdispatch)"
+ LIBDISPATCH_BUILD_ARGS="-DLIBDISPATCH_SOURCE_DIR=${LIBDISPATCH_SOURCE_DIR} -DLIBDISPATCH_BUILD_DIR=${LIBDISPATCH_BUILD_DIR}"
+ fi
+
if [[ "${BUILD_NINJA}" ]]; then
NINJA_BUILD_DIR=$(build_directory build ninja)
NINJA_BIN="${NINJA_BUILD_DIR}/ninja"
@@ -1809,7 +1815,7 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
set -x
pushd "${FOUNDATION_SOURCE_DIR}"
SWIFTC="${SWIFTC_BIN}" CLANG="${LLVM_BIN}"/clang SWIFT="${SWIFT_BIN}" \
- SDKROOT="${SWIFT_BUILD_PATH}" BUILD_DIR="${build_dir}" DSTROOT="${INSTALL_DESTDIR}" PREFIX="${INSTALL_PREFIX}" ./configure "${FOUNDATION_BUILD_TYPE}" -DXCTEST_BUILD_DIR=${XCTEST_BUILD_DIR}
+ SDKROOT="${SWIFT_BUILD_PATH}" BUILD_DIR="${build_dir}" DSTROOT="${INSTALL_DESTDIR}" PREFIX="${INSTALL_PREFIX}" ./configure "${FOUNDATION_BUILD_TYPE}" -DXCTEST_BUILD_DIR=${XCTEST_BUILD_DIR} $LIBDISPATCH_BUILD_ARGS
${NINJA_BIN}
popd
{ set +x; } 2>/dev/null
@@ -1819,6 +1825,7 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
;;
libdispatch)
LIBDISPATCH_BUILD_DIR=$(build_directory ${deployment_target} ${product})
+ SWIFT_BUILD_PATH="$(build_directory ${deployment_target} swift)"
set -x
if [[ ! -f "${LIBDISPATCH_BUILD_DIR}"/config.status ]]; then
@@ -1828,7 +1835,7 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
autoreconf -fvi
popd
pushd "${LIBDISPATCH_BUILD_DIR}"
- "${LIBDISPATCH_SOURCE_DIR}"/configure --prefix="${INSTALL_DESTDIR}"/"${INSTALL_PREFIX}"
+ "${LIBDISPATCH_SOURCE_DIR}"/configure --prefix="${INSTALL_DESTDIR}"/"${INSTALL_PREFIX}" --with-swift-toolchain="${SWIFT_BUILD_PATH}"
popd
fi
pushd "${LIBDISPATCH_BUILD_DIR}"
--
2.5.4 (Apple Git-61)
#!/bin/bash
docker build -f swift.dockerfile -t $username/swift:$tag .
docker tag $username/swift:$tag $username/swift:latest
\ No newline at end of file
#!/bin/bash
id=$(docker create swift-tmp)
docker cp $id:/tmp/swift.tar.gz .
rm -rf fakeroot
mkdir -p fakeroot/usr/local
tar xf swift.tar.gz -C fakeroot/usr/local --strip-components 1
rm -rf swift.tar.gz
#patch silly dispatch
mkdir fakeroot/usr/local/include/dispatch/haxx
mv fakeroot/usr/local/include/dispatch/Dispatch.swift* fakeroot/usr/local/include/dispatch/haxx/
mv fakeroot/usr/local/include/dispatch/module.map fakeroot/usr/local/include/dispatch/haxx/
#we need to file a ⛏ about this silly workaround at some point
#but we have to wait for ⛏729 to get resolved first
#since the repro steps will change
sed -i '' "s+/tmp/install///usr/include/dispatch/dispatch.h+/usr/local/include/dispatch/dispatch.h+" fakeroot/usr/local/include/dispatch/haxx/module.map
tar czf swift-local.tar.gz -C fakeroot .
rm -rf fakeroot
\ No newline at end of file
echo "Building runtime image..."
id=$(docker create drewcrawford/swift:latest)
docker cp $id:usr/local/lib/swift - > swiftlibs.tar
docker build -f Runtime.dockerfile -t $username/swift-runtime:latest .
docker tag $username/swift-runtime:latest $username/swift-runtime:$tag
\ No newline at end of file
#!/bin/bash
sed "s/__TAG__/$tag/" build.dockerfile > Dockerfile.tagged
docker build -f Dockerfile.tagged -t swift-tmp .
\ No newline at end of file
......@@ -3,8 +3,8 @@ MAINTAINER Drew Crawford
ENV SWIFT_TAG="__TAG__" RUNTIME_PACKAGES="clang libedit2 libpython2.7 libxml2 libicu52" BUILDTIME_PACKAGES="git ca-certificates python ninja-build cmake uuid-dev libbsd-dev libicu-dev pkg-config libedit-dev file libxml2-dev python-dev libncurses5-dev libsqlite3-dev libreadline6-dev rsync"
#apply patches here
# ADD SR-437.patch /
# for libdispatch, we also need more stuff
ENV BUILDTIME_PACKAGES="$BUILDTIME_PACKAGES make gobjc automake autoconf libtool pkg-config systemtap-sdt-dev libblocksruntime-dev libkqueue-dev libpthread-workqueue-dev libbsd-dev"
# Create a directory to work in
RUN mkdir swift-dev
......@@ -18,6 +18,9 @@ WORKDIR /swift-dev/swift
# submodules? Where we're going, we don't need submodules!
RUN ./utils/update-checkout --clone
#libdispatch needs submodules tho, LOL
RUN cd ../swift-corelibs-libdispatch && git submodule init && git submodule update
# The silly update-checkout script does not understand matching the swift checkout ref
# In practice what you're supposed to do (I think! It's not documented!) is check out the same snapshot tag
# Not all the folders have them (where do some of them come from??) but we'll just try them all
......@@ -26,11 +29,14 @@ ADD update-tags.sh /swift-dev/update-tags.sh
RUN bash /swift-dev/update-tags.sh
# Apply patches here
# cd ../swift-corelibs-foundation
# git apply < /SR-437.patch
# cat Foundation/NSPathUtilities.swift
ADD LIBDISPATCH_PR_43.patch /swift-dev/
ADD SWIFT_PR_1212.patch /swift-dev/
# RUN cd ../swift-corelibs-libdispatch && git apply < ../LIBDISPATCH_PR_43.patch
RUN git config --global user.email "drew@sealedabstract.com" && git config --global user.name "Drew Crawford"
RUN git am -3 < ../SWIFT_PR_1212.patch
# And now we build, like a good little linuxen.
# I believe this is what the linux build script does. In practice, this builds a system into /tmp/install and then tars it up.
RUN ./utils/build-script --preset=buildbot_linux install_destdir="/tmp/install" installable_package="/tmp/swift.tar.gz"
ADD presets.ini /swift-dev/swift/presets.ini
RUN ./utils/build-script --preset=drew --preset-file=presets.ini --preset-file=utils/build-presets.ini installable_package="/tmp/swift.tar.gz" install_destdir="/tmp/install/"
......@@ -2,26 +2,11 @@ set -e
username="drewcrawford"
echo "Type tag name"
read tag
WORKDIR=/tmp
export tag
export username
sed "s/__TAG__/$tag/" build.dockerfile > Dockerfile.tagged
docker build -f Dockerfile.tagged -t swift-tmp .
echo "Moving swift.tar.gz to new container..."
id=$(docker create swift-tmp)
docker cp $id:/tmp/swift.tar.gz .
rm -rf fakeroot
mkdir -p fakeroot/usr/local
tar xf swift.tar.gz -C fakeroot/usr/local --strip-components 1
tar cf swift-local.tar.gz -C fakeroot .
rm -rf fakeroot
docker build -f swift.dockerfile -t $username/swift:$tag .
docker tag $username/swift:$tag $username/swift:latest
echo "Building runtime image..."
id=$(docker create drewcrawford/swift:latest)
docker cp $id:usr/local/lib/swift - > swiftlibs.tar
docker build -f Runtime.dockerfile -t $username/swift-runtime:latest .
docker tag $username/swift-runtime:latest $username/swift-runtime:$tag
docker push $username/swift-runtime:latest
docker push $username/swift-runtime:$tag
docker push $username/swift:latest
docker push $username/swift:$tag
\ No newline at end of file
bash build-swift.sh
bash build-swift-local.sh
bash build-swift-image.sh
bash build-swift-runtime.sh
bash publish.sh
\ No newline at end of file
[preset: drew]
mixin-preset=buildbot_linux
libdispatch
#certain options must go over -- (to be piped to build-script-impl)
dash-dash
install-libdispatch=1
#work around ⛏
#install-prefix=/usr/local
#libdispatch tests currently hang for me. oh well
skip-test-libdispatch=1
#disable more tests (if desired)
#skip-test-validation=1
#skip-test-swift=1
#work around "no such module XCTest"
#I asked on the ML about why I need this
skip-test-foundation=1
#skip-test-llbuild=1
#skip-test-swiftpm=1
docker push $username/swift-runtime:latest
docker push $username/swift-runtime:$tag
docker push $username/swift:latest
docker push $username/swift:$tag
\ No newline at end of file
FROM debian:latest
MAINTAINER Drew Crawford
RUN apt-get update && apt-get install --no-install-recommends -y clang libedit2 libpython2.7 libxml2 libicu52 && rm -rf rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#these: libblocksruntime-dev libkqueue0 libpthread-workqueue0 are libdispatch-related
RUN apt-get update && apt-get install --no-install-recommends -y clang libedit2 libpython2.7 libxml2 libicu52 libblocksruntime-dev libkqueue0 libpthread-workqueue0 && rm -rf rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ADD swift-local.tar.gz /
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment