[swift-dev] Please remove your Swift build directory
Karl
razielim at gmail.com
Wed Jun 1 19:08:10 CDT 2016
> On 1 Jun 2016, at 18:16, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>
> On Wed, Jun 1, 2016 at 7:17 AM, Karl via swift-dev <swift-dev at swift.org> wrote:
>> We’d configure it like this:
>> - SWIFT_HOST_TRIPLE (e.g x86_64-unknown-linux-gnu)
>> - SWIFT_DEPLOYMENT_TARGETS (e.g. x86_64-unknown-linux-gnu + armv7-linux-gnueabihf + armv7-none-linux-androideabi + i386-none-linux-androideabi + …)
>
> Hi Karl,
>
> One thing to keep in mind is that triples are not as useful as they
> can seem to be, and trying to derive information from them can
> sometimes be a futile exercise because the information just either
> isn't there, or different vendors mean different things but use the
> same triple.
>
> This is an excellent thread on this topic from llvm-dev:
>
> http://comments.gmane.org/gmane.comp.compilers.llvm.devel/87804
>
> Also: https://wiki.debian.org/Multiarch/Tuples#Why_not_use_GNU_triplets.3F
>
> I'm not saying that SDK/ARCH is a better replacement (it isn't, it is
> currently a strict subset of the information from the triple), but at
> least it is not the triple itself, so people don't have the
> expectation of being able to provide the triple and let the system
> figure out the rest. So I'd be concerned about starting to treat the
> triple as the primary piece of information, and the rest as secondary.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
Yes, I’m not really fond of using triples either. However, we need the triple for every stdlib target we build anyway, so even if we passed some kind of list of tuples from build-script > CMake, we’d have to try and derive a triple from that information and it must always match the thing that was specified in the build-script to configure LLVM.
The build script still only works in terms of “deployment targets” (e.g. iphoneos-armv7, iphonesimulator-x86_64) and the triples are hardcoded in there, so it’s not like we expect CMake to just work with completely arbitrary triples. The host and all of the stdlib targets you build will come from that curated list of triples which we know can be detected.
We don’t need too much information, anyway. We only need the architecture, and enough pattern matching to disambiguate which SDK it’s referring to (e.g match “*-linux-gnu*" for linux, “*-linux-android*" for android, etc). We don’t really need to *completely* understand the triple.
@Austin: Could your issues be related to https://github.com/apple/swift/commit/06d8455cdf53f9196ae5d6a09bd8aadbb3c1c3d6 ?
Karl
More information about the swift-dev
mailing list