Skip to content

Commit cbe7515

Browse files
committed
temp: review changes
1 parent de059c9 commit cbe7515

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

binary/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name = "system-deps-binary"
33
version = "0.1.0"
44
edition = "2021"
5-
links = "system-deps-binary"
65

76
[build-dependencies]
87
system-deps-meta = { path = "../meta" }

binary/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn paths() -> HashMap<String, Vec<PathBuf>> {
115115
let mut follow_list = HashMap::new();
116116

117117
// Global overrides from environment
118-
// TODO: This need to come first
118+
// TODO: Change this so the env set global url always is first in the list of paths
119119
if let Some(url) = env("SYSTEM_DEPS_BINARY_URL") {
120120
let checksum = env("SYSTEM_DEPS_BINARY_CHECKSUM");
121121
let pkg_paths = env("SYSTEM_DEPS_BINARY_PKG_PATHS");

meta/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn find_by_path(mut dir: PathBuf) -> Option<PathBuf> {
5050
/// Get the manifest from the project directory. This is **not** the directory
5151
/// where `system-deps` is cloned, it should point to the top level `Cargo.toml`
5252
/// file. This is needed to obtain metadata from all of dependencies, including
53-
/// those upstream of the package being compiled.
53+
/// those downstream of the package being compiled.
5454
///
5555
/// If the target directory is not a subfolder of the project it will not be
5656
/// possible to detect it automatically. In this case, the user will be asked

meta/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ fn check_cfg(lit: &str) -> Option<bool> {
4040

4141
/// Inserts values from b into a only if they don't already exist.
4242
/// TODO: This function could be a lot cleaner and it needs better error handling.
43+
/// The logic for merging values needs to handle more cases so during testing this will have to be rewritten.
44+
/// Additionally, make sure that only downstream crates can override the metadata.
4345
fn merge(a: &mut Value, b: Value) {
4446
match (a, b) {
4547
(a @ &mut Value::Object(_), Value::Object(b)) => {
@@ -66,7 +68,7 @@ fn merge(a: &mut Value, b: Value) {
6668
}
6769

6870
/// Recursively read dependency manifests to find metadata matching a key.
69-
/// The matching metadata is aggregated in a list, with upstream crates having priority
71+
/// The matching metadata is aggregated in a list, with downstream crates having priority
7072
/// for overwriting values. It will only read from the metadata sections matching the
7173
/// provided key.
7274
///

src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -934,9 +934,10 @@ impl Config {
934934
combined_pkg_config_path.extend_from_slice(&pkg_config_path);
935935

936936
// should the lib be statically linked?
937-
let statik = self
938-
.env
939-
.has_value(&EnvVariable::new_link(Some(name)), "static")
937+
let statik = cfg!(feature = "binary")
938+
|| self
939+
.env
940+
.has_value(&EnvVariable::new_link(Some(name)), "static")
940941
|| self.env.has_value(&EnvVariable::new_link(None), "static");
941942

942943
let mut library = if self.env.contains(&EnvVariable::new_no_pkg_config(name)) {

0 commit comments

Comments
 (0)