Skip to content

Fix conflict #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 247 commits into
base: added-support-for-client-certificate-authentication
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
247 commits
Select commit Hold shift + click to select a range
7258a8d
Make _MultiHandle timeout timer non-repeatable
lxbndr Dec 25, 2023
f9a54f3
Cancel DispatchSource before closing socket (#4791)
lxbndr Dec 25, 2023
3eb4fab
wip
parkera Feb 1, 2024
1115c11
wip
parkera Feb 1, 2024
5daa772
Basic Foundation package builds
parkera Feb 2, 2024
763145c
Reexport FoundationEssentials and start fixing build errors - error t…
parkera Feb 2, 2024
8017faa
Remove legacy Darwin files
parkera Feb 3, 2024
bf6c5e3
Builds with re-exported FoundationEssentials
parkera Feb 3, 2024
f1c0d8a
Remove a lot of old build stuff to focus on package
parkera Feb 3, 2024
8c08801
Ignore swiftpm file
parkera Feb 3, 2024
9582a2c
Remove more CMake cruft
parkera Feb 3, 2024
f816f15
Allow Date in plutil
parkera Feb 3, 2024
83a1f83
Moving tests WIP
parkera Feb 5, 2024
24dcbae
Got one test building
parkera Feb 6, 2024
6ba9edf
Add libcurl for CF
parkera Feb 6, 2024
9fc5349
Build CFXMLInterface and FoundationXML
parkera Feb 6, 2024
e09e811
Build FoundationNetworking
parkera Feb 7, 2024
55b2f94
Remove more cmake build files
parkera Feb 7, 2024
9db5173
Build FoundationXML/FoundationNetworking
parkera Feb 7, 2024
bfdf5f2
Don't rely on bridging for NSData
parkera Feb 7, 2024
f501e19
Work towards macOS build
parkera Feb 8, 2024
7914671
Ensure we're using the built-in CoreFoundation and not mixing things …
parkera Feb 10, 2024
0f87f9d
Use bridging again - relies on compiler from 2024-02-07 or later
parkera Feb 10, 2024
bd05761
Clean up export of essentials, and stop warning about resources
parkera Feb 10, 2024
11c4942
Use FoundationEssentials Locale
parkera Feb 10, 2024
e1e3bd3
Add deprecated API to Locale
parkera Feb 10, 2024
74b371d
Remove ability to unsafeBitCast from CFLocale to NSLocale
parkera Feb 12, 2024
60f6f7a
Recore Date
parkera Feb 15, 2024
1b88a3b
Stop assuming `CFSTR` is a constant-time expression with Clang 15 (#4…
kateinoigakukun Feb 15, 2024
7052e54
Depend on public branch of swift-foundation
parkera Feb 15, 2024
c54936a
Use SCL-F SPI import
parkera Feb 15, 2024
3d2c6cb
Use FoundationEssentials UUID
parkera Feb 15, 2024
2238ee6
Remove AttributedString from swift-corelibs-foundation in favor of sw…
parkera Feb 15, 2024
a5079cb
Fix a Locale bug
parkera Feb 15, 2024
ad4867b
Move Data support to NSData
parkera Feb 15, 2024
7dcee5e
Use Context to get package directory for relative paths in unicode data
parkera Feb 16, 2024
3b4b7b4
Use FoundationEssentials Calendar, TimeZone, DateComponents
parkera Feb 15, 2024
100517e
Remove obsolete Mirror test
parkera Feb 17, 2024
3e128d5
Use module bundle instead of main, for swiftpm compatibility
parkera Feb 22, 2024
53857d5
Fix bundle access, Calendar bridging
parkera Feb 22, 2024
1b4f09d
Merge changes from upstream swift-corelibs-foundation
parkera Mar 1, 2024
1df1dd8
Don't use SWIFT_CORELIBS_FOUNDATION_HAS_THREADS in header file
parkera Mar 1, 2024
431e765
Build xdgTestHelper
parkera Mar 1, 2024
4f91b6d
Fix some issues with Calendar identifier bridging
parkera Mar 1, 2024
fa7a2d1
Work towards fixing Data tests
parkera Mar 4, 2024
157195c
Merge upstream/main
parkera Mar 12, 2024
2fde124
Drop CocoaError from SCL-F, it is now in swift-foundation
parkera Mar 13, 2024
e141251
Remove duplicate error codes
parkera Mar 13, 2024
8f3ab77
Additional fixes for NSError
parkera Mar 13, 2024
dafd82b
Bridge from a CFTypeRef to a Swift value correctly
parkera Mar 13, 2024
97797b4
Adjust unit tests for new behaviors in swift-foundation
parkera Mar 13, 2024
5d08034
Ensure TimeZone is passed through to underlying components
parkera Mar 18, 2024
6a84869
Make sure to bridge self not just always the current locale
parkera Mar 18, 2024
5e6ca49
Update tests to account for new nonbreaking space behavior in formatt…
parkera Mar 18, 2024
5cd8466
Resolve a warning in the test build
parkera Mar 18, 2024
829f9cd
Avoid a warning in the test build
parkera Mar 20, 2024
b723193
Fix some expectations around process names
parkera Mar 20, 2024
249a466
Merge pull request #4927 from parkera/package
parkera Mar 27, 2024
f4566b9
Resolve -Wno-int-conversion warnings
jmschonfeld Mar 29, 2024
cd9a1a2
Make package SCF depend on Apple swift-foundation repo
jmschonfeld Mar 29, 2024
31c93c7
Fix Package test failures for Linux
jmschonfeld Apr 1, 2024
5b64137
Update swift-foundation/swift-foundation-icu dependencies (#4935)
jmschonfeld Apr 2, 2024
52d9d71
Remove SCF version of IndexPath (#4938)
jmschonfeld Apr 24, 2024
595a0d5
Remove SCF version of PropertyListEncoder/PropertyListDecoder (#4939)
jmschonfeld Apr 24, 2024
9494d4b
Remove ProcessInfo in favor of swift-foundation's implementation (#4945)
jmschonfeld May 2, 2024
d8f1bfe
Remove String APIs implemented in swift-foundation (#4946)
jmschonfeld May 6, 2024
d3871a5
[Windows] Use `fd_set` according to Winsock2 specifics
lxbndr May 12, 2024
6e5d962
Remove Collections+DataProtocol and some CocoaError extensions (#4956)
jmschonfeld May 14, 2024
cc5704d
Remove URL in favor of swift-foundation's URL (#4955)
jmschonfeld May 14, 2024
a9ffa77
CoreFoundation modularization and packaging improvements
parkera May 7, 2024
405627b
Merge pull request #4952 from parkera/parkera/build_package_macos
parkera May 16, 2024
6f4c134
Recore FileManager on top of FoundationEssentials.FileManager (#4957)
jmschonfeld May 17, 2024
2c5b4e2
Merge remote-tracking branch 'upstream/main' into package
parkera May 20, 2024
927e685
Merge pull request #4961 from parkera/package
parkera May 20, 2024
ce23015
Change the way we check for libcurl availability
parkera May 21, 2024
855f90f
Merge pull request #4962 from parkera/parkera/change_curl_feature_ava…
parkera May 21, 2024
097f850
Mark Bundle as Sendable
parkera May 23, 2024
bc59b7c
Merge pull request #4963 from parkera/parkera/bundle_sendable
parkera May 24, 2024
19bde7e
Merge remote-tracking branch 'upstream/main' into package
parkera May 24, 2024
1b669a5
Merge pull request #4964 from parkera/package
parkera May 24, 2024
9c020a9
Merge pull request #4859 from readdle/readdle/urlsession-dispatchsour…
shahmishal May 25, 2024
ad8bf7b
Remove URLQueryItem from swift-corelibs-foundation in favor of Founda…
iCharlesHu May 29, 2024
08e829c
Add upcall for FoundationEssentials to initialize NSNumbers (#4966)
jmschonfeld May 29, 2024
0f1a45b
Merge pull request #4967 from iCharlesHu/charles/remove-url-query-item
iCharlesHu May 29, 2024
fa71faf
Merge pull request #4954 from readdle/win-fd-set
compnerd May 30, 2024
a59a97a
NSData options should typealias to Data options (#4968)
jmschonfeld May 30, 2024
9a8e5ae
Remove additional unnecessary FileManager code (#4971)
jmschonfeld Jun 5, 2024
ff64e86
Add async URLSession methods (#4970)
jrflat Jun 6, 2024
d7c868a
Fix test_webSocket hang (#4973)
jrflat Jun 7, 2024
301b6f5
[wasm] Do not set permissions in `Data.write`
kkebo Jun 8, 2024
ca3669e
Merge pull request #4976 from kkebo/fix-nsdata-write-for-wasi
kateinoigakukun Jun 9, 2024
697cb9e
Merge main
parkera Jun 10, 2024
fbbe6fa
Merge pull request #4977 from parkera/package
parkera Jun 10, 2024
7e2f7fe
Include CFBase.h in CoreFoundation_Prefix.h (#4979)
jmschonfeld Jun 17, 2024
c772413
Introduce Cmake support for SwiftCorelibsFoundation
iCharlesHu May 18, 2024
e9e40df
Merge pull request #4959 from iCharlesHu/charles/cmake-support
iCharlesHu Jun 20, 2024
f4f5d7c
Various fixes to support building within the toolchain (#4985)
jmschonfeld Jun 21, 2024
67eb5cb
Add SWIFTCI_USE_LOCAL_DEPS build mode (#4986)
jmschonfeld Jun 21, 2024
1181ecb
[CMake] Add plutil to CMake build (#4987)
jmschonfeld Jun 24, 2024
27ae565
[CMake] Copy headers to known directory for direct client test builds…
jmschonfeld Jun 24, 2024
f28f4be
Remove Codable.swift (#4993)
jmschonfeld Jun 26, 2024
f186ff8
[Linux] Enable build-ids. (#4995)
al45tair Jun 27, 2024
f1c66e0
[CMake] Fix Windows Build (#4991)
jmschonfeld Jun 28, 2024
9118940
[CMake] Include GNUInstallDirs (#4996)
jmschonfeld Jun 28, 2024
06bd59d
Use FSR for Process executable path on Windows (#4999)
jmschonfeld Jul 8, 2024
082b0dc
Avoiding linking CF from outside of Foundation (#5003)
jmschonfeld Jul 11, 2024
ad15f44
[CMake] correctly apply -fcf-runtime-abi=swift on Windows (#5004)
jmschonfeld Jul 12, 2024
7e53507
Workaround broken glibc modulemap
etcwilde Jul 10, 2024
32cd74f
Fix include path to Dispatch
parkera Jun 24, 2024
fd80603
Merge pull request #5006 from parkera/parkera/fix_dispatch_path
parkera Jul 12, 2024
17051b4
Allocate buffer of correct size in `NSURL.fileSystemRepresentation` o…
lxbndr Jul 11, 2024
543ae3c
Merge pull request #5008 from apple/package
jmschonfeld Jul 16, 2024
8c68478
Merge pull request #5007 from readdle/win-url-fsr-utf8
parkera Jul 16, 2024
0f7e129
Merge pull request #5005 from etcwilde/ewilde/main-workaround-broken-…
parkera Jul 17, 2024
1fc5ee5
Add fcntl.h include, required for some linux platforms
parkera Jul 17, 2024
5e305a5
Merge pull request #5014 from parkera/parkera/amazonlinux2_include_fix
shahmishal Jul 18, 2024
15ee5c3
Re-core some String APIs on swift-foundation (#5009)
jmschonfeld Jul 18, 2024
a757413
Use a shared queue for URLSessions
jrflat Jul 18, 2024
2e87e5e
Merge pull request #5016 from jrflat/urlsession-threading-crash
parkera Jul 19, 2024
b55ac8f
Enable importing the Synchronization module (#5015)
jmschonfeld Jul 19, 2024
acf9154
Remove swift-corelibs-foundation duplicate implementations of Decimal…
parkera Jun 13, 2024
f11c7f2
Remove obsolete docs folder
parkera Jul 16, 2024
bb9021c
Update README with swift-foundation recore
parkera Jul 17, 2024
f57bc56
Merge pull request #5018 from parkera/parkera/remove_obsolete_docs
parkera Jul 20, 2024
20967d3
Merge pull request #5017 from parkera/parkera/replace_json_coders
parkera Jul 20, 2024
fa2b3ad
Add environment variable to specify include path for dispatch (#5025)
jmschonfeld Jul 24, 2024
af24464
Adopt Swift 6 and audit for Sendable (#5000)
parkera Jul 25, 2024
65abf58
Re-enable tests requiring isoLatin1/macOSRoman (#5027)
jmschonfeld Jul 25, 2024
3a3bf2f
Fix local CMake build (#5032)
jmschonfeld Jul 27, 2024
9e7732b
Fix SwiftPM build dispatch include path on Windows (#5033)
jmschonfeld Jul 29, 2024
3420746
Add default implementations for three default protocol conformances i…
jakepetroules Jul 20, 2024
aa5c175
Disable tests failing on amazon linux (#5036)
jmschonfeld Jul 30, 2024
1ed5181
Make sure that the once used for Process is static, so not recreated …
parkera Jul 30, 2024
8e4ddae
Make completion-based send/receive functions public in `URLSessionWeb…
lxbndr Jul 31, 2024
9c8bac4
Fix CoreFoundation install path (#5037)
jmschonfeld Aug 1, 2024
9d1a846
Update to use dynamic replacement for _NSNumberInitializer (#5045)
jmschonfeld Aug 2, 2024
45cb79c
Disable test_connectTimeout (#5046)
jrflat Aug 6, 2024
17bc8ed
Add `.index-build` to `.gitignore` (#5054)
MaxDesiatov Aug 6, 2024
b3fa847
Implement hook for data reading from remote URL (#5049)
jmschonfeld Aug 7, 2024
7f38264
build: Repair the build on WASI platform (#5052)
MaxDesiatov Aug 7, 2024
3506f58
[CMake] Use LIBXML2_INCLUDE_DIR instead of hardcoding /usr/include/li…
kateinoigakukun Aug 7, 2024
fef1083
[CMake] Disable libdispatch & threads, enable some emulations on WASI
kateinoigakukun Aug 7, 2024
27310f4
[CMake] Exclude FoundationNetworking and _CFURLSessionInterface on WASI
kateinoigakukun Aug 7, 2024
164af81
[wasm] Include CFPreferences.h, CFRunLoop.h, and CFStream.h in WASI b…
kateinoigakukun Aug 7, 2024
f91a759
[wasm] Fix the new CFString.c compilation error on WASI
kateinoigakukun Aug 7, 2024
27efb0c
[wasm] Build the vendored version of BlocksRuntime on WASI
kateinoigakukun Aug 7, 2024
f0a3631
[wasm] `strlcpy` and `strlcat` are available in wasi-libc
kateinoigakukun Aug 7, 2024
8176d11
[Build] Repair WASI build with SwiftPM
kateinoigakukun Aug 7, 2024
e5104c3
Use `__builtin_return_address` instead of `__builtin_frame_address`
kateinoigakukun Aug 7, 2024
a1b9c39
[CMake] Not even try to find libdispatch on WASI
kateinoigakukun Aug 7, 2024
965246e
[CMake] Build BlocksRuntime as object library
kateinoigakukun Aug 7, 2024
3b8485a
[CMake] Remove POSITION_INDEPENDENT_CODE=FALSE from BlocksRuntime
kateinoigakukun Aug 8, 2024
7ccef0d
Allow for more flexibility in what path SWIFTCI_USE_LOCAL_DEPS means …
parkera Aug 8, 2024
6450f42
Merge pull request #5057 from kateinoigakukun/yt/repair-wasi-build
kateinoigakukun Aug 9, 2024
0d18916
Enable WMO for release builds (#5059)
jmschonfeld Aug 9, 2024
be0e853
Remove the workaround for WASI errno conflict
kateinoigakukun Aug 10, 2024
4127e85
Make curl an optional dependency when not building FoundationNetworking
kateinoigakukun Aug 10, 2024
c09a4f7
Include userInfo in Error descriptions
jakepetroules Aug 12, 2024
3e725c4
Fix incorrect help documentation of XCTestMain (#5044)
kkebo Aug 12, 2024
2a27eca
Merge pull request #5063 from kateinoigakukun/pr-e48524c7b6d29dd22e45…
kateinoigakukun Aug 13, 2024
e1d7356
Merge pull request #5064 from kateinoigakukun/pr-053b25017d60084b5d4f…
kateinoigakukun Aug 13, 2024
951f353
Merge pull request #5065 from apple/debuggable-nserrors
jakepetroules Aug 14, 2024
1bd5574
Bring back defines and flags
etcwilde Aug 8, 2024
16071df
Fix the musl build in Port.swift
etcwilde Aug 8, 2024
b22db59
Add comment on symbol searching
etcwilde Aug 13, 2024
2973067
Fix CFTimeZone crashes on Windows (#5070)
jmschonfeld Aug 16, 2024
e0f1615
Merge pull request #5069 from etcwilde/ewilde/main-musl-builds
etcwilde Aug 16, 2024
a39f398
Repair the Windows SwiftPM build (#5068)
jmschonfeld Aug 16, 2024
1b8c1ea
Fix up tests for Windows (#5074)
jmschonfeld Aug 21, 2024
4418280
Add stub for Testing module (#5077)
jmschonfeld Aug 21, 2024
018d8ef
Merge pull request #5022 from apple/urlsessiondelegate-default-implem…
jakepetroules Aug 24, 2024
ef225c7
Add one more XCTAssert for isLeapMonth in TestDate.swift (#5080)
lamtrinhdev Aug 30, 2024
c820f72
Fix compiler error in CoreFoundation when building in C++ mode (#5081)
egorzhdan Sep 3, 2024
83062fa
Tests: prefer `XCTAssertEqual` over `XCTAssertTrue`
compnerd Sep 8, 2024
a12c7d1
Merge pull request #5083 from compnerd/equal
compnerd Sep 8, 2024
86a733f
[XMLParser] Fix reentrancy issue around `currentParser` (#5061)
kateinoigakukun Sep 16, 2024
9c03e2e
CMake: Fix accidental variable expansion of `WASI`
kateinoigakukun Sep 19, 2024
c542180
Merge pull request #5084 from kateinoigakukun/yt/wasi-cmake-var
kateinoigakukun Sep 20, 2024
d493cfb
Delete CODE_OF_CONDUCT.md
parispittman Sep 20, 2024
6425c14
Update CONTRIBUTING.md
parispittman Sep 20, 2024
b70557a
Correct spelling mistake: manDocumentURL -> mainDocumentURL
jiang7369 Sep 22, 2024
7f0f8da
Fix a test marked `@MainActor` but not `async`.
grynspan Sep 24, 2024
001fb5c
Add a thread-safe implementation of Process.currentDirectoryURL
jakepetroules Jun 16, 2024
98f4bac
Merge pull request #5088 from swiftlang/jgrynspan/mainactor-sync-test
grynspan Sep 25, 2024
4a86531
Merge pull request #4981 from swiftlang/process-currentdir-threadsafe
jakepetroules Sep 26, 2024
722752d
Merge pull request #5085 from swiftlang/parispittman-patch-1
itingliu Sep 27, 2024
465203c
Merge pull request #5086 from swiftlang/parispittman-patch-2
itingliu Sep 27, 2024
4623e8e
Restore thread-unsafe fallback for setting the Process working directory
jakepetroules Sep 28, 2024
7b5cd12
Merge pull request #5090 from swiftlang/process-currentdir-threadsafe
jakepetroules Oct 1, 2024
b6de43d
Merge pull request #5087 from jiang7369/patch-1
itingliu Oct 1, 2024
ebc24af
Update FileManager.swift to include bracket in save message (#5093)
LordBurtz Oct 2, 2024
6304081
[Musl] Add back missing autolink arguments, fix CFPosixSpawnFileActio…
al45tair Oct 4, 2024
e55e1d8
Merge pull request #5097 from al45tair/static-linux-autolink
al45tair Oct 4, 2024
301bafe
[CFXMLInterface] Remove spurious include path. (#5101)
al45tair Oct 11, 2024
f1b2fb2
Fix bounds checking error when parsing WWW-Authenticate field (#5103)
toffaletti Oct 15, 2024
cb6b2fa
Fix a leak when mutating CharacterSet by moving away from _SwiftNSCha…
parkera Oct 15, 2024
bf7369a
Fixed an infinite loop caused by force casting NSError to CocoaError.…
nnabeyang Oct 18, 2024
64ba207
[CoreFoundation] Replace use of strlcpy/strlcat with our own function…
al45tair Oct 18, 2024
af2bcc5
Ensure that NSCharacterSet always returns an NSObject on copy (follow…
parkera Oct 22, 2024
b1b4603
Move __CFAllocatorRespectsHintZeroWhenAllocating to a CF-internal hea…
parkera Oct 30, 2024
974106b
Skip test_emptyFilename on Windows while we investigate the failure (…
jrflat Nov 1, 2024
9cc5d4c
Align fatalError messages in Objective-C bridging methods for consist…
nnabeyang Nov 1, 2024
8c0a11e
Fix crash when using WebSockets with URLSession.shared (#5128)
jrflat Nov 2, 2024
1acc48b
improve CustomNSError.errorDomain calculation (#5132)
ChrisBenua Nov 5, 2024
f812a85
suggestedFilename always returns a valid filename (#5019)
Coeur Nov 5, 2024
13d628a
Fix Dictionary ordering in TestHTTPURLResponse.test_NSCoding
jrflat Nov 6, 2024
cb8377e
Merge pull request #5133 from jrflat/httpurlresponse-coding-test
rintaro Nov 6, 2024
21b3196
Fix various typos (#5075)
Coeur Nov 6, 2024
731f3ae
[Windows] FileManager.enumerator(at:) default error handler should co…
jmschonfeld Nov 20, 2024
c28bf23
CGPoint, CGSize, CGRect Conforms Hashable (#5134)
KYHyeon Nov 21, 2024
de3d58f
[android] Fix package manifest and one Bionic function's API version
finagolfin Dec 6, 2024
8255a77
Home directory for non-existent user should not fall back to /var/emp…
jmschonfeld Dec 6, 2024
fddda82
Fix FreeBSD build
michael-yuji Dec 9, 2024
fef9930
typo
michael-yuji Dec 9, 2024
b81f510
Merge pull request #5144 from finagolfin/main
finagolfin Dec 11, 2024
9b2dde9
Merge commit '246b3474fd4cb91d13b5ecb8fb5175aa6b50aa1e' into github/main
hyp Aug 6, 2024
7f4bf4b
Fix fts_open now that apinotes are applied
hyp Aug 6, 2024
5f40cce
Update Sources/Foundation/FileManager+POSIX.swift
compnerd Aug 7, 2024
e505ccf
fix Port.swift conditional
hyp Dec 11, 2024
90c4f5c
Ensure that the Android build on a windows host doesn't turn on WMO yet
hyp Dec 12, 2024
70ce513
[android] fix pthread flag inclusion in libxml2 package
hyp Dec 12, 2024
1da58eb
review fixes
hyp Dec 12, 2024
4c3228c
Merge pull request #5024 from hyp/eng/recore-android-build
hyp Dec 12, 2024
f415af0
Merge branch 'main' into freebsd-wip
michael-yuji Dec 16, 2024
bc2b966
[android] Use Bionic imports instead where possible
finagolfin Dec 17, 2024
238130a
Merge pull request #5146 from michael-yuji/freebsd-wip
finagolfin Dec 17, 2024
25d044f
Merge pull request #5149 from finagolfin/main
finagolfin Dec 17, 2024
c466923
Fix race condition in __CFStringGetEightBitStringEncoding (#5155)
jmschonfeld Jan 15, 2025
0129358
Fix OpenBSD clause. (#5160)
3405691582 Jan 24, 2025
871e288
Disallow creation of CFStrings from non-8bit c-strings (#5165)
jmschonfeld Feb 10, 2025
bb396c4
New HTTP loader for URLSession (#5162)
guoye-zhang Feb 10, 2025
8caf77d
Add an unknown case in case FoundationEssentials.Calendar exposes mor…
itingliu Feb 17, 2025
35f5bcc
Disable a base64 test while we investigate (#5174)
parkera Feb 21, 2025
fb8d64d
Remove incorrect `guard` check for Android (#5171)
finagolfin Feb 22, 2025
9dd8777
always @preconcurrency import Glibc/Musl (#5170)
weissi Feb 26, 2025
d2de975
Process: unwrap the `posix_spawnattr_t` on Android
compnerd Feb 27, 2025
a563ace
Set CMP0157 to OLD for Android
Steelskin Feb 27, 2025
54c4e51
Merge pull request #5179 from compnerd/spawn
compnerd Feb 28, 2025
853b681
CoreFoundation: adjust declaration of private SPI
compnerd Mar 2, 2025
01576d7
Set CMP0157 to OLD only for Windows hosts
Steelskin Mar 3, 2025
db6474a
Merge pull request #5180 from Steelskin/fabrice/disable-cmp0157-android
weliveindetail Mar 5, 2025
4a9694d
ensure curlver.h has been included before checking LIBCURL_VERSION (#…
toffaletti Mar 5, 2025
15022ff
Pass -fno-omit-frame-pointer on Linux (#5191)
jmschonfeld Mar 20, 2025
cb4ee87
Deprecate cString on non-Darwin (#3885) (#5190)
parkera Mar 24, 2025
4c93e5b
Fix the comment about the posix_spawn_file_actions_addchdir support s…
jakepetroules Mar 24, 2025
af2ecd8
Add callout for FoundationEssentials to handle non-UTF encodings (#51…
parkera Mar 25, 2025
fb68306
Merge branch 'main' into added-support-2
zunda-pixel Mar 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Mac OS X filesystem metadata
.DS_Store

Package.resolved

# Xcode user artifacts
xcuserdata/
project.xcworkspace
Expand All @@ -23,8 +25,10 @@ project.xcworkspace

Build
.build
.index-build
.configuration

*.swp
*.orig
.arcconfig
.swiftpm
327 changes: 207 additions & 120 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@

cmake_minimum_required(VERSION 3.15.1)
##===----------------------------------------------------------------------===##
##
## This source file is part of the Swift open source project
##
## Copyright (c) 2024 Apple Inc. and the Swift project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
## See CONTRIBUTORS.md for the list of Swift project authors
##
## SPDX-License-Identifier: Apache-2.0
##
##===----------------------------------------------------------------------===##

cmake_minimum_required(VERSION 3.24)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)

# NOTE(compnerd) enable CMP0091 - select MSVC runtime based on
# CMAKE_MSVC_RUNTIME_LIBRARY. Requires CMake 3.15 or newer
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
if(POLICY CMP0156)
# Deduplicate linked libraries where appropriate
cmake_policy(SET CMP0156 NEW)
endif()

if(POLICY CMP0157)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows AND CMAKE_SYSTEM_NAME STREQUAL Android)
# CMP0157 causes swift-collections to fail to compile when targetting
# Android on Windows due to swift-driver not being present during the
# toolchain build. Disable it for now.
cmake_policy(SET CMP0157 OLD)
else()
# New Swift build model: improved incremental build performance and LSP support
cmake_policy(SET CMP0157 NEW)
endif()
endif()

if (NOT DEFINED CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER clang)
endif()

project(Foundation
LANGUAGES C Swift)
enable_testing()
LANGUAGES C Swift)

if(NOT SWIFT_SYSTEM_NAME)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
Expand All @@ -21,143 +48,203 @@ if(NOT SWIFT_SYSTEM_NAME)
endif()
endif()

# NOTE(compnerd) default to /MD or /MDd by default based on the configuration.
# Cache the variable to allow the user to alter the configuration.
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" CACHE
STRING "MSVC Runtime Library")

if(CMAKE_VERSION VERSION_LESS 3.16.0)
if(NOT (CMAKE_SYSTEM_NAME STREQUAL Windows OR CMAKE_SYSTEM_NAME STREQUAL Darwin))
set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ")
set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP ":")
endif()
# Workaround for CMake 3.15 which doesn't link libraries properly on Windows
set(CMAKE_LINK_LIBRARY_FLAG "-l")
# Don't enable WMO on Windows due to linker failures
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
# Enable whole module optimization for release builds & incremental for debug builds
if(POLICY CMP0157)
set(CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
else()
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:Swift>,$<CONFIG:Release>>:-wmo>)
endif()
endif()

if(CMAKE_VERSION VERSION_LESS 3.16 AND CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
else()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)

option(BUILD_SHARED_LIBS "build shared libraries" ON)
option(BUILD_FULLY_STATIC "build fully static" NO)
option(HAS_LIBDISPATCH_API "has libdispatch API" ON)
option(FOUNDATION_ENABLE_FOUNDATION_NETWORKING "build FoundationNetworking module" ON)
option(FOUNDATION_BUILD_TOOLS "build tools" ON)
option(NS_CURL_ASSUME_FEATURES_MISSING "Assume that optional libcurl features are missing rather than test the library's version, for build debugging" NO)

if(HAS_LIBDISPATCH_API)
find_package(dispatch CONFIG REQUIRED)
# Optionally build tools (on by default) but only when building shared libraries
if(BUILD_SHARED_LIBS)
option(FOUNDATION_BUILD_TOOLS "build tools" ON)
endif()

find_package(ICU COMPONENTS uc i18n REQUIRED OPTIONAL_COMPONENTS data)

# This is needed if we're statically linking, otherwise we can't pull in Dispatch
# because we won't have RT::rt as a CMake target.
if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
find_package(LibRT)
set(FOUNDATION_BUILD_NETWORKING_default ON)
if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
# Networking is not supported on WASI
set(FOUNDATION_BUILD_NETWORKING_default OFF)
endif()
option(FOUNDATION_BUILD_NETWORKING "build FoundationNetworking"
${FOUNDATION_BUILD_NETWORKING_default})

include(SwiftSupport)
include(GNUInstallDirs)
include(XCTest)

set(CF_DEPLOYMENT_SWIFT YES CACHE BOOL "Build for Swift" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE YES)

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG OFF)
if(HAS_LIBDISPATCH_API)
find_package(Threads REQUIRED)
# Fetchable dependencies
include(FetchContent)
if (_SwiftFoundationICU_SourceDIR)
FetchContent_Declare(SwiftFoundationICU
SOURCE_DIR ${_SwiftFoundationICU_SourceDIR})
else()
FetchContent_Declare(SwiftFoundationICU
GIT_REPOSITORY https://github.com/apple/swift-foundation-icu.git
GIT_TAG 0.0.9)
endif()

set(SAVED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS NO)
add_subdirectory(CoreFoundation EXCLUDE_FROM_ALL)
set(BUILD_SHARED_LIBS ${SAVED_BUILD_SHARED_LIBS})
if (_SwiftFoundation_SourceDIR)
FetchContent_Declare(SwiftFoundation
SOURCE_DIR ${_SwiftFoundation_SourceDIR})
else()
FetchContent_Declare(SwiftFoundation
GIT_REPOSITORY https://github.com/apple/swift-foundation.git
GIT_TAG main)
endif()
FetchContent_MakeAvailable(SwiftFoundationICU SwiftFoundation)

include(CheckLinkerFlag)
include(CheckSymbolExists)

check_linker_flag(C "LINKER:--build-id=sha1" LINKER_SUPPORTS_BUILD_ID)

# Detect if the system libc defines symbols for these functions.
# If it is not availble, swift-corelibs-foundation has its own implementations
# that will be used. If it is available, it should not redefine them.
# Note: SwiftPM does not have the ability to introspect the contents of the SDK
# and therefore will always include these functions in the build and will
# cause build failures on platforms that define these functions.
check_symbol_exists("strlcat" "string.h" HAVE_STRLCAT)
check_symbol_exists("strlcpy" "string.h" HAVE_STRLCPY)
check_symbol_exists("issetugid" "unistd.h" HAVE_ISSETUGID)
add_compile_definitions(
$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_STRLCAT}>>:HAVE_STRLCAT>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_STRLCPY}>>:HAVE_STRLCPY>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_ISSETUGID}>>:HAVE_ISSETUGID>)

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
check_symbol_exists(sched_getaffinity "sched.h" HAVE_SCHED_GETAFFINITY)
add_compile_definitions($<$<COMPILE_LANGUAGE:C>:HAVE_SCHED_GETAFFINITY>)

# Pass -fno-omit-frame-pointer while compiling for better backtraces
add_compile_options(
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fno-omit-frame-pointer>"
"$<$<COMPILE_LANGUAGE:C,CXX>:-fno-omit-frame-pointer>")
endif()

# BlocksRuntime is already in libdispatch so it is only needed if libdispatch is
# NOT being used
if(NOT HAS_LIBDISPATCH_API)
add_subdirectory(Sources/BlocksRuntime)
# Precompute module triple for installation
if(NOT SwiftFoundation_MODULE_TRIPLE)
set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info)
if(CMAKE_Swift_COMPILER_TARGET)
list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET})
endif()
execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
string(JSON module_triple GET "${target_info_json}" "target" "moduleTriple")
set(SwiftFoundation_MODULE_TRIPLE "${module_triple}" CACHE STRING "swift module triple used for installed swiftmodule and swiftinterface files")
mark_as_advanced(SwiftFoundation_MODULE_TRIPLE)
endif()

# Setup include paths for uuid/uuid.h
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/uuid-headers/uuid/uuid.h
COMMAND
${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/uuid-headers/uuid
COMMAND
${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/Sources/UUID/uuid.h ${CMAKE_BINARY_DIR}/uuid-headers/uuid/uuid.h)
add_custom_target(uuid-headers
DEPENDS ${CMAKE_BINARY_DIR}/uuid-headers/uuid/uuid.h)
add_dependencies(CoreFoundation uuid-headers)
target_include_directories(CoreFoundation PRIVATE
${CMAKE_BINARY_DIR}/uuid-headers
${CMAKE_CURRENT_BINARY_DIR}/CoreFoundation.framework/Headers)
# System dependencies

# We know libdispatch is always unavailable on WASI
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WASI")
find_package(LibRT)
find_package(dispatch CONFIG)
if(NOT dispatch_FOUND)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
set(DEFAULT_DISPATCH_INCLUDE_PATH "/usr/lib/swift")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(DEFAULT_DISPATCH_INCLUDE_PATH "$ENV{SDKROOT}usr/include")
endif()
set(DISPATCH_INCLUDE_PATH "${DEFAULT_DISPATCH_INCLUDE_PATH}" CACHE STRING "A path to where you can find libdispatch headers")
message("-- dispatch_DIR not found, using dispatch from SDK at ${DISPATCH_INCLUDE_PATH}")
list(APPEND _Foundation_common_build_flags
"-I${DISPATCH_INCLUDE_PATH}"
"-I${DISPATCH_INCLUDE_PATH}/Block")
endif()
endif()
if(ANDROID)
# LibXml2 looks for the Threads package, so
# ensure that it doesn't try to use the `-pthread`
# flag on Android.
set(CMAKE_HAVE_LIBC_PTHREAD YES)
endif()
find_package(LibXml2 REQUIRED)
if(FOUNDATION_BUILD_NETWORKING)
find_package(CURL REQUIRED)
endif()

add_subdirectory(Sources)
if(ENABLE_TESTING)
find_package(XCTest CONFIG REQUIRED)
add_subdirectory(Tests)
# Common build flags (_CFURLSessionInterface, _CFXMLInterface, CoreFoundation)
list(APPEND _Foundation_common_build_flags
"-DDEPLOYMENT_RUNTIME_SWIFT"
"-DCF_BUILDING_CF"
"-DHAVE_STRUCT_TIMESPEC"
"-Wno-shorten-64-to-32"
"-Wno-deprecated-declarations"
"-Wno-unreachable-code"
"-Wno-conditional-uninitialized"
"-Wno-unused-variable"
"-Wno-unused-function"
"-Wno-microsoft-enum-forward-reference"
"-Wno-int-conversion"
"-Wno-switch"
"-fblocks")

if(NOT CMAKE_SYSTEM_NAME STREQUAL "WASI")
list(APPEND _Foundation_common_build_flags
"-DDEPLOYMENT_ENABLE_LIBDISPATCH"
"-DSWIFT_CORELIBS_FOUNDATION_HAS_THREADS")
endif()

if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS
CoreFoundation CFXMLInterface)
if(NOT "${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
list(APPEND _Foundation_common_build_flags
"-fconstant-cfstrings"
"-fdollars-in-identifiers"
"-fno-common"
"-fcf-runtime-abi=swift")

if(NOT CMAKE_SYSTEM_NAME STREQUAL OpenBSD)
list(APPEND _Foundation_common_build_flags
"-fexceptions")
endif()
else()
list(APPEND _Foundation_common_build_flags
"/EHsc"
"/clang:-fcf-runtime-abi=swift")
endif()

if(NOT HAS_LIBDISPATCH_API)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS
BlocksRuntime)
endif()
if(CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND _Foundation_common_build_flags
"-DDEBUG")
endif()

install(TARGETS CoreFoundation CFXMLInterface
DESTINATION lib/swift_static/${SWIFT_SYSTEM_NAME})
# Swift build flags (Foundation, FoundationNetworking, FoundationXML)
set(_Foundation_swift_build_flags)
list(APPEND _Foundation_swift_build_flags
"-swift-version 6"
"-DDEPLOYMENT_RUNTIME_SWIFT"
"-Xfrontend"
"-require-explicit-sendable")

if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
# Enable wasi-libc emulation features
set(WASI_EMULATION_DEFS _WASI_EMULATED_MMAN _WASI_EMULATED_SIGNAL _WASI_EMULATED_PROCESS_CLOCKS)
foreach(def ${WASI_EMULATION_DEFS})
list(APPEND _Foundation_swift_build_flags "SHELL:-Xcc -D${def}")
list(APPEND _Foundation_common_build_flags "-D${def}")
endforeach()
else()
# Assume we have threads on other platforms
list(APPEND _Foundation_swift_build_flags
"-DSWIFT_CORELIBS_FOUNDATION_HAS_THREADS")
endif()

if(FOUNDATION_ENABLE_FOUNDATION_NETWORKING)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS
CFURLSessionInterface)
install(TARGETS CFURLSessionInterface
DESTINATION lib/swift_static/${SWIFT_SYSTEM_NAME})
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
list(APPEND _Foundation_common_build_flags
"-D_GNU_SOURCE")
endif()

set(swift_lib_dir "lib/swift")
if(NOT BUILD_SHARED_LIBS)
set(swift_lib_dir "lib/swift_static")
endif()

# TODO(compnerd) install as a Framework as that is how swift actually is built
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/CoreFoundation.framework/Headers/
DESTINATION
${swift_lib_dir}/CoreFoundation
FILES_MATCHING PATTERN "*.h")
install(FILES
CoreFoundation/Base.subproj/$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:static/>module.map
DESTINATION
${swift_lib_dir}/CoreFoundation)
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/CFURLSessionInterface.framework/Headers/
DESTINATION
${swift_lib_dir}/CFURLSessionInterface
FILES_MATCHING PATTERN "*.h")
install(FILES
CoreFoundation/URL.subproj/$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:static/>module.map
DESTINATION
${swift_lib_dir}/CFURLSessionInterface)
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/CFXMLInterface.framework/Headers/
DESTINATION
${swift_lib_dir}/CFXMLInterface
FILES_MATCHING PATTERN "*.h")
install(FILES
CoreFoundation/Parsing.subproj/$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:static/>module.map
DESTINATION
${swift_lib_dir}/CFXMLInterface)
include(GNUInstallDirs)
include(FoundationSwiftSupport)

add_subdirectory(Sources)
add_subdirectory(cmake/modules)
3 changes: 0 additions & 3 deletions CODE_OF_CONDUCT.md

This file was deleted.

Loading