fork/cargo

git clone https://git.julia.blue/fork/cargo

Weihang Lofeat(generate-lockfile): Add unstable --publish-time flag (#16265)6ce5357ac

master
6.5 KiB164 linesraw
1CARGO-GENERATE-LOCKFILE(1)
2
3NAME
4       cargo-generate-lockfile — Generate the lockfile for a package
5
6SYNOPSIS
7       cargo generate-lockfile [options]
8
9DESCRIPTION
10       This command will create the Cargo.lock lockfile for the current package
11       or workspace. If the lockfile already exists, it will be rebuilt with
12       the latest available version of every package.
13
14       See also cargo-update(1) which is also capable of creating a Cargo.lock
15       lockfile and has more options for controlling update behavior.
16
17OPTIONS
18   Display Options
19       -v, --verbose
20           Use verbose output. May be specified twice for “very verbose”
21           output which includes extra output such as dependency warnings and
22           build script output. May also be specified with the term.verbose
23           config value
24           <https://doc.rust-lang.org/cargo/reference/config.html>.
25
26       -q, --quiet
27           Do not print cargo log messages. May also be specified with the
28           term.quiet config value
29           <https://doc.rust-lang.org/cargo/reference/config.html>.
30
31       --color when
32           Control when colored output is used. Valid values:
33
34           o  auto (default): Automatically detect if color support is
35              available on the terminal.
36
37           o  always: Always display colors.
38
39           o  never: Never display colors.
40
41           May also be specified with the term.color config value
42           <https://doc.rust-lang.org/cargo/reference/config.html>.
43
44   Manifest Options
45       --manifest-path path
46           Path to the Cargo.toml file. By default, Cargo searches for the
47           Cargo.toml file in the current directory or any parent directory.
48
49       --ignore-rust-version
50           Ignore rust-version specification in packages.
51
52       --publish-time yyyy-mm-ddThh:mm:ssZ
53           Latest publish time allowed for registry packages (Unstable)
54
55           This is a best-effort filter on allowed packages, including:
56
57           o  packages from unsupported registries are always accepted
58
59           o  only the current yank state is respected, not the state as of
60              --publish-time
61
62           o  precision of the publish time
63
64       --locked
65           Asserts that the exact same dependencies and versions are used as
66           when the existing Cargo.lock file was originally generated. Cargo
67           will exit with an error when either of the following scenarios
68           arises:
69
70           o  The lock file is missing.
71
72           o  Cargo attempted to change the lock file due to a different
73              dependency resolution.
74
75           It may be used in environments where deterministic builds are
76           desired, such as in CI pipelines.
77
78       --offline
79           Prevents Cargo from accessing the network for any reason. Without
80           this flag, Cargo will stop with an error if it needs to access the
81           network and the network is not available. With this flag, Cargo will
82           attempt to proceed without the network if possible.
83
84           Beware that this may result in different dependency resolution than
85           online mode. Cargo will restrict itself to crates that are
86           downloaded locally, even if there might be a newer version as
87           indicated in the local copy of the index. See the cargo-fetch(1)
88           command to download dependencies before going offline.
89
90           May also be specified with the net.offline config value
91           <https://doc.rust-lang.org/cargo/reference/config.html>.
92
93       --frozen
94           Equivalent to specifying both --locked and --offline.
95
96       --lockfile-path PATH
97           Changes the path of the lockfile from the default
98           (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock
99           (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that
100           providing --lockfile-path will ignore existing lockfile at the
101           default path, and instead will either use the lockfile from PATH, or
102           write a new lockfile into the provided PATH if it doesn’t exist.
103           This flag can be used to run most commands in read-only directories,
104           writing lockfile into the provided PATH.
105
106           This option is only available on the nightly channel
107           <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and
108           requires the -Z unstable-options flag to enable (see #14421
109           <https://github.com/rust-lang/cargo/issues/14421>).
110
111   Common Options
112       +toolchain
113           If Cargo has been installed with rustup, and the first argument to
114           cargo begins with +, it will be interpreted as a rustup toolchain
115           name (such as +stable or +nightly). See the rustup documentation
116           <https://rust-lang.github.io/rustup/overrides.html> for more
117           information about how toolchain overrides work.
118
119       --config KEY=VALUE or PATH
120           Overrides a Cargo configuration value. The argument should be in
121           TOML syntax of KEY=VALUE, or provided as a path to an extra
122           configuration file. This flag may be specified multiple times. See
123           the command-line overrides section
124           <https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides>
125           for more information.
126
127       -C PATH
128           Changes the current working directory before executing any specified
129           operations. This affects things like where cargo looks by default
130           for the project manifest (Cargo.toml), as well as the directories
131           searched for discovering .cargo/config.toml, for example. This
132           option must appear before the command name, for example cargo -C
133           path/to/my-project build.
134
135           This option is only available on the nightly channel
136           <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and
137           requires the -Z unstable-options flag to enable (see #10098
138           <https://github.com/rust-lang/cargo/issues/10098>).
139
140       -h, --help
141           Prints help information.
142
143       -Z flag
144           Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
145           details.
146
147ENVIRONMENT
148       See the reference
149       <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
150       for details on environment variables that Cargo reads.
151
152EXIT STATUS
153       o  0: Cargo succeeded.
154
155       o  101: Cargo failed to complete.
156
157EXAMPLES
158       1. Create or update the lockfile for the current package or workspace:
159
160              cargo generate-lockfile
161
162SEE ALSO
163       cargo(1), cargo-update(1)
164