Skip to content

Commit

Permalink
Merge pull request #2433 from containers/cargo-deps
Browse files Browse the repository at this point in the history
Update cargo dependencies
  • Loading branch information
openshift-merge-bot[bot] authored Oct 9, 2024
2 parents 05dd729 + f84b77e commit af15cf0
Show file tree
Hide file tree
Showing 366 changed files with 8,451 additions and 3,665 deletions.
2 changes: 1 addition & 1 deletion .cargo-vendor/autocfg/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.lock":"8e60b691c883629c1e19c8dad7c4c18cded1a85c2e8f2e2a77e7a96957f865a7","Cargo.toml":"f8c2d5675773b7ddff8801c3c17ff9d26e9632fe2027a6b81ceb7bda67d71bfd","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"27995d58ad5c1145c1a8cd86244ce844886958a35eb2b78c6b772748669999ac","README.md":"51238410cbbb06b149a794d954ff4d5943da566a97e71dc3aa8b5fa5a9b538b6","examples/integers.rs":"589ff4271566dfa322becddf3e2c7b592e6e0bc97b02892ce75619b7e452e930","examples/nightly.rs":"ac8b5a9aa1e04465e44f5053b3c899b635e07af058c73aa8b45176bf4b5912f9","examples/paths.rs":"1b30e466b824ce8df7ad0a55334424131d9d2573d6cf9f7d5d50c09c8901d526","examples/traits.rs":"cbee6a3e1f7db60b02ae25b714926517144a77cb492021f492774cf0e1865a9e","examples/versions.rs":"38535e6d9f5bfae0de474a3db79a40e8f5da8ba9334c5ff4c363de9bc99d4d12","src/error.rs":"fd8ff67c64f7cd1b9f81325a81de4baa34c39d6ae298bdb33f9829cc91acac39","src/lib.rs":"7b00cd501b52bab797bf047ada2a446e16fc2b8b05567670d8b8b7ada3179f55","src/rustc.rs":"a8a213ddb64a05c1a1af933bcb331a98879e942b167c33d8f94f9f60ebb14e29","src/tests.rs":"594a1cff6fef4a0f8b5f962a668fda4030db5005f37f01eeb06d692fc48a60df","src/version.rs":"4f7d23b36f01c7be1871be86c038d6cb4689e145d67c82d3793690e9aa05b133","tests/no_std.rs":"cc5619466c6e955552f30ed2f80ba8ddf45c3d5d257f628f54dedc0da978f6aa","tests/rustflags.rs":"5c8169b88216055019db61b5d7baf4abdf675e3b14b54f5037bb1e3acd0a5d3f","tests/wrap_ignored":"a9e241edf584a0702066b25bc15c5bbfd8a1019e14fb655fc4f47a67360065ca","tests/wrappers.rs":"e8eb0eb5ac28ecd9e3473b5ddc321b1d4d523a6fb0c072255ac37d40674aa35c"},"package":"0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"}
{"files":{"Cargo.lock":"c53e68eabea3d0b6dbc762cdc0c0bd105a7ac97c76e0b8c5f492d0b94074469c","Cargo.toml":"624e428251fce7244aa71fe7764c1556bc8077ee4579ad7e5803cc8a74061673","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"27995d58ad5c1145c1a8cd86244ce844886958a35eb2b78c6b772748669999ac","README.md":"21308cfaaea9e841e01a43b7ec77304c1daeea8d0e3ec8fe5022d8e56acc4eb2","examples/integers.rs":"589ff4271566dfa322becddf3e2c7b592e6e0bc97b02892ce75619b7e452e930","examples/nightly.rs":"ac8b5a9aa1e04465e44f5053b3c899b635e07af058c73aa8b45176bf4b5912f9","examples/paths.rs":"1b30e466b824ce8df7ad0a55334424131d9d2573d6cf9f7d5d50c09c8901d526","examples/traits.rs":"cbee6a3e1f7db60b02ae25b714926517144a77cb492021f492774cf0e1865a9e","examples/versions.rs":"38535e6d9f5bfae0de474a3db79a40e8f5da8ba9334c5ff4c363de9bc99d4d12","src/error.rs":"fd8ff67c64f7cd1b9f81325a81de4baa34c39d6ae298bdb33f9829cc91acac39","src/lib.rs":"b40828305eb18bcaad11608fbbf82d97fe381803fbf1b89a1511f0675ba49e6c","src/rustc.rs":"a8a213ddb64a05c1a1af933bcb331a98879e942b167c33d8f94f9f60ebb14e29","src/tests.rs":"b39f4d880ad343e65307a9e0c381954ea27adce4732f825516ce7952e2e5a91d","src/version.rs":"4f7d23b36f01c7be1871be86c038d6cb4689e145d67c82d3793690e9aa05b133","tests/no_std.rs":"18859dc4992fe1769887bde05f03d28f1ce524eafd17646d3fbcb4379422761a","tests/rustflags.rs":"e8ded4d57ba25379a38ab48456d67df14f82abbbb5f6bb66221c6decbcb517a3","tests/support/mod.rs":"32087d365b438ac3f62df9bb066d8d648b80cb130a5c777afcb2f21fbb68d88e","tests/tests.rs":"abd41a6a937ee58d7dcb541384705f87ec47294f6af6dab821441d50fd66ee7d","tests/wrap_ignored":"a9e241edf584a0702066b25bc15c5bbfd8a1019e14fb655fc4f47a67360065ca","tests/wrappers.rs":"b5137fe36768eaef277fb8650b0fe45b2c675d9e60b1b49d39f2ec95082c285b"},"package":"ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"}
5 changes: 2 additions & 3 deletions .cargo-vendor/autocfg/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 46 additions & 1 deletion .cargo-vendor/autocfg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
[package]
rust-version = "1.0"
name = "autocfg"
version = "1.3.0"
version = "1.4.0"
authors = ["Josh Stone <[email protected]>"]
build = false
exclude = ["/.github/**"]
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Automatic cfg for Rust compiler features"
documentation = "https://docs.rs/autocfg/"
readme = "README.md"
Expand All @@ -27,4 +32,44 @@ categories = ["development-tools::build-utils"]
license = "Apache-2.0 OR MIT"
repository = "https://github.com/cuviper/autocfg"

[lib]
name = "autocfg"
path = "src/lib.rs"

[[example]]
name = "integers"
path = "examples/integers.rs"

[[example]]
name = "nightly"
path = "examples/nightly.rs"

[[example]]
name = "paths"
path = "examples/paths.rs"

[[example]]
name = "traits"
path = "examples/traits.rs"

[[example]]
name = "versions"
path = "examples/versions.rs"

[[test]]
name = "no_std"
path = "tests/no_std.rs"

[[test]]
name = "rustflags"
path = "tests/rustflags.rs"

[[test]]
name = "tests"
path = "tests/tests.rs"

[[test]]
name = "wrappers"
path = "tests/wrappers.rs"

[dependencies]
7 changes: 7 additions & 0 deletions .cargo-vendor/autocfg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ should only be used when the compiler supports it.

## Release Notes

- 1.4.0 (2024-09-26)

- Add `emit_possibility` for Rust 1.80's [checked cfgs], and call that
automatically for methods that conditionally `emit`, by @Techcable.

[checked cfgs]: https://blog.rust-lang.org/2024/05/06/check-cfg.html

- 1.3.0 (2024-05-03)

- Add `probe_raw` for direct control of the code that will be test-compiled.
Expand Down
87 changes: 71 additions & 16 deletions .cargo-vendor/autocfg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
//!
//! fn main() {
//! # // Normally, cargo will set `OUT_DIR` for build scripts.
//! # std::env::set_var("OUT_DIR", "target");
//! # let exe = std::env::current_exe().unwrap();
//! # std::env::set_var("OUT_DIR", exe.parent().unwrap());
//! let ac = autocfg::new();
//! ac.emit_has_type("i128");
//!
Expand Down Expand Up @@ -91,13 +92,20 @@ pub struct AutoCfg {
target: Option<OsString>,
no_std: bool,
rustflags: Vec<String>,
uuid: u64,
}

/// Writes a config flag for rustc on standard out.
///
/// This looks like: `cargo:rustc-cfg=CFG`
///
/// Cargo will use this in arguments to rustc, like `--cfg CFG`.
///
/// This does not automatically call [`emit_possibility`]
/// so the compiler my generate an [`unexpected_cfgs` warning][check-cfg-flags].
/// However, all the builtin emit methods on [`AutoCfg`] call [`emit_possibility`] automatically.
///
/// [check-cfg-flags]: https://blog.rust-lang.org/2024/05/06/check-cfg.html
pub fn emit(cfg: &str) {
println!("cargo:rustc-cfg={}", cfg);
}
Expand All @@ -123,6 +131,25 @@ pub fn rerun_env(var: &str) {
println!("cargo:rerun-if-env-changed={}", var);
}

/// Indicates to rustc that a config flag should not generate an [`unexpected_cfgs` warning][check-cfg-flags]
///
/// This looks like `cargo:rustc-check-cfg=cfg(VAR)`
///
/// As of rust 1.80, the compiler does [automatic checking of cfgs at compile time][check-cfg-flags].
/// All custom configuration flags must be known to rustc, or they will generate a warning.
/// This is done automatically when calling the builtin emit methods on [`AutoCfg`],
/// but not when calling [`autocfg::emit`](crate::emit) directly.
///
/// Versions before rust 1.80 will simply ignore this directive.
///
/// This function indicates to the compiler that the config flag never has a value.
/// If this is not desired, see [the blog post][check-cfg].
///
/// [check-cfg-flags]: https://blog.rust-lang.org/2024/05/06/check-cfg.html
pub fn emit_possibility(cfg: &str) {
println!("cargo:rustc-check-cfg=cfg({})", cfg);
}

/// Creates a new `AutoCfg` instance.
///
/// # Panics
Expand Down Expand Up @@ -176,6 +203,7 @@ impl AutoCfg {
rustc_version: rustc_version,
target: target,
no_std: false,
uuid: new_uuid(),
};

// Sanity check with and without `std`.
Expand Down Expand Up @@ -227,21 +255,27 @@ impl AutoCfg {
/// Sets a `cfg` value of the form `rustc_major_minor`, like `rustc_1_29`,
/// if the current `rustc` is at least that version.
pub fn emit_rustc_version(&self, major: usize, minor: usize) {
let cfg_flag = format!("rustc_{}_{}", major, minor);
emit_possibility(&cfg_flag);
if self.probe_rustc_version(major, minor) {
emit(&format!("rustc_{}_{}", major, minor));
emit(&cfg_flag);
}
}

fn probe_fmt<'a>(&self, source: Arguments<'a>) -> Result<(), Error> {
/// Returns a new (hopefully unique) crate name for probes.
fn new_crate_name(&self) -> String {
#[allow(deprecated)]
static ID: AtomicUsize = ATOMIC_USIZE_INIT;

let id = ID.fetch_add(1, Ordering::Relaxed);
format!("autocfg_{:016x}_{}", self.uuid, id)
}

fn probe_fmt<'a>(&self, source: Arguments<'a>) -> Result<(), Error> {
let mut command = self.rustc.command();
command
.arg("--crate-name")
.arg(format!("probe{}", id))
.arg(self.new_crate_name())
.arg("--crate-type=lib")
.arg("--out-dir")
.arg(&self.out_dir)
Expand Down Expand Up @@ -291,7 +325,8 @@ impl AutoCfg {
/// ```
/// # extern crate autocfg;
/// # // Normally, cargo will set `OUT_DIR` for build scripts.
/// # std::env::set_var("OUT_DIR", "target");
/// # let exe = std::env::current_exe().unwrap();
/// # std::env::set_var("OUT_DIR", exe.parent().unwrap());
/// let ac = autocfg::new();
/// assert!(ac.probe_raw("#![no_builtins]").is_ok());
/// ```
Expand All @@ -306,7 +341,8 @@ impl AutoCfg {
/// ```
/// # extern crate autocfg;
/// # // Normally, cargo will set `OUT_DIR` for build scripts.
/// # std::env::set_var("OUT_DIR", "target");
/// # let exe = std::env::current_exe().unwrap();
/// # std::env::set_var("OUT_DIR", exe.parent().unwrap());
/// let ac = autocfg::new();
/// let code = r#"
/// #![feature(slice_group_by)]
Expand Down Expand Up @@ -336,8 +372,10 @@ impl AutoCfg {

/// Emits a config value `has_CRATE` if `probe_sysroot_crate` returns true.
pub fn emit_sysroot_crate(&self, name: &str) {
let cfg_flag = format!("has_{}", mangle(name));
emit_possibility(&cfg_flag);
if self.probe_sysroot_crate(name) {
emit(&format!("has_{}", mangle(name)));
emit(&cfg_flag);
}
}

Expand All @@ -357,13 +395,12 @@ impl AutoCfg {
/// Any non-identifier characters in the `path` will be replaced with
/// `_` in the generated config value.
pub fn emit_has_path(&self, path: &str) {
if self.probe_path(path) {
emit(&format!("has_{}", mangle(path)));
}
self.emit_path_cfg(path, &format!("has_{}", mangle(path)));
}

/// Emits the given `cfg` value if `probe_path` returns true.
pub fn emit_path_cfg(&self, path: &str, cfg: &str) {
emit_possibility(cfg);
if self.probe_path(path) {
emit(cfg);
}
Expand All @@ -385,13 +422,12 @@ impl AutoCfg {
/// Any non-identifier characters in the trait `name` will be replaced with
/// `_` in the generated config value.
pub fn emit_has_trait(&self, name: &str) {
if self.probe_trait(name) {
emit(&format!("has_{}", mangle(name)));
}
self.emit_trait_cfg(name, &format!("has_{}", mangle(name)));
}

/// Emits the given `cfg` value if `probe_trait` returns true.
pub fn emit_trait_cfg(&self, name: &str, cfg: &str) {
emit_possibility(cfg);
if self.probe_trait(name) {
emit(cfg);
}
Expand All @@ -413,13 +449,12 @@ impl AutoCfg {
/// Any non-identifier characters in the type `name` will be replaced with
/// `_` in the generated config value.
pub fn emit_has_type(&self, name: &str) {
if self.probe_type(name) {
emit(&format!("has_{}", mangle(name)));
}
self.emit_type_cfg(name, &format!("has_{}", mangle(name)));
}

/// Emits the given `cfg` value if `probe_type` returns true.
pub fn emit_type_cfg(&self, name: &str, cfg: &str) {
emit_possibility(cfg);
if self.probe_type(name) {
emit(cfg);
}
Expand All @@ -438,6 +473,7 @@ impl AutoCfg {

/// Emits the given `cfg` value if `probe_expression` returns true.
pub fn emit_expression_cfg(&self, expr: &str, cfg: &str) {
emit_possibility(cfg);
if self.probe_expression(expr) {
emit(cfg);
}
Expand All @@ -456,6 +492,7 @@ impl AutoCfg {

/// Emits the given `cfg` value if `probe_constant` returns true.
pub fn emit_constant_cfg(&self, expr: &str, cfg: &str) {
emit_possibility(cfg);
if self.probe_constant(expr) {
emit(cfg);
}
Expand Down Expand Up @@ -533,3 +570,21 @@ fn rustflags(target: &Option<OsString>, dir: &Path) -> Vec<String> {

Vec::new()
}

/// Generates a numeric ID to use in probe crate names.
///
/// This attempts to be random, within the constraints of Rust 1.0 and no dependencies.
fn new_uuid() -> u64 {
const FNV_OFFSET_BASIS: u64 = 0xcbf2_9ce4_8422_2325;
const FNV_PRIME: u64 = 0x100_0000_01b3;

// This set should have an actual random hasher.
let set: std::collections::HashSet<u64> = (0..256).collect();

// Feed the `HashSet`-shuffled order into FNV-1a.
let mut hash: u64 = FNV_OFFSET_BASIS;
for x in set {
hash = (hash ^ x).wrapping_mul(FNV_PRIME);
}
hash
}
Loading

0 comments on commit af15cf0

Please sign in to comment.