Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read configuration from environment variables #2398

Merged
merged 3 commits into from
Feb 26, 2016

Commits on Feb 19, 2016

  1. Refactor configuration return values

    Wrap up the value/definition pair in a generic structure so we can extend it
    well later.
    alexcrichton committed Feb 19, 2016
    Configuration menu
    Copy the full SHA
    455f800 View commit details
    Browse the repository at this point in the history
  2. Make Config::get private

    Don't actually want to expose this, callers need to use the more concrete
    methods anyway.
    alexcrichton committed Feb 19, 2016
    Configuration menu
    Copy the full SHA
    56db20d View commit details
    Browse the repository at this point in the history
  3. Read configuration from environment variables

    This commit adds a more principled system to rationalize what ends up being a
    configuration value versus an environment variable. This problem is solved by
    just saying that they're one and the same! Similar to Bundler, this commit
    supports overriding the `foo.bar` configuration value with the `CARGO_FOO_BAR`
    environment variable.
    
    Currently this is used as part of the `get_string` and `get_i64` methods on
    `Config`. This means, for example, that the following environment variables can
    now be used to configure Cargo:
    
    * CARGO_BUILD_JOBS
    * CARGO_HTTP_TIMEOUT
    * CARGO_HTTP_PROXY
    
    Currently it's not supported to encode a list in an environment variable, so for
    example `CARGO_PATHS` would not be read when reading the global `paths`
    configuration value.
    
    cc rust-lang#2362
    cc rust-lang#2395 -- intended to close this in tandem with rust-lang#2397
    alexcrichton committed Feb 19, 2016
    Configuration menu
    Copy the full SHA
    a40440c View commit details
    Browse the repository at this point in the history