File tree Expand file tree Collapse file tree 4 files changed +39
-6
lines changed
swift-ci/sdks/static-linux Expand file tree Collapse file tree 4 files changed +39
-6
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ ARG BORINGSSL_VERSION=fips-20220613
24
24
ARG ICU_VERSION=maint/maint-69
25
25
ARG ZLIB_VERSION=1.3.1
26
26
27
+ # Architecture to build on (empty means x86-64)
28
+ ARG OS_ARCH_SUFFIX=
29
+
27
30
# ............................................................................
28
31
29
32
# Install development tools
@@ -62,7 +65,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
62
65
OS_MAJOR_VER=$OS_MAJOR_VER \
63
66
OS_MINOR_VER=$OS_MINOR_VER \
64
67
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MINOR_VER \
65
- SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MINOR_VER"
68
+ SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MINOR_VER$OS_ARCH_SUFFIX "
66
69
67
70
COPY scripts/install-swift.sh /scripts/install-swift.sh
68
71
RUN chmod ugo+x /scripts/install-swift.sh
Original file line number Diff line number Diff line change 14
14
#
15
15
# ===----------------------------------------------------------------------===
16
16
17
- DOCKER=docker
17
+ if [[ " $DOCKER " == " " ]]; then
18
+ DOCKER=docker
19
+ fi
20
+
21
+ case $( arch) in
22
+ arm64|aarch64)
23
+ OS_ARCH_SUFFIX=-aarch64
24
+ ;;
25
+ amd64|x86_64)
26
+ OS_ARCH_SUFFIX=
27
+ ;;
28
+ * )
29
+ echo " Unknown architecture $( arch) "
30
+ exit 1
31
+ ;;
32
+ esac
18
33
19
34
# Build the Docker image
20
- $( DOCKER) build -t static-swift-linux .
35
+ $DOCKER build --build-arg OS_ARCH_SUFFIX= $OS_ARCH_SUFFIX -t static-swift-linux .
21
36
22
37
# Check-out the sources
23
38
scripts/fetch-source.sh --clone-with-ssh --source-dir source
24
39
25
40
mkdir -p products
26
41
27
42
# Run the build
28
- $( DOCKER) run -it --rm \
43
+ $DOCKER run -it --rm \
29
44
-v ./source:/source \
30
45
-v ./products:/products \
31
46
static-swift-linux \
Original file line number Diff line number Diff line change @@ -144,6 +144,20 @@ while [ "$#" -gt 0 ]; do
144
144
shift
145
145
done
146
146
147
+ # Work out the host architecture
148
+ case $( arch) in
149
+ arm64|aarch64)
150
+ host_arch=arm64
151
+ ;;
152
+ amd64|x86_64)
153
+ host_arch=x86_64
154
+ ;;
155
+ * )
156
+ echo " Unknown host architecture $( arch) "
157
+ exit 1
158
+ ;;
159
+ esac
160
+
147
161
# Change the commas for spaces
148
162
archs=" ${archs// ,/ } "
149
163
662
676
--compiler-vendor=apple \
663
677
--bootstrapping hosttools \
664
678
--build-linux-static --install-swift \
665
- --stdlib-deployment-targets linux-x86_64 ,linux-static-$arch \
679
+ --stdlib-deployment-targets linux-$host_arch ,linux-static-$arch \
666
680
--build-stdlib-deployment-targets all \
667
681
--musl-path=${build_dir} /sdk_root \
668
682
--linux-static-arch=$arch \
724
738
-DFOUNDATION_PATH_TO_LIBDISPATCH_BUILD=${build_dir} /$arch /dispatch \
725
739
-D_SwiftFoundation_SourceDIR=${source_dir} /swift-project/swift-foundation \
726
740
-D_SwiftFoundationICU_SourceDIR=${source_dir} /swift-project/swift-foundation-icu \
741
+ -D_SwiftCollections_SourceDIR=${source_dir} /swift-project/swift-collections \
727
742
-DCMAKE_Swift_COMPILER_WORKS=YES \
728
743
-Ddispatch_DIR=${build_dir} /$arch /dispatch/cmake/modules
729
744
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ cd swift
164
164
# Get its dependencies
165
165
header " Fetching Swift Dependencies"
166
166
167
- extra_args=--skip-history
167
+ extra_args=" --skip-history --all-repositories "
168
168
if [[ $SWIFT_VERSION == scheme:* ]]; then
169
169
utils/update-checkout ${clone_arg} --scheme ${SWIFT_VERSION# scheme: } ${extra_args}
170
170
elif [[ $SWIFT_VERSION == tag:* ]]; then
You can’t perform that action at this time.
0 commit comments