Skip to content

Commit

Permalink
this doesn't work just yet
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Apr 7, 2023
1 parent 738cc39 commit f5a35c8
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 24 deletions.
6 changes: 2 additions & 4 deletions Cargo.toml
Expand Up @@ -124,7 +124,7 @@ faccess = "0.2.3"
fancy-regex = "0.10.0"
flate2 = "1.0.22"
fnv = "1.0.7"
fs2 = "0.4.3"
fs4 = { version = "0.6", features = ["sync"] }
futures = { version = "0.3.24", features = ["async-await", "compat"] }
futures-intrusive = "0.4"
glob = "0.3.0"
Expand All @@ -144,8 +144,7 @@ internment = { version = "0.7", features = ["arc"] }
inventory = "0.1.9"
is_proc_translated = "0.1.1"
itertools = "0.10.3"
jemalloc-ctl = "0.5.0"
jemallocator = { version = "0.5.0", features = ["profiling"] }

libc = "0.2.132"
linked-hash-map = { version = "0.5", features = ["serde_impl"] }
log = "0.4"
Expand Down Expand Up @@ -176,7 +175,6 @@ prost-build = "0.11.6"
prost-derive = "0.11.6"
prost-types = "0.11.6"
protoc-bin-vendored = "3.0.0"
psutil = "3.2"
quote = "1.0.3"
rand = { version = "0.8.4", features = ["small_rng"] }
rand_chacha = "0.3"
Expand Down
4 changes: 3 additions & 1 deletion app/buck2/Cargo.toml
Expand Up @@ -60,8 +60,10 @@ buck2_test_runner = { workspace = true }
buck2_cli_proto = { workspace = true }
buck2_util = { workspace = true }

[target.'cfg(all(unix, not(illumos)))'.dependencies]
jemallocator = { version = "0.5.0", features = ["profiling"] }

[target.'cfg(unix)'.dependencies]
jemallocator = { workspace = true }
nix = { workspace = true }

