Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ pub fn init(opts: &NewOptions, gctx: &GlobalContext) -> CargoResult<NewProjectKi
detect_source_paths_and_types(path, name, &mut src_paths_types)?;
let kind = calculate_new_project_kind(opts.kind, opts.auto_detect_kind, &src_paths_types);
gctx.shell()
.status("Creating", format!("{} package", opts.kind))?;
.status("Creating", format!("{} package", kind))?;

if path.join("Cargo.toml").exists() {
anyhow::bail!(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 23 additions & 7 deletions tests/testsuite/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,16 @@ fn simple_install() {
cargo_process("install bar")
.with_stderr_data(str![[r#"
[INSTALLING] bar v0.1.0
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
|
= [HELP] use `cargo +stable install` if you meant to use the stable toolchain
= [NOTE] rustup selects the toolchain based on the parent environment and not the environment of the package being installed
[LOCKING] 1 package to latest compatible version
[COMPILING] foo v0.0.1
[COMPILING] bar v0.1.0
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[INSTALLING] [..]bar[..]
[INSTALLED] package `bar v0.1.0` (executable `bar[EXE]`)
[INSTALLING] [ROOT]/home/.cargo/bin/bar
[INSTALLED] package `bar v0.1.0` (executable `bar`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries

"#]])
Expand Down Expand Up @@ -192,7 +196,11 @@ fn simple_install_fail() {
.with_status(101)
.with_stderr_data(str![[r#"
[INSTALLING] bar v0.1.0
[ERROR] failed to compile `bar v0.1.0`, intermediate artifacts can be found at `[..]`.
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
|
= [HELP] use `cargo +stable install` if you meant to use the stable toolchain
= [NOTE] rustup selects the toolchain based on the parent environment and not the environment of the package being installed
[ERROR] failed to compile `bar v0.1.0`, intermediate artifacts can be found at `/var/folders/78/tfh4ck1s0nv0h4ztpq0l8x8m0000gn/T/cargo-installBoQ1KK`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_BUILD_BUILD_DIR` to that path.

Caused by:
Expand Down Expand Up @@ -241,12 +249,16 @@ fn install_without_feature_dep() {
cargo_process("install bar")
.with_stderr_data(str![[r#"
[INSTALLING] bar v0.1.0
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
|
= [HELP] use `cargo +stable install` if you meant to use the stable toolchain
= [NOTE] rustup selects the toolchain based on the parent environment and not the environment of the package being installed
[LOCKING] 1 package to latest compatible version
[COMPILING] foo v0.0.1
[COMPILING] bar v0.1.0
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[INSTALLING] [..]bar[..]
[INSTALLED] package `bar v0.1.0` (executable `bar[EXE]`)
[INSTALLING] [ROOT]/home/.cargo/bin/bar
[INSTALLED] package `bar v0.1.0` (executable `bar`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries

"#]])
Expand Down Expand Up @@ -770,13 +782,17 @@ fn version_missing() {
cargo_process("install bar")
.with_stderr_data(str![[r#"
[INSTALLING] bar v0.1.0
[ERROR] failed to compile [..], intermediate artifacts can be found at `[..]`.
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
|
= [HELP] use `cargo +stable install` if you meant to use the stable toolchain
= [NOTE] rustup selects the toolchain based on the parent environment and not the environment of the package being installed
[ERROR] failed to compile `bar v0.1.0`, intermediate artifacts can be found at `/var/folders/78/tfh4ck1s0nv0h4ztpq0l8x8m0000gn/T/cargo-installri16vj`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_BUILD_BUILD_DIR` to that path.

Caused by:
failed to select a version for the requirement `foo = "^2"`
candidate versions found which didn't match: 0.0.1
location searched: directory source `[..] (which is replacing registry `[..]`)
location searched: directory source `[ROOT]/index` (which is replacing registry `crates-io`)
required by package `bar v0.1.0`
perhaps a crate was updated and forgotten to be re-vendored?

Expand Down
16 changes: 12 additions & 4 deletions tests/testsuite/feature_unification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,15 @@ fn cargo_install_ignores_config() {
.env("CARGO_RESOLVER_FEATURE_UNIFICATION", "workspace")
.with_stderr_data(str![[r#"
[INSTALLING] a v0.1.0 ([ROOT]/foo)
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
|
= [HELP] use `cargo +stable install` if you meant to use the stable toolchain
= [NOTE] rustup selects the toolchain based on the parent environment and not the environment of the package being installed
[COMPILING] common v0.1.0 ([ROOT]/foo/common)
[COMPILING] a v0.1.0 ([ROOT]/foo)
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[INSTALLING] [ROOT]/home/.cargo/bin/a[EXE]
[INSTALLED] package `a v0.1.0 ([ROOT]/foo)` (executable `a[EXE]`)
[INSTALLING] [ROOT]/home/.cargo/bin/a
[INSTALLED] package `a v0.1.0 ([ROOT]/foo)` (executable `a`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries

"#]])
Expand All @@ -916,9 +920,13 @@ fn cargo_install_ignores_config() {
.env("CARGO_RESOLVER_FEATURE_UNIFICATION", "package")
.with_stderr_data(str![[r#"
[INSTALLING] a v0.1.0 ([ROOT]/foo)
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
|
= [HELP] use `cargo +stable install` if you meant to use the stable toolchain
= [NOTE] rustup selects the toolchain based on the parent environment and not the environment of the package being installed
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[REPLACING] [ROOT]/home/.cargo/bin/a[EXE]
[REPLACED] package `a v0.1.0 ([ROOT]/foo)` with `a v0.1.0 ([ROOT]/foo)` (executable `a[EXE]`)
[REPLACING] [ROOT]/home/.cargo/bin/a
[REPLACED] package `a v0.1.0 ([ROOT]/foo)` with `a v0.1.0 ([ROOT]/foo)` (executable `a`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries

"#]])
Expand Down
16 changes: 12 additions & 4 deletions tests/testsuite/glob_targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,14 @@ fn install_example() {
.cargo("install --path . --example 'ex*1'")
.with_stderr_data(str![[r#"
[INSTALLING] foo v0.0.1 ([ROOT]/foo)
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
|
= [HELP] use `cargo +stable install` if you meant to use the stable toolchain
= [NOTE] rustup selects the toolchain based on the parent environment and not the environment of the package being installed
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[INSTALLING] [ROOT]/home/.cargo/bin/example1[EXE]
[INSTALLED] package `foo v0.0.1 ([ROOT]/foo)` (executable `example1[EXE]`)
[INSTALLING] [ROOT]/home/.cargo/bin/example1
[INSTALLED] package `foo v0.0.1 ([ROOT]/foo)` (executable `example1`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries

"#]])
Expand All @@ -367,10 +371,14 @@ fn install_bin() {
.cargo("install --path . --bin 'bi*1'")
.with_stderr_data(str![[r#"
[INSTALLING] foo v0.0.1 ([ROOT]/foo)
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
|
= [HELP] use `cargo +stable install` if you meant to use the stable toolchain
= [NOTE] rustup selects the toolchain based on the parent environment and not the environment of the package being installed
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[INSTALLING] [ROOT]/home/.cargo/bin/bin1[EXE]
[INSTALLED] package `foo v0.0.1 ([ROOT]/foo)` (executable `bin1[EXE]`)
[INSTALLING] [ROOT]/home/.cargo/bin/bin1
[INSTALLED] package `foo v0.0.1 ([ROOT]/foo)` (executable `bin1`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries

"#]])
Expand Down
Loading
Loading