-
Notifications
You must be signed in to change notification settings - Fork 3k
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
meson: use swiftc instead of swift for building #15442
Conversation
Download the artifacts for this pull request: |
i am wondering: that's a lot less changes than i anticipated tbh. [edit] |
I was wondering, if it is possible to use native Meson swift compiler detection? They at least have the swift support defined https://github.com/mesonbuild/meson/blob/master/mesonbuild/compilers/swift.py not sure how it works if at all, but maybe it would be possible to use? |
we tried this initially but it didn't work around 3 years ago (somewhere hidden here #8840 or maybe on IRC, #8840 (comment)). i believe one of the biggest blockers was, that we have code that operates in both direction (objective-)c<>swift and the meson integration doesn't support this (eg only swift only worked/works?) |
swiftc does not accept May related to: https://github.com/swiftlang/swift/blob/464ff30cfae713fab658fbd071954dbd726b678f/lib/DriverTool/sil_func_extractor_main.cpp#L128-L132 Here is an excerpt from verbose output by
Our target linked library is static(*.o), rather dynamic(*.dylib) by default.
I agree. |
I haven’t tried it, but it seems that the meson integration doesn’t include all options we need. |
let me rephrase the question. this was the case before too (.o file), but we didn't need to add the also you need to adjust the commit message, the PR title would be fine. |
This is because Linking is made by ld/libtool(depends on macOS version), and requires a flag to specify whether the target library is dynamic or static. In the doc ref I mentioned above:
The third step requires a I attached the verbose output (swiftc_verbose.txt). Check it If you'd like to view how it works in the code. |
thanks for you work on this one, it's much appreciated. |
IMO, it would be much nicer to have meson integration if possible for this. Directly building the compiler command kind of sucks and there's a lot of dumb manual things we have to do (e.g. like adding defines for |
I’m not an expert in meson, and meson manual doesn’t include any references to swift. I think I’ll give it a try when I have some free time. [Edit] |
Use swiftc instead of swift for building on macOS. This is requested in #13608.
The compile has been tested and successfully passed on M1 Air running Sequoia 15.1.1(Swift version 6.0.2).
Ref doc: https://github.com/swiftlang/swift/blob/main/docs/Driver.md