Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erlang-ls: fix OTP 27 compatibility #372731

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkgs/development/beam-modules/erlang-ls/1576.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/apps/els_lsp/test/els_completion_SUITE.erl b/apps/els_lsp/test/els_completion_SUITE.erl
index b610b1d4..9c8614f0 100644
--- a/apps/els_lsp/test/els_completion_SUITE.erl
+++ b/apps/els_lsp/test/els_completion_SUITE.erl
@@ -711,6 +711,7 @@ exported_types(Config) ->
<<"filename_all">>,
<<"io_device">>
] ++
+ [<<"io_server">> || OtpRelease >= 27] ++
[<<"location">> || OtpRelease >= 26] ++
[
<<"mode">>,
27 changes: 19 additions & 8 deletions pkgs/development/beam-modules/erlang-ls/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
erlang,
fetchFromGitHub,
fetchgit,
fetchHex,
Expand All @@ -13,6 +14,7 @@ let
version = "1.1.0";
owner = "erlang-ls";
repo = "erlang_ls";

deps = import ./rebar-deps.nix {
inherit fetchHex fetchFromGitHub fetchgit;
builder = buildRebar3;
Expand Down Expand Up @@ -41,12 +43,18 @@ let
in
rebar3Relx {
pname = "erlang-ls";

inherit version;

src = fetchFromGitHub {
inherit owner repo;
hash = "sha256-MSDBU+blsAdeixaHMMXmeMJ+9Yrzn3HekE8KbIc/Guo=";
rev = version;
};

# remove when fixed upstream https://github.com/erlang-ls/erlang_ls/pull/1576
patches = lib.optionals (lib.versionAtLeast erlang.version "27") [ ./1576.diff ];

releaseType = "escript";
beamDeps = builtins.attrValues deps;

Expand All @@ -59,16 +67,11 @@ rebar3Relx {
HOME=. rebar3 ct
HOME=. rebar3 proper --constraint_tries 100
'';
installFlags = [ "PREFIX=$(out)" ];

# tests seem to be a bit flaky on darwin, skip them for now
doCheck = !stdenv.hostPlatform.isDarwin;
installFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://github.com/erlang-ls/erlang_ls";
description = "Erlang Language Server";
platforms = platforms.unix;
license = licenses.asl20;
mainProgram = "erlang_ls";
};

passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p common-updater-scripts coreutils git gnused gnutar gzip nixfmt-rfc-style "rebar3WithPlugins { globalPlugins = [ beamPackages.rebar3-nix ]; }"
Expand All @@ -88,4 +91,12 @@ rebar3Relx {
echo "erlang-ls is already up-to-date"
fi
'';

meta = with lib; {
homepage = "https://github.com/erlang-ls/erlang_ls";
description = "Erlang Language Server";
platforms = platforms.unix;
license = licenses.asl20;
mainProgram = "erlang_ls";
};
}
4 changes: 1 addition & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7104,13 +7104,11 @@ with pkgs;
erlang_nox = beam_nox.interpreters.erlang;

inherit (beam.packages.erlang)
ex_doc erlfmt elvis-erlang
erlang-ls ex_doc erlfmt elvis-erlang
rebar rebar3 rebar3WithPlugins
fetchHex
lfe lfe_2_1;

inherit (beam.packages.erlang_26) erlang-ls;

beamPackages = dontRecurseIntoAttrs beam27Packages;
beamMinimalPackages = dontRecurseIntoAttrs beamMinimal27Packages;

Expand Down