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
Copy file name to clipboardExpand all lines: DESIGN.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ A simple setup for managing the toolchains could look like this:
67
67
68
68
The toolchains (i.e. the contents of a given Swift download tarball) would be contained in the toolchains directory, each named according to the major/minor/patch version. `config.json` would contain any required metadata (e.g. the latest Swift version, which toolchain is selected, etc.). If pulling in Foundation to use `JSONEncoder`/`JSONDecoder` (or some other JSON tool) would be a problem, we could also use something simpler.
69
69
70
-
The `~/.local/bin` directory would include symlinks pointing to swiftly itself. When the proxies binaries are executed swiftly proxies them to the requested toolchain, or the default.
70
+
The `~/.local/share/swiftly/bin` directory would include symlinks pointing to swiftly itself. When the proxies binaries are executed swiftly proxies them to the requested toolchain, or the default.
71
71
72
72
This is all very similar to how rustup does things, but I figure there's no need to reinvent the wheel here.
73
73
@@ -115,7 +115,7 @@ This will install the latest available stable release of Swift. If the latest ve
115
115
116
116
##### Installing a specific release version of Swift
117
117
118
-
To install a specific version of Swift, the user can provide it.
118
+
To install a specific version of Swift, the user can provide it.
119
119
120
120
If a patch version isn't specified, it’ll install the latest patch version that matches the minor version provided. If a version is already installed that has the same major and minor version, a message will be printed indicating so and directing the user to `swiftly update a.b` if they wish to check for updates.
121
121
@@ -306,19 +306,21 @@ This command will provide the full path to the directory where the selected tool
306
306
307
307
#### Run with a selected toolchain
308
308
309
-
There are cases where you might want to run an arbitrary command using a selected toolchain. An example could be that you want to build something with CMake.
309
+
There are cases where you might want to run an arbitrary command using a selected toolchain. An example could be that you want to build something with CMake or Autoconf.
310
310
311
311
```
312
312
# CMake
313
-
swiftly run cmake -G ninja
313
+
swiftly run cmake -G ninja -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++
314
314
swiftly run ninja build
315
315
316
316
# Autoconf
317
-
swiftly run ./configure
318
-
swiftly run make
317
+
CC=clang swiftly run ./configure
318
+
CC=clang swiftly run make
319
319
```
320
320
321
-
Swiftly adjusts certain environment variables, such as prefixing the PATH to the selected toolchain directory, and setting the CC and CXX variables to the locations of clang and clang++ in those toolchains so that the build tools use them. If you want to explicitly specify a toolchain for the command you can do that with a selector notation like this:
321
+
Swiftly prefixes the PATH to the selected toolchain directory and runs the command so that the toolchain executables are available and have precedence.
322
+
323
+
If you want to explicitly specify a toolchain for the command you can do that with a selector notation like this:
322
324
323
325
```
324
326
swiftly run swift build +5.10.1 # Runs swift build with the 5.10.1 toolchain
@@ -333,8 +335,8 @@ If the selected toolchain is not installed then swiftly will exit with a message
333
335
swiftly run swift build +main-snapshot
334
336
335
337
# Generate makefiles with the latest released Swift toolchain
336
-
swiftly run +latest cmake -G "Unix Makefile"
337
-
swiftly run +latest make
338
+
swiftly run +latest cmake -G "Unix Makefile" -D CMAKE_C_COMPILER=clang
339
+
CC=clang swiftly run +latest make
338
340
```
339
341
340
342
## Detailed Design
@@ -498,7 +500,7 @@ If the tag is a newer version than the installed one, a prompt indicating the ne
498
500
$ dpkg --status libcurl4
499
501
```
500
502
501
-
If the exit code of the previous command was 0, then we know the dependency exists and can return true. If it wasn't, then we call fall back to attempting to locate the library via `pkg-config`:
503
+
If the exit code of the previous command was 0, then we know the dependency exists and can return true. If it wasn't, then we can fall back to attempting to locate the library via `pkg-config`:
Copy file name to clipboardExpand all lines: Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -501,7 +501,7 @@ You can run one of the usual toolchain commands directly:
501
501
502
502
Or you can run another program (or script) that runs one or more toolchain commands:
503
503
504
-
$ swiftly run make # Builds targets using clang/swiftc
504
+
$ CC=clang swiftly run make # Builds targets using clang
505
505
$ swiftly run ./build-things.sh # Script invokes 'swift build' to create certain product binaries
506
506
507
507
Toolchain selection is determined by swift version files `.swift-version`, with a default global as the fallback. See the `swiftly use` command for more details.
NOTE: On macOS it is possible that the shell will pick up the system Swift on the path
272
-
instead of the one that swiftly has installed for you. You can run this command to update
273
-
the shell with the latest PATHs.
249
+
Your shell caches items on your path for better performance. Swiftly has added items to your path that may not get picked up right away. You can run this command to update your shell to get these items.
0 commit comments