<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Whoops, now to the list.<br><br><div>Nicky</div></div><div><br>Begin forwarded message:<br><br></div><blockquote type="cite"><div><b>From:</b> Nicky Gerritsen <<a href="mailto:nickygerritsen@me.com">nickygerritsen@me.com</a>><br><b>Date:</b> 24 maart 2016 06:56:52 CET<br><b>To:</b> Max Howell <<a href="mailto:max.howell@apple.com">max.howell@apple.com</a>><br><b>Subject:</b> <b>Re: [swift-evolution] Draft Proposal SwiftPM System Module Search Paths</b><br><br></div></blockquote><blockquote type="cite"><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>First of all, +1 on the idea.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">But second a question: in the Package.swift file providers section, what would need to be done in for example the "apt" case it a package has a different name on Debian and Ubuntu?</div><div id="AppleMailSignature">This is something that happens occasionally, so we should at least be able to support this.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Is this something that can be tackled by using (optional) extra parameters on the enum values?<br><br>Regards,<div><br></div><div>Nicky</div></div><div><br>On 23 mrt. 2016, at 19:10, Max Howell via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><h1 style="box-sizing: border-box; margin: 0px 0px 0.21999rem; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; line-height: 3rem; font-size: 2.0571429rem; padding-top: 0.78001rem; color: rgb(55, 61, 73);" class="">SwiftPM System Module Search Paths</h1><ul style="box-sizing: border-box; margin-bottom: 0.83999rem; padding-top: 0.16001rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class=""><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class="">Proposal: <a href="https://github.com/apple/swift-evolution/blob/master/proposals/NNNN-swiftpm-system-module-search-paths.md" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); background-position: 0px 0px;" class="">SE-NNNN</a></li><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class="">Author: <a href="https://github.com/mxcl" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); background-position: 0px 0px;" class="">Max Howell</a></li><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class="">Status: <span style="box-sizing: border-box; font-weight: 700;" class="">Awaiting review</span></li><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class="">Review manager: Anders Bertelrud</li></ul><h2 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; font-size: 1.953125rem; margin-bottom: 0.1835837rem; padding-top: 0.8164163rem; line-height: 3rem; color: rgb(55, 61, 73);" class=""><a id="Introduction_8" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Introduction</h2><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">Swift is able to <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">import</code> C libraries in the same manner as Swift libraries.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">For this to occur the library must be represented by a clang module-map file.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">The current system for using these module-map files with SwiftPM works, but with a number of caveats that must be addressed.</p><h2 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; font-size: 1.953125rem; margin-bottom: 0.1835837rem; padding-top: 0.8164163rem; line-height: 3rem; color: rgb(55, 61, 73);" class=""><a id="Motivation_18" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Motivation</h2><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">The current implementation of system module packages have a number of problems:</p><ol style="box-sizing: border-box; margin-bottom: 0.83999rem; padding-top: 0.16001rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class=""><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class="">Install locations vary across platforms and modulemap files require absolute paths</li><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class=""><code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">/usr/lib:/usr/local/lib</code> is not always a sufficient <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">-L</code> search path</li><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class=""><code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">/usr/include:/usr/local/include</code> is not always a sufficient <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">-I</code> C compiler search path</li><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class="">Installing the system library is left up to the end-user to figure out</li></ol><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">For example to import a module map representing the GTK library, the include search path must be supplemented with <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">-I/usr/include/gtk</code> so that a number of includes in the <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">gtk.h</code> header can be sourced for the complete modular definition of GTK.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">For example to import a module map representing the GTK library a user must first have a copy of GTK and its headers installed. On Debian based systems the install name for this system package is <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">libgtk-3-0-dev</code> which is not entirely intuitive.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">For example, Homebrew and MacPorts on OS X install to prefixes other than <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">/usr</code>.<code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">.modulemap</code> files must specify headers with absolute paths. The standard we encourage with modulemaps is for the headers to be specified with an assumed prefix of <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">/usr</code>, but you will not find eg. <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">jpeglib.h</code> at <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">/usr/include/jpeglib.h</code> if it is installed with Homebrew or MacPorts.</p><h2 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; font-size: 1.953125rem; margin-bottom: 0.1835837rem; padding-top: 0.8164163rem; line-height: 3rem; color: rgb(55, 61, 73);" class=""><a id="Proposed_Solution_42" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Proposed Solution</h2><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">We propose that SwiftPM gains the ability to use the cross-platform <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">pkg-config</code> tool so that it can query <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">pkg-config</code> for the missing path and flag arguments.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">We propose that SwiftPM gains the ability to use the cross-platform <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">pkg-config</code> tool to identify when the system package is not installed to a <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">/usr</code> and in such a case preprocess the modulemap changing the prefix it uses.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">We propose that <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">Package.swift</code> is supplemented with metadata that provides the package-install-name for specific platforms.</p><h2 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; font-size: 1.953125rem; margin-bottom: 0.1835837rem; padding-top: 0.8164163rem; line-height: 3rem; color: rgb(55, 61, 73);" class=""><a id="Detailed_Design_55" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Detailed Design</h2><h3 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; line-height: 3rem; font-size: 1.6457143rem; margin-bottom: 0.07599rem; padding-top: 0.92401rem; color: rgb(55, 61, 73);" class=""><a id="Solving_PathFlags_Issues_57" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Solving Path/Flags Issues</h3><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">Some of our problems can be solved by using the cross platform tool: <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">pkg-config</code>.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">A C package can provide a pkg-config file (<code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">.pc</code>) which describes:</p><ol style="box-sizing: border-box; margin-bottom: 0.83999rem; padding-top: 0.16001rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class=""><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class="">Its install location</li><li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;" class="">Supplementary C-flags that should be used when building against this library</li></ol><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">If SwiftPM used the <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">.pc</code> file that comes with packages, this solves problems 1 through 3.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">Of the tickets we currently have open describing issues using Swift-system-module-packages, reading the <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">.pc</code> file would fix all of them.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">It is a convention to name the <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">.pc</code> file after the library link-name, so we can determine which <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">.pc</code> file to ask <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">pkg-config</code> for by parsing the <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">.modulemap</code> file in the Swift package.</p><h3 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; line-height: 3rem; font-size: 1.6457143rem; margin-bottom: 0.07599rem; padding-top: 0.92401rem; color: rgb(55, 61, 73);" class=""><a id="Providing_Package_Install_Names_75" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Providing Package Install Names</h3><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class=""><code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">Package.swift</code> would be supplemented like so:</p><pre style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1.33999rem; word-break: break-all; word-wrap: break-word; color: rgb(51, 51, 51); border: 1px solid rgb(211, 218, 234); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; overflow: auto; font-family: monospace, monospace; font-size: 14px; padding: 0.66001rem 9.5px 9.5px; line-height: 2rem; background-image: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem); background-size: 100% 4rem;" class=""><code class="language-swift" style="box-sizing: border-box; color: inherit; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; padding: 0px; font-size: inherit; font-family: monospace, monospace; white-space: pre-wrap;"><span class="hljs-keyword" style="box-sizing: border-box; color: rgb(133, 153, 0);">let</span> package = <span class="hljs-type" style="box-sizing: border-box; color: rgb(181, 137, 0);">Package</span>(
name: <span class="hljs-string" style="box-sizing: border-box; color: rgb(42, 161, 152);">"CFoo"</span>,
providers: .<span class="hljs-type" style="box-sizing: border-box; color: rgb(181, 137, 0);">Brew</span>(installName: <span class="hljs-string" style="box-sizing: border-box; color: rgb(42, 161, 152);">"foo"</span>),
.<span class="hljs-type" style="box-sizing: border-box; color: rgb(181, 137, 0);">Apt</span>(installName: <span class="hljs-string" style="box-sizing: border-box; color: rgb(42, 161, 152);">"libfoo-dev"</span>),
)
</code></pre><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">Thus, in the event of build failure for modules that depend on this package we provide additional help to the user:</p><pre style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1.33999rem; word-break: break-all; word-wrap: break-word; color: rgb(51, 51, 51); border: 1px solid rgb(211, 218, 234); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; overflow: auto; font-family: monospace, monospace; font-size: 14px; padding: 0.66001rem 9.5px 9.5px; line-height: 2rem; background-image: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem); background-size: 100% 4rem;" class=""><code style="box-sizing: border-box; color: inherit; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; padding: 0px; font-size: inherit; font-family: monospace, monospace; white-space: pre-wrap;" class="">error: failed to build module `ba<span class="hljs-string" style="box-sizing: border-box; color: rgb(42, 161, 152);">r'
note: you may need to install `foo'</span> using your system-packager:
apt-get install libfoo-dev
</code></pre><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">Since the syntax to provide this information uses an explicit enum we can add code for each enum to detect which system packagers should be recommended. The community will need to write the code for their own platforms. It also means that if a specific packager requires additional parameters, they can be added on a per enum basis.</p><h2 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; font-size: 1.953125rem; margin-bottom: 0.1835837rem; padding-top: 0.8164163rem; line-height: 3rem; color: rgb(55, 61, 73);" class=""><a id="Impact_on_Existing_Code_103" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Impact on Existing Code</h2><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">There will be no impact on existing code as this feature simply improves an existing feature making new code possible.</p><h2 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; font-size: 1.953125rem; margin-bottom: 0.1835837rem; padding-top: 0.8164163rem; line-height: 3rem; color: rgb(55, 61, 73);" class=""><a id="Alternatives_Considered_109" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Alternatives Considered</h2><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">A clear alternative is allowing additional flags to be specified in a system-module package’s <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">Package.swift</code>.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">However since these paths and flags will vary by platform this would because a large matrix that is quite a maintenance burden. Really this information is recorded already, in the system package itself, and in fact almost all packages nowadays provide it in a <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">.pc</code> <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">pkg-config</code> file.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">Also we do not want to allow arbitrary flags to be specified in <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">Package.swift</code>, this allows packages too much power to break a large dependency graph with bad compiles. The only entity that understands the whole graph and can manage the build without breakage is SwiftPM, and allowing packages themselves to add arbitrary flags prevents SwiftPM from being able to understand and control the build ensuring reliability and preventing “Dependency Hell”.</p><h2 style="box-sizing: border-box; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; margin-top: 0px; font-size: 1.953125rem; margin-bottom: 0.1835837rem; padding-top: 0.8164163rem; line-height: 3rem; color: rgb(55, 61, 73);" class=""><a id="Future_Directions_121" style="box-sizing: border-box; cursor: pointer; color: rgb(160, 170, 191); text-decoration: underline; background-position: 0px 0px; background-repeat: initial initial;" class=""></a>Future Directions</h2><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">The build system could be made more reliable by having the specific packager provide the information that this proposal garners from <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">pkg-config</code>. For example, Homebrew installs everything into independent directories, using these directories instead of more general POSIX search paths means there is no danger of edge-case search path collisions and the wrong libraries being picked up.</p><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">If this was done <code style="box-sizing: border-box; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 4px; font-size: 1em; font-family: monospace, monospace;" class="">pkg-config</code> could become just one option for providing this data, and be used only as a fallback.</p><hr style="box-sizing: content-box; height: 0px; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class=""><p style="box-sizing: border-box; padding-top: 0.66001rem; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-top: 0px; margin-bottom: 1.33999rem; color: rgb(55, 61, 73); font-family: Georgia, Cambria, serif; font-size: 14px;" class="">We could add an additional flag so that deployment of Swift Packages could be made simpler and system dependencies be installed automatically.</p></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></div></blockquote></body></html>