Skip to content

Commit 23de52f

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 04f5f33 + 1bdefa1 commit 23de52f

File tree

4,153 files changed

+118041
-55855
lines changed

Some content is hidden

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

4,153 files changed

+118041
-55855
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ filename =
4444
exclude =
4545
.git,
4646
__pycache__,
47+
.build,
4748

4849
ignore =
4950
# The black tool treats slices consistently, the E203 warning is not PEP8

.github/CODEOWNERS

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/docs/Windows* @compnerd
5656

5757
# include
58-
/include/swift-c/DependencyScan/ @artemcm
58+
/include/swift-c/DependencyScan/ @artemcm @cachemeifyoucan
5959
/include/swift/*Demangl*/ @rjmccall
6060
/include/swift/AST/ @hborla @slavapestov @xedin
6161
/include/swift/AST/*Availability* @tshortli
@@ -71,7 +71,7 @@
7171
/include/swift/Basic/ @DougGregor
7272
/include/swift/Basic/Features.def @DougGregor @hborla
7373
/include/swift/ClangImporter @zoecarver @hyp @egorzhdan @beccadax @ian-twilightcoder @Xazax-hun
74-
/include/swift/DependencyScan @artemcm
74+
/include/swift/DependencyScan @artemcm @cachemeifyoucan
7575
/include/swift/Driver*/ @artemcm
7676
/include/swift/Frontend*/ @artemcm @tshortli
7777
/include/swift/IDE/ @ahoppen @bnbarham @hamishknight @rintaro
@@ -118,7 +118,7 @@
118118
/lib/Basic/Windows @compnerd
119119
/lib/ClangImporter @zoecarver @hyp @egorzhdan @beccadax @ian-twilightcoder @Xazax-hun
120120
/lib/ClangImporter/DWARFImporter* @adrian-prantl
121-
/lib/DependencyScan @artemcm
121+
/lib/DependencyScan @artemcm @cachemeifyoucan
122122
/lib/Driver*/ @artemcm
123123
/lib/DriverTool/autolink_extract_main.cpp @MaxDesiatov @etcwilde
124124
/lib/DriverTool/sil* @jckarter
@@ -247,7 +247,7 @@
247247
/unittests/*Demangl*/ @rjmccall
248248
/unittests/AST/ @hborla @slavapestov @xedin
249249
/unittests/AST/*Evaluator* @CodaFi @slavapestov
250-
/unittests/DependencyScan/ @artemcm
250+
/unittests/DependencyScan/ @artemcm @cachemeifyoucan
251251
/unittests/FrontendTool/ @artemcm @tshortli
252252
/unittests/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @hamishknight @rintaro
253253
/unittests/Reflection/ @slavapestov
@@ -261,13 +261,15 @@
261261

262262
# utils
263263
/utils/*windows* @compnerd
264+
/utils/generate-xcode @hamishknight
264265
/utils/gyb_sourcekit_support/ @ahoppen @bnbarham @hamishknight @rintaro
265266
/utils/sourcekit_fuzzer/ @ahoppen @bnbarham @hamishknight @rintaro
266267
/utils/swift_build_support/products/earlyswiftsyntax.py @ahoppen @bnbarham @hamishknight @rintaro
267268
/utils/swift_build_support/products/skstresstester.py @ahoppen @bnbarham @hamishknight @rintaro
268269
/utils/swift_build_support/products/sourcekitlsp.py @ahoppen @bnbarham @hamishknight @rintaro
269270
/utils/swift_build_support/products/swiftformat.py @ahoppen @allevato @bnbarham @hamishknight @rintaro
270271
/utils/swift_build_support/products/swiftsyntax.py @ahoppen @bnbarham @hamishknight @rintaro
272+
/utils/swift-xcodegen/ @hamishknight
271273
/utils/update-checkout* @shahmishal
272274
/utils/update_checkout/ @shahmishal
273275
/utils/vim/ @compnerd

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ docs/_build
5252

5353
# SwiftPM
5454
.build
55+
.index-build
5556
.swiftpm
5657

5758
#==============================================================================#
@@ -78,3 +79,20 @@ SortedCFDatabase.def
7879
htmlcov
7980
.coverage
8081
/benchmark/scripts/Benchmark_Driverc
82+
83+
#==============================================================================#
84+
# Ignore copied Swift Stdlib files while migrating stdlib
85+
#==============================================================================#
86+
Runtimes/**/*.swift
87+
Runtimes/**/*.h
88+
Runtimes/**/*.cpp
89+
Runtimes/**/*.c
90+
Runtimes/**/*.m
91+
Runtimes/**/*.mm
92+
Runtimes/**/*.def
93+
Runtimes/**/*.gyb
94+
Runtimes/**/*.apinotes
95+
Runtimes/**/*.yaml
96+
Runtimes/**/*.inc
97+
Runtimes/**/*.json
98+
Runtimes/**/*.modulemap

