mirror of https://github.com/rust-lang/cargo
Auto merge of #13004 - weihanglo:rust-1.74.0-bump-credential, r=ehuss
[stable-1.74] chore: bump `cargo-credential-*` crates as e58b84d
broke stuff
This commit is contained in:
commit
5c8a2842e0
|
@ -98,7 +98,7 @@ jobs:
|
|||
- name: Install cargo-semver-checks
|
||||
run: |
|
||||
mkdir installed-bins
|
||||
curl -Lf https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.22.1/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz \
|
||||
curl -Lf https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.24.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz \
|
||||
| tar -xz --directory=./installed-bins
|
||||
echo `pwd`/installed-bins >> $GITHUB_PATH
|
||||
- run: ci/validate-version-bump.sh
|
||||
|
|
|
@ -334,7 +334,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cargo-credential-libsecret"
|
||||
version = "0.3.2"
|
||||
version = "0.4.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo-credential",
|
||||
|
@ -343,7 +343,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cargo-credential-macos-keychain"
|
||||
version = "0.3.1"
|
||||
version = "0.4.0"
|
||||
dependencies = [
|
||||
"cargo-credential",
|
||||
"security-framework",
|
||||
|
@ -351,7 +351,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cargo-credential-wincred"
|
||||
version = "0.3.1"
|
||||
version = "0.4.0"
|
||||
dependencies = [
|
||||
"cargo-credential",
|
||||
"windows-sys",
|
||||
|
|
|
@ -23,9 +23,9 @@ base64 = "0.21.3"
|
|||
bytesize = "1.3"
|
||||
cargo = { path = "" }
|
||||
cargo-credential = { version = "0.4.0", path = "credential/cargo-credential" }
|
||||
cargo-credential-libsecret = { version = "0.3.1", path = "credential/cargo-credential-libsecret" }
|
||||
cargo-credential-wincred = { version = "0.3.0", path = "credential/cargo-credential-wincred" }
|
||||
cargo-credential-macos-keychain = { version = "0.3.0", path = "credential/cargo-credential-macos-keychain" }
|
||||
cargo-credential-libsecret = { version = "0.4.0", path = "credential/cargo-credential-libsecret" }
|
||||
cargo-credential-wincred = { version = "0.4.0", path = "credential/cargo-credential-wincred" }
|
||||
cargo-credential-macos-keychain = { version = "0.4.0", path = "credential/cargo-credential-macos-keychain" }
|
||||
cargo-platform = { path = "crates/cargo-platform", version = "0.1.4" }
|
||||
cargo-test-macro = { path = "crates/cargo-test-macro" }
|
||||
cargo-test-support = { path = "crates/cargo-test-support" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "cargo-credential-libsecret"
|
||||
version = "0.3.2"
|
||||
version = "0.4.0"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository = "https://github.com/rust-lang/cargo"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "cargo-credential-macos-keychain"
|
||||
version = "0.3.1"
|
||||
version = "0.4.0"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository = "https://github.com/rust-lang/cargo"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "cargo-credential-wincred"
|
||||
version = "0.3.1"
|
||||
version = "0.4.0"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository = "https://github.com/rust-lang/cargo"
|
||||
|
|
|
@ -10,10 +10,6 @@ use std::collections::HashMap;
|
|||
use std::num::NonZeroU64;
|
||||
use tracing::debug;
|
||||
|
||||
pub use super::encode::Metadata;
|
||||
pub use super::encode::{EncodableDependency, EncodablePackageId, EncodableResolve};
|
||||
pub use super::resolve::Resolve;
|
||||
|
||||
// A `Context` is basically a bunch of local resolution information which is
|
||||
// kept around for all `BacktrackFrame` instances. As a result, this runs the
|
||||
// risk of being cloned *a lot* so we want to make this as cheap to clone as
|
||||
|
|
|
@ -411,92 +411,6 @@ fn linker() {
|
|||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test(nightly, reason = "plugins are unstable")]
|
||||
fn plugin_with_extra_dylib_dep() {
|
||||
if cross_compile::disabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
let foo = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[dependencies.bar]
|
||||
path = "../bar"
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"src/main.rs",
|
||||
r#"
|
||||
#![feature(plugin)]
|
||||
#![plugin(bar)]
|
||||
|
||||
fn main() {}
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
let _bar = project()
|
||||
.at("bar")
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "bar"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
name = "bar"
|
||||
plugin = true
|
||||
|
||||
[dependencies.baz]
|
||||
path = "../baz"
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
r#"
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate baz;
|
||||
extern crate rustc_driver;
|
||||
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
#[no_mangle]
|
||||
pub fn __rustc_plugin_registrar(reg: &mut Registry) {
|
||||
println!("{}", baz::baz());
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
let _baz = project()
|
||||
.at("baz")
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "baz"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
name = "baz"
|
||||
crate_type = ["dylib"]
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "pub fn baz() -> i32 { 1 }")
|
||||
.build();
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
foo.cargo("build --target").arg(&target).run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn cross_tests() {
|
||||
if !cross_compile::can_run_on_host() {
|
||||
|
|
|
@ -131,7 +131,6 @@ mod patch;
|
|||
mod path;
|
||||
mod paths;
|
||||
mod pkgid;
|
||||
mod plugins;
|
||||
mod proc_macro;
|
||||
mod profile_config;
|
||||
mod profile_custom;
|
||||
|
|
|
@ -1,421 +0,0 @@
|
|||
//! Tests for rustc plugins.
|
||||
|
||||
use cargo_test_support::rustc_host;
|
||||
use cargo_test_support::{basic_manifest, project};
|
||||
|
||||
#[cargo_test(nightly, reason = "plugins are unstable")]
|
||||
fn plugin_to_the_max() {
|
||||
let foo = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
name = "foo_lib"
|
||||
|
||||
[dependencies.bar]
|
||||
path = "../bar"
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"src/main.rs",
|
||||
r#"
|
||||
#![feature(plugin)]
|
||||
#![plugin(bar)]
|
||||
extern crate foo_lib;
|
||||
|
||||
fn main() { foo_lib::foo(); }
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"src/foo_lib.rs",
|
||||
r#"
|
||||
#![feature(plugin)]
|
||||
#![plugin(bar)]
|
||||
|
||||
pub fn foo() {}
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
let _bar = project()
|
||||
.at("bar")
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "bar"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
name = "bar"
|
||||
plugin = true
|
||||
|
||||
[dependencies.baz]
|
||||
path = "../baz"
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
r#"
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate baz;
|
||||
extern crate rustc_driver;
|
||||
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
#[no_mangle]
|
||||
pub fn __rustc_plugin_registrar(_reg: &mut Registry) {
|
||||
println!("{}", baz::baz());
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
let _baz = project()
|
||||
.at("baz")
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "baz"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
name = "baz"
|
||||
crate_type = ["dylib"]
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "pub fn baz() -> i32 { 1 }")
|
||||
.build();
|
||||
|
||||
foo.cargo("build").run();
|
||||
foo.cargo("doc").run();
|
||||
}
|
||||
|
||||
#[cargo_test(nightly, reason = "plugins are unstable")]
|
||||
fn plugin_with_dynamic_native_dependency() {
|
||||
let build = project()
|
||||
.at("builder")
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "builder"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
name = "builder"
|
||||
crate-type = ["dylib"]
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "#[no_mangle] pub extern fn foo() {}")
|
||||
.build();
|
||||
|
||||
let foo = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[dependencies.bar]
|
||||
path = "bar"
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"src/main.rs",
|
||||
r#"
|
||||
#![feature(plugin)]
|
||||
#![plugin(bar)]
|
||||
|
||||
fn main() {}
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"bar/Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "bar"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
build = 'build.rs'
|
||||
|
||||
[lib]
|
||||
name = "bar"
|
||||
plugin = true
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"bar/build.rs",
|
||||
r#"
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
let root = PathBuf::from(env::var("BUILDER_ROOT").unwrap());
|
||||
let file = format!("{}builder{}",
|
||||
env::consts::DLL_PREFIX,
|
||||
env::consts::DLL_SUFFIX);
|
||||
let src = root.join(&file);
|
||||
let dst = out_dir.join(&file);
|
||||
fs::copy(src, dst).unwrap();
|
||||
if cfg!(target_env = "msvc") {
|
||||
fs::copy(root.join("builder.dll.lib"),
|
||||
out_dir.join("builder.dll.lib")).unwrap();
|
||||
}
|
||||
println!("cargo:rustc-flags=-L {}", out_dir.display());
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"bar/src/lib.rs",
|
||||
r#"
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_driver;
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
#[cfg_attr(not(target_env = "msvc"), link(name = "builder"))]
|
||||
#[cfg_attr(target_env = "msvc", link(name = "builder.dll"))]
|
||||
extern { fn foo(); }
|
||||
|
||||
#[no_mangle]
|
||||
pub fn __rustc_plugin_registrar(_reg: &mut Registry) {
|
||||
unsafe { foo() }
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
|
||||
build.cargo("build").run();
|
||||
|
||||
let root = build.root().join("target").join("debug");
|
||||
foo.cargo("build -v").env("BUILDER_ROOT", root).run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn plugin_integration() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
build = "build.rs"
|
||||
|
||||
[lib]
|
||||
name = "foo"
|
||||
plugin = true
|
||||
doctest = false
|
||||
"#,
|
||||
)
|
||||
.file("build.rs", "fn main() {}")
|
||||
.file("src/lib.rs", "")
|
||||
.file("tests/it_works.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("test -v").run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn doctest_a_plugin() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[dependencies]
|
||||
bar = { path = "bar" }
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "#[macro_use] extern crate bar;")
|
||||
.file(
|
||||
"bar/Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "bar"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
name = "bar"
|
||||
plugin = true
|
||||
"#,
|
||||
)
|
||||
.file("bar/src/lib.rs", "pub fn bar() {}")
|
||||
.build();
|
||||
|
||||
p.cargo("test -v").run();
|
||||
}
|
||||
|
||||
// See #1515
|
||||
#[cargo_test]
|
||||
fn native_plugin_dependency_with_custom_linker() {
|
||||
let target = rustc_host();
|
||||
|
||||
let _foo = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
plugin = true
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
let bar = project()
|
||||
.at("bar")
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "bar"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[dependencies.foo]
|
||||
path = "../foo"
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "")
|
||||
.file(
|
||||
".cargo/config",
|
||||
&format!(
|
||||
r#"
|
||||
[target.{}]
|
||||
linker = "nonexistent-linker"
|
||||
"#,
|
||||
target
|
||||
),
|
||||
)
|
||||
.build();
|
||||
|
||||
bar.cargo("build --verbose")
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
[RUNNING] `rustc [..] -C linker=nonexistent-linker [..]`
|
||||
[ERROR] [..]linker[..]
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test(nightly, reason = "requires rustc_private")]
|
||||
fn panic_abort_plugins() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[profile.dev]
|
||||
panic = 'abort'
|
||||
|
||||
[dependencies]
|
||||
bar = { path = "bar" }
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "")
|
||||
.file(
|
||||
"bar/Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "bar"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
plugin = true
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"bar/src/lib.rs",
|
||||
r#"
|
||||
#![feature(rustc_private)]
|
||||
extern crate rustc_ast;
|
||||
extern crate rustc_driver;
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
|
||||
p.cargo("build").run();
|
||||
}
|
||||
|
||||
#[cargo_test(nightly, reason = "requires rustc_private")]
|
||||
fn shared_panic_abort_plugins() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[profile.dev]
|
||||
panic = 'abort'
|
||||
|
||||
[dependencies]
|
||||
bar = { path = "bar" }
|
||||
baz = { path = "baz" }
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "extern crate baz;")
|
||||
.file(
|
||||
"bar/Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "bar"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
plugin = true
|
||||
|
||||
[dependencies]
|
||||
baz = { path = "../baz" }
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"bar/src/lib.rs",
|
||||
r#"
|
||||
#![feature(rustc_private)]
|
||||
extern crate rustc_ast;
|
||||
extern crate rustc_driver;
|
||||
extern crate baz;
|
||||
"#,
|
||||
)
|
||||
.file("baz/Cargo.toml", &basic_manifest("baz", "0.0.1"))
|
||||
.file("baz/src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("build -v").run();
|
||||
}
|
|
@ -202,52 +202,6 @@ fn impl_and_derive() {
|
|||
p.cargo("run").with_stdout("X { success: true }").run();
|
||||
}
|
||||
|
||||
#[cargo_test(nightly, reason = "plugins are unstable")]
|
||||
fn plugin_and_proc_macro() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[lib]
|
||||
plugin = true
|
||||
proc-macro = true
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
r#"
|
||||
#![feature(rustc_private)]
|
||||
#![feature(proc_macro, proc_macro_lib)]
|
||||
|
||||
extern crate rustc_driver;
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
extern crate proc_macro;
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[no_mangle]
|
||||
pub fn __rustc_plugin_registrar(reg: &mut Registry) {}
|
||||
|
||||
#[proc_macro_derive(Questionable)]
|
||||
pub fn questionable(input: TokenStream) -> TokenStream {
|
||||
input
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
|
||||
let msg = " `lib.plugin` and `lib.proc-macro` cannot both be `true`";
|
||||
p.cargo("check")
|
||||
.with_status(101)
|
||||
.with_stderr_contains(msg)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn proc_macro_doctest() {
|
||||
let foo = project()
|
||||
|
|
Loading…
Reference in New Issue