Skip to content

Replace 'project' with 'package' in many strings and comments. #6065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/bin/cargo/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,18 @@ OPTIONS:
{unified}

Some common cargo commands are (see all commands with --list):
build Compile the current project
check Analyze the current project and report errors, but don't build object files
build Compile the current package
check Analyze the current package and report errors, but don't build object files
clean Remove the target directory
doc Build this project's and its dependencies' documentation
new Create a new cargo project
init Create a new cargo project in an existing directory
doc Build this package's and its dependencies' documentation
new Create a new cargo package
init Create a new cargo package in an existing directory
run Build and execute src/main.rs
test Run the tests
bench Run the benchmarks
update Update dependencies listed in Cargo.lock
search Search registry for crates
publish Package and upload this project to the registry
publish Package and upload this package to the registry
install Install a Rust binary
uninstall Uninstall a Rust binary

Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/generate_lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cargo::ops;

pub fn cli() -> App {
subcommand("generate-lockfile")
.about("Generate the lockfile for a project")
.about("Generate the lockfile for a package")
.arg_manifest_path()
}

Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
ops::init(&opts, config)?;
config
.shell()
.status("Created", format!("{} project", opts.kind))?;
.status("Created", format!("{} package", opts.kind))?;
Ok(())
}
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/locate_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
let root = root.to_str()
.ok_or_else(|| {
format_err!(
"your project path contains characters \
"your package path contains characters \
not representable in Unicode"
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cargo::print_json;
pub fn cli() -> App {
subcommand("metadata")
.about(
"Output the resolved dependencies of a project, \
"Output the resolved dependencies of a package, \
the concrete used versions including overrides, \
in machine-readable format",
)
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {

ops::new(&opts, config)?;
let path = args.value_of("path").unwrap();
let project_name = if let Some(name) = args.value_of("name") {
let package_name = if let Some(name) = args.value_of("name") {
name
} else {
path
};
config
.shell()
.status("Created", format!("{} `{}` project", opts.kind, project_name))?;
.status("Created", format!("{} `{}` package", opts.kind, package_name))?;
Ok(())
}
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn cli() -> App {
.arg_message_format()
.after_help(
"\
If neither `--bin` nor `--example` are given, then if the project only has one
If neither `--bin` nor `--example` are given, then if the package only has one
bin target it will be run. Otherwise `--bin` specifies the bin target to run,
and `--example` specifies the example target to run. At most one of `--bin` or
`--example` can be provided.
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/build_plan.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! A graph-like structure used to represent the rustc commands to build the project and the
//! A graph-like structure used to represent the rustc commands to build the package and the
//! interdependencies between them.
//!
//! The BuildPlan structure is used to store the dependency graph of a dry run so that it can be
Expand Down
6 changes: 3 additions & 3 deletions src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ use self::compilation_files::CompilationFiles;
/// All information needed to define a Unit.
///
/// A unit is an object that has enough information so that cargo knows how to build it.
/// For example, if your project has dependencies, then every dependency will be built as a library
/// unit. If your project is a library, then it will be built as a library unit as well, or if it
/// For example, if your package has dependencies, then every dependency will be built as a library
/// unit. If your package is a library, then it will be built as a library unit as well, or if it
/// is a binary with `main.rs`, then a binary will be output. There are also separate unit types
/// for `test`ing and `check`ing, amongst others.
///
Expand Down Expand Up @@ -462,7 +462,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
// `CARGO_INCREMENTAL`.
// * `profile.dev.incremental` - in `Cargo.toml` specific profiles can
// be configured to enable/disable incremental compilation. This can
// be primarily used to disable incremental when buggy for a project.
// be primarily used to disable incremental when buggy for a package.
// * Finally, each profile has a default for whether it will enable
// incremental compilation or not. Primarily development profiles
// have it enabled by default while release profiles have it disabled
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/job_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl<'a> JobQueue<'a> {
// maximum number of parallel jobs we have tokens for). A local queue
// is maintained separately from the main dependency queue as one
// dequeue may actually dequeue quite a bit of work (e.g. 10 binaries
// in one project).
// in one package).
//
// After a job has finished we update our internal state if it was
// successful and otherwise wait for pending work to finish if it failed
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,8 @@ fn rustdoc<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoResult
// actually invoke rustc.
//
// In general users don't expect `cargo build` to cause rebuilds if you change
// directories. That could be if you just change directories in the project or
// if you literally move the whole project wholesale to a new directory. As a
// directories. That could be if you just change directories in the package or
// if you literally move the whole package wholesale to a new directory. As a
// result we mostly don't factor in `cwd` to this calculation. Instead we try to
// track the workspace as much as possible and we update the current directory
// of rustc/rustdoc where appropriate.
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ impl<'cfg> Workspace<'cfg> {
}

// Don't walk across `CARGO_HOME` when we're looking for the
// workspace root. Sometimes a project will be organized with
// workspace root. Sometimes a package will be organized with
// `CARGO_HOME` pointing inside of the workspace root or in the
// current project, but we don't want to mistakenly try to put
// current package, but we don't want to mistakenly try to put
// crates.io crates into the workspace by accident.
if self.config.home() == path {
break;
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ pub fn version() -> VersionInfo {
// There are two versions at play here:
// - version of cargo-the-binary, which you see when you type `cargo --version`
// - version of cargo-the-library, which you download from crates.io for use
// in your projects.
// in your packages.
//
// We want to make the `binary` version the same as the corresponding Rust/rustc release.
// At the same time, we want to keep the library version at `0.x`, because Cargo as
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct CleanOptions<'a> {
pub doc: bool,
}

/// Cleans the project from build artifacts.
/// Cleans the package's build artifacts.
pub fn clean(ws: &Workspace, opts: &CleanOptions) -> CargoResult<()> {
let target_dir = ws.target_dir();
let config = ws.config();
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/ops/cargo_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ fn install_one(
match pkg.manifest().edition() {
Edition::Edition2015 => config.shell().warn(
"Using `cargo install` to install the binaries for the \
project in current working directory is deprecated, \
package in current working directory is deprecated, \
use `cargo install --path .` instead. \
Use `cargo build` if you want to simply build the package.",
)?,
Edition::Edition2018 => bail!(
"Using `cargo install` to install the binaries for the \
project in current working directory is no longer supported, \
package in current working directory is no longer supported, \
use `cargo install --path .` instead. \
Use `cargo build` if you want to simply build the package."
),
Expand Down
36 changes: 18 additions & 18 deletions src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub enum VersionControl {
pub struct NewOptions {
pub version_control: Option<VersionControl>,
pub kind: NewProjectKind,
/// Absolute path to the directory for the new project
/// Absolute path to the directory for the new package
pub path: PathBuf,
pub name: Option<String>,
pub edition: Option<String>,
Expand Down Expand Up @@ -109,14 +109,14 @@ fn get_name<'a>(path: &'a Path, opts: &'a NewOptions) -> CargoResult<&'a str> {

let file_name = path.file_name().ok_or_else(|| {
format_err!(
"cannot auto-detect project name from path {:?} ; use --name to override",
"cannot auto-detect package name from path {:?} ; use --name to override",
path.as_os_str()
)
})?;

file_name.to_str().ok_or_else(|| {
format_err!(
"cannot create project with a non-unicode name: {:?}",
"cannot create package with a non-unicode name: {:?}",
file_name
)
})
Expand Down Expand Up @@ -174,12 +174,12 @@ fn check_name(name: &str, opts: &NewOptions) -> CargoResult<()> {
}

fn detect_source_paths_and_types(
project_path: &Path,
project_name: &str,
package_path: &Path,
package_name: &str,
detected_files: &mut Vec<SourceFileInformation>,
) -> CargoResult<()> {
let path = project_path;
let name = project_name;
let path = package_path;
let name = package_name;

enum H {
Bin,
Expand Down Expand Up @@ -233,20 +233,20 @@ fn detect_source_paths_and_types(
let sfi = match i.handling {
H::Bin => SourceFileInformation {
relative_path: pp,
target_name: project_name.to_string(),
target_name: package_name.to_string(),
bin: true,
},
H::Lib => SourceFileInformation {
relative_path: pp,
target_name: project_name.to_string(),
target_name: package_name.to_string(),
bin: false,
},
H::Detect => {
let content = paths::read(&path.join(pp.clone()))?;
let isbin = content.contains("fn main");
SourceFileInformation {
relative_path: pp,
target_name: project_name.to_string(),
target_name: package_name.to_string(),
bin: isbin,
}
}
Expand Down Expand Up @@ -276,7 +276,7 @@ cannot automatically generate Cargo.toml as the main target would be ambiguous",
} else {
if let Some(plp) = previous_lib_relpath {
bail!(
"cannot have a project with \
"cannot have a package with \
multiple libraries, \
found both `{}` and `{}`",
plp,
Expand All @@ -290,17 +290,17 @@ cannot automatically generate Cargo.toml as the main target would be ambiguous",
Ok(())
}

fn plan_new_source_file(bin: bool, project_name: String) -> SourceFileInformation {
fn plan_new_source_file(bin: bool, package_name: String) -> SourceFileInformation {
if bin {
SourceFileInformation {
relative_path: "src/main.rs".to_string(),
target_name: project_name,
target_name: package_name,
bin: true,
}
} else {
SourceFileInformation {
relative_path: "src/lib.rs".to_string(),
target_name: project_name,
target_name: package_name,
bin: false,
}
}
Expand Down Expand Up @@ -330,7 +330,7 @@ pub fn new(opts: &NewOptions, config: &Config) -> CargoResult<()> {

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

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

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

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

mk(config, &mkopts).chain_err(|| {
format_err!(
"Failed to create project `{}` at `{}`",
"Failed to create package `{}` at `{}`",
name,
path.display()
)
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_output_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct OutputMetadataOptions {
pub version: u32,
}

/// Loads the manifest, resolves the dependencies of the project to the concrete
/// Loads the manifest, resolves the dependencies of the package to the concrete
/// used versions - considering overrides - and writes all dependencies in a JSON
/// format to stdout.
pub fn output_metadata(ws: &Workspace, opt: &OutputMetadataOptions) -> CargoResult<ExportInfo> {
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn run(
)
} else {
bail!(
"`cargo run` requires that a project only have one \
"`cargo run` requires that a package only have one \
executable; use the `--bin` option to specify which one \
to run\navailable binaries: {}",
names.join(", ")
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn compile_tests<'a>(
Ok(compilation)
}

/// Run the unit and integration tests of a project.
/// Run the unit and integration tests of a package.
fn run_unit_tests(
options: &TestOptions,
test_args: &[String],
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/ops/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn check_version_control(opts: &FixOptions) -> CargoResult<()> {
}
let config = opts.compile_opts.config;
if !existing_vcs_repo(config.cwd(), config.cwd()) {
bail!("no VCS found for this project and `cargo fix` can potentially \
bail!("no VCS found for this package and `cargo fix` can potentially \
perform destructive changes; if you'd like to suppress this \
error pass `--allow-no-vcs`")
}
Expand Down Expand Up @@ -137,7 +137,7 @@ fn check_version_control(opts: &FixOptions) -> CargoResult<()> {
files_list.push_str(" (staged)\n");
}

bail!("the working directory of this project has uncommitted changes, and \
bail!("the working directory of this package has uncommitted changes, and \
`cargo fix` can potentially perform destructive changes; if you'd \
like to suppress this error pass `--allow-dirty`, `--allow-staged`, \
or commit the changes to these files:\n\
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/vcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use util::{process, CargoResult};

// Check if we are in an existing repo. We define that to be true if either:
//
// 1. We are in a git repo and the path to the new project is not an ignored
// 1. We are in a git repo and the path to the new package is not an ignored
// path in that repo.
// 2. We are in an HG repo.
pub fn existing_vcs_repo(path: &Path, cwd: &Path) -> bool {
Expand Down
10 changes: 5 additions & 5 deletions src/etc/_cargo
Original file line number Diff line number Diff line change
Expand Up @@ -426,20 +426,20 @@ esac
_cargo_cmds(){
local -a commands;commands=(
'bench:execute all benchmarks of a local package'
'build:compile the current project'
'check:check the current project without compiling'
'build:compile the current package'
'check:check the current package without compiling'
'clean:remove generated artifacts'
'doc:build package documentation'
'fetch:fetch package dependencies'
'generate-lockfile:create lockfile'
'git-checkout:git checkout'
'help:get help for commands'
'init:create new project in current directory'
'init:create new package in current directory'
'install:install a Rust binary'
'locate-project:print "Cargo.toml" location'
'login:login to remote server'
'metadata:the metadata for a project in json'
'new:create a new project'
'metadata:the metadata for a package in json'
'new:create a new package'
'owner:manage the owners of a crate on the registry'
'package:assemble local package into a distributable tarball'
'pkgid:print a fully qualified package specification'
Expand Down
2 changes: 1 addition & 1 deletion src/etc/man/cargo-build.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.hy
.SH NAME
.PP
cargo\-build \- Compile the current project
cargo\-build \- Compile the current package
.SH SYNOPSIS
.PP
\f[I]cargo build\f[] [OPTIONS]
Expand Down
Loading