Unverified Commit 7c63ac83 authored by Bernhard Schuster's avatar Bernhard Schuster Committed by GitHub
Browse files

overseer: simplify debugging some more (#4053)

* overseer: simplify debugging some more

* chore: undo gitignore change
parent 70ccebc4
Pipeline #161596 passed with stages
in 42 minutes and 18 seconds
/// A dummy build script, so `OUT_DIR` is set.
fn main() {}
...@@ -98,12 +98,12 @@ pub(crate) fn impl_overseer_gen( ...@@ -98,12 +98,12 @@ pub(crate) fn impl_overseer_gen(
additive.extend(impl_message_wrapper_enum(&info)?); additive.extend(impl_message_wrapper_enum(&info)?);
additive.extend(impl_dispatch(&info)); additive.extend(impl_dispatch(&info));
#[cfg(feature = "expansion")] if cfg!(feature = "expansion") {
{
use std::io::Write; use std::io::Write;
let cwd = std::env::current_dir().unwrap(); let out = env!("OUT_DIR");
let path: std::path::PathBuf = cwd.join("overlord-expansion.rs"); let out = std::path::PathBuf::from(out);
let path = out.join("overlord-expansion.rs");
let mut f = std::fs::OpenOptions::new() let mut f = std::fs::OpenOptions::new()
.write(true) .write(true)
.create(true) .create(true)
...@@ -117,9 +117,15 @@ pub(crate) fn impl_overseer_gen( ...@@ -117,9 +117,15 @@ pub(crate) fn impl_overseer_gen(
std::process::Command::new("rustfmt") std::process::Command::new("rustfmt")
.arg("--edition=2018") .arg("--edition=2018")
.arg(&path) .arg(&path)
.current_dir(cwd) .current_dir(out)
.spawn() .spawn()
.expect("Running rustfmt works. qed"); .expect("Running rustfmt works. qed");
let path = path.display().to_string();
Ok(quote! {
include!( #path );
})
} else {
Ok(additive)
} }
Ok(additive)
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment