Skip to content

Commit f9748b6

Browse files
authored
Add --locked flag to Cargo install (#1642)
Using the `--locked` flag prevents installation failures when dependencies have broken updates. All references are replaced.
1 parent 9e9fbf7 commit f9748b6

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

book/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Using [Homebrew](https://brew.sh/), you will need to install "openssl" and "cmak
107107
Nushell releases are published as source to the popular Rust package registry [crates.io](https://crates.io/). This makes it easy to build and install the latest Nu release with `cargo`:
108108

109109
```nu
110-
cargo install nu
110+
cargo install nu --locked
111111
```
112112

113113
The `cargo` tool will do the work of downloading Nu and its source dependencies, building it, and installing it into the cargo bin path.

book/plugins.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Nushell also ships with several plugins that serve as examples or tools for plug
2727
Core plugins are typically distributed with the Nushell release and should already be installed in the same directory as the Nushell executable. If this is the case on your system, core plugins should be using correct `nu-plugin` protocol version. If your package management system installs them separately, please make sure to update the core plugins whenever Nushell itself is updated.
2828

2929
::: tip Installing using Cargo
30-
For example, when installing or upgrading Nushell directly from crates.io using `cargo install nu`, the corresponding core plugins for that version may also be installed or updated using `cargo install nu_plugin_<plugin_name>`.
30+
For example, when installing or upgrading Nushell directly from crates.io using `cargo install nu --locked`, the corresponding core plugins for that version may also be installed or updated using `cargo install nu_plugin_<plugin_name> --locked`.
3131

3232
To install all of the default plugins, from within Nushell run:
3333

@@ -37,7 +37,7 @@ To install all of the default plugins, from within Nushell run:
3737
nu_plugin_gstat
3838
nu_plugin_formats
3939
nu_plugin_query
40-
] | each { cargo install $in } | ignore
40+
] | each { cargo install $in --locked } | ignore
4141
```
4242

4343
:::
@@ -54,13 +54,13 @@ To install a third-party plugin on your system, you first need to make sure the
5454
To install a plugin by name from crates.io, run:
5555

5656
```nu
57-
cargo install nu_plugin_<plugin_name>
57+
cargo install nu_plugin_<plugin_name> --locked
5858
```
5959

6060
When installing from a repository (e.g., GitHub), run the following from inside the cloned repository:
6161

6262
```nu
63-
cargo install --path .
63+
cargo install --path . --locked
6464
```
6565

6666
This will create a binary file that can be used to add the plugin.

contributor-book/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ Here we import everything we need -- types and functions -- to be able to create
254254
Once we have finished our plugin, to use it all we need to do is install it.
255255

256256
```nu
257-
> cargo install --path .
257+
> cargo install --path . --locked
258258
# nushell only (run with `nu -c` if not in nushell)
259259
> plugin add ~/.cargo/bin/nu_plugin_len # add .exe on Windows
260260
```

es/book/instalacion.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,23 @@ brew install openssl cmake
113113
Una vez instaladas las depependencias que Nu necesita, podemos instalarla usando el comando `cargo` que viene con el compilador Rust.
114114

115115
```
116-
> cargo install nu
116+
> cargo install nu --locked
117117
```
118118

119119
¡Eso es todo! Cargo hará el trabajo de descarga Nu junto con sus dependencias, construirla e instalarla en el bin path de cargo para que podamos arrancarlo.
120120

121121
Si deseas instalar con más funcionalidades, puedes hacer:
122122

123123
```
124-
> cargo install nu --features=stable
124+
> cargo install nu --locked --features=stable
125125
```
126126

127127
Para todas las funcionalidades disponibles, la manera más fácil es descargar la fuente de Nu y construírlo usted mismo usando las herramientas de Rust:
128128

129129
```
130130
> git clone https://github.com/nushell/nushell.git
131131
> cd nushell
132-
nushell> cargo install --path . --force --features=stable
132+
nushell> cargo install --path . --locked --force --features=stable
133133
134134
Para que esto funcione, asegúrate de tener todas las dependencias instaladas (que se muestran arriba) en el sistema.
135135

pt-BR/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Instale a última versão a partir da [página de _releases_](https://github.com
2424
Alternativamente, você pode instalar a partir do código fonte com o [crates.io](https://crates.io):
2525

2626
```sh
27-
$ cargo install nu
27+
$ cargo install nu --locked
2828
```
2929

3030
#### Instale com Gerenciador de Pacotes

pt-BR/book/instalacao.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ brew install openssl cmake
9595
Quando tivermos todas as dependências de que o Nu precisa, podemos instalá-lo usando o comando `cargo`, que vem junto com o compilador Rust.
9696

9797
```nu
98-
> cargo install nu
98+
> cargo install nu --locked
9999
```
100100

101101
Pronto! A ferramenta cargo fará o download do Nu e das dependências do fonte, o build e a instalação no caminho bin do cargo, de forma que possamos rodá-lo.
102102

103103
Se quiser instalar todas as funcionalidades, inclusive algumas opcionais divertidas, você pode usar:
104104

105105
```nu
106-
> cargo install nu --features=stable
106+
> cargo install nu --locked --features=stable
107107
```
108108

109109
Para esse comando funcionar, certifique-se de ter todas as dependências (mostradas acima) instaladas no seu sistema.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
> git clone https://github.com/nushell/nushell.git
22
> cd nushell
3-
nushell> cargo install --path .
3+
nushell> cargo install --path . --locked
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
> cargo install nu
1+
> cargo install nu --locked

0 commit comments

Comments
 (0)