windows: Make solana-test-validator work (backport #20099) (#20123)

* windows: Make solana-test-validator work (#20099)

* windows: Make solana-test-validator work

The important changes to get this going on Windows:

* ledger lock needs to be done on a file instead of the directory
* IPC service needs to use the Windows pipe naming scheme
* always disable the JIT
* file logging not possible yet because we can't redirect stderr,
but this will change once env_logger fixes the pipe output target!

* Integrate review feedback

(cherry picked from commit 567f30aa1a)

# Conflicts:
#	validator/src/bin/solana-test-validator.rs
#	validator/src/lib.rs
#	validator/src/main.rs

* Fix merge conflicts

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
This commit is contained in:
mergify[bot]
2021-09-24 12:59:12 +00:00
committed by GitHub
parent 63b24d9577
commit b112e4a8aa
8 changed files with 86 additions and 41 deletions

View File

@@ -362,7 +362,7 @@ fn get_windows_path_var() -> Result<Option<String>, String> {
Ok(Some(s))
} else {
println!("the registry key HKEY_CURRENT_USER\\Environment\\PATH does not contain valid Unicode. Not modifying the PATH variable");
return Ok(None);
Ok(None)
}
}
Err(ref e) if e.kind() == io::ErrorKind::NotFound => Ok(Some(String::new())),
@@ -391,7 +391,7 @@ fn add_to_path(new_path: &str) -> bool {
if !old_path.contains(&new_path) {
let mut new_path = new_path.to_string();
if !old_path.is_empty() {
new_path.push_str(";");
new_path.push(';');
new_path.push_str(&old_path);
}
@@ -416,7 +416,7 @@ fn add_to_path(new_path: &str) -> bool {
SendMessageTimeoutA(
HWND_BROADCAST,
WM_SETTINGCHANGE,
0 as WPARAM,
0_usize,
"Environment\0".as_ptr() as LPARAM,
SMTO_ABORTIFHUNG,
5000,