Skip to content

Commit

Permalink
[antlir] delete buck env shenanigans
Browse files Browse the repository at this point in the history
Summary: We don't have to care about buck1 anymore, delete this shit

Test Plan: testhard

Differential Revision: D54001758
  • Loading branch information
vmagro authored and facebook-github-bot committed Feb 21, 2024
1 parent d542388 commit fe6dfcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
25 changes: 6 additions & 19 deletions antlir/antlir2/antlir2_vm/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ pub(crate) fn create_tpx_logs(
pub(crate) fn env_names_to_kvpairs(env_names: Vec<String>) -> Vec<KvPair> {
let mut names: HashSet<_> = env_names.into_iter().collect();
// If these env exist, always pass them through.
["RUST_LOG", "RUST_BACKTRACE", "ANTLIR_BUCK"]
.iter()
.for_each(|name| {
names.insert(name.to_string());
});
["RUST_LOG", "RUST_BACKTRACE"].iter().for_each(|name| {
names.insert(name.to_string());
});
names
.iter()
.filter_map(|name| match std::env::var(name) {
Expand Down Expand Up @@ -151,13 +149,7 @@ mod test {
result: HashMap<String, OsString>,
}

const ALLOWED_ENV_NAMES: &[&str] = &[
"RUST_LOG",
"RUST_BACKTRACE",
"ANTLIR_BUCK",
"TEST_PILOT_A",
"OTHER",
];
const ALLOWED_ENV_NAMES: &[&str] = &["RUST_LOG", "RUST_BACKTRACE", "TEST_PILOT_A", "OTHER"];

impl EnvTest {
fn new(
Expand Down Expand Up @@ -203,21 +195,16 @@ mod test {
[
EnvTest::new(vec![], vec![], vec![]),
// Reads nothing
EnvTest::new(
vec![],
vec!["RUST_LOG", "ANTLIR_BUCK", "TEST_PILOT_A", "OTHER"],
vec![],
),
EnvTest::new(vec![], vec!["RUST_LOG", "TEST_PILOT_A", "OTHER"], vec![]),
// Always pass through
EnvTest::new(
vec![
("RUST_LOG", "info"),
("ANTLIR_BUCK", "1"),
("TEST_PILOT_A", "A"),
("OTHER", "other"),
],
vec![],
vec![("RUST_LOG", "info"), ("ANTLIR_BUCK", "1")],
vec![("RUST_LOG", "info")],
),
// Selection
EnvTest::new(
Expand Down
1 change: 0 additions & 1 deletion antlir/bzl/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ def _normalize_rust_dep(dep):
return dep
return shim.third_party.library(dep, platform = "rust")

antlir_buck_env = shim.antlir_buck_env
buck_command_alias = shim.buck_command_alias
buck_filegroup = shim.buck_filegroup
buck_genrule = shim.buck_genrule
Expand Down

0 comments on commit fe6dfcb

Please sign in to comment.