Skip to content

Commit 18c8c5f

Browse files
committed
Auto merge of #6065 - zachlute:change-project-to-package, r=dwijnand
Replace 'project' with 'package' in many strings and comments. Partial fix for #6056. Shouldn't be anything too interesting or surprising in here. Still need to do documentation, but will do that as a different PR.
2 parents 77e02e7 + f3bd19f commit 18c8c5f

36 files changed

+87
-87
lines changed

src/bin/cargo/cli.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,18 @@ OPTIONS:
178178
{unified}
179179
180180
Some common cargo commands are (see all commands with --list):
181-
build Compile the current project
182-
check Analyze the current project and report errors, but don't build object files
181+
build Compile the current package
182+
check Analyze the current package and report errors, but don't build object files
183183
clean Remove the target directory
184-
doc Build this project's and its dependencies' documentation
185-
new Create a new cargo project
186-
init Create a new cargo project in an existing directory
184+
doc Build this package's and its dependencies' documentation
185+
new Create a new cargo package
186+
init Create a new cargo package in an existing directory
187187
run Build and execute src/main.rs
188188
test Run the tests
189189
bench Run the benchmarks
190190
update Update dependencies listed in Cargo.lock
191191
search Search registry for crates
192-
publish Package and upload this project to the registry
192+
publish Package and upload this package to the registry
193193
install Install a Rust binary
194194
uninstall Uninstall a Rust binary
195195

src/bin/cargo/commands/generate_lockfile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use cargo::ops;
44

55
pub fn cli() -> App {
66
subcommand("generate-lockfile")
7-
.about("Generate the lockfile for a project")
7+
.about("Generate the lockfile for a package")
88
.arg_manifest_path()
99
}
1010

src/bin/cargo/commands/init.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
1414
ops::init(&opts, config)?;
1515
config
1616
.shell()
17-
.status("Created", format!("{} project", opts.kind))?;
17+
.status("Created", format!("{} package", opts.kind))?;
1818
Ok(())
1919
}

src/bin/cargo/commands/locate_project.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
1919
let root = root.to_str()
2020
.ok_or_else(|| {
2121
format_err!(
22-
"your project path contains characters \
22+
"your package path contains characters \
2323
not representable in Unicode"
2424
)
2525
})

