Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Update cargo. #1608

Merged
merged 1 commit into from
Jan 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 36 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rls-span = "0.5"
rls-vfs = "0.8"
rls-ipc = { version = "0.1.0", path = "rls-ipc", optional = true }

cargo = { git = "https://github.com/rust-lang/cargo", rev = "626f0f40efd32e6b3dbade50cd53fdfaa08446ba" }
cargo = { git = "https://github.com/rust-lang/cargo", rev = "86134e7666a088682f20b76278c3ee096a315218" }
cargo_metadata = "0.8"
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "b245fbd0f2bdbd002611a45d0758f9be44eaf66b", optional = true }
env_logger = "0.7"
Expand Down
18 changes: 10 additions & 8 deletions rls/src/build/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use cargo::core::{
};
use cargo::ops::{compile_with_exec, CompileFilter, CompileOptions, Packages};
use cargo::util::{
errors::ManifestError, homedir, important_paths, CargoResult, Config as CargoConfig,
config as cargo_config, errors::ManifestError, homedir, important_paths, CargoResult,
ConfigValue, ProcessBuilder,
};
use failure::{self, format_err, Fail};
Expand Down Expand Up @@ -166,7 +166,7 @@ fn run_cargo_ws(
inner_lock: environment::InnerLock,
mut restore_env: Environment<'_>,
manifest_path: &PathBuf,
config: &CargoConfig,
config: &cargo_config::Config,
ws: &Workspace<'_>,
) -> CargoResult<PathBuf> {
let (all, packages) = match package_arg {
Expand Down Expand Up @@ -649,8 +649,8 @@ pub fn make_cargo_config(
target_dir: Option<&Path>,
cwd: &Path,
shell: Shell,
) -> CargoConfig {
let config = CargoConfig::new(shell, cwd.to_path_buf(), homedir(build_dir).unwrap());
) -> cargo_config::Config {
let config = cargo_config::Config::new(shell, cwd.to_path_buf(), homedir(build_dir).unwrap());

// Cargo is expecting the config to come from a config file and keeps
// track of the path to that file. We'll make one up, it shouldn't be
Expand All @@ -662,9 +662,10 @@ pub fn make_cargo_config(

let mut config_value_map = config.load_values().unwrap();
{
let build_value = config_value_map
.entry("build".to_owned())
.or_insert_with(|| ConfigValue::Table(HashMap::new(), config_path.clone()));
let build_value = config_value_map.entry("build".to_owned()).or_insert_with(|| {
let def = cargo_config::Definition::Path(config_path.clone());
ConfigValue::Table(HashMap::new(), def)
});

let target_dir = target_dir.map(|d| d.to_str().unwrap().to_owned()).unwrap_or_else(|| {
// Try to use .cargo/config build.target-dir + "/rls"
Expand All @@ -686,7 +687,8 @@ pub fn make_cargo_config(
cargo_target.join("rls").to_str().unwrap().to_owned()
});

let td_value = ConfigValue::String(target_dir, config_path);
let def = cargo_config::Definition::Path(config_path);
let td_value = ConfigValue::String(target_dir, def);
if let ConfigValue::Table(ref mut build_table, _) = *build_value {
build_table.insert("target-dir".to_owned(), td_value);
} else {
Expand Down
2 changes: 1 addition & 1 deletion rls/src/project_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl ProjectModel {
// Enable nightly flag for cargo(see #1043)
cargo::core::enable_nightly_features();
// frozen = false, locked = false, offline = false
config.configure(0, Some(true), &None, false, false, false, &None, &[])?;
config.configure(0, Some(true), None, false, false, false, &None, &[], &[])?;
let ws = Workspace::new(&ws_manifest, &config)?;
// get resolve from lock file
let prev = {
Expand Down