diff --git a/aws-lc-rs/README.md b/aws-lc-rs/README.md index d4ebc8b969a..e366c937fc6 100644 --- a/aws-lc-rs/README.md +++ b/aws-lc-rs/README.md @@ -90,7 +90,7 @@ detected in the build environment *it is used* to compile the assembly files. Ho if a NASM assembler is not available, and the "fips" feature is not enabled, then the build fails unless one of the following conditions are true: * You are building for `x86-64` and either: - * The `AWS_LC_SYS_PREBUILT_NASM` environment variable is found and has a value of "1" (or the value is empty); OR + * The `AWS_LC_SYS_PREBUILT_NASM` environment variable is found and has a value of "1"; OR * `AWS_LC_SYS_PREBUILT_NASM` is *not found* in the environment AND the "prebuilt-nasm" feature has been enabled. If the above cases apply, then the crate provided prebuilt NASM objects will be used for the build. To prevent usage of prebuilt NASM diff --git a/aws-lc-rs/src/lib.rs b/aws-lc-rs/src/lib.rs index 1e75b8eb149..5632ec4c9d1 100644 --- a/aws-lc-rs/src/lib.rs +++ b/aws-lc-rs/src/lib.rs @@ -91,7 +91,7 @@ //! if a NASM assembler is not available, and the "fips" feature is not enabled, then the build fails unless one of the following conditions are true: //! //! * You are building for `x86-64` and either: -//! * The `AWS_LC_SYS_PREBUILT_NASM` environment variable is found and has a value of "1" (or the value is empty); OR +//! * The `AWS_LC_SYS_PREBUILT_NASM` environment variable is found and has a value of "1"; OR //! * `AWS_LC_SYS_PREBUILT_NASM` is *not found* in the environment AND the "prebuilt-nasm" feature has been enabled. //! //! If the above cases apply, then the crate provided prebuilt NASM objects will be used for the build. To prevent usage of prebuilt NASM diff --git a/aws-lc-sys/README.md b/aws-lc-sys/README.md index 723d1e5a495..1f96e3585ca 100644 --- a/aws-lc-sys/README.md +++ b/aws-lc-sys/README.md @@ -43,7 +43,7 @@ if a NASM assembler is not available, and the "fips" feature is not enabled, the following conditions are true: * You are building for `x86-64` and either: - * The `AWS_LC_SYS_PREBUILT_NASM` environment variable is found and has a value of "1" (or the value is empty); OR + * The `AWS_LC_SYS_PREBUILT_NASM` environment variable is found and has a value of "1"; OR * `AWS_LC_SYS_PREBUILT_NASM` is *not found* in the environment AND the "prebuilt-nasm" feature has been enabled. If the above cases apply, then the crate provided prebuilt NASM objects will be used for the build. To prevent usage of diff --git a/aws-lc-sys/builder/main.rs b/aws-lc-sys/builder/main.rs index 0773085b4e2..3fae1e4448b 100644 --- a/aws-lc-sys/builder/main.rs +++ b/aws-lc-sys/builder/main.rs @@ -77,21 +77,28 @@ fn option_env>(name: N) -> Option { fn env_var_to_bool(name: &str) -> Option { let build_type_result = option_env(name); if let Some(env_var_value) = build_type_result { - eprintln!("{name}={env_var_value}"); - // If the environment variable is set, we ignore every other factor. + eprintln!("Evaluating: {name}='{env_var_value}'"); + let env_var_value = env_var_value.to_lowercase(); if env_var_value.starts_with('0') || env_var_value.starts_with('n') || env_var_value.starts_with("off") + || env_var_value.starts_with('f') { - Some(false) - } else { - // Otherwise, if the variable is set, assume true - Some(true) + eprintln!("Parsed: {name}=false"); + return Some(false); } - } else { - None + if env_var_value.starts_with(|c: char| c.is_ascii_digit()) + || env_var_value.starts_with('y') + || env_var_value.starts_with("on") + || env_var_value.starts_with('t') + { + eprintln!("Parsed: {name}=true"); + return Some(true); + } + eprintln!("Parsed: {name}=unknown"); } + None } impl Default for OutputLibType { diff --git a/book/src/requirements/windows.md b/book/src/requirements/windows.md index ffe3a46742e..fe52787465d 100644 --- a/book/src/requirements/windows.md +++ b/book/src/requirements/windows.md @@ -49,7 +49,7 @@ if a NASM assembler is not available, and the "fips" feature is not enabled, the following conditions are true: * You are building for `x86-64` and either: - * The `AWS_LC_SYS_PREBUILT_NASM` environment variable is found and has a value of "1" (or the value is empty); OR + * The `AWS_LC_SYS_PREBUILT_NASM` environment variable is found and has a value of "1"; OR * `AWS_LC_SYS_PREBUILT_NASM` is *not found* in the environment AND the "prebuilt-nasm" feature has been enabled. If the above cases apply, then the crate provided prebuilt NASM objects will be used for the build. To prevent usage of