From 62e36bbdc8af80afca98340cbdb03bf340d4a090 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 7 Apr 2025 11:05:16 -0400 Subject: [PATCH 1/6] Add documentation about the TMPDIR environment variable for better discovery --- Documentation/SwiftlyDocs.docc/automated-install.md | 1 + Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md | 6 +++++- Sources/Swiftly/Install.swift | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Documentation/SwiftlyDocs.docc/automated-install.md b/Documentation/SwiftlyDocs.docc/automated-install.md index e70fb118..8e5c7d97 100644 --- a/Documentation/SwiftlyDocs.docc/automated-install.md +++ b/Documentation/SwiftlyDocs.docc/automated-install.md @@ -75,6 +75,7 @@ If you want to install swiftly, or the binaries that it manages into different l - term `SWIFTLY_HOME_DIR`: The location of the swiftly configuration files, and environment scripts - term `SWIFTLY_BIN_DIR`: The location of the swiftly binary and toolchain symbolic links (for example swift, swiftc, and so on) +- term `TMPDIR`: The temporary directory to be used by swiftly for temporary files, such as downloads that can be very large until they are cleaned up. Sometimes swiftly can't automatically detect the system platform, or isn't supported by swift. You can provide the platform as an option to the `swiftly init` subcommand: diff --git a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md index 4478a04b..06fc5043 100644 --- a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md +++ b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md @@ -53,10 +53,14 @@ Likewise, the latest snapshot associated with a given development branch can be $ swiftly install 5.7-snapshot $ swiftly install main-snapshot - Install whatever toolchain is currently selected, such as the the one in the .swift-version file: +Install whatever toolchain is currently selected, such as the the one in the .swift-version file: $ swiftly install +NOTE: Toolchains are downloaded to a temporary file that is later cleaned up by the installation process. If these files are too big for your usual temporary directory you can choose another location by setting the `TMPDIR` environment variable. + + $ TMPDIR=/large/file/tmp/storage swiftly install latest + **--use:** diff --git a/Sources/Swiftly/Install.swift b/Sources/Swiftly/Install.swift index 3bbb9299..a11c602d 100644 --- a/Sources/Swiftly/Install.swift +++ b/Sources/Swiftly/Install.swift @@ -40,9 +40,15 @@ struct Install: SwiftlyCommand { $ swiftly install 5.7-snapshot $ swiftly install main-snapshot - Install whatever toolchain is currently selected, such as the the one in the .swift-version file: + Install whatever toolchain is currently selected, such as the the one in the .swift-version file: $ swiftly install + + NOTE: Toolchains are downloaded to a temporary file that is later cleaned up by the installation \ + process. If these files are too big for your usual temporary directory you can choose another location \ + by setting the `TMPDIR` environment variable. + + $ TMPDIR=/large/file/tmp/storage swiftly install latest """ )) var version: String? From e1589ce2f0275db1ebfeb2e65e3bd136aa9b4fff Mon Sep 17 00:00:00 2001 From: Chris McGee <87777443+cmcgee1024@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:44:05 -0400 Subject: [PATCH 2/6] Update Documentation/SwiftlyDocs.docc/automated-install.md Co-authored-by: Joseph Heck --- Documentation/SwiftlyDocs.docc/automated-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/SwiftlyDocs.docc/automated-install.md b/Documentation/SwiftlyDocs.docc/automated-install.md index 8e5c7d97..7d43b83e 100644 --- a/Documentation/SwiftlyDocs.docc/automated-install.md +++ b/Documentation/SwiftlyDocs.docc/automated-install.md @@ -75,7 +75,7 @@ If you want to install swiftly, or the binaries that it manages into different l - term `SWIFTLY_HOME_DIR`: The location of the swiftly configuration files, and environment scripts - term `SWIFTLY_BIN_DIR`: The location of the swiftly binary and toolchain symbolic links (for example swift, swiftc, and so on) -- term `TMPDIR`: The temporary directory to be used by swiftly for temporary files, such as downloads that can be very large until they are cleaned up. +- term `TMPDIR`: The temporary directory swiftly uses to hold large files, such as downloads, until it cleans them up. Sometimes swiftly can't automatically detect the system platform, or isn't supported by swift. You can provide the platform as an option to the `swiftly init` subcommand: From 4f1a8343f9ed55ad514558245373abf48a4a1fd9 Mon Sep 17 00:00:00 2001 From: Chris McGee <87777443+cmcgee1024@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:44:30 -0400 Subject: [PATCH 3/6] Update Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md Co-authored-by: Joseph Heck --- Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md index 06fc5043..553b4a92 100644 --- a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md +++ b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md @@ -57,7 +57,7 @@ Install whatever toolchain is currently selected, such as the the one in the .sw $ swiftly install -NOTE: Toolchains are downloaded to a temporary file that is later cleaned up by the installation process. If these files are too big for your usual temporary directory you can choose another location by setting the `TMPDIR` environment variable. +NOTE: Swiftly downloads toolchains to a temporary file that it later cleans during its installation process. If these files are too big for your system temporary directory, set another location by setting the `TMPDIR` environment variable. $ TMPDIR=/large/file/tmp/storage swiftly install latest From 276927902ba68f1db080e6cf57d734e5118dbf2a Mon Sep 17 00:00:00 2001 From: Chris McGee <87777443+cmcgee1024@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:45:10 -0400 Subject: [PATCH 4/6] Update Sources/Swiftly/Install.swift Co-authored-by: Joseph Heck --- Sources/Swiftly/Install.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Swiftly/Install.swift b/Sources/Swiftly/Install.swift index a11c602d..d7cacb52 100644 --- a/Sources/Swiftly/Install.swift +++ b/Sources/Swiftly/Install.swift @@ -44,7 +44,7 @@ struct Install: SwiftlyCommand { $ swiftly install - NOTE: Toolchains are downloaded to a temporary file that is later cleaned up by the installation \ + NOTE: Swiftly downloads toolchains to a temporary file that it later cleans during its installation process. If these files are too big for your system temporary directory, set another location by setting the `TMPDIR` environment variable. process. If these files are too big for your usual temporary directory you can choose another location \ by setting the `TMPDIR` environment variable. From 43260b085d5ebeeaee5a3e78fc7a7770939ac7f3 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 7 Apr 2025 15:01:08 -0400 Subject: [PATCH 5/6] Regenerate the CLI reference --- Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md index 553b4a92..6790b04b 100644 --- a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md +++ b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md @@ -58,6 +58,7 @@ Install whatever toolchain is currently selected, such as the the one in the .sw $ swiftly install NOTE: Swiftly downloads toolchains to a temporary file that it later cleans during its installation process. If these files are too big for your system temporary directory, set another location by setting the `TMPDIR` environment variable. +process. If these files are too big for your usual temporary directory you can choose another location by setting the `TMPDIR` environment variable. $ TMPDIR=/large/file/tmp/storage swiftly install latest From 28600ff9cb792684fc2d4bc433c65b66e6f5bc6e Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 7 Apr 2025 15:18:35 -0400 Subject: [PATCH 6/6] Fix bad merge --- Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md | 1 - Sources/Swiftly/Install.swift | 2 -- 2 files changed, 3 deletions(-) diff --git a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md index 6790b04b..553b4a92 100644 --- a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md +++ b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md @@ -58,7 +58,6 @@ Install whatever toolchain is currently selected, such as the the one in the .sw $ swiftly install NOTE: Swiftly downloads toolchains to a temporary file that it later cleans during its installation process. If these files are too big for your system temporary directory, set another location by setting the `TMPDIR` environment variable. -process. If these files are too big for your usual temporary directory you can choose another location by setting the `TMPDIR` environment variable. $ TMPDIR=/large/file/tmp/storage swiftly install latest diff --git a/Sources/Swiftly/Install.swift b/Sources/Swiftly/Install.swift index d7cacb52..8984679e 100644 --- a/Sources/Swiftly/Install.swift +++ b/Sources/Swiftly/Install.swift @@ -45,8 +45,6 @@ struct Install: SwiftlyCommand { $ swiftly install NOTE: Swiftly downloads toolchains to a temporary file that it later cleans during its installation process. If these files are too big for your system temporary directory, set another location by setting the `TMPDIR` environment variable. - process. If these files are too big for your usual temporary directory you can choose another location \ - by setting the `TMPDIR` environment variable. $ TMPDIR=/large/file/tmp/storage swiftly install latest """