[swift-dev] Please remove your Swift build directory

Karl razielim at gmail.com
Wed Jun 1 09:17:17 CDT 2016


I’ll have a look in to the SWIFT_BUILD_EXAMPLES warning.

SWIFT_HOST_TRIPLE is a new flag used to override the triple we calculate in CMake (for Linux targets only, Darwin SDK configuration is too different right now). I would like it to one day replace SWIFT_HOST_VARIANT_ARCH and SWIFT_HOST_VARIANT_SDK (which will instead by derived from the triple). We will need SDKs to become architecture-specific at some point (so that we don’t need to hardcode ‘ANDROID’ as ‘armv7’, or so that you can compile multiple architecture variants of the same SDK such as ‘linux-i386’ and ‘linux-x86_64’), and we’re going to need to calculate triples for them, so it just makes sense to do the triple calculation in the build script and use them in place of SDK names to configure both the host and stdlib targets.

So that means instead of using these flags to configure swift:
- SWIFT_HOST_VARIANT_SDK (e.g. LINUX)
- SWIFT_HOST_VARIANT_ARCH (e.g. x86_64)
- SWIFT_SDKS (e.g. LINUX;ANDROID)

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 + …)
(+ SWIFT_{platform}_{arch}_SYSROOT for all non-Darwin targets except host, but that’s new functionality)

I didn't want to change too much too quickly, but if we’re happy with this direction, I can do the triple->HOST_VARIANT_SDK/ARCH part for all platforms which would silence the warning. We’d still configure by SDK names and hardcoded architectures. Changing that part is less simple.

This was obviously a big patch and I apologise if it caused any problems. If there’s anything else I can help with please let me know.
On the other hand, that’s pretty much all we had to do to compile foreign hosts. The rest is tiny and fairly uncontroversial (https://github.com/karwa/swift/commit/d090724bd37dffe243d477fd0ffd1ba87a90c70b).

Karl

> On 31 May 2016, at 19:49, Joe Groff via swift-dev <swift-dev at swift.org> wrote:
> 
> 
>> On May 31, 2016, at 10:20 AM, Joe Groff via swift-dev <swift-dev at swift.org> wrote:
>> 
>> 
>>> On May 31, 2016, at 9:37 AM, Dmitri Gribenko via swift-dev <swift-dev at swift.org> wrote:
>>> 
>>> Hi,
>>> 
>>> We have merged a CMake and build-script refactoring that requires a
>>> from-scratch build.  Trying to use an existing build directory will
>>> result in strange errors in the middle of the build.
>>> 
>>> Excuse me for the inconvenience.
>> 
>> This seems to have broken Xcode project generation, which in the default configuration now fails with:
>> 
>> 	-- 
>> 	CMake Error at CMakeLists.txt:702 (message):
>> 	  Unknown SDKs:
>> 	  IOS;IOS_SIMULATOR;TVOS;TVOS_SIMULATOR;WATCHOS;WATCHOS_SIMULATOR
>> 
>> Probably easy to work around by manually configuring out those SDKs, since Xcode projects don't support cross-building to begin with, but this used to just work.
> 
> New build-script also appears to pass some CMake variables that aren't used in the ninja configuration:
> 
> 	-- Generating done
> 	CMake Warning:
> 	  Manually-specified variables were not used by the project:
> 	
> 	    SWIFT_BUILD_EXAMPLES
> 	    SWIFT_HOST_TRIPLE
> 
> -Joe
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev



More information about the swift-dev mailing list