1
- # ` env `
1
+ # ` env-set `
2
2
3
3
The tracking issue for this feature is: [ #118372 ] ( https://github.com/rust-lang/rust/issues/118372 ) .
4
4
@@ -11,11 +11,11 @@ from the `proc_macro` crate.
11
11
This information will be stored in the dep-info files. For more information about
12
12
dep-info files, take a look [ here] ( https://doc.rust-lang.org/cargo/guide/build-cache.html#dep-info-files ) .
13
13
14
- When retrieving an environment variable value, the one specified by ` --env ` will take
14
+ When retrieving an environment variable value, the one specified by ` --env-set ` will take
15
15
precedence. For example, if you want have ` PATH=a ` in your environment and pass:
16
16
17
17
``` bash
18
- rustc --env PATH=env
18
+ rustc --env-set PATH=env
19
19
```
20
20
21
21
Then you will have:
@@ -24,22 +24,22 @@ Then you will have:
24
24
assert_eq!(env!("PATH"), "env");
25
25
```
26
26
27
- It will trigger a new compilation if any of the ` --env ` argument value is different.
27
+ It will trigger a new compilation if any of the ` --env-set ` argument value is different.
28
28
So if you first passed:
29
29
30
30
``` bash
31
- --env A=B --env X=12
31
+ --env-set A=B --env X=12
32
32
```
33
33
34
34
and then on next compilation:
35
35
36
36
``` bash
37
- --env A=B
37
+ --env-set A=B
38
38
```
39
39
40
40
` X ` value is different (not set) so the code will be re-compiled.
41
41
42
42
Please note that on Windows, environment variables are case insensitive but case
43
43
preserving whereas ` rustc ` 's environment variables are case sensitive. For example,
44
44
having ` Path ` in your environment (case insensitive) is different than using
45
- ` rustc --env Path=... ` (case sensitive).
45
+ ` rustc --env-set Path=... ` (case sensitive).
0 commit comments