- 
                Notifications
    
You must be signed in to change notification settings  - Fork 518
 
Description
If the version attribute is omitted, we set rustc env vars corresponding to an assumed version of 0.0.0 (such as CARGO_PKG_VERSION_MAJOR=0, etc.). We only set these for rustc compilation, but we omit them for running the cargo build script itself, which is inconsistent with the behavior when version is provided (in which case, the env vars are set both for compilation and build script execution). In addition, these env vars can conflict with the .env files that are provided to the rustc_env_files and build_script_env_files attributes, in which case their values are overridden by the values in the files.
To resolve the inconsistencies and make it easier to reason about the behavior, if the version attribute is omitted, we will stop injecting the "0.0.0" version and skip setting the extra env vars, as long as the incompatible_do_not_inject_degenerate_version_to_rustc_env flag is enabled.