Skip to content

Commit 84d57f2

Browse files
authored
Ensure symlink warning is shown (#15126)
Fixes #15115, see also clap-rs/clap#6092 <img width="1079" height="1030" alt="image" src="https://github.com/user-attachments/assets/05b003a6-9ca0-4f2b-8a74-078aa155ce6d" />
1 parent 9c634d9 commit 84d57f2

File tree

6 files changed

+67
-11
lines changed

6 files changed

+67
-11
lines changed

crates/uv-cli/src/lib.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,6 +2769,11 @@ pub struct VenvArgs {
27692769
///
27702770
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and
27712771
/// Windows.
2772+
///
2773+
/// WARNING: The use of symlink link mode is discouraged, as they create tight coupling between
2774+
/// the cache and the target environment. For example, clearing the cache (`uv cache clear`)
2775+
/// will break all installed packages by way of removing the underlying source files. Use
2776+
/// symlinks with caution.
27722777
#[arg(long, value_enum, env = EnvVars::UV_LINK_MODE)]
27732778
pub link_mode: Option<uv_install_wheel::LinkMode>,
27742779

@@ -4808,6 +4813,11 @@ pub struct ToolUpgradeArgs {
48084813
///
48094814
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and
48104815
/// Windows.
4816+
///
4817+
/// WARNING: The use of symlink link mode is discouraged, as they create tight coupling between
4818+
/// the cache and the target environment. For example, clearing the cache (`uv cache clear`)
4819+
/// will break all installed packages by way of removing the underlying source files. Use
4820+
/// symlinks with caution.
48114821
#[arg(
48124822
long,
48134823
value_enum,
@@ -5612,6 +5622,11 @@ pub struct InstallerArgs {
56125622
///
56135623
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and
56145624
/// Windows.
5625+
///
5626+
/// WARNING: The use of symlink link mode is discouraged, as they create tight coupling between
5627+
/// the cache and the target environment. For example, clearing the cache (`uv cache clear`)
5628+
/// will break all installed packages by way of removing the underlying source files. Use
5629+
/// symlinks with caution.
56155630
#[arg(
56165631
long,
56175632
value_enum,
@@ -5824,6 +5839,11 @@ pub struct ResolverArgs {
58245839
///
58255840
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and
58265841
/// Windows.
5842+
///
5843+
/// WARNING: The use of symlink link mode is discouraged, as they create tight coupling between
5844+
/// the cache and the target environment. For example, clearing the cache (`uv cache clear`)
5845+
/// will break all installed packages by way of removing the underlying source files. Use
5846+
/// symlinks with caution.
58275847
#[arg(
58285848
long,
58295849
value_enum,
@@ -6028,6 +6048,11 @@ pub struct ResolverInstallerArgs {
60286048
///
60296049
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and
60306050
/// Windows.
6051+
///
6052+
/// WARNING: The use of symlink link mode is discouraged, as they create tight coupling between
6053+
/// the cache and the target environment. For example, clearing the cache (`uv cache clear`)
6054+
/// will break all installed packages by way of removing the underlying source files. Use
6055+
/// symlinks with caution.
60316056
#[arg(
60326057
long,
60336058
value_enum,

crates/uv-install-wheel/src/linker.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ pub enum LinkMode {
2727
/// Hard link packages from the wheel into the `site-packages` directory.
2828
Hardlink,
2929
/// Symbolically link packages from the wheel into the `site-packages` directory.
30-
///
31-
/// WARNING: The use of symlinks is discouraged, as they create tight coupling between the
32-
/// cache and the target environment. For example, clearing the cache (`uv cache clear`) will
33-
/// break all installed packages by way of removing the underlying source files. Use symlinks
34-
/// with caution.
3530
Symlink,
3631
}
3732

crates/uv-settings/src/settings.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ pub struct ResolverInstallerOptions {
639639
default = "[]",
640640
value_type = "dict",
641641
example = r#"
642-
[extra-build-dependencies]
642+
[extra-build-dependencies]
643643
pytest = ["setuptools"]
644644
"#
645645
)]
@@ -685,6 +685,11 @@ pub struct ResolverInstallerOptions {
685685
///
686686
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and
687687
/// Windows.
688+
///
689+
/// WARNING: The use of symlink link mode is discouraged, as they create tight coupling between
690+
/// the cache and the target environment. For example, clearing the cache (`uv cache clear`)
691+
/// will break all installed packages by way of removing the underlying source files. Use
692+
/// symlinks with caution.
688693
#[option(
689694
default = "\"clone\" (macOS) or \"hardlink\" (Linux, Windows)",
690695
value_type = "str",
@@ -1568,6 +1573,11 @@ pub struct PipOptions {
15681573
///
15691574
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and
15701575
/// Windows.
1576+
///
1577+
/// WARNING: The use of symlink link mode is discouraged, as they create tight coupling between
1578+
/// the cache and the target environment. For example, clearing the cache (`uv cache clear`)
1579+
/// will break all installed packages by way of removing the underlying source files. Use
1580+
/// symlinks with caution.
15711581
#[option(
15721582
default = "\"clone\" (macOS) or \"hardlink\" (Linux, Windows)",
15731583
value_type = "str",

0 commit comments

Comments
 (0)