You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where Clibuv is a wrapper around the libuv library (in real life it's a git submodule under Sources/Clibuv/), and Foo depends on Clibuv. See attached Foo-51.zip.
The project builds fine in Swift 5.1.
With Swift 5.2.3 however, I get errors like these:
While building module 'Clibuv' imported from Foo/Sources/Foo/main.c:2:
is a smaller change that doesn't change how module maps are generated, but that instead conditionalizes the passing of the additional flag in the original bugfix so that it now checks the swift-tools-version of the package. We can then do an evolution proposal to improve the module generation logic separately from this.
After a lot of discussion, the concern was that there could be an unknowable number of packages that relied on the behavior that had been introduced in SwiftPM 5.2, so the PR was withdrawn. We are updating the development documentation to emphasize not changing behavior without conditionalizing it on the swift-tools-version of the package so that future transitions will be smoother, but this doesn't seem to be an issue that can be addressed without a custom module map.
Attachment: Download
Environment
Mac OS 10.15.4
Xcode: Version 11.4.1 (11E503a)
***
Apple Swift version 5.1.3 (swift-5.1.3-RELEASE)
Target: x86_64-apple-darwin19.4.0
***
Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
Target: x86_64-apple-darwin19.4.0
***
Apple Swift version 5.2.3 (swift-5.2.3-RELEASE)
Target: x86_64-apple-darwin19.4.0
Additional Detail from JIRA
md5: 3ccd8a2eef170863c7e301bf6d2d6e64
Issue Description:
I have a project that's structured as follows:
{{ - Sources}}
{{ |- Clibuv}}
{{ |- Foo}}
where
Clibuv
is a wrapper around thelibuv
library (in real life it's a git submodule underSources/Clibuv/
), andFoo
depends onClibuv
. See attached Foo-51.zip.The project builds fine in Swift 5.1.
With Swift 5.2.3 however, I get errors like these:
While building module 'Clibuv' imported from Foo/Sources/Foo/main.c:2:
In file included from <module-includes>:3:
Foo/Sources/Clibuv/libuv/include/uv/bsd.h:25:9: warning: 'UV_PLATFORM_FS_EVENT_FIELDS' macro redefined [-Wmacro-redefined]
{{#define UV_PLATFORM_FS_EVENT_FIELDS }}
{{ ^}}
Foo/Sources/Clibuv/libuv/include/uv/darwin.h:45:9: note: previous definition is here
#define UV_PLATFORM_FS_EVENT_FIELDS
Checking the build output I see that a module map is automatically generated for
Clibuv
:module Clibuv {
{{ umbrella "/Users/ylee/Downloads/Foo/Sources/Clibuv/libuv/include"}}
{{ export *}}
{{}}}
To address the build issue, I add a custom module map under
Sources/Clibuv/include/
:module Clibuv {
{{ header "uv.h"}}
{{ export *}}
{{}}}
And updated
Package.swift
. See Foo-52-fix.zip.{{ }}
The text was updated successfully, but these errors were encountered: