diff --git a/server/autotest_server/testers/haskell/haskell_tester.py b/server/autotest_server/testers/haskell/haskell_tester.py index 572f2841..754e3c25 100644 --- a/server/autotest_server/testers/haskell/haskell_tester.py +++ b/server/autotest_server/testers/haskell/haskell_tester.py @@ -7,7 +7,7 @@ from ..tester import Tester, Test, TestError from ..specs import TestSpecs -STACK_OPTIONS = ["--resolver=lts-14.27", "--system-ghc", "--allow-different-user"] +STACK_OPTIONS = ["--resolver=lts-16.17", "--system-ghc", "--allow-different-user"] class HaskellTest(Test): diff --git a/server/autotest_server/testers/haskell/setup.py b/server/autotest_server/testers/haskell/setup.py index 2cbcdb65..5f049b62 100644 --- a/server/autotest_server/testers/haskell/setup.py +++ b/server/autotest_server/testers/haskell/setup.py @@ -7,7 +7,7 @@ def create_environment(_settings, _env_dir, default_env_dir): - resolver = "lts-14.27" + resolver = "lts-16.17" cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS] subprocess.run(cmd, check=True) @@ -16,7 +16,10 @@ def create_environment(_settings, _env_dir, default_env_dir): def install(): subprocess.run(os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.system"), check=True) - + resolver = "lts-16.17" + cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS] + subprocess.run(cmd, check=True) + subprocess.run(os.path.join(os.path.dirname(os.path.realpath(__file__)), "stack_permissions.sh"), check=True, shell=True) def settings(): with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "settings_schema.json")) as f: diff --git a/server/autotest_server/testers/haskell/stack_permissions.sh b/server/autotest_server/testers/haskell/stack_permissions.sh new file mode 100755 index 00000000..1671af06 --- /dev/null +++ b/server/autotest_server/testers/haskell/stack_permissions.sh @@ -0,0 +1,4 @@ +echo "allow-different-user: true" >> $STACK_ROOT/config.yaml +chmod a+w $STACK_ROOT/stack.sqlite3.pantry-write-lock +chmod a+w $STACK_ROOT/global-project/.stack-work/stack.sqlite3.pantry-write-lock +chmod a+w $STACK_ROOT/pantry/pantry.sqlite3.pantry-write-lock \ No newline at end of file diff --git a/server/autotest_server/tests/test_autotest_server.py b/server/autotest_server/tests/test_autotest_server.py index f2a61b61..6629ffe0 100644 --- a/server/autotest_server/tests/test_autotest_server.py +++ b/server/autotest_server/tests/test_autotest_server.py @@ -48,3 +48,9 @@ def test_sticky(): autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker) assert os.path.exists(path) is False + +def test_stack_permissions(): + stack_root = os.environ['STACK_ROOT'] + path = f"{stack_root}/stack.sqlite3.pantry-write-lock" + permissions = oct(os.stat(path).st_mode)[-3:] + assert permissions[1] == '6' \ No newline at end of file