Skip to content

Commit be81bd0

Browse files
authored
Merge pull request #122 from IBM-Swift/swift51
Support Swift 5.1 and disable build caching by default
2 parents bbc39cf + 527dc64 commit be81bd0

File tree

6 files changed

+102
-114
lines changed

6 files changed

+102
-114
lines changed

README.md

Lines changed: 90 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -16,157 +16,151 @@ Example usage (see the [Specify a Swift version](#specify-a-swift-version) secti
1616
$ ibmcloud app push
1717
Invoking 'ibmcloud app push'...
1818

19-
Using manifest file /Users/gvalenc/git/Kitura-Starter/manifest.yml
20-
19+
Using manifest file /Users/gvalenc/git/DevX/Kitura-Starter/manifest.yml
2120
Getting app info...
2221
Creating app with these attributes...
23-
+ name: GV-Kitura-Starter
24-
path: /Users/gvalenc/git/Kitura-Starter
22+
+ name: kitura-starter-swift51
23+
path: /Users/gvalenc/git/DevX/Kitura-Starter
2524
buildpacks:
2625
+ https://github.com/IBM-Swift/swift-buildpack
2726
+ command: Kitura-Starter
2827
+ disk quota: 1G
2928
+ instances: 1
3029
+ memory: 256M
3130
routes:
32-
+ gv-kitura-starter-chatty-shark.mybluemix.net
31+
+ kitura-starter-swift51-turbulent-buffalo.mybluemix.net
3332

34-
Creating app GV-Kitura-Starter...
33+
Creating app kitura-starter-swift51...
3534
Mapping routes...
3635
Comparing local files to remote cache...
3736
Packaging files to upload...
3837
Uploading files...
39-
29.97 KiB / 29.97 KiB [=================================================================] 100.00% 1s
38+
30.50 KiB / 30.50 KiB [==================================================================================] 100.00% 1s
4039

4140
Waiting for API to complete processing files...
42-
timeout connecting to log server, no log will be shown
43-
4441

4542
Staging app and tracing logs...
46-
Cell b52d4499-f402-4b95-8ccc-75f95c8b518d creating container for instance 90754c9f-3c50-43a5-bdaa-80ad61cee7c3
47-
Cell b52d4499-f402-4b95-8ccc-75f95c8b518d successfully created container for instance 90754c9f-3c50-43a5-bdaa-80ad61cee7c3
43+
Cell 4506b303-dccf-48d5-9f39-7c6ac85ff0da creating container for instance 0dc09158-a961-42cc-acef-77853eed9182
44+
Cell 4506b303-dccf-48d5-9f39-7c6ac85ff0da successfully created container for instance 0dc09158-a961-42cc-acef-77853eed9182
4845
Downloading app package...
49-
Downloaded app package (30K)
50-
-----> Buildpack version 2.1.1
51-
-----> Default supported Swift version is 5.0.2
46+
Downloaded app package (30.5K)
47+
-----> Buildpack version 2.2.0
48+
-----> Default supported Swift version is 5.1
5249
-----> Configure for apt-get installs...
5350
-----> Writing profile script...
5451
-----> Copying deb files to installation folder...
5552
-----> No Aptfile found.
56-
-----> Getting swift-5.0.2
57-
Downloaded swift-5.0.2
58-
-----> Unpacking swift-5.0.2.tar.gz
53+
-----> Getting swift-5.1
54+
Downloaded swift-5.1
55+
-----> Unpacking swift-5.1.tar.gz
5956
-----> Getting clang-8.0.0
6057
Downloaded clang-8.0.0
6158
-----> Unpacking clang-8.0.0.tar.xz
6259
-----> .ssh directory and config file not found.
6360
-----> Skipping cache restore (new swift signature)
6461
-----> Fetching Swift packages and parsing Package.swift files...
65-
Fetching https://github.com/IBM-Swift/BlueSocket.git
66-
Fetching https://github.com/IBM-Swift/CloudEnvironment.git
67-
Fetching https://github.com/IBM-Swift/Health.git
68-
Fetching https://github.com/IBM-Swift/KituraContracts.git
62+
Fetching https://github.com/apple/swift-log.git
6963
Fetching https://github.com/IBM-Swift/BlueSignals.git
64+
Fetching https://github.com/IBM-Swift/Kitura.git
65+
Fetching https://github.com/IBM-Swift/Swift-cfenv.git
7066
Fetching https://github.com/IBM-Swift/OpenSSL.git
67+
Fetching https://github.com/IBM-Swift/KituraContracts.git
7168
Fetching https://github.com/IBM-Swift/BlueSSLService.git
72-
Fetching https://github.com/IBM-Swift/Configuration.git
69+
Fetching https://github.com/IBM-Swift/BlueSocket.git
70+
Fetching https://github.com/IBM-Swift/CloudEnvironment.git
7371
Fetching https://github.com/IBM-Swift/Kitura-net.git
74-
Fetching https://github.com/IBM-Swift/Kitura-TemplateEngine.git
75-
Fetching https://github.com/IBM-Swift/Kitura.git
76-
Fetching https://github.com/IBM-Swift/Swift-cfenv.git
7772
Fetching https://github.com/IBM-Swift/HeliumLogger.git
7873
Fetching https://github.com/IBM-Swift/LoggerAPI.git
79-
Fetching https://github.com/IBM-Swift/TypeDecoder.git
8074
Fetching https://github.com/IBM-Swift/FileKit.git
81-
Completed resolution in 8.55s
82-
Cloning https://github.com/IBM-Swift/KituraContracts.git
83-
Resolving https://github.com/IBM-Swift/KituraContracts.git at 1.1.1
75+
Fetching https://github.com/IBM-Swift/Kitura-TemplateEngine.git
76+
Fetching https://github.com/IBM-Swift/Configuration.git
77+
Fetching https://github.com/IBM-Swift/TypeDecoder.git
78+
Fetching https://github.com/IBM-Swift/Health.git
79+
Completed resolution in 19.04s
80+
Cloning https://github.com/IBM-Swift/LoggerAPI.git
81+
Resolving https://github.com/IBM-Swift/LoggerAPI.git at 1.9.0
82+
Cloning https://github.com/IBM-Swift/OpenSSL.git
83+
Resolving https://github.com/IBM-Swift/OpenSSL.git at 2.2.2
84+
Cloning https://github.com/IBM-Swift/BlueSSLService.git
85+
Resolving https://github.com/IBM-Swift/BlueSSLService.git at 1.0.48
8486
Cloning https://github.com/IBM-Swift/TypeDecoder.git
85-
Resolving https://github.com/IBM-Swift/TypeDecoder.git at 1.3.0
86-
Cloning https://github.com/IBM-Swift/Configuration.git
87-
Resolving https://github.com/IBM-Swift/Configuration.git at 3.0.2
87+
Resolving https://github.com/IBM-Swift/TypeDecoder.git at 1.3.3
8888
Cloning https://github.com/IBM-Swift/CloudEnvironment.git
89-
Resolving https://github.com/IBM-Swift/CloudEnvironment.git at 9.0.0
90-
Cloning https://github.com/IBM-Swift/Kitura-TemplateEngine.git
91-
Resolving https://github.com/IBM-Swift/Kitura-TemplateEngine.git at 2.0.0
92-
Cloning https://github.com/IBM-Swift/Kitura.git
93-
Resolving https://github.com/IBM-Swift/Kitura.git at 2.6.2
94-
Cloning https://github.com/IBM-Swift/BlueSSLService.git
95-
Resolving https://github.com/IBM-Swift/BlueSSLService.git at 1.0.44
89+
Resolving https://github.com/IBM-Swift/CloudEnvironment.git at 9.1.0
90+
Cloning https://github.com/IBM-Swift/BlueSignals.git
91+
Resolving https://github.com/IBM-Swift/BlueSignals.git at 1.0.20
9692
Cloning https://github.com/IBM-Swift/FileKit.git
97-
Resolving https://github.com/IBM-Swift/FileKit.git at 0.0.1
98-
Cloning https://github.com/IBM-Swift/Health.git
99-
Resolving https://github.com/IBM-Swift/Health.git at 1.0.4
93+
Resolving https://github.com/IBM-Swift/FileKit.git at 0.0.2
10094
Cloning https://github.com/IBM-Swift/BlueSocket.git
101-
Resolving https://github.com/IBM-Swift/BlueSocket.git at 1.0.44
102-
Cloning https://github.com/IBM-Swift/OpenSSL.git
103-
Resolving https://github.com/IBM-Swift/OpenSSL.git at 2.2.2
104-
Cloning https://github.com/IBM-Swift/LoggerAPI.git
105-
Resolving https://github.com/IBM-Swift/LoggerAPI.git at 1.8.0
95+
Resolving https://github.com/IBM-Swift/BlueSocket.git at 1.0.48
96+
Cloning https://github.com/IBM-Swift/KituraContracts.git
97+
Resolving https://github.com/IBM-Swift/KituraContracts.git at 1.1.3
98+
Cloning https://github.com/apple/swift-log.git
99+
Resolving https://github.com/apple/swift-log.git at 1.1.0
100+
Cloning https://github.com/IBM-Swift/Configuration.git
101+
Resolving https://github.com/IBM-Swift/Configuration.git at 3.0.4
106102
Cloning https://github.com/IBM-Swift/Swift-cfenv.git
107-
Resolving https://github.com/IBM-Swift/Swift-cfenv.git at 6.0.2
103+
Resolving https://github.com/IBM-Swift/Swift-cfenv.git at 6.0.3
108104
Cloning https://github.com/IBM-Swift/Kitura-net.git
109-
Resolving https://github.com/IBM-Swift/Kitura-net.git at 2.1.6
110-
Cloning https://github.com/IBM-Swift/BlueSignals.git
111-
Resolving https://github.com/IBM-Swift/BlueSignals.git at 1.0.16
105+
Resolving https://github.com/IBM-Swift/Kitura-net.git at 2.3.0
106+
Cloning https://github.com/IBM-Swift/Health.git
107+
Resolving https://github.com/IBM-Swift/Health.git at 1.0.5
112108
Cloning https://github.com/IBM-Swift/HeliumLogger.git
113-
Resolving https://github.com/IBM-Swift/HeliumLogger.git at 1.8.0
109+
Resolving https://github.com/IBM-Swift/HeliumLogger.git at 1.9.0
110+
Cloning https://github.com/IBM-Swift/Kitura.git
111+
Resolving https://github.com/IBM-Swift/Kitura.git at 2.8.1
112+
Cloning https://github.com/IBM-Swift/Kitura-TemplateEngine.git
113+
Resolving https://github.com/IBM-Swift/Kitura-TemplateEngine.git at 2.0.1
114114
-----> No additional packages to download.
115115
-----> Skipping installation of App Management (debug)
116116
-----> Installing system level dependencies...
117117
-----> Building Package...
118118
-----> Build config: release
119-
[1/20] Compiling CHTTPParser utils.c
120-
[2/20] Compiling CHTTPParser http_parser.c
121-
[3/20] Compiling Swift Module 'TypeDecoder' (2 sources)
122-
[4/20] Compiling Swift Module 'Socket' (3 sources)
123-
[5/20] Compiling Swift Module 'Signals' (1 sources)
124-
[6/20] Compiling Swift Module 'LoggerAPI' (1 sources)
125-
[7/20] Compiling Swift Module 'KituraTemplateEngine' (1 sources)
126-
[8/20] Compiling Swift Module 'KituraContracts' (9 sources)
127-
[9/20] Compiling Swift Module 'HeliumLogger' (2 sources)
128-
[10/20] Compiling Swift Module 'Health' (3 sources)
129-
/tmp/app/.build/checkouts/TypeDecoder/Sources/TypeDecoder/TypeDecoder.swift:292:16: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'TypeInfo' to 'Hashable' by implementing 'hash(into:)' instead
130-
public var hashValue: Int {
131-
^
132-
[11/20] Compiling Swift Module 'FileKit' (1 sources)
133-
[12/20] Compiling Swift Module 'Configuration' (5 sources)
134-
[13/20] Compiling Swift Module 'SSLService' (2 sources)
135-
[14/20] Compiling Swift Module 'CloudFoundryEnv' (6 sources)
136-
[15/20] Compiling Swift Module 'KituraNet' (36 sources)
137-
[16/20] Compiling Swift Module 'CloudEnvironment' (18 sources)
138-
[17/20] Compiling Swift Module 'Kitura' (52 sources)
139-
/tmp/app/.build/checkouts/Kitura/Sources/Kitura/contentType/MediaType.swift:163:16: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'MediaType' to 'Hashable' by implementing 'hash(into:)' instead
140-
public let hashValue: Int
141-
^
142-
[18/20] Compiling Swift Module 'Controller' (1 sources)
143-
[19/20] Compiling Swift Module 'Kitura_Starter' (1 sources)
144-
[20/20] Linking ./.build/x86_64-unknown-linux/release/Kitura-Starter
119+
[1/7] Compiling Signals Signals.swift
120+
[2/8] Compiling KituraTemplateEngine TemplateEngine.swift
121+
[3/8] Compiling CHTTPParser utils.c
122+
[4/8] Compiling CHTTPParser http_parser.c
123+
[5/8] Compiling Logging Locks.swift
124+
[6/9] Compiling LoggerAPI Logger.swift
125+
[7/11] Compiling TypeDecoder OrderedDictionary.swift
126+
[8/12] Compiling HeliumLogger HeliumLogHandler.swift
127+
[9/12] Compiling Socket Socket.swift
128+
[10/13] Compiling Health Health.swift
129+
[11/14] Compiling FileKit FileKit.swift
130+
[12/15] Compiling SSLService SSLPointerTricks.swift
131+
[13/16] Compiling Configuration ConfigurationManager.swift
132+
[14/17] Compiling CloudFoundryEnv App.swift
133+
[15/18] Compiling CloudEnvironment AlertNotificationCredentials.swift
134+
[16/18] Compiling KituraContracts BodyDecoder.swift
135+
[17/18] Compiling KituraNet BufferList.swift
136+
[18/19] Compiling Kitura AdditionalCookieAttribute.swift
137+
[19/20] Compiling Controller Controller.swift
138+
[20/21] Compiling Kitura-Starter main.swift
139+
[21/21] Linking Kitura-Starter
145140
-----> Bin path: /tmp/app/.build/x86_64-unknown-linux/release
146141
-----> Copying dynamic libraries
147142
-----> Copying binaries to 'bin'
148143
-----> Clearing previous swift cache
149-
-----> Saving cache (default):
150-
-----> - .build
144+
-----> Skipping cache save (disabled by default)
151145
-----> Optimizing contents of cache folder...
152146
No start command specified by buildpack or via Procfile.
153147
App will not start unless a command is provided at runtime.
154148
Exit status 0
155149
Uploading droplet, build artifacts cache...
156150
Uploading droplet...
157151
Uploading build artifacts cache...
158-
Uploaded build artifacts cache (49.1M)
159-
Uploaded droplet (244.7M)
152+
Uploaded build artifacts cache (2K)
153+
Uploaded droplet (259.5M)
160154
Uploading complete
161-
Cell b52d4499-f402-4b95-8ccc-75f95c8b518d stopping instance 90754c9f-3c50-43a5-bdaa-80ad61cee7c3
162-
Cell b52d4499-f402-4b95-8ccc-75f95c8b518d destroying container for instance 90754c9f-3c50-43a5-bdaa-80ad61cee7c3
155+
Cell 4506b303-dccf-48d5-9f39-7c6ac85ff0da stopping instance 0dc09158-a961-42cc-acef-77853eed9182
156+
Cell 4506b303-dccf-48d5-9f39-7c6ac85ff0da destroying container for instance 0dc09158-a961-42cc-acef-77853eed9182
163157

164158
Waiting for app to start...
165159

166-
name: GV-Kitura-Starter
160+
name: kitura-starter-swift51
167161
requested state: started
168-
routes: gv-kitura-starter-chatty-shark.mybluemix.net
169-
last uploaded: Wed 31 Jul 14:13:09 CDT 2019
162+
routes: kitura-starter-swift51-turbulent-buffalo.mybluemix.net
163+
last uploaded: Thu 26 Sep 10:52:49 CDT 2019
170164
stack: cflinuxfs3
171165
buildpacks: https://github.com/IBM-Swift/swift-buildpack
172166

@@ -175,14 +169,14 @@ instances: 1/1
175169
memory usage: 256M
176170
start command: Kitura-Starter
177171
state since cpu memory disk details
178-
#0 running 2019-07-31T19:14:04Z 0.4% 36K of 256M 458.4M of 1G
172+
#0 running 2019-09-26T15:53:33Z 1.9% 36K of 256M 194.5M of 1G
179173
```
180174

181175
The buildpack will detect your app as Swift if it has a `Package.swift` file in the root.
182176

183177
### Version installed on the IBM Cloud
184178

185-
The latest version of the IBM Cloud buildpack for Swift on the IBM Cloud is [v2.1.1](https://github.com/IBM-Swift/swift-buildpack/releases/tag/2.1.1).
179+
The latest version of the IBM Cloud buildpack for Swift on the IBM Cloud is [v2.2.0](https://github.com/IBM-Swift/swift-buildpack/releases/tag/2.2.0).
186180

187181
Please note that it is possible that the latest buildpack code contained in this repo hasn't yet been installed on the IBM Cloud. If that happens to be the case and you'd like to leverage the latest buildpack code, you can do so by adding the `-b https://github.com/IBM-Swift/swift-buildpack` parameter to the `ibmcloud app push` command, as shown below:
188182

@@ -224,21 +218,21 @@ command: <executable_name>
224218

225219
### What is the latest version of Swift supported?
226220

227-
The latest version of Swift supported by this buildpack is ```5.0.2```.
221+
The latest version of Swift supported by this buildpack is ```5.1```.
228222

229223
### Specify a Swift version
230224

231225
You specify the version of Swift for your application using a `.swift-version` file in the root of your repository:
232226

233227
```shell
234228
$ cat .swift-version
235-
5.0
229+
5.1
236230
```
237231

238232
Please note that the swift_buildpack installed on the IBM Cloud **caches** the following versions of the Swift binaries:
239233

234+
- `5.1`
240235
- `5.0.2`
241-
- `5.0.1`
242236
- `4.2.4`
243237

244238
If you'd like to use a different version of Swift [that is not cached] on the IBM Cloud, you can specify it in the `.swift-version` file. Please be aware that using a Swift version that is not cached increases the provisioning time of your app on the IBM Cloud.
@@ -361,17 +355,17 @@ Previous versions of this buildpack provided the [libdispatch](https://github.co
361355

362356
### Caching of the .build directory
363357

364-
Following the release of Swift 3.1, the IBM Cloud buildpack for Swift caches the contents of the `.build` folder to speed up the provisioning of your application the next time you execute the `ibmcloud app push` command. If you'd prefer not to use this caching mechanism, you can disable it by executing the following command:
358+
Following the release of Swift 5.1, the IBM Cloud buildpack for Swift does not cache the contents of the `.build` folder by default. Caching this folder helps speed up the provisioning of your application the next time you execute the `ibmcloud app push` command, but can cause an application to exceed its disk space quota. If you'd prefer to use this caching mechanism, you can enable it by executing the following command:
365359

366360
```shell
367-
ibmcloud app env-set <app_name> SWIFT_BUILD_DIR_CACHE false
361+
ibmcloud app env-set <app_name> SWIFT_BUILD_DIR_CACHE true
368362
ibmcloud app restage <app_name>
369363
```
370364

371-
If at some point, you'd like to re-enable caching of the `.build` folder, you can do so by executing:
365+
If at some point, you'd like to disable caching of the `.build` folder, you can do so by executing:
372366

373367
```shell
374-
ibmcloud app env-set <app_name> SWIFT_BUILD_DIR_CACHE true
368+
ibmcloud app env-set <app_name> SWIFT_BUILD_DIR_CACHE false
375369
ibmcloud app restage <app_name>
376370
```
377371

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.1
1+
2.2.0

bin/compile.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ cache_build() {
303303
clear_cache
304304
# cf set-env swift-helloworld SWIFT_PACKAGES_CACHE true
305305
# cf restage swift-helloworld
306-
if ! ${SWIFT_BUILD_DIR_CACHE:-true}; then
307-
status "Skipping cache save (disabled by config)"
306+
if ! ${SWIFT_BUILD_DIR_CACHE:-false}; then
307+
status "Skipping cache save (disabled by default)"
308308
else
309-
status "Saving cache (default):"
309+
status "Saving cache (enabled by config):"
310310
save_cache_directories "$BUILD_DIR" "$CACHE_DIR" "$SWIFT_BUILD_DIR"
311311
fi
312312
save_signatures

lib/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
##
1616

1717
# Global/common vars
18-
DEFAULT_SWIFT_VERSION=5.0.2
18+
DEFAULT_SWIFT_VERSION=5.1
1919
CLANG_VERSION=8.0.0
2020

2121
error() {

manifest.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,15 @@ url_to_dependency_map:
2626

2727
dependencies:
2828
- name: swift
29-
version: 5.0.2
30-
uri: https://swift.org/builds/swift-5.0.2-release/ubuntu1804/swift-5.0.2-RELEASE/swift-5.0.2-RELEASE-ubuntu18.04.tar.gz
31-
sha256: 95c250699b0ddc1c16c5c18f833b5ca660ac651c5218773b2ff7c6f9157c94fb
29+
version: 5.1
30+
uri: https://swift.org/builds/swift-5.1-release/ubuntu1804/swift-5.1-RELEASE/swift-5.1-RELEASE-ubuntu18.04.tar.gz
31+
sha256: e91acf51b214f6c86e6c136b0c5ef547691b5be4a40220f353acb8846f53f28f
3232
cf_stacks:
3333
- cflinuxfs3
3434
- name: swift
35-
version: 5.0.1
36-
uri: https://swift.org/builds/swift-5.0.1-release/ubuntu1804/swift-5.0.1-RELEASE/swift-5.0.1-RELEASE-ubuntu18.04.tar.gz
37-
sha256: 68aceff0bb0ba1f85b0e93e88936d66a527a525dc6b1a6c2e394480a871dd40e
38-
cf_stacks:
39-
- cflinuxfs3
40-
- name: swift
41-
version: 4.2.4
42-
uri: https://swift.org/builds/swift-4.2.4-release/ubuntu1804/swift-4.2.4-RELEASE/swift-4.2.4-RELEASE-ubuntu18.04.tar.gz
43-
sha256: 2c48ad9a71dd74189d4338c059cc047ea60d4cecd388126e14b3112a0cca1aa0
35+
version: 5.0.3
36+
uri: https://swift.org/builds/swift-5.0.3-release/ubuntu1804/swift-5.0.3-RELEASE/swift-5.0.3-RELEASE-ubuntu18.04.tar.gz
37+
sha256: 5f10aae8ee9131712828b6683a84e8c39192befba25ab4886bf2b44f15181ce3
4438
cf_stacks:
4539
- cflinuxfs3
4640
- name: clang

spec/shell_wrapper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module ShellWrapper
1414
let(:apt_cache_dir) { Dir.mktmpdir }
1515
let(:buildpack_dir) { File.join(File.dirname(__FILE__), '../') }
1616
let(:common_shell_script) { File.join(buildpack_dir, 'lib', 'common.sh') }
17-
let(:default_swift_version) { '5.0.2' }
17+
let(:default_swift_version) { '5.1' }
1818

1919
describe '#install_packages' do
2020
context 'deb file exists in $APT_CACHE_DIR/archives' do

0 commit comments

Comments
 (0)