[target.'cfg(windows)'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion app/buck2/bin/buck2.rs
Expand Up @@ -30,7 +30,7 @@ use fbinit::FacebookInit;
// So when we set our own allocator, buck build buck2 or buck2 build buck2 often breaks.
// Making jemalloc the default only when we do a cargo build.
#[cfg_attr(all(unix, not(fbcode_build), not(buck_oss_build)), global_allocator)]
#[cfg(all(unix, not(fbcode_build), not(buck_oss_build)))]
#[cfg(all(unix, not(fbcode_build), not(buck_oss_build)), not(illumos))]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

fn init_logging(_fb: FacebookInit) -> anyhow::Result<Box<dyn LogConfigurationReloadHandle>> {
Expand Down
4 changes: 2 additions & 2 deletions app/buck2_build_api/Cargo.toml
Expand Up @@ -73,8 +73,8 @@ buck2_cli_proto = { workspace = true }
buck2_util = { workspace = true }
buck2_critical_path = { workspace = true }

[target.'cfg(unix)'.dependencies]
jemallocator = { workspace = true }
[target.'cfg(all(unix, not(illumos)))'.dependencies]
jemallocator = { version = "0.5.0", features = ["profiling"] }

[dev-dependencies]
maplit = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion app/buck2_client_ctx/Cargo.toml
Expand Up @@ -16,7 +16,7 @@ chrono = { workspace = true }
crossterm = { workspace = true }
derivative = { workspace = true }
derive_more = { workspace = true }
fs2 = { workspace = true }
fs4 = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
httparse = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion app/buck2_client_ctx/src/build_count.rs
Expand Up @@ -15,7 +15,7 @@ use anyhow::Context;
use buck2_common::client_utils;
use buck2_core::fs::paths::abs_norm_path::AbsNormPathBuf;
use buck2_core::fs::paths::file_name::FileName;
use fs2::FileExt;
use fs4::FileExt;
use serde::Deserialize;
use serde::Serialize;
use tokio::io::AsyncReadExt;
Expand Down
2 changes: 1 addition & 1 deletion app/buck2_client_ctx/src/daemon/client/mod.rs
Expand Up @@ -19,7 +19,7 @@ use buck2_cli_proto::*;
use buck2_common::daemon_dir::DaemonDir;
use buck2_core::fs::fs_util;
use buck2_core::fs::paths::abs_norm_path::AbsNormPathBuf;
use fs2::FileExt;
use fs4::FileExt;
use futures::future::BoxFuture;
use futures::pin_mut;
use futures::stream;
Expand Down
9 changes: 5 additions & 4 deletions app/buck2_protoc_dev/src/lib.rs
Expand Up @@ -18,15 +18,16 @@ fn get_env(key: &str) -> Option<OsString> {
}

#[cfg(not(buck2_build))]
fn set_var(var: &str, override_var: &str, path: &Path) {
assert!(path.exists(), "Path does not exist: `{}`", path.display());
fn set_var(var: &str, override_var: &str, path: Option<&Path>) {

let path_buf;
let path = if let Some(override_var_value) = env::var_os(override_var) {
eprintln!("INFO: Variable ${} is overridden by ${}", var, override_var);
path_buf = std::path::PathBuf::from(override_var_value);
&path_buf
} else {
let path = path.unwrap();
assert!(path.exists(), "Path does not exist: `{}`", path.display());
path
};

Expand All @@ -50,7 +51,7 @@ fn maybe_set_protoc() {
set_var(
"PROTOC",
"BUCK2_BUILD_PROTOC",
&protoc_bin_vendored::protoc_bin_path().unwrap(),
protoc_bin_vendored::protoc_bin_path(),
);
}
}
Expand All @@ -62,7 +63,7 @@ fn maybe_set_protoc_include() {
set_var(
"PROTOC_INCLUDE",
"BUCK2_BUILD_PROTOC_INCLUDE",
&protoc_bin_vendored::include_path().unwrap(),
protoc_bin_vendored::include_path(),
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/buck2_server/Cargo.toml
Expand Up @@ -66,8 +66,8 @@ buck2_events = { workspace = true }
buck2_util = { workspace = true }
host_sharing = { workspace = true }

[target.'cfg(unix)'.dependencies]
psutil = { workspace = true }
[target.'cfg(all(unix, not(illumos)))'.dependencies]
psutil = "3.2"

[dev-dependencies]
assert_matches = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions app/buck2_server/src/net_io.rs
Expand Up @@ -13,7 +13,7 @@ pub struct Counters {
pub bytes_recv: u64,
}

#[cfg(unix)]
#[cfg(all(unix, not(illumos))]
mod collector {
use std::collections::HashMap;
use std::sync::Arc;
Expand Down Expand Up @@ -67,7 +67,7 @@ mod collector {
}

// psutil network stats aren't implemented on windows.
#[cfg(not(unix))]
#[cfg(any(not(unix), illumos))]
mod collector {
use std::collections::HashMap;

Expand Down
10 changes: 6 additions & 4 deletions shim/third-party/rust/Cargo.toml
Expand Up @@ -71,7 +71,7 @@ faccess = "0.2.3"
fancy-regex = "0.10.0"
flate2 = "1.0.22"
fnv = "1.0.7"
fs2 = "0.4.3"
fs4 = { version = "0.6", features = ["sync"] }
futures = { version = "0.3.24", features = ["async-await", "compat"] }
futures-intrusive = "0.4"
glob = "0.3.0"
Expand All @@ -91,8 +91,6 @@ internment = { version = "0.7", features = ["arc"] }
inventory = "0.1.9"
is_proc_translated = "0.1.1"
itertools = "0.10.3"
jemalloc-ctl = "0.3.3"
jemallocator = { version = "0.3.2", features = ["profiling"] }
lalrpop = { version = "0.19.7", artifact = "bin" }
lalrpop-util = "0.19.7"
libc = "0.2.132"
Expand Down Expand Up @@ -126,7 +124,6 @@ prost = "0.11.6"
prost-build = "0.11.6"
prost-derive = "0.11.6"
prost-types = "0.11.6"
psutil = "3.2"
quote = "1.0.3"
rand = { version = "0.8.4", features = ["small_rng"] }
rand_chacha = "0.3"
Expand Down Expand Up @@ -186,6 +183,11 @@ xattr = "0.2.2"
zip = "0.5"
zstd = "=0.11.1"

[target.'cfg(all(unix, not(illumos)))'.dependencies]
jemalloc-ctl = "0.3.3"
jemallocator = { version = "0.3.2", features = ["profiling"] }
psutil = "3.2"

[patch.crates-io]
# For https://github.com/tokio-rs/prost/pull/802
prost = { git = "https://github.com/krallin/prost.git", rev = "90b7e204c66f6baed0b1426ce456fb70d16b1cdb", version = "0.11.6"}
Expand Down
2 changes: 1 addition & 1 deletion starlark-rust/starlark/Cargo.toml
Expand Up @@ -42,7 +42,7 @@ walkdir = "2.3"
serde = { version = "1.0", features = ["derive"] }
logos = "0.12"
serde_json = "1.0"
rustyline = "7.1"
rustyline = "9.1"
maplit = "1.0.2"
lsp-server = "0.5"
lsp-types = "0.93.0"
Expand Down

0 comments on commit f5a35c8

Please sign in to comment.