CHANGELOG.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,30 @@
33
> [!NOTE]
44
> This is in reverse chronological order, so newer entries are added to the top.
55
6-
## Swift (next)
6+
## Swift 6.1
7+
8+
* Projected value initializers are now correctly injected into calls when
9+
an argument exactly matches a parameter with an external property wrapper.
10+
11+
For example:
12+
13+
```swift
14+
struct Binding {
15+
...
16+
init(projectedValue: Self) { ... }
17+
}
18+
19+
func checkValue(@Binding value: Int) {}
20+
21+
func use(v: Binding<Int>) {
22+
checkValue($value: v)
23+
// Transformed into: `checkValue(value: Binding(projectedValue: v))`
24+
}
25+
```
26+
27+
Previous versions of the Swift compiler incorrectly omitted projected value
28+
initializer injection in the call to `checkValue` because the argument type
29+
matched the parameter type exactly.
730

831
* [SE-0444][]:
932
When the upcoming feature `MemberImportVisibility` is enabled, Swift will
@@ -40,7 +63,7 @@
4063
* [SE-0442][]:
4164
TaskGroups can now be created without explicitly specifying their child task's result types:
4265

43-
Previously the child task type would have to be specified explicitly when creating the task group:
66+
Previously the child task type would have to be specified explicitly when creating the task group:
4467

4568
```swift
4669
await withTaskGroup(of: Int.self) { group in
@@ -50,7 +73,7 @@ Previously the child task type would have to be specified explicitly when creati
5073
}
5174
```
5275

53-
Now the type is inferred based on the first use of the task group within the task group's body:
76+
Now the type is inferred based on the first use of the task group within the task group's body:
5477