src/bin/cargo/commands/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use cargo::print_json;
66
pub fn cli() -> App {
77
subcommand("metadata")
88
.about(
9-
"Output the resolved dependencies of a project, \
9+
"Output the resolved dependencies of a package, \
1010
the concrete used versions including overrides, \
1111
in machine-readable format",
1212
)

src/bin/cargo/commands/new.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
1414

1515
ops::new(&opts, config)?;
1616
let path = args.value_of("path").unwrap();
17-
let project_name = if let Some(name) = args.value_of("name") {
17+
let package_name = if let Some(name) = args.value_of("name") {
1818
name
1919
} else {
2020
path
2121
};
2222
config
2323
.shell()
24-
.status("Created", format!("{} `{}` project", opts.kind, project_name))?;
24+
.status("Created", format!("{} `{}` package", opts.kind, package_name))?;
2525
Ok(())
2626
}

src/bin/cargo/commands/run.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn cli() -> App {
2323
.arg_message_format()
2424
.after_help(
2525
"\
26-
If neither `--bin` nor `--example` are given, then if the project only has one
26+
If neither `--bin` nor `--example` are given, then if the package only has one
2727
bin target it will be run. Otherwise `--bin` specifies the bin target to run,
2828
and `--example` specifies the example target to run. At most one of `--bin` or
2929
`--example` can be provided.

src/cargo/core/compiler/build_plan.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! A graph-like structure used to represent the rustc commands to build the project and the
1+
//! A graph-like structure used to represent the rustc commands to build the package and the
22
//! interdependencies between them.
33
//!
44
//! The BuildPlan structure is used to store the dependency graph of a dry run so that it can be

src/cargo/core/compiler/context/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ use self::compilation_files::CompilationFiles;
3131
/// All information needed to define a Unit.
3232
///
3333
/// A unit is an object that has enough information so that cargo knows how to build it.
34-
/// For example, if your project has dependencies, then every dependency will be built as a library
35-
/// unit. If your project is a library, then it will be built as a library unit as well, or if it
34+
/// For example, if your package has dependencies, then every dependency will be built as a library
35+
/// unit. If your package is a library, then it will be built as a library unit as well, or if it
3636
/// is a binary with `main.rs`, then a binary will be output. There are also separate unit types
3737
/// for `test`ing and `check`ing, amongst others.
3838
///
@@ -462,7 +462,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
462462
// `CARGO_INCREMENTAL`.
463463
// * `profile.dev.incremental` - in `Cargo.toml` specific profiles can
464464
// be configured to enable/disable incremental compilation. This can
465-
// be primarily used to disable incremental when buggy for a project.
465+
// be primarily used to disable incremental when buggy for a package.
466466
// * Finally, each profile has a default for whether it will enable
467467
// incremental compilation or not. Primarily development profiles
468468
// have it enabled by default while release profiles have it disabled

src/cargo/core/compiler/job_queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<'a> JobQueue<'a> {
220220
// maximum number of parallel jobs we have tokens for). A local queue
221221
// is maintained separately from the main dependency queue as one
222222
// dequeue may actually dequeue quite a bit of work (e.g. 10 binaries
223-
// in one project).
223+
// in one package).
224224
//
225225
// After a job has finished we update our internal state if it was
226226
// successful and otherwise wait for pending work to finish if it failed

src/cargo/core/compiler/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,8 @@ fn rustdoc<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoResult
658658
// actually invoke rustc.
659659
//
660660
// In general users don't expect `cargo build` to cause rebuilds if you change
661-
// directories. That could be if you just change directories in the project or
662-
// if you literally move the whole project wholesale to a new directory. As a
661+
// directories. That could be if you just change directories in the package or
662+
// if you literally move the whole package wholesale to a new directory. As a
663663
// result we mostly don't factor in `cwd` to this calculation. Instead we try to
664664
// track the workspace as much as possible and we update the current directory
665665
// of rustc/rustdoc where appropriate.

src/cargo/core/workspace.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ impl<'cfg> Workspace<'cfg> {
389389
}
390390

391391
// Don't walk across `CARGO_HOME` when we're looking for the
392-
// workspace root. Sometimes a project will be organized with
392+
// workspace root. Sometimes a package will be organized with
393393
// `CARGO_HOME` pointing inside of the workspace root or in the
394-
// current project, but we don't want to mistakenly try to put
394+
// current package, but we don't want to mistakenly try to put
395395
// crates.io crates into the workspace by accident.
396396
if self.config.home() == path {
397397
break;

src/cargo/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub fn version() -> VersionInfo {
215215
// There are two versions at play here:
216216
// - version of cargo-the-binary, which you see when you type `cargo --version`
217217
// - version of cargo-the-library, which you download from crates.io for use
218-
// in your projects.
218+
// in your packages.
219219
//
220220
// We want to make the `binary` version the same as the corresponding Rust/rustc release.
221221
// At the same time, we want to keep the library version at `0.x`, because Cargo as

src/cargo/ops/cargo_clean.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub struct CleanOptions<'a> {
2222
pub doc: bool,
2323
}
2424

25-
/// Cleans the project from build artifacts.
25+
/// Cleans the package's build artifacts.
2626
pub fn clean(ws: &Workspace, opts: &CleanOptions) -> CargoResult<()> {
2727
let target_dir = ws.target_dir();
2828
let config = ws.config();

src/cargo/ops/cargo_install.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ fn install_one(
229229
match pkg.manifest().edition() {
230230
Edition::Edition2015 => config.shell().warn(
231231
"Using `cargo install` to install the binaries for the \
232-
project in current working directory is deprecated, \
232+
package in current working directory is deprecated, \
233233
use `cargo install --path .` instead. \
234234
Use `cargo build` if you want to simply build the package.",
235235
)?,
236236
Edition::Edition2018 => bail!(
237237
"Using `cargo install` to install the binaries for the \
238-
project in current working directory is no longer supported, \
238+
package in current working directory is no longer supported, \
239239
use `cargo install --path .` instead. \
240240
Use `cargo build` if you want to simply build the package."
241241
),

src/cargo/ops/cargo_new.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub enum VersionControl {
2727
pub struct NewOptions {
2828
pub version_control: Option<VersionControl>,
2929
pub kind: NewProjectKind,
30-
/// Absolute path to the directory for the new project
30+
/// Absolute path to the directory for the new package
3131
pub path: PathBuf,
3232
pub name: Option<String>,
3333
pub edition: Option<String>,
@@ -109,14 +109,14 @@ fn get_name<'a>(path: &'a Path, opts: &'a NewOptions) -> CargoResult<&'a str> {
109109

110110
let file_name = path.file_name().ok_or_else(|| {
111111
format_err!(
112-
"cannot auto-detect project name from path {:?} ; use --name to override",
112+
"cannot auto-detect package name from path {:?} ; use --name to override",
113113
path.as_os_str()
114114
)
115115
})?;
116116

117117
file_name.to_str().ok_or_else(|| {
118118
format_err!(
119-
"cannot create project with a non-unicode name: {:?}",
119+
"cannot create package with a non-unicode name: {:?}",
120120
file_name
121121
)
122122
})
@@ -174,12 +174,12 @@ fn check_name(name: &str, opts: &NewOptions) -> CargoResult<()> {
174174
}
175175

176176
fn detect_source_paths_and_types(
177-
project_path: &Path,
178-
project_name: &str,
177+
package_path: &Path,
178+
package_name: &str,
179179
detected_files: &mut Vec<SourceFileInformation>,
180180
) -> CargoResult<()> {
181-
let path = project_path;
182-
let name = project_name;
181+
let path = package_path;
182+
let name = package_name;
183183

184184
enum H {
185185
Bin,
@@ -233,20 +233,20 @@ fn detect_source_paths_and_types(
233233
let sfi = match i.handling {
234234
H::Bin => SourceFileInformation {
235235
relative_path: pp,
236-
target_name: project_name.to_string(),
236+
target_name: package_name.to_string(),
237237
bin: true,
238238
},
239239
H::Lib => SourceFileInformation {
240240
relative_path: pp,
241-
target_name: project_name.to_string(),
241+
target_name: package_name.to_string(),
242242
bin: false,
243243
},
244244
H::Detect => {
245245
let content = paths::read(&path.join(pp.clone()))?;
246246
let isbin = content.contains("fn main");
247247
SourceFileInformation {
248248
relative_path: pp,
249-
target_name: project_name.to_string(),
249+
target_name: package_name.to_string(),
250250
bin: isbin,
251251
}
252252
}
@@ -276,7 +276,7 @@ cannot automatically generate Cargo.toml as the main target would be ambiguous",
276276
} else {
277277
if let Some(plp) = previous_lib_relpath {
278278
bail!(
279-
"cannot have a project with \
279+
"cannot have a package with \
280280
multiple libraries, \
281281
found both `{}` and `{}`",
282282
plp,
@@ -290,17 +290,17 @@ cannot automatically generate Cargo.toml as the main target would be ambiguous",
290290
Ok(())
291291
}
292292

293-
fn plan_new_source_file(bin: bool, project_name: String) -> SourceFileInformation {
293+
fn plan_new_source_file(bin: bool, package_name: String) -> SourceFileInformation {
294294
if bin {
295295
SourceFileInformation {
296296
relative_path: "src/main.rs".to_string(),
297-
target_name: project_name,
297+
target_name: package_name,
298298
bin: true,
299299
}
300300
} else {
301301
SourceFileInformation {
302302
relative_path: "src/lib.rs".to_string(),
303-
target_name: project_name,
303+
target_name: package_name,
304304
bin: false,
305305
}
306306
}
@@ -330,7 +330,7 @@ pub fn new(opts: &NewOptions, config: &Config) -> CargoResult<()> {
330330

331331
mk(config, &mkopts).chain_err(|| {
332332
format_err!(
333-
"Failed to create project `{}` at `{}`",
333+
"Failed to create package `{}` at `{}`",
334334
name,
335335
path.display()
336336
)
@@ -342,7 +342,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
342342
let path = &opts.path;
343343

344344
if fs::metadata(&path.join("Cargo.toml")).is_ok() {
345-
bail!("`cargo init` cannot be run on existing Cargo projects")
345+
bail!("`cargo init` cannot be run on existing Cargo packages")
346346
}
347347

348348
let name = get_name(path, opts)?;
@@ -356,7 +356,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
356356
src_paths_types.push(plan_new_source_file(opts.kind.is_bin(), name.to_string()));
357357
} else {
358358
// --bin option may be ignored if lib.rs or src/lib.rs present
359-
// Maybe when doing `cargo init --bin` inside a library project stub,
359+
// Maybe when doing `cargo init --bin` inside a library package stub,
360360
// user may mean "initialize for library, but also add binary target"
361361
}
362362

@@ -407,7 +407,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
407407

408408
mk(config, &mkopts).chain_err(|| {
409409
format_err!(
410-
"Failed to create project `{}` at `{}`",
410+
"Failed to create package `{}` at `{}`",
411411
name,
412412
path.display()
413413
)

src/cargo/ops/cargo_output_metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct OutputMetadataOptions {
1717
pub version: u32,
1818
}
1919

20-
/// Loads the manifest, resolves the dependencies of the project to the concrete
20+
/// Loads the manifest, resolves the dependencies of the package to the concrete
2121
/// used versions - considering overrides - and writes all dependencies in a JSON
2222
/// format to stdout.
2323
pub fn output_metadata(ws: &Workspace, opt: &OutputMetadataOptions) -> CargoResult<ExportInfo> {

src/cargo/ops/cargo_run.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn run(
6161
)
6262
} else {
6363
bail!(
64-
"`cargo run` requires that a project only have one \
64+
"`cargo run` requires that a package only have one \
6565
executable; use the `--bin` option to specify which one \
6666
to run\navailable binaries: {}",
6767
names.join(", ")

src/cargo/ops/cargo_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn compile_tests<'a>(
6969
Ok(compilation)
7070
}
7171

72-
/// Run the unit and integration tests of a project.
72+
/// Run the unit and integration tests of a package.
7373
fn run_unit_tests(
7474
options: &TestOptions,
7575
test_args: &[String],

src/cargo/ops/fix.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn check_version_control(opts: &FixOptions) -> CargoResult<()> {
8585
}
8686
let config = opts.compile_opts.config;
8787
if !existing_vcs_repo(config.cwd(), config.cwd()) {
88-
bail!("no VCS found for this project and `cargo fix` can potentially \
88+
bail!("no VCS found for this package and `cargo fix` can potentially \
8989
perform destructive changes; if you'd like to suppress this \
9090
error pass `--allow-no-vcs`")
9191
}
@@ -137,7 +137,7 @@ fn check_version_control(opts: &FixOptions) -> CargoResult<()> {
137137
files_list.push_str(" (staged)\n");
138138
}
139139

140-
bail!("the working directory of this project has uncommitted changes, and \
140+
bail!("the working directory of this package has uncommitted changes, and \
141141
`cargo fix` can potentially perform destructive changes; if you'd \
142142
like to suppress this error pass `--allow-dirty`, `--allow-staged`, \
143143
or commit the changes to these files:\n\

src/cargo/util/vcs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use util::{process, CargoResult};
77

88
// Check if we are in an existing repo. We define that to be true if either:
99
//
10-
// 1. We are in a git repo and the path to the new project is not an ignored
10+
// 1. We are in a git repo and the path to the new package is not an ignored
1111
// path in that repo.
1212
// 2. We are in an HG repo.
1313
pub fn existing_vcs_repo(path: &Path, cwd: &Path) -> bool {

src/etc/_cargo

+5-5
Original file line numberDiff line numberDiff line change
@@ -426,20 +426,20 @@ esac
426426
_cargo_cmds(){
427427
local -a commands;commands=(
428428
'bench:execute all benchmarks of a local package'
429-
'build:compile the current project'
430-
'check:check the current project without compiling'
429+
'build:compile the current package'
430+
'check:check the current package without compiling'
431431
'clean:remove generated artifacts'
432432
'doc:build package documentation'
433433
'fetch:fetch package dependencies'
434434
'generate-lockfile:create lockfile'
435435
'git-checkout:git checkout'
436436
'help:get help for commands'
437-
'init:create new project in current directory'
437+
'init:create new package in current directory'
438438
'install:install a Rust binary'
439439
'locate-project:print "Cargo.toml" location'
440440
'login:login to remote server'
441-
'metadata:the metadata for a project in json'
442-
'new:create a new project'
441+
'metadata:the metadata for a package in json'
442+
'new:create a new package'
443443
'owner:manage the owners of a crate on the registry'
444444
'package:assemble local package into a distributable tarball'
445445
'pkgid:print a fully qualified package specification'

src/etc/man/cargo-build.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.hy
33
.SH NAME
44
.PP
5-
cargo\-build \- Compile the current project
5+
cargo\-build \- Compile the current package
66
.SH SYNOPSIS
77
.PP
88
\f[I]cargo build\f[] [OPTIONS]

0 commit comments

Comments
 (0)