<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:1.2em 0px!important">Well, I suppose it comes down to: are the OSes in <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">os(...)</code> strings or enums?</p>
<p style="margin:1.2em 0px!important">If they are strings then the compiler doesn’t need to be changed to add a new OS — it just needs to have a standard way to look it up. For example it might check <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">lsb_release</code> first, then try <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">sw_vers</code>. If the string there presented matches something in an <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">os(...)</code> condition in a macro, then it works. There is no internally maintained list of “valid OSes” so there is no need to extend such a list to handle each new release of Ubuntu, Debian, &amp;c</p>
<p style="margin:1.2em 0px!important">On Wed, 9 Dec 2015 at 13:08, Max Howell &lt;<a href="mailto:max.howell@apple.com" target="_blank">max.howell@apple.com</a>&gt; wrote:</p>
<p style="margin:1.2em 0px!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr"><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; Another option would seem to be modelling the daylights out of build environments but I think this runs afoul of enumerations. Right now we have `os(Linux)` but we&#39;d really need `os(Ubuntu)`, `os(RedHat)` and so forth to handle dependencies like these. And if people are working on a new distro -- or merely want a new platform tag even though they are on a stock distro -- this would fail unless they rebuilt the Swift compiler or package manager with an extended enumeration.<br>
<br>
Well, the module maps aren’t Swift so it wouldn’t work. Certainly we could allow some kind of #if syntax in module maps, but I think the elegance of one-file per platform will be enough and is much simpler.</blockquote></div><p style="margin:1.2em 0px!important">Maybe I wasn’t clear here. This passage is about the platform names — how do we keep discovery flexible? I’m assuming there is an enum somewhere — <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">OSX</code>, <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Linux</code>, <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">iOS</code> — in the compiler and what I’d like to suggest is, a centralized registry like that will create maintenance headaches for maintainers and frustrate developers, too. So taking one file per platform as a given, as long as platform discovery is easily extended then porting libraries is easy — add a new platform file, or even pass the “compatible platform” as an option.</p></div></div></div></blockquote></div></div><div style="word-wrap:break-word"><div>I’m sorry, I don’t understand.</div><br></div></blockquote><p></p></div><p style="margin:1.2em 0px!important"></p>
<div title="MDH:PGRpdj5XZWxsLCBJIHN1cHBvc2UgaXQgY29tZXMgZG93biB0bzogYXJlIHRoZSBPU2VzIGluIGBv
cyguLi4pYCBzdHJpbmdzIG9yIGVudW1zPzwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+SWYgdGhl
eSBhcmUgc3RyaW5ncyB0aGVuIHRoZSBjb21waWxl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