-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Swift cannot use -enable-experimental-cxx-interop
on Linux with Foundation
#64457
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
Comments
With
|
I'm also getting wild erorrs here. I don't want to flood this issue with another batch of erors, but apparently in my case I get a segfault when compiling for linux (and a humongouse error output, which I will share if asked for); and also get a quick fail on mac which I can share since it's fairly quick and small:
Sure, it may look like it's an issue with swift-log, and it may be the case, but I only get this failure when I try to enable the experimental cxx interop. If this comment was merely a noise, please accept my apologies. |
@adam-rocska This is great feedback. We will look into it. |
CC @etcwilde |
similar errors here with Swift nightly and <module-includes>:2:10: note: in file included from <module-includes>:2:
#include "CoreFoundation.h"
^
/usr/lib/swift/CoreFoundation/CoreFoundation.h:33:10: note: in file included from /usr/lib/swift/CoreFoundation/CoreFoundation.h:33:
#include <math.h>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/math.h:36:11: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/math.h:36:
# include <cmath>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/cmath:1927:12: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/cmath:1927:
# include <bits/specfun.h>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/specfun.h:45:10: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/specfun.h:45:
#include <bits/stl_algobase.h>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/stl_algobase.h:64:10: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/stl_algobase.h:64:
#include <bits/stl_pair.h>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/stl_pair.h:59:10: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/stl_pair.h:59:
#include <bits/move.h> // for std::move / std::forward, and std::swap
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/move.h:74:5: error: redefinition of 'forward'
forward(typename std::remove_reference<_Tp>::type& __t) noexcept
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/move.h:74:5: note: previous definition is here
forward(typename std::remove_reference<_Tp>::type& __t) noexcept
^
<module-includes>:2:10: note: in file included from <module-includes>:2:
#include "CoreFoundation.h"
^
/usr/lib/swift/CoreFoundation/CoreFoundation.h:33:10: note: in file included from /usr/lib/swift/CoreFoundation/CoreFoundation.h:33:
#include <math.h>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/math.h:36:11: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/math.h:36:
# include <cmath>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/cmath:1927:12: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/cmath:1927:
# include <bits/specfun.h>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/specfun.h:45:10: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/specfun.h:45:
#include <bits/stl_algobase.h>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/stl_algobase.h:64:10: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/stl_algobase.h:64:
#include <bits/stl_pair.h>
^
/usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/stl_pair.h:59:10: note: in file included from /usr/bin/../lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/bits/stl_pair.h:59:
#include <bits/move.h> // for std::move / std::forward, and std::swap |
Similar errors here:
If I remove |
yeah it appears it's only breaking starting with C++17 and above. Investigating. |
@adam-rocska fwiw, your issue has been fixed, we now provide (deprecated) default constructors again. |
I have a potential fix. |
Fixes swiftlang#64457 (cherry picked from commit c215abd)
Thank you, will this make it into 5.9? |
Description
Foundation can't be used on Linux when
-enable-experimental-cxx-interop
is enabled.Steps to reproduce
import Foundation
from a Swift file compiled with-enable-experimental-cxx-interop
on Linux.Here's a full step-by-step repro case on macOS with Docker installed:
cd /path/to/unzipped/swift-cxx-interop-demo
swift run -Xcc -std=c++17
<- building and running on macOS worksdocker run -it -v
pwd:
pwd-w
pwdswift:5.7.3 swift run -Xcc -std=c++17
<- fails on Linux with the following errors:Expected behavior
Foundation should be usable on Linux when
-enable-experimental-cxx-interop
is enabled.Environment
The text was updated successfully, but these errors were encountered: