Skip to content

Commit 3d75b7f

Browse files
deploy: b5d7d4e
1 parent a3e62ac commit 3d75b7f

File tree

4 files changed

+54
-28
lines changed

4 files changed

+54
-28
lines changed

getting-started/setup.html

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -167,23 +167,21 @@ <h1><a class="header" href="#installation---latest-release-swift-603" id="instal
167167
<li>You cannot use toolchains bundled with Xcode to use the Swift SDK.</li>
168168
<li>If you are using macOS, please follow the <a href="https://www.swift.org/install/macos/package_installer/">official guide</a> to install the toolchain.</li>
169169
</ul>
170+
<p>Please ensure you have installed the Swift 6.0.3 Open Source toolchain.</p>
171+
<pre><code class="language-sh">swift --version
172+
</code></pre>
173+
<table><thead><tr><th>Toolchain</th><th>Output</th></tr></thead><tbody>
174+
<tr><td>❌ Xcode</td><td><code>Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)</code></td></tr>
175+
<tr><td>✅ Open Source (macOS)</td><td><code>Apple Swift version 6.0.3 (swift-6.0.3-RELEASE)</code></td></tr>
176+
<tr><td>✅ Open Source (Others)</td><td><code>Swift version 6.0.3 (swift-6.0.3-RELEASE)</code></td></tr>
177+
</tbody></table>
170178
<p>Once you have installed the Open Source toolchain, you can install the Swift SDK for WebAssembly:</p>
171-
<pre><code class="language-bash">$ swift sdk install &quot;https://github.com/swiftwasm/swift/releases/download/swift-wasm-6.0.3-RELEASE/swift-wasm-6.0.3-RELEASE-wasm32-unknown-wasi.artifactbundle.zip&quot; --checksum &quot;31d3585b06dd92de390bacc18527801480163188cd7473f492956b5e213a8618&quot;
179+
<pre><code class="language-bash">swift sdk install &quot;https://github.com/swiftwasm/swift/releases/download/swift-wasm-6.0.3-RELEASE/swift-wasm-6.0.3-RELEASE-wasm32-unknown-wasi.artifactbundle.zip&quot; --checksum &quot;31d3585b06dd92de390bacc18527801480163188cd7473f492956b5e213a8618&quot;
172180
</code></pre>
173-
<p>After installing the Swift SDK, you can see the installed SDKs:</p>
174-
<pre><code class="language-bash">$ swift sdk list
175-
&lt;SDK name&gt;
176-
...
181+
<p>After installing the Swift SDK, you can see <code>6.0.3-RELEASE-wasm32-unknown-wasi</code> in the Swift SDK list:</p>
182+
<pre><code class="language-bash">swift sdk list
177183
</code></pre>
178184
<p>You can also find other SDKs from <a href="https://github.com/swiftwasm/swift/releases">the GitHub Releases page</a>.</p>
179-
<p>Use the following shell snippet to query compatible Swift SDK for your current toolchain version:</p>
180-
<pre><code class="language-console">(
181-
V=&quot;$(swiftc --version | head -n1)&quot;; \
182-
TAG=&quot;$(curl -sL &quot;https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/tag-by-version.json&quot; | jq -r --arg v &quot;$V&quot; '.[$v] | .[-1]')&quot;; \
183-
curl -sL &quot;https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/builds/$TAG.json&quot; | \
184-
jq -r '.[&quot;swift-sdks&quot;][&quot;wasm32-unknown-wasi&quot;] | &quot;swift sdk install \&quot;\(.url)\&quot; --checksum \&quot;\(.checksum)\&quot;&quot;'
185-
)
186-
</code></pre>
187185
<h2><a class="header" href="#hello-world" id="hello-world">Hello, World</a></h2>
188186
<p>First, create a new directory for your project and navigate into it:</p>
189187
<pre><code class="language-bash">$ mkdir hello &amp;&amp; cd hello
@@ -210,6 +208,21 @@ <h3><a class="header" href="#how-to-check-if-i-am-using-open-source-toolchain-or
210208
<tr><td>Open Source (macOS)</td><td><code>Apple Swift version 6.0.3 (swift-6.0.3-RELEASE)</code></td></tr>
211209
<tr><td>Open Source (Others)</td><td><code>Swift version 6.0.3 (swift-6.0.3-RELEASE)</code></td></tr>
212210
</tbody></table>
211+
<h3><a class="header" href="#unknown0-error-module-compiled-with-swift-603-cannot-be-imported-by-the-swift-xyz" id="unknown0-error-module-compiled-with-swift-603-cannot-be-imported-by-the-swift-xyz"><code>&lt;unknown&gt;:0: error: module compiled with Swift 6.0.3 cannot be imported by the Swift x.y.z</code></a></h3>
212+
<p>This error occurs when the Swift toolchain version you are using is different from the version of the Swift SDK you have installed.</p>
213+
<p>To resolve this issue, you can either:</p>
214+
<ol>
215+
<li>Switch the Swift toolchain to the same version as the Swift SDK you have installed. Check the <a href="https://www.swift.org/install/macos/package_installer/">official guide</a> for how to switch the toolchain.</li>
216+
<li>Install the Swift SDK for the same version as the Swift toolchain you are using.
217+
Use the following shell snippet to query compatible Swift SDK for your current toolchain version:</li>
218+
</ol>
219+
<pre><code class="language-console">(
220+
V=&quot;$(swiftc --version | head -n1)&quot;; \
221+
TAG=&quot;$(curl -sL &quot;https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/tag-by-version.json&quot; | jq -r --arg v &quot;$V&quot; '.[$v] | .[-1]')&quot;; \
222+
curl -sL &quot;https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/builds/$TAG.json&quot; | \
223+
jq -r '.[&quot;swift-sdks&quot;][&quot;wasm32-unknown-wasi&quot;] | &quot;swift sdk install \&quot;\(.url)\&quot; --checksum \&quot;\(.checksum)\&quot;&quot;'
224+
)
225+
</code></pre>
213226
<h3><a class="header" href="#what-is-the-difference-between-the-swift-toolchain-and-the-swift-sdk" id="what-is-the-difference-between-the-swift-toolchain-and-the-swift-sdk">What is the difference between the Swift Toolchain and the Swift SDK?</a></h3>
214227
<p>The Swift toolchain is a complete package that includes the Swift compiler, standard library, and other tools.</p>
215228
<p>The Swift SDK includes a subset of the Swift toolchain that includes only the necessary components for cross-compilation and some supplementary resources.</p>

print.html

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,23 +192,21 @@ <h1><a class="header" href="#installation---latest-release-swift-603" id="instal
192192
<li>You cannot use toolchains bundled with Xcode to use the Swift SDK.</li>
193193
<li>If you are using macOS, please follow the <a href="https://www.swift.org/install/macos/package_installer/">official guide</a> to install the toolchain.</li>
194194
</ul>
195+
<p>Please ensure you have installed the Swift 6.0.3 Open Source toolchain.</p>
196+
<pre><code class="language-sh">swift --version
197+
</code></pre>
198+
<table><thead><tr><th>Toolchain</th><th>Output</th></tr></thead><tbody>
199+
<tr><td>❌ Xcode</td><td><code>Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)</code></td></tr>
200+
<tr><td>✅ Open Source (macOS)</td><td><code>Apple Swift version 6.0.3 (swift-6.0.3-RELEASE)</code></td></tr>
201+
<tr><td>✅ Open Source (Others)</td><td><code>Swift version 6.0.3 (swift-6.0.3-RELEASE)</code></td></tr>
202+
</tbody></table>
195203
<p>Once you have installed the Open Source toolchain, you can install the Swift SDK for WebAssembly:</p>
196-
<pre><code class="language-bash">$ swift sdk install &quot;https://github.com/swiftwasm/swift/releases/download/swift-wasm-6.0.3-RELEASE/swift-wasm-6.0.3-RELEASE-wasm32-unknown-wasi.artifactbundle.zip&quot; --checksum &quot;31d3585b06dd92de390bacc18527801480163188cd7473f492956b5e213a8618&quot;
204+
<pre><code class="language-bash">swift sdk install &quot;https://github.com/swiftwasm/swift/releases/download/swift-wasm-6.0.3-RELEASE/swift-wasm-6.0.3-RELEASE-wasm32-unknown-wasi.artifactbundle.zip&quot; --checksum &quot;31d3585b06dd92de390bacc18527801480163188cd7473f492956b5e213a8618&quot;
197205
</code></pre>
198-
<p>After installing the Swift SDK, you can see the installed SDKs:</p>
199-
<pre><code class="language-bash">$ swift sdk list
200-
&lt;SDK name&gt;
201-
...
206+
<p>After installing the Swift SDK, you can see <code>6.0.3-RELEASE-wasm32-unknown-wasi</code> in the Swift SDK list:</p>
207+
<pre><code class="language-bash">swift sdk list
202208
</code></pre>
203209
<p>You can also find other SDKs from <a href="https://github.com/swiftwasm/swift/releases">the GitHub Releases page</a>.</p>
204-
<p>Use the following shell snippet to query compatible Swift SDK for your current toolchain version:</p>
205-
<pre><code class="language-console">(
206-
V=&quot;$(swiftc --version | head -n1)&quot;; \
207-
TAG=&quot;$(curl -sL &quot;https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/tag-by-version.json&quot; | jq -r --arg v &quot;$V&quot; '.[$v] | .[-1]')&quot;; \
208-
curl -sL &quot;https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/builds/$TAG.json&quot; | \
209-
jq -r '.[&quot;swift-sdks&quot;][&quot;wasm32-unknown-wasi&quot;] | &quot;swift sdk install \&quot;\(.url)\&quot; --checksum \&quot;\(.checksum)\&quot;&quot;'
210-
)
211-
</code></pre>
212210
<h2><a class="header" href="#hello-world" id="hello-world">Hello, World</a></h2>
213211
<p>First, create a new directory for your project and navigate into it:</p>
214212
<pre><code class="language-bash">$ mkdir hello &amp;&amp; cd hello
@@ -235,6 +233,21 @@ <h3><a class="header" href="#how-to-check-if-i-am-using-open-source-toolchain-or
235233
<tr><td>Open Source (macOS)</td><td><code>Apple Swift version 6.0.3 (swift-6.0.3-RELEASE)</code></td></tr>
236234
<tr><td>Open Source (Others)</td><td><code>Swift version 6.0.3 (swift-6.0.3-RELEASE)</code></td></tr>
237235
</tbody></table>
236+
<h3><a class="header" href="#unknown0-error-module-compiled-with-swift-603-cannot-be-imported-by-the-swift-xyz" id="unknown0-error-module-compiled-with-swift-603-cannot-be-imported-by-the-swift-xyz"><code>&lt;unknown&gt;:0: error: module compiled with Swift 6.0.3 cannot be imported by the Swift x.y.z</code></a></h3>
237+
<p>This error occurs when the Swift toolchain version you are using is different from the version of the Swift SDK you have installed.</p>
238+
<p>To resolve this issue, you can either:</p>
239+
<ol>
240+
<li>Switch the Swift toolchain to the same version as the Swift SDK you have installed. Check the <a href="https://www.swift.org/install/macos/package_installer/">official guide</a> for how to switch the toolchain.</li>
241+
<li>Install the Swift SDK for the same version as the Swift toolchain you are using.
242+
Use the following shell snippet to query compatible Swift SDK for your current toolchain version:</li>
243+
</ol>
244+
<pre><code class="language-console">(
245+
V=&quot;$(swiftc --version | head -n1)&quot;; \
246+
TAG=&quot;$(curl -sL &quot;https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/tag-by-version.json&quot; | jq -r --arg v &quot;$V&quot; '.[$v] | .[-1]')&quot;; \
247+
curl -sL &quot;https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/builds/$TAG.json&quot; | \
248+
jq -r '.[&quot;swift-sdks&quot;][&quot;wasm32-unknown-wasi&quot;] | &quot;swift sdk install \&quot;\(.url)\&quot; --checksum \&quot;\(.checksum)\&quot;&quot;'
249+
)
250+
</code></pre>
238251
<h3><a class="header" href="#what-is-the-difference-between-the-swift-toolchain-and-the-swift-sdk" id="what-is-the-difference-between-the-swift-toolchain-and-the-swift-sdk">What is the difference between the Swift Toolchain and the Swift SDK?</a></h3>
239252
<p>The Swift toolchain is a complete package that includes the Swift compiler, standard library, and other tools.</p>
240253
<p>The Swift SDK includes a subset of the Swift toolchain that includes only the necessary components for cross-compilation and some supplementary resources.</p>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)