about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix36
1 files changed, 28 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix b/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix
index 0c52a89229da..e189c563e86e 100644
--- a/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix
+++ b/nixpkgs/pkgs/development/tools/misc/terraform-ls/default.nix
@@ -1,26 +1,46 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, stdenv }:
 
 buildGoModule rec {
   pname = "terraform-ls";
-  version = "0.16.2";
+  version = "0.18.1";
 
   src = fetchFromGitHub {
     owner = "hashicorp";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-5+h1fyTCp1jUZeKRCeDhfqAA11SMyR5nw2Y2x6JyIwY=";
+    sha256 = "sha256-68Hs9kwv7GTGnYtoJh61ubaggPKbxFwz7qDwYaJ74c8=";
   };
-  vendorSha256 = "sha256-m5ddUwuTX0mSihkoGIMQKidptwUL8Bao5HgHJBWX0os=";
+  vendorSha256 = "sha256-NgOpnCe0uGQVDVKYUIULqPTfvfkDtxIUQiCVwiE7nuc=";
 
-  # tests fail in sandbox mode because of trying to download stuff from releases.hashicorp.com
-  doCheck = false;
+  preBuild = ''
+    buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version} -X main.prerelease=")
+  '';
 
-  buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
+  preCheck = ''
+    # Remove tests that requires networking
+    rm internal/terraform/exec/exec_test.go
+  '' + lib.optionalString stdenv.isAarch64 ''
+    # Not all test failures have tracking issues as HashiCorp do not have
+    # aarch64 testing infra easily available, see issue 549 below.
+
+    # Remove file that contains `TestLangServer_workspaceExecuteCommand_modules_multiple`
+    # which fails on aarch64: https://github.com/hashicorp/terraform-ls/issues/549
+    rm internal/langserver/handlers/execute_command_modules_test.go
+
+    # `TestModuleManager_ModuleCandidatesByPath` variants fail
+    rm internal/terraform/module/module_manager_test.go
+
+    # internal/terraform/module/module_ops_queue_test.go:17:15: undefined: testLogger
+    # internal/terraform/module/watcher_test.go:39:11: undefined: testLogger
+    # internal/terraform/module/watcher_test.go:79:14: undefined: testLogger
+    rm internal/terraform/module/{watcher_test,module_ops_queue_test}.go
+  '';
 
   meta = with lib; {
     description = "Terraform Language Server (official)";
     homepage = "https://github.com/hashicorp/terraform-ls";
+    changelog = "https://github.com/hashicorp/terraform-ls/blob/v${version}/CHANGELOG.md";
     license = licenses.mpl20;
-    maintainers = with maintainers; [ mbaillie ];
+    maintainers = with maintainers; [ mbaillie jk ];
   };
 }