From 44a62c92c1c1b650539103280ba5415ed7a13319 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Wed, 23 Feb 2022 09:08:59 -0600 Subject: [PATCH] Prevent rebar3 from seeing any global config With the hex plugin download it would cause rebar3 tests to fail on any VM that couldn't load the pre-compiled plugin modules. This just hides the config and plugin cache from rebar3 when running under this test script. --- test/compile-check.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/compile-check.py b/test/compile-check.py index 5be58ec..2b5e404 100755 --- a/test/compile-check.py +++ b/test/compile-check.py @@ -43,6 +43,14 @@ JTAPP2_URL = "https://github.com/davisp/jtapp2" REBAR2_URL = "https://github.com/rebar/rebar" REBAR3_URL = "https://github.com/erlang/rebar3" +# Prevent rebar3 from reading any global configuration. The need +# for setting HOME instead of REBAR3_* variables is because the +# plugin cache can't be set via environment so we just use a +# hammer and set a fake HOME. +os.environ["ASDF_CONFIG_FILE"] = os.path.expanduser("~/.asdfrc") +os.environ["ASDF_DATA_DIR"] = os.path.expanduser("~/.asdf") +os.environ["HOME"] = "./hopefully-not-a-directory" + def init_test_dir(): if not os.path.exists(TEST_DIR):