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
This commit is contained in:
Jon Cinque
2021-09-22 23:10:35 +02:00
committed by GitHub
parent 0eb0d7f73b
commit 567f30aa1a
10 changed files with 107 additions and 40 deletions

View File

@ -51,3 +51,21 @@ pub fn setup_with_default(filter: &str) {
pub fn setup() {
setup_with_default("error");
}
// Configures file logging with a default filter if RUST_LOG is not set
//
// NOTE: This does not work at the moment, pending the resolution of https://github.com/env-logger-rs/env_logger/issues/208
pub fn setup_file_with_default(logfile: &str, filter: &str) {
use std::fs::OpenOptions;
let file = OpenOptions::new()
.write(true)
.create(true)
.append(true)
.open(logfile)
.unwrap();
let logger = env_logger::Builder::from_env(env_logger::Env::new().default_filter_or(filter))
.format_timestamp_nanos()
.target(env_logger::Target::Pipe(Box::new(file)))
.build();
replace_logger(logger);
}