Specifying MSRV in package now (#664)

* specifying MSRV in package now
This commit is contained in:
James Hodgkinson 2022-03-31 14:12:53 +10:00 committed by GitHub
parent 5cb429904d
commit 134235ef7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 23 additions and 20 deletions

View file

@ -16,7 +16,7 @@ The library documentation is [here](https://kanidm.github.io/kanidm/rustdoc/mast
### Minimum Supported Rust Version
The MSRV is specified [here](https://github.com/kanidm/kanidm/blob/master/profiles/RUST_MSRV).
The MSRV is specified in the package `Cargo.toml` files.
### Dependencies

View file

@ -2,6 +2,7 @@
name = "kanidm_client"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Kanidm Client Library"

View file

@ -128,9 +128,15 @@ impl KanidmClientBuilder {
}
// TODO #253: Handle these errors better, or at least provide diagnostics?
let mut f = File::open(ca_path).map_err(|e| {error!(?e);})?;
f.read_to_end(&mut buf).map_err(|e| {error!(?e);})?;
reqwest::Certificate::from_pem(&buf).map_err(|e| {error!(?e);})
let mut f = File::open(ca_path).map_err(|e| {
error!(?e);
})?;
f.read_to_end(&mut buf).map_err(|e| {
error!(?e);
})?;
reqwest::Certificate::from_pem(&buf).map_err(|e| {
error!(?e);
})
}
fn apply_config_options(self, kcc: KanidmClientConfig) -> Result<Self, ()> {

View file

@ -2,6 +2,7 @@
name = "kanidm_proto"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Kanidm Protocol Bindings for serde"

View file

@ -2,6 +2,7 @@
name = "kanidm_tools"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
default-run = "kanidm"
license = "MPL-2.0"

View file

@ -2,6 +2,7 @@
name = "kanidm_unix_int"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Kanidm Unix Integration Clients"

View file

@ -2,6 +2,7 @@
name = "nss_kanidm"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
[lib]

View file

@ -2,6 +2,7 @@
name = "pam_kanidm"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
[lib]

View file

@ -2,6 +2,7 @@
name = "pam_tester"
version = "0.1.2"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -2,6 +2,7 @@
name = "kanidm"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Kanidm Server Library and Binary"

View file

@ -2,6 +2,7 @@
name = "daemon"
version = "0.1.0"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Kanidm Server Daemon"

View file

@ -2,6 +2,7 @@
name = "score"
version = "0.1.0"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Kanidm Server Library and Binary"

View file

@ -2,6 +2,7 @@
name = "kanidmd_web_ui"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Kanidm Server Web User Interface"

View file

@ -2,6 +2,7 @@
name = "orca"
version = "1.1.0-alpha.7"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Orca - load testing for LDAP and Kanidm"

View file

@ -2,6 +2,7 @@
name = "profiles"
version = "1.1.0"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.59"
edition = "2021"
license = "MPL-2.0"
description = "Kanidm Build System Profiles"

View file

@ -1 +0,0 @@
1.59.0

View file

@ -3,11 +3,8 @@ use std::fs;
use std::path::PathBuf;
fn main() {
println!("cargo:rerun-if-changed=RUST_MSRV");
println!("cargo:rerun-if-env-changed=KANIDM_BUILD_PROFILE");
let rust_minver = include_str!("RUST_MSRV");
let profile = env::var("KANIDM_BUILD_PROFILE").unwrap_or_else(|_| "developer".to_string());
let profile_path: PathBuf = ["./", format!("{}.toml", profile).as_str()]
@ -23,5 +20,4 @@ fn main() {
println!("cargo:rustc-env=KANIDM_BUILD_PROFILE={}", profile);
println!("cargo:rustc-env=KANIDM_BUILD_PROFILE_TOML={}", contents);
println!("cargo:rustc-env=KANIDM_RUST_MSRV={}", rust_minver);
}

View file

@ -1,4 +1,3 @@
use rustc_version::{version, Version};
use serde::Deserialize;
use std::env;
@ -29,19 +28,9 @@ struct ProfileConfig {
}
pub fn apply_profile() {
println!("cargo:rerun-if-env-changed=KANIDM_RUST_MSRV");
println!("cargo:rerun-if-env-changed=KANIDM_BUILD_PROFILE");
println!("cargo:rerun-if-env-changed=KANIDM_BUILD_PROFILE_TOML");
// check to see if the rust version matches the rust minimum version we require for this build
let rust_minver = env!("KANIDM_RUST_MSRV");
let required_rust_ver = Version::parse(&rust_minver.replace("\n", "")).unwrap();
println!("Rust version: {}", version().unwrap());
println!("Required version: {}", required_rust_ver);
if version().unwrap() < required_rust_ver {
panic!("This crate requires rustc >= {}, quitting.", rust_minver);
}
// transform any requested paths for our server. We do this by reading
// our profile that we have been provided.
let profile = env!("KANIDM_BUILD_PROFILE");