diff --git a/bootstrap/src/main.rs b/bootstrap/src/main.rs index ddcc9d38..0c9aadf3 100644 --- a/bootstrap/src/main.rs +++ b/bootstrap/src/main.rs @@ -15,6 +15,15 @@ fn main() { env!("CARGO_MANIFEST_DIR"), "/../meta/src/grammar.pest" )); + + // workaround for Windows + // TODO: use `normpath` or a different workaround on Windows? + let pest_ref = pest.to_string_lossy(); + let normalized_path = pest_ref + .strip_prefix(r#"\\?\"#) + .unwrap_or_else(|| &pest_ref); + let pest = Path::new(&normalized_path); + // Path on which we should write generated grammar file. // In case `not-bootstrap-in-src` is: // * OFF -> in `grammar.rs` next to `grammar.pest` diff --git a/meta/Cargo.toml b/meta/Cargo.toml index b2989b3c..d10bddeb 100644 --- a/meta/Cargo.toml +++ b/meta/Cargo.toml @@ -27,7 +27,7 @@ once_cell = "1.8.0" [build-dependencies] sha2 = { version = "0.10", default-features = false } -cargo = { version = "0.72.2", optional = true } +cargo = { version = "0.81.0", optional = true } [features] default = [] diff --git a/meta/build.rs b/meta/build.rs index 0c8f69ed..b61c53e9 100644 --- a/meta/build.rs +++ b/meta/build.rs @@ -1,10 +1,9 @@ #[cfg(feature = "not-bootstrap-in-src")] use cargo::{ core::{resolver::CliFeatures, Workspace}, - ops, - ops::{CompileOptions, Packages}, + ops::{self, CompileOptions, Packages}, util::command_prelude::CompileMode, - Config, + GlobalContext, }; use sha2::{Digest, Sha256}; use std::env; @@ -82,7 +81,7 @@ fn main() { #[cfg(feature = "not-bootstrap-in-src")] { - let config = Config::default().expect("cargo config"); + let config = GlobalContext::default().expect("cargo config"); let workspace_manifest = manifest_dir .join("../Cargo.toml") .canonicalize()