<html><body><p><tt>swift-corelibs-dev-bounces@swift.org wrote on 02/11/2016 06:18:58 AM:<br><br>> From: Drew Crawford via swift-corelibs-dev <swift-corelibs-dev@swift.org></tt><br><tt>> To: "Daniel A. Steffen" <dsteffen@apple.com></tt><br><tt>> Cc: swift-corelibs-dev@swift.org</tt><br><tt>> Date: 02/11/2016 06:19 AM</tt><br><tt>> Subject: Re: [swift-corelibs-dev] libdispatch import order / nondeterminism</tt><br><tt>> Sent by: swift-corelibs-dev-bounces@swift.org</tt><br><tt>> <br>> On Feb 10, 2016, at 10:31 PM, Daniel A. Steffen <dsteffen@apple.com> wrote:</tt><br><tt>> <br>> having -I /usr/local/include/dispatch doesn’t seem right to me, the <br>> C header include convention is all <dispatch/*.h> so the dispatch/ <br>> directory itself should not be part of the search path. </tt><br><tt>> <br>> The problem is that to pick up a modulemap / swiftmodule file right <br>> now in Swift, we need "-I /path/to" where /path/to contains <br>> "module.modulemap" / "foo.swiftmodule"</tt><br><tt>> <br>> Meanwhile passing "-I /path/to" also will pick up all header files <br>> in that directory, which here includes "time.h".</tt><br><tt>> <br>> I personally think that behavior (the Swift compiler behavior) is <br>> wrong to couple these two ideas. But arguing the compiler is wrong <br>> is probably above my pay grade.</tt><br><tt>> <br>> Anyway, as long as this is the compiler behavior, we can't have <br>> "time.h" in the same directory as the modulemap. So either</tt><br><tt>> <br>> we put swiftmodule / modulemap in /usr/local/include/dispatch and <br>> headers into /usr/local/include/dispatch/headers</tt><br><tt>> we put headers in /usr/local/include/dispatch and swiftmodule/<br>> modulemap into /usr/local/include/dispatch/module</tt><br><tt>> <br>> I don't know which one to do, and I'm bad at wrestling autotools, so<br>> I'm not sure I can PR.</tt><br><tt>> <br>> I'm working around by arbitrarily picking one of these resolutions <br>> and shell scripting it as part of my install.</tt><br><tt>> <br></tt><br><tt>I'm working on changes so that when built with swift/utils/build-script the pieces of libdispatch get properly placed in the installable Swift package that is being built. I think this is actually where we want to get to, and it avoids needing to pass the -I arguments to swiftc. When the bits are placed properly in the Swift install, swiftc is finding them without help.</tt><br><br><tt>I think I'm on track to submit a PR later today. So far, changes are confined to in the autotools setup in libdispatch. </tt><br><br><br><tt>--dave</tt><br><br><BR>
</body></html>