From e277d5d64e27dfbfb9ff05f147f7d5189617dea2 Mon Sep 17 00:00:00 2001 From: vlad20012 Date: Fri, 28 Jan 2022 16:18:25 +0300 Subject: [PATCH] Add a way to disable dll copying for users of proc_macro_srv library --- crates/proc_macro_srv/src/dylib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/proc_macro_srv/src/dylib.rs b/crates/proc_macro_srv/src/dylib.rs index ab13e66fb8..cc0b816a53 100644 --- a/crates/proc_macro_srv/src/dylib.rs +++ b/crates/proc_macro_srv/src/dylib.rs @@ -168,6 +168,10 @@ fn ensure_file_with_lock_free_access(path: &Path) -> io::Result { use std::ffi::OsString; use std::hash::{BuildHasher, Hasher}; + if std::env::var("RA_DONT_COPY_PROC_MACRO_DLL").is_ok() { + return Ok(path.to_path_buf()); + } + let mut to = std::env::temp_dir(); let file_name = path.file_name().ok_or_else(|| {