You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[static-linux-sdk] Update "Getting Started with the Static Linux SDK"
Enhance clarity and transparency by adding more details about dependency management when using the Static Linux SDK, especially regarding the dependencies bundled with it.
Co-authored-by: Alastair Houghton <[email protected]>
Signed-off-by: Melissa Kilby <[email protected]>
Copy file name to clipboardExpand all lines: documentation/articles/static-linux-getting-started.md
+78-2Lines changed: 78 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
layout: page
3
3
date: 2024-06-04 12:00:00
4
4
title: Getting Started with the Static Linux SDK
5
-
author: [al45tair]
5
+
author: [al45tair, incertum]
6
6
---
7
7
8
8
It's well known that Swift can be used to build software for Apple
@@ -24,6 +24,16 @@ with no external dependencies at all (not even the C library), which
24
24
means that it will run on _any_ Linux distribution as the only thing
25
25
it depends on is the Linux system call interface.
26
26
27
+
This portability comes at a cost, namely that everything your program
28
+
depends on must be statically linked. There is no support for dynamic
29
+
linking whatsoever — even the `dlopen()` function will not work.
30
+
31
+
A result of this design choice is that the Static Linux SDK uses a
32
+
“bring your own dependencies” model, similar to that you might be used
33
+
to with the Swift Package Manager. You cannot use system libraries,
34
+
but must either rely on the handful of common libraries supplied with
35
+
the Static SDK (see below), or build any extras yourself.
36
+
27
37
Additionally, the Static Linux SDK can be used from any platform
28
38
supported by the Swift compiler and package manager; this means that
29
39
you can develop and test your program on macOS before building and
@@ -255,7 +265,7 @@ in another, or a pointer type will be imported as `OpaquePointer`
255
265
rather than `UnsafePointer<FOO>`.
256
266
257
267
If you do find yourself needing to make these kinds of adjustments,
258
-
you can make your local copy of the package dependency editable by
268
+
you can make your [local copy](https://developer.apple.com/documentation/xcode/editing-a-package-dependency-as-a-local-package) of the package dependency editable by
259
269
doing
260
270
261
271
```console
@@ -265,3 +275,69 @@ $ swift package edit SomePackage
265
275
and then editing the files in the `Packages` directory that appears in
266
276
your program's source directory. You may wish to consider raising PRs
267
277
upstream with any fixes you may have.
278
+
279
+
If your project makes use of C or C++ language libraries, you may need
280
+
to take additional steps. The Static SDK for Linux includes a small
0 commit comments