2021-06-13 13:39:15 +02:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, stdenv }:
|
2020-06-12 12:35:06 +02:00
|
|
|
|
2020-11-03 01:39:40 +01:00
|
|
|
buildGoModule rec {
|
2020-06-12 12:35:06 +02:00
|
|
|
pname = "terraform-ls";
|
2021-06-17 17:53:16 +02:00
|
|
|
version = "0.18.1";
|
2020-06-12 12:35:06 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hashicorp";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-06-17 17:53:16 +02:00
|
|
|
sha256 = "sha256-68Hs9kwv7GTGnYtoJh61ubaggPKbxFwz7qDwYaJ74c8=";
|
2020-06-12 12:35:06 +02:00
|
|
|
};
|
2021-06-17 17:53:16 +02:00
|
|
|
vendorSha256 = "sha256-NgOpnCe0uGQVDVKYUIULqPTfvfkDtxIUQiCVwiE7nuc=";
|
2020-06-12 12:35:06 +02:00
|
|
|
|
2021-06-10 20:09:10 +02:00
|
|
|
preBuild = ''
|
|
|
|
buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version} -X main.prerelease=")
|
|
|
|
'';
|
2020-11-03 01:39:40 +01:00
|
|
|
|
2021-06-10 20:09:10 +02:00
|
|
|
preCheck = ''
|
2021-06-13 13:39:15 +02:00
|
|
|
# Remove tests that requires networking
|
2021-06-10 20:09:10 +02:00
|
|
|
rm internal/terraform/exec/exec_test.go
|
2021-06-13 13:39:15 +02:00
|
|
|
'' + 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
|
2021-06-10 20:09:10 +02:00
|
|
|
'';
|
2020-06-12 12:35:06 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Terraform Language Server (official)";
|
|
|
|
homepage = "https://github.com/hashicorp/terraform-ls";
|
2021-06-10 20:09:10 +02:00
|
|
|
changelog = "https://github.com/hashicorp/terraform-ls/blob/v${version}/CHANGELOG.md";
|
2020-06-12 12:35:06 +02:00
|
|
|
license = licenses.mpl20;
|
2021-06-10 20:09:10 +02:00
|
|
|
maintainers = with maintainers; [ mbaillie jk ];
|
2020-06-12 12:35:06 +02:00
|
|
|
};
|
|
|
|
}
|