5578
```swift
5679
await withTaskGroup { group in
@@ -63,6 +86,8 @@ Now the type is inferred based on the first use of the task group within the tas
6386

6487
## Swift 6.0
6588

89+
### 2024-09-17 (Xcode 16.0)
90+
6691
* Swift 6 comes with a new language mode that prevents the risk of data races
6792
at compile time. This guarantee is accomplished through _data isolation_; the
6893
compiler will validate that data passed over a boundary between concurrently

CMakeLists.txt

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,10 @@ option(SWIFT_ENABLE_EXPERIMENTAL_PARSER_VALIDATION
747747
"Enable experimental SwiftParser validation by default"
748748
FALSE)
749749

750+
option(SWIFT_ENABLE_EXPERIMENTAL_POINTER_BOUNDS
751+
"Enable experimental safe wrappers around external functions"
752+
FALSE)
753+
750754
cmake_dependent_option(SWIFT_BUILD_SOURCEKIT
751755
"Build SourceKit" TRUE
752756
"SWIFT_ENABLE_DISPATCH" FALSE)
@@ -946,12 +950,6 @@ if (NOT BOOTSTRAPPING_MODE)
946950
message(FATAL_ERROR "turning off bootstrapping is not supported anymore")
947951
endif()
948952

949-
# As a temporary workaround, disable SwiftCompilerSources on
950-
# Windows/ARM64 because the compiler segfaults
951-
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64")
952-
set(BOOTSTRAPPING_MODE "OFF")
953-
endif()
954-
955953
set(SWIFT_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin")
956954
set(SWIFT_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib")
957955
if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "")
@@ -1399,6 +1397,7 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
13991397
message(STATUS "Observation Support: ${SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION}")
14001398
message(STATUS "Synchronization Support: ${SWIFT_ENABLE_SYNCHRONIZATION}")
14011399
message(STATUS "Volatile Support: ${SWIFT_ENABLE_VOLATILE}")
1400+
message(STATUS "Pointer Bounds Support: ${SWIFT_ENABLE_EXPERIMENTAL_POINTER_BOUNDS}")
14021401
message(STATUS "")
14031402
else()
14041403
message(STATUS "Not building Swift standard library, SDK overlays, and runtime")
@@ -1466,6 +1465,10 @@ if(SWIFT_ENABLE_DISPATCH)
14661465
endif()
14671466

14681467
# Add all of the subdirectories, where we actually do work.
1468+
add_subdirectory(include)
1469+
if(SWIFT_INCLUDE_TOOLS)
1470+
add_subdirectory(lib)
1471+
endif()
14691472

14701473
###############
14711474
# PLEASE READ #
@@ -1518,11 +1521,7 @@ if(SWIFT_INCLUDE_APINOTES)
15181521
add_subdirectory(apinotes)
15191522
endif()
15201523

1521-
add_subdirectory(include)
1522-
15231524
if(SWIFT_INCLUDE_TOOLS)
1524-
add_subdirectory(lib)
1525-
15261525
add_subdirectory(SwiftCompilerSources)
15271526

15281527
# Always include this after including stdlib/!
@@ -1579,3 +1578,48 @@ if(XCODE)
15791578
add_custom_target(Miscellaneous
15801579
SOURCES ${SWIFT_TOPLEVEL_HEADERS})
15811580
endif()
1581+
1582+
# New standard library build
1583+
option(SWIFT_ENABLE_NEW_RUNTIME_BUILD "Build Swift runtimes with new build system" OFF)
1584+
if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
1585+
1586+
add_custom_target(PopulateRuntimeSourceDir
1587+
COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Resync.cmake"
1588+
COMMENT "Copying sources into new runtime build")
1589+
1590+
foreach(sdk ${SWIFT_SDKS})
1591+
foreach(arch ${SWIFT_SDK_${sdk}_ARCHITECTURES})
1592+
# Provide a mechanism to skip building one of these runtimes
1593+
if(SWIFT_SKIP_${sdk}_${arch}_RUNTIME)
1594+
message(STATUS "Skipping: ${arch}-${sdk} runtime build")
1595+
continue()
1596+
endif()
1597+
set(stdlib_target "swift-stdlib-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
1598+
if(${SWIFT_SDK_${sdk}_${arch}_CACHE})
1599+
set(stdlib_cache_file_flag -C ${SWIFT_SDK_${sdk}_${arch}_CACHE})
1600+
endif()
1601+
ExternalProject_Add("${stdlib_target}-core"
1602+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Core"
1603+
# TODO: Add this once we're ready to start swapping out the libraries
1604+
# for testing
1605+
# INSTALL_DIR "${CMAKE_BINARY_DIR}/"
1606+
1607+
DEPENDS PopulateRuntimeSourceDir
1608+
CMAKE_ARGS
1609+
-DCMAKE_INSTALL_LIBDIR:FILEPATH=lib/swift/${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${arch}
1610+
# Compiler will see mismatched swift modules and fail initial checks
1611+
-DCMAKE_Swift_COMPILER_WORKS:BOOLEAN=YES
1612+
-DBUILD_SHARED_LIBS:BOOLEAN=YES # TODO: Make this configurable
1613+
${stdlib_cache_file_flag}
1614+
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
1615+
-DCMAKE_INSTALL_PREFIX:FILEPATH=<INSTALL_DIR>
1616+
-DCMAKE_Swift_COMPILER:FILEPATH=$<IF:$<BOOL:${CMAKE_CROSSCOMPILING}>,${CMAKE_Swift_COMPILER},$<PATH:REPLACE_FILENAME,$<TARGET_FILE:swift-frontend>,swiftc>>
1617+
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
1618+
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
1619+
-DCMAKE_COLOR_DIAGNOSTICS:BOOLEAN=${CMAKE_COLOR_DIAGNOSTICS})
1620+
if(NOT ${CMAKE_CROSSCOMPILING})
1621+
add_dependencies("${stdlib_target}" swift-frontend)
1622+
endif()
1623+
endforeach()
1624+
endforeach()
1625+
endif()

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ To switch to this template when drafting a pull request in a [swiftlang](https:/
236236
### Commit Access
237237

238238
Commit access is granted to contributors with a track record of submitting high-quality changes.
239-
If you would like commit access, please send an email to [the code owners list]([email protected]) with the GitHub user name that you want to use and a list of 5 non-trivial pull requests that were accepted without modifications.
239+
If you would like commit access, please send an email to [the code owners list](mailto:[email protected]) with the GitHub user name that you want to use and a list of 5 non-trivial pull requests that were accepted without modifications.
240240

241241
Once you’ve been granted commit access, you will be able to commit to all of the GitHub repositories that host Swift.org projects.
242242
To verify that your commit access works, please make a test commit (for example, change a comment or add a blank line). The following policies apply to users with commit access:

0 commit comments

Comments
 (0)