From 4939888b8b81f0f874698b0039db441e9c28e10e Mon Sep 17 00:00:00 2001 From: Moosieus Date: Sat, 19 Apr 2025 11:53:05 -0400 Subject: [PATCH 1/2] [chore] Drop support for Elixir 1.13 and 1.14: * Set default Elixir version to 1.15.8 * Set default OTP version to 25.0 * Drop Elixir 1.13 and 1.14 from allowed versions and CI tests * Drop OTP 24 from allowed versions and CI tests --- .github/workflows/elixir.yml | 10 +++------- .github/workflows/release.yml | 4 ++-- README.md | 6 +++--- apps/common/lib/lexical/document/lines.ex | 6 +----- apps/common/mix.exs | 2 +- apps/common/test/lexical/ast/tokens_test.exs | 14 +++++++------- apps/common/test/lexical/vm/versions_test.exs | 16 ++++++++-------- apps/lexical_credo/mix.exs | 2 +- apps/proto/mix.exs | 2 +- apps/protocol/mix.exs | 2 +- apps/remote_control/mix.exs | 2 +- .../fixtures/compilation_callback_errors/mix.exs | 2 +- .../test/fixtures/compilation_errors/mix.exs | 2 +- .../test/fixtures/compilation_warnings/mix.exs | 2 +- .../test/fixtures/navigations/mix.exs | 2 +- .../test/fixtures/parse_errors/mix.exs | 2 +- .../remote_control/test/fixtures/project/mix.exs | 2 +- .../test/fixtures/project_metadata/mix.exs | 2 +- .../test/fixtures/umbrella/apps/first/mix.exs | 2 +- .../test/fixtures/umbrella/apps/second/mix.exs | 2 +- apps/server/lib/lexical/server/boot.ex | 4 +--- apps/server/mix.exs | 2 +- apps/server/test/lexical/server/boot_test.exs | 10 +++++----- integration/README.md | 2 +- pages/installation.md | 15 ++++++--------- 25 files changed, 52 insertions(+), 65 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index b36064a8..b1ac5ebc 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -18,7 +18,7 @@ env: # so keeping credo, dialyzer and formatting checks in the matrix # would create an impossible situation, as different versions would have # different rules - DEFAULT_ELIXIR: 1.14.3-otp-25 + DEFAULT_ELIXIR: 1.15.8-otp-25 DEFAULT_OTP: 25.3.2.4 permissions: @@ -162,13 +162,9 @@ jobs: otp: "26" - elixir: "1.16" otp: "25" - - elixir: "1.15.6" + - elixir: "1.15.8" otp: "26" - - elixir: "1.15.6" - otp: "25" - - elixir: "1.14" - otp: "25" - - elixir: "1.13" + - elixir: "1.15.8" otp: "25" steps: # Step: Check out the code. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92e3758d..5622543b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,8 +14,8 @@ jobs: - name: Set up Elixir uses: erlef/setup-beam@v1 with: - otp-version: "24.3.4.12" - elixir-version: "1.13.4-otp-24" + otp-version: "25.0" + elixir-version: "1.15.8-otp-25" version-type: strict - name: Checkout code diff --git a/README.md b/README.md index 5f880e2b..eb22d221 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,9 @@ Lexical will be available in `/path/to/lexical`. ## Development -Lexical is intended to run on any version of Erlang 24+ and Elixir -1.13+. Before beginning development, you should install Erlang -`24.3.4.12` and Elixir `1.13.4` and use those versions when you're +Lexical is intended to run on any version of Erlang 25+ and Elixir +1.15+. Before beginning development, you should install Erlang +`25.0` and Elixir `1.15.8` and use those versions when you're building code. You should also look at the [complete compatibility diff --git a/apps/common/lib/lexical/document/lines.ex b/apps/common/lib/lexical/document/lines.ex index 092459d7..9d266a67 100644 --- a/apps/common/lib/lexical/document/lines.ex +++ b/apps/common/lib/lexical/document/lines.ex @@ -147,11 +147,7 @@ defimpl Enumerable, for: Lexical.Document.Lines do def slice(%Lines{} = document) do slicing_function = - if Version.match?(System.version(), ">= 1.14.0") do - fn start, len, step -> do_slice(document, start, len, step) end - else - fn start, len -> do_slice(document, start, len, 1) end - end + fn start, len, step -> do_slice(document, start, len, step) end {:ok, Lines.size(document), slicing_function} end diff --git a/apps/common/mix.exs b/apps/common/mix.exs index 10b592cb..77c327dd 100644 --- a/apps/common/mix.exs +++ b/apps/common/mix.exs @@ -6,7 +6,7 @@ defmodule Common.MixProject do [ app: :common, version: "0.7.2", - elixir: "~> 1.13", + elixir: "~> 1.15", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), diff --git a/apps/common/test/lexical/ast/tokens_test.exs b/apps/common/test/lexical/ast/tokens_test.exs index 15d1d215..8b656ec1 100644 --- a/apps/common/test/lexical/ast/tokens_test.exs +++ b/apps/common/test/lexical/ast/tokens_test.exs @@ -63,23 +63,23 @@ defmodule Lexical.Ast.TokensTest do tokens = Tokens.prefix_stream(document, position) assert Enum.to_list(tokens) == [ - {:eol, '\n', []}, - {:eol, '\n', []}, - {:eol, '\n', []}, - {:eol, '\n', []}, + {:eol, ~c"\n", []}, + {:eol, ~c"\n", []}, + {:eol, ~c"\n", []}, + {:eol, ~c"\n", []}, { :interpolated_string, [ {:literal, "foo«", {{1, 1}, {1, 5}}}, {:interpolation, - [{:eol, {3, 18, 1}}, {:int, {4, 13, 2}, '2'}, {:eol, {4, 14, 1}}], + [{:eol, {3, 18, 1}}, {:int, {4, 13, 2}, ~c"2"}, {:eol, {4, 14, 1}}], {{3, 18}, {5, 11}}}, {:literal, "»bar", {{5, 11}, {5, 15}}} ], {3, 11} }, - {:eol, '\n', []}, - {:eol, '\n', []} + {:eol, ~c"\n", []}, + {:eol, ~c"\n", []} ] end end diff --git a/apps/common/test/lexical/vm/versions_test.exs b/apps/common/test/lexical/vm/versions_test.exs index 94ae01b6..2166eb31 100644 --- a/apps/common/test/lexical/vm/versions_test.exs +++ b/apps/common/test/lexical/vm/versions_test.exs @@ -85,29 +85,29 @@ defmodule Lexical.VM.VersionTest do describe "compatible?/1" do test "lower major versions of erlang are compatible with later major versions" do - patch_system_versions("1.14.5", "26.0") - patch_tagged_versions("1.14.5", "25.0") + patch_system_versions("1.15.8", "26.0") + patch_tagged_versions("1.15.8", "25.0") assert compatible?("/foo/bar/baz") end test "higher major versions are not compatible with lower major versions" do - patch_system_versions("1.14.5", "25.0") - patch_tagged_versions("1.14.5", "26.0") + patch_system_versions("1.15.8", "25.0") + patch_tagged_versions("1.15.8", "26.0") refute compatible?("/foo/bar/baz") end test "the same versions are compatible with each other" do - patch_system_versions("1.14.5", "25.3.3") - patch_tagged_versions("1.14.5", "25.0") + patch_system_versions("1.15.8", "25.3.3") + patch_tagged_versions("1.15.8", "25.0") assert compatible?("/foo/bar/baz") end test "higher minor versions are compatible" do - patch_system_versions("1.14.5", "25.3.0") - patch_tagged_versions("1.14.5", "25.0") + patch_system_versions("1.15.8", "25.3.0") + patch_tagged_versions("1.15.8", "25.0") assert compatible?("/foo/bar/baz") end diff --git a/apps/lexical_credo/mix.exs b/apps/lexical_credo/mix.exs index b7f1be29..28ac08ff 100644 --- a/apps/lexical_credo/mix.exs +++ b/apps/lexical_credo/mix.exs @@ -8,7 +8,7 @@ defmodule LexicalCredo.MixProject do [ app: :lexical_credo, version: @version, - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), docs: docs(), diff --git a/apps/proto/mix.exs b/apps/proto/mix.exs index adfb5f8e..fda25348 100644 --- a/apps/proto/mix.exs +++ b/apps/proto/mix.exs @@ -6,7 +6,7 @@ defmodule Proto.MixProject do [ app: :proto, version: "0.7.2", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), dialyzer: Mix.Dialyzer.config(add_apps: [:jason]) diff --git a/apps/protocol/mix.exs b/apps/protocol/mix.exs index fa5c1bd1..f0257a68 100644 --- a/apps/protocol/mix.exs +++ b/apps/protocol/mix.exs @@ -7,7 +7,7 @@ defmodule Lexical.Protocol.MixProject do app: :protocol, env: Mix.env(), version: "0.7.2", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), dialyzer: Mix.Dialyzer.config(add_apps: [:jason]), diff --git a/apps/remote_control/mix.exs b/apps/remote_control/mix.exs index ec28a236..ed954516 100644 --- a/apps/remote_control/mix.exs +++ b/apps/remote_control/mix.exs @@ -6,7 +6,7 @@ defmodule Lexical.RemoteControl.MixProject do [ app: :remote_control, version: "0.7.2", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), dialyzer: Mix.Dialyzer.config(), diff --git a/apps/remote_control/test/fixtures/compilation_callback_errors/mix.exs b/apps/remote_control/test/fixtures/compilation_callback_errors/mix.exs index bda846f6..c4f5579c 100644 --- a/apps/remote_control/test/fixtures/compilation_callback_errors/mix.exs +++ b/apps/remote_control/test/fixtures/compilation_callback_errors/mix.exs @@ -7,7 +7,7 @@ defmodule CompilationCallbackErrors.MixProject do [ app: :compilation_callback_errors, version: "0.1.0", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/remote_control/test/fixtures/compilation_errors/mix.exs b/apps/remote_control/test/fixtures/compilation_errors/mix.exs index a60aee2e..b54d6d6c 100644 --- a/apps/remote_control/test/fixtures/compilation_errors/mix.exs +++ b/apps/remote_control/test/fixtures/compilation_errors/mix.exs @@ -7,7 +7,7 @@ defmodule CompilationErrors.MixProject do [ app: :compilation_errors, version: "0.1.0", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/remote_control/test/fixtures/compilation_warnings/mix.exs b/apps/remote_control/test/fixtures/compilation_warnings/mix.exs index e2430943..e0e24811 100644 --- a/apps/remote_control/test/fixtures/compilation_warnings/mix.exs +++ b/apps/remote_control/test/fixtures/compilation_warnings/mix.exs @@ -7,7 +7,7 @@ defmodule CompilationWarnings.MixProject do [ app: :compilation_warnings, version: "0.1.0", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/remote_control/test/fixtures/navigations/mix.exs b/apps/remote_control/test/fixtures/navigations/mix.exs index e74ff1ab..f0054b98 100644 --- a/apps/remote_control/test/fixtures/navigations/mix.exs +++ b/apps/remote_control/test/fixtures/navigations/mix.exs @@ -7,7 +7,7 @@ defmodule Navigations.MixProject do [ app: :navigations, version: "0.1.0", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/remote_control/test/fixtures/parse_errors/mix.exs b/apps/remote_control/test/fixtures/parse_errors/mix.exs index 2aba639d..8b972a70 100644 --- a/apps/remote_control/test/fixtures/parse_errors/mix.exs +++ b/apps/remote_control/test/fixtures/parse_errors/mix.exs @@ -7,7 +7,7 @@ defmodule ParseErrors.MixProject do [ app: :parse_errors, version: "0.1.0", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/remote_control/test/fixtures/project/mix.exs b/apps/remote_control/test/fixtures/project/mix.exs index 167e4ba4..af783348 100644 --- a/apps/remote_control/test/fixtures/project/mix.exs +++ b/apps/remote_control/test/fixtures/project/mix.exs @@ -7,7 +7,7 @@ defmodule Project.MixProject do [ app: :project, version: "0.1.0", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/remote_control/test/fixtures/project_metadata/mix.exs b/apps/remote_control/test/fixtures/project_metadata/mix.exs index 32d7a3d6..572b039d 100644 --- a/apps/remote_control/test/fixtures/project_metadata/mix.exs +++ b/apps/remote_control/test/fixtures/project_metadata/mix.exs @@ -7,7 +7,7 @@ defmodule ProjectMetadata.MixProject do [ app: :project_metadata, version: "0.1.0", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/remote_control/test/fixtures/umbrella/apps/first/mix.exs b/apps/remote_control/test/fixtures/umbrella/apps/first/mix.exs index 3edddc27..815706fb 100644 --- a/apps/remote_control/test/fixtures/umbrella/apps/first/mix.exs +++ b/apps/remote_control/test/fixtures/umbrella/apps/first/mix.exs @@ -11,7 +11,7 @@ defmodule Umbrella.First.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/remote_control/test/fixtures/umbrella/apps/second/mix.exs b/apps/remote_control/test/fixtures/umbrella/apps/second/mix.exs index b95da126..0e253af1 100644 --- a/apps/remote_control/test/fixtures/umbrella/apps/second/mix.exs +++ b/apps/remote_control/test/fixtures/umbrella/apps/second/mix.exs @@ -11,7 +11,7 @@ defmodule Umbrella.Second.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/apps/server/lib/lexical/server/boot.ex b/apps/server/lib/lexical/server/boot.ex index 1b58b630..a076e275 100644 --- a/apps/server/lib/lexical/server/boot.ex +++ b/apps/server/lib/lexical/server/boot.ex @@ -83,9 +83,7 @@ defmodule Lexical.Server.Boot do end @allowed_elixir %{ - "1.13.0" => ">= 1.13.0", - "1.14.0" => ">= 1.14.0", - "1.15.0" => ">= 1.15.3", + "1.15.0" => ">= 1.15.8", "1.16.0" => ">= 1.16.0", "1.17.0-rc" => ">= 1.17.0-rc", "1.17.0" => ">= 1.17.0", diff --git a/apps/server/mix.exs b/apps/server/mix.exs index 880462bf..eff0a4d6 100644 --- a/apps/server/mix.exs +++ b/apps/server/mix.exs @@ -6,7 +6,7 @@ defmodule Lexical.Server.MixProject do [ app: :server, version: "0.7.2", - elixir: "~> 1.13", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), dialyzer: Mix.Dialyzer.config(add_apps: [:jason, :proto]), diff --git a/apps/server/test/lexical/server/boot_test.exs b/apps/server/test/lexical/server/boot_test.exs index ed9b7854..4b718fb5 100644 --- a/apps/server/test/lexical/server/boot_test.exs +++ b/apps/server/test/lexical/server/boot_test.exs @@ -7,8 +7,8 @@ defmodule Lexical.Server.BootTest do describe "detect_errors/0" do test "returns empty list when all checks succeed" do - patch_runtime_versions("1.14.5", "25.0") - patch_compiled_versions("1.14.5", "25.0") + patch_runtime_versions("1.15.8", "25.0") + patch_compiled_versions("1.15.8", "25.0") assert [] = Boot.detect_errors() end @@ -22,8 +22,8 @@ defmodule Lexical.Server.BootTest do end test "includes error when runtime erlang is incompatible" do - patch_runtime_versions("1.13.4", "23.0") - patch_compiled_versions("1.13.4", "23.0") + patch_runtime_versions("1.15.8", "23.0") + patch_compiled_versions("1.15.8", "23.0") assert [error] = Boot.detect_errors() assert error =~ "FATAL: Lexical is not compatible with Erlang/OTP 23.0.0" @@ -31,7 +31,7 @@ defmodule Lexical.Server.BootTest do test "includes multiple errors when runtime elixir and erlang are incompatible" do patch_runtime_versions("1.15.2", "26.0.0") - patch_compiled_versions("1.15.6", "26.1") + patch_compiled_versions("1.15.8", "26.1") assert [elixir_error, erlang_error] = Boot.detect_errors() assert elixir_error =~ "FATAL: Lexical is not compatible with Elixir 1.15.2" diff --git a/integration/README.md b/integration/README.md index 08bf7ac2..1765c918 100644 --- a/integration/README.md +++ b/integration/README.md @@ -32,7 +32,7 @@ $ LX_DEBUG=1 ./integration/test.sh test_find_asdf_directory... > No version manager detected > Found asdf. Activating... -> Detected Elixir through asdf: /root/.asdf/installs/elixir/1.15.6-otp-26/bin/elixir +> Detected Elixir through asdf: /root/.asdf/installs/elixir/1.15.8-otp-26/bin/elixir Pass ... ``` diff --git a/pages/installation.md b/pages/installation.md index 3fae4365..8bb8c208 100644 --- a/pages/installation.md +++ b/pages/installation.md @@ -11,16 +11,13 @@ Lexical supports the following versions of Elixir and Erlang: | Erlang | Version range | Notes | | ----------- |----------------- | ------ | -| 24 | `>= 24.3.4.12` | Might run on older versions; this was the lowest that would compile on arm | | 25 | `>= 25.0` | | | 26 | `>= 26.0.2` | | | 27 | `>= 27.0` | Will use dramatically more memory due to a bug in Erlang's ETS table compression | | Elixir | Version Range | Notes | | -------- | -------------- | -------- | -| 1.13 | `>= 1.13.4` | | -| 1.14 | `all` | | -| 1.15 | `>= 1.15.3` | `1.15.0` - `1.15.2` had compiler bugs that prevented lexical from working | +| 1.15 | `>= 1.15.8` | | | 1.16 | `>= 1.16.0` | | | 1.17 | `>= 1.17.0` | | @@ -29,12 +26,12 @@ supports, but it's important to understand that Lexical needs to be compiled under the lowest version of elixir and erlang that you intend to use it with. That means if you have the following projects: - * `first`: elixir `1.14.4` erlang `24.3.2` - * `second`: elixir `1.14.3` erlang `25.0` - * `third`: elixir: `1.13.3` erlang `25.2.3` + * `first`: elixir `1.18.3` erlang `27.3.3` + * `second`: elixir `1.16.1` erlang `25.2.3` + * `third`: elixir: `1.15.8` erlang `26.0` -Lexical would need to be compiled with Erlang `24.3.2` and Elixir `1.13.3`. -Lexical's prepackaged builds use Erlang `24.3.4.12` and Elixir `1.13.4` +Lexical would need to be compiled with Erlang `25.2.3` and Elixir `1.15.8`. +Lexical's prepackaged builds use Erlang `25.0` and Elixir `1.15.8` ## Prerequisites First, Install git LFS by [following these instructions](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage). From 7f799f65f1883d9398e612793863c0192e383910 Mon Sep 17 00:00:00 2001 From: Moosieus Date: Mon, 21 Apr 2025 12:49:32 -0400 Subject: [PATCH 2/2] add note about ETS table compression --- pages/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/installation.md b/pages/installation.md index 8bb8c208..be6a754f 100644 --- a/pages/installation.md +++ b/pages/installation.md @@ -13,7 +13,7 @@ Lexical supports the following versions of Elixir and Erlang: | ----------- |----------------- | ------ | | 25 | `>= 25.0` | | | 26 | `>= 26.0.2` | | -| 27 | `>= 27.0` | Will use dramatically more memory due to a bug in Erlang's ETS table compression | +| 27 | `>= 27.0` | `27.0` - `27.0.1` Will use dramatically more memory due to a bug in Erlang's ETS table compression | | Elixir | Version Range | Notes | | -------- | -------------- | -------- |