Redefinition of module 'FFI' #11
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: aparoksha/adwaita-swift#11
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
macOS 13.6.6
Xcode 15.2
Building Adwaita Swift Pkg give the following error:
Redefinition of module 'FFI'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/ffi/module.modulemap:1:8 Redefinition of module 'FFI'
Homebrew and libffi on my M1 mac:
admin@mbam1 ~ % which pkg-config
/opt/homebrew/bin/pkg-config
admin@mbam1 ~ % pkg-config --cflags libffi
-I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi
I found this same issue previously reported in Homebrew and SwiftPM sites by user having same clash problem
when they try building swift-systemlib-demo.
Related links:
Strange clash between Xcode and command-line tools when building Swift system library package #4025
https://github.com/orgs/Homebrew/discussions/4025
Patch *.sdk paths from pkgConfig files to the current SDK #6772
https://github.com/apple/swift-package-manager/pull/6772
See details here: https://github.com/apple/swift-package-manager/issues/6439
I give a try to compile the Swift package swift-systemlib-demo and its fine without error.
As explained in This package that was used by the SwiftPM team to reproduce the error and test their fix.
It just strange the error re-appear when building Adwaita for Swift.
Any idea ?
To Reproduce
Download the Swift package and
swift build
Expected behavior
Build success
Additional context
Building for debugging...
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/ffi/module.modulemap:1:8: error: redefinition of module 'FFI'
module FFI [system] {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi/module.modulemap:1:8: note: previously defined here
module FFI [system] [extern_c] {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/ffi/module.modulemap:1:8: error: redefinition of module 'FFI'
module FFI [system] {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi/module.modulemap:1:8: note: previously defined here
module FFI [system] [extern_c] {
Thanks for opening the issue, @litewrap! I experienced this as well when testing on macOS. Here is what works for me:
Product > Clean Build Folder...
).File > Packages > Reset Package Caches
)DerivedData
folder (~/Library/Developer/Xcode/DerivedData
)File > Packages > Resolve Package Versions
)I'm not sure whether every step is strictly necessary. Does that help in your case?
I first experienced this problem here: https://github.com/stackotter/swift-cross-ui/issues/47
Yes package build success !
Thanks David and bravo for this great package !!
Nice! While libadwaita works on macOS, I recommend using Linux for the best experience. I recommend trying Asahi Linux. Thanks for opening the issue!
Thank you!