Skip to content

Commit 26299c8

Browse files
authored
Merge pull request #1582 from swiftwasm/maxd/master-merge
Resolve conflicts with `master`
2 parents f03fd8e + a0db7cb commit 26299c8

File tree

1,018 files changed

+33886
-27442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,018 files changed

+33886
-27442
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,29 @@ jobs:
2222
sudo apt-get purge libgcc-9-dev gcc-9 libstdc++-9-dev
2323
sudo swapoff -a
2424
sudo rm -f /swapfile
25+
sudo rm -rf /opt/hostedtoolcache
26+
sudo rm -rf /usr/share/dotnet
2527
sudo apt clean
2628
docker rmi $(docker image ls -aq)
2729
df -h
2830
- uses: actions/checkout@v1
2931
with:
3032
path: swift
33+
- name: Prepare sccache timestamp
34+
id: cache_timestamp
35+
shell: cmake -P {0}
36+
run: |
37+
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
38+
message("::set-output name=timestamp::${current_date}")
3139
- uses: actions/cache@v1
3240
with:
3341
path: ../build-cache
34-
key: ${{ runner.os }}-sccache-v9
42+
key: ${{ runner.os }}-sccache-v10-${{ steps.cache_timestamp.outputs.timestamp }}
43+
restore-keys: |
44+
${{ runner.os }}-sccache-v10-
3545
- name: Build Linux installable archive
3646
run: |
3747
./utils/webassembly/ci.sh
38-
echo "Cleanup build directory to free disk space"
39-
rm -rf ../build
4048
- name: Upload Linux installable archive
4149
uses: actions/upload-artifact@v1
4250
with:
@@ -58,10 +66,18 @@ jobs:
5866
- uses: actions/checkout@v1
5967
with:
6068
path: swift
69+
- name: Prepare sccache timestamp
70+
id: cache_timestamp
71+
shell: cmake -P {0}
72+
run: |
73+
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
74+
message("::set-output name=timestamp::${current_date}")
6175
- uses: actions/cache@v1
6276
with:
6377
path: ../build-cache
64-
key: ${{ runner.os }}-sccache-v9
78+
key: ${{ runner.os }}-sccache-v10-${{ steps.cache_timestamp.outputs.timestamp }}
79+
restore-keys: |
80+
${{ runner.os }}-sccache-v10-
6581
- name: Build macOS installable archive
6682
run: |
6783
sudo xcode-select --switch /Applications/Xcode_12_beta.app/Contents/Developer/
@@ -72,7 +88,7 @@ jobs:
7288
name: macos-installable
7389
path: ../swift-wasm-DEVELOPMENT-SNAPSHOT-osx.tar.gz
7490
- name: Pack test results
75-
run: tar cJf swift-test-results.tar.gz ../build/*/swift-macosx-x86_64/swift-test-results
91+
run: tar cJf swift-test-results.tar.gz ../target-build/*/swift-macosx-x86_64/swift-test-results
7692
- name: Upload test results
7793
uses: actions/upload-artifact@v1
7894
with:

CHANGELOG.md

Lines changed: 91 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,100 @@ CHANGELOG
44
<details>
55
<summary>Note: This is in reverse chronological order, so newer entries are added to the top.</summary>
66

7-
| Version | Released | Toolchain |
8-
| :--------------------- | :--------- | :---------- |
9-
| [Swift 5.3](#swift-53) | | |
10-
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
11-
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
12-
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
13-
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
14-
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
15-
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
16-
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
17-
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
18-
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
19-
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
20-
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
21-
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
22-
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
23-
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |
7+
| Version | Released | Toolchain |
8+
| :------------------------ | :--------- | :---------- |
9+
| [Swift Next](#swift-next) |
10+
| [Swift 5.3](#swift-53) | | |
11+
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
12+
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
13+
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
14+
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
15+
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
16+
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
17+
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
18+
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
19+
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
20+
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
21+
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
22+
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
23+
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
24+
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |
2425

2526
</details>
2627

28+
Swift Next
29+
----------
30+
31+
* [SE-0287][]:
32+
33+
Implicit member expressions now support chains of member accesses, making the following valid:
34+
35+
```swift
36+
let milky: UIColor = .white.withAlphaComponent(0.5)
37+
let milky2: UIColor = .init(named: "white")!.withAlphaComponent(0.5)
38+
let milkyChance: UIColor? = .init(named: "white")?.withAlphaComponent(0.5)
39+
```
40+
41+
As is the case with the existing implicit member expression syntax, the resulting type of the chain must be the same as the (implicit) base, so it is not well-formed to write:
42+
43+
```swift
44+
let cgMilky: CGColor = .white.withAlphaComponent(0.5).cgColor
45+
```
46+
47+
(Unless, of course, appropriate `white` and `withAlphaComponent` members were defined on `CGColor`.)
48+
49+
Members of a "chain" can be properties, method calls, subscript accesses, force unwraps, or optional chaining question marks. Furthermore, the type of each member along the chain is permitted to differ (again, as long as the base of the chain matches the resulting type) meaning the following successfully typechecks:
50+
51+
```swift
52+
struct Foo {
53+
static var foo = Foo()
54+
static var bar = Bar()
55+
56+
var anotherFoo: Foo { Foo() }
57+
func getFoo() -> Foo { Foo() }
58+
var optionalFoo: Foo? { Foo() }
59+
subscript() -> Foo { Foo() }
60+
}
61+
62+
struct Bar {
63+
var anotherFoo = Foo()
64+
}
65+
66+
let _: Foo? = .bar.anotherFoo.getFoo().optionalFoo?.optionalFoo![]
67+
```
68+
2769
Swift 5.3
2870
---------
2971

72+
* [SE-0279][] & [SE-0286][]:
73+
74+
Trailing closure syntax has been extended to allow additional labeled closures to follow the initial unlabeled closure:
75+
76+
```swift
77+
// Single trailing closure argument
78+
UIView.animate(withDuration: 0.3) {
79+
self.view.alpha = 0
80+
}
81+
// Multiple trailing closure arguments
82+
UIView.animate(withDuration: 0.3) {
83+
self.view.alpha = 0
84+
} completion: { _ in
85+
self.view.removeFromSuperview()
86+
}
87+
```
88+
89+
Additionally, trailing closure arguments now match the appropriate parameter according to a forward-scan rule (as opposed to the previous backward-scan rule):
90+
91+
```swift
92+
func takesClosures(first: () -> Void, second: (Int) -> Void = { _ in }) {}
93+
94+
takesClosures {
95+
print("First")
96+
}
97+
```
98+
99+
In the above example, the trailing closure argument matches parameter `first`, whereas pre-Swift-5.3 it would have matched `second`. In order to ease the transition to this new rule, cases in which the forward-scan and backward-scan match a single trailing closure to different parameters, the backward-scan result is preferred and a warning is emitted. This is expected to be upgraded to an error in the next major version of Swift.
100+
30101
* [SR-7083][]:
31102

32103
Property observers such as `willSet` and `didSet` are now supported on `lazy` properties:
@@ -8070,7 +8141,10 @@ Swift 1.0
80708141
[SE-0268]: <https://github.com/apple/swift-evolution/blob/master/proposals/0268-didset-semantics.md>
80718142
[SE-0269]: <https://github.com/apple/swift-evolution/blob/master/proposals/0269-implicit-self-explicit-capture.md>
80728143
[SE-0276]: <https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md>
8144+
[SE-0279]: <https://github.com/apple/swift-evolution/blob/master/proposals/0279-multiple-trailing-closures.md>
80738145
[SE-0280]: <https://github.com/apple/swift-evolution/blob/master/proposals/0280-enum-cases-as-protocol-witnesses.md>
8146+
[SE-0286]: <https://github.com/apple/swift-evolution/blob/master/proposals/0286-forward-scan-trailing-closures.md>
8147+
[SE-0287]: <https://github.com/apple/swift-evolution/blob/master/proposals/0287-implicit-member-chains.md>
80748148

80758149
[SR-75]: <https://bugs.swift.org/browse/SR-75>
80768150
[SR-106]: <https://bugs.swift.org/browse/SR-106>

CMakeLists.txt

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ option(SWIFT_REPORT_STATISTICS
369369
"Create json files which contain internal compilation statistics"
370370
FALSE)
371371

372+
option(SWIFT_DISABLE_OBJC_INTEROP
373+
"Disable Objective-C interoperability even on platforms what would normally have it"
374+
FALSE)
375+
372376
# FIXME(wasm) Reflection tests are temporalily disabled due to lack of linker features
373377
option(SWIFTWASM_DISABLE_REFLECTION_TEST
374378
"Disable building swift-reflection-test for WebAssembly build"
@@ -391,10 +395,6 @@ option(SWIFT_RUNTIME_ENABLE_LEAK_CHECKER
391395
"Should the runtime be built with support for non-thread-safe leak detecting entrypoints"
392396
FALSE)
393397

394-
option(SWIFT_STDLIB_USE_NONATOMIC_RC
395-
"Build the standard libraries and overlays with nonatomic reference count operations enabled"
396-
FALSE)
397-
398398
option(SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS
399399
"Enable runtime function counters and expose the API."
400400
FALSE)
@@ -634,6 +634,22 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQU
634634
set(SWIFT_COMPILER_IS_MSVC_LIKE TRUE)
635635
endif()
636636

637+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
638+
# CMake's default for CMAKE_CXX_FLAGS_RELEASE is "-O3 -DNDEBUG". Let's avoid "-O3" for consistency
639+
# between Release and RelWithDebInfo. Dropping -DNDEBUG from this setting is blocked by triggering
640+
# a test failure of Swift-Unit :: Syntax/./SwiftSyntaxTests/TypeSyntaxTests.MetatypeTypeWithAPIs
641+
# because unit tests don't currently explicitly set -DNDEBUG/-UNDEBUG.
642+
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
643+
644+
_compute_lto_flag("${SWIFT_TOOLS_ENABLE_LTO}" _lto_flag_out)
645+
if(_lto_flag_out)
646+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} -gline-tables-only")
647+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gline-tables-only")
648+
endif()
649+
else()
650+
651+
endif()
652+
637653
#
638654
# Configure SDKs.
639655
#
@@ -933,7 +949,6 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
933949
endif()
934950
endif()
935951

936-
find_package(Python2 COMPONENTS Interpreter REQUIRED)
937952
find_package(Python3 COMPONENTS Interpreter REQUIRED)
938953

939954
#

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ The required version of Xcode changes frequently, and is often a beta release.
115115
Check this document or the host information on <https://ci.swift.org> for the
116116
current required version.
117117

118+
Swift's build tooling is meant to support spaces in the paths passed to them,
119+
but using spaces sometimes tickles bugs in Swift's build scripts or the tools
120+
they rely on. For example, [SR-13441](https://bugs.swift.org/browse/SR-13441)
121+
is caused by a space in the Xcode path used on macOS. If you see Swift's build
122+
tooling misbehave due to a space in a path, please
123+
[report the bug on the Swift bug tracker](https://swift.org/contributing/#reporting-bugs)
124+
and then change the path to work around it.
125+
118126
You will also need [CMake](https://cmake.org) and [Ninja](https://ninja-build.org),
119127
which can be installed via a package manager:
120128

benchmark/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ set(SWIFT_BENCH_MODULES
9191
single-source/Fibonacci
9292
single-source/FindStringNaive
9393
single-source/FlattenList
94+
single-source/FloatingPointConversion
9495
single-source/FloatingPointParsing
9596
single-source/FloatingPointPrinting
9697
single-source/Hanoi
@@ -136,6 +137,7 @@ set(SWIFT_BENCH_MODULES
136137
single-source/PrefixWhile
137138
single-source/Prims
138139
single-source/PrimsNonStrongRef
140+
single-source/ProtocolConformance
139141
single-source/ProtocolDispatch
140142
single-source/ProtocolDispatch2
141143
single-source/Queue

benchmark/scripts/Template.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -19,4 +19,4 @@ public let {name} = [
1919
@inline(never)
2020
public func run_{name}(N: Int) {{
2121
// TODO
22-
}}
22+
}}

0 commit comments

Comments
 (0)