Skip to content

Commit

Permalink
Merge pull request #2555 from ferd/drop-backwards-otp-compat
Browse files Browse the repository at this point in the history
Only support 3 newest OTP versions
  • Loading branch information
ferd authored May 19, 2021
2 parents e2beaff + 28e55e7 commit 1ee4514
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
otp_version: [20, 21, 22, 23, 24]
otp_version: [22, 23, 24]
os: [ubuntu-latest]

container:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: gleam-lang/setup-erlang@master
with:
otp-version: 21.3.8.17
otp-version: 22.3.4.18
- name: Compile
run: ./bootstrap
- name: CT tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: gleam-lang/setup-erlang@master
with:
otp-version: 21.3.8.17
otp-version: 22.3.4.18
- name: Compile
run: ./bootstrap
- name: CT tests
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rebar3

[![Build Status](https://github.com/erlang/rebar3/workflows/Common%20Test/badge.svg)](https://github.com/erlang/rebar3/actions?query=branch%3Amaster+workflow%3A"Common+Test") [![Erlang Versions](https://img.shields.io/badge/Supported%20Erlang%2FOTP-19.0%20to%2023.0-blue)](http://www.erlang.org)
[![Build Status](https://github.com/erlang/rebar3/workflows/Common%20Test/badge.svg)](https://github.com/erlang/rebar3/actions?query=branch%3Amaster+workflow%3A"Common+Test") [![Erlang Versions](https://img.shields.io/badge/Supported%20Erlang%2FOTP-22.0%20to%2024.0-blue)](http://www.erlang.org)

1. [What is Rebar3?](#what-is-rebar3)
2. [Why Rebar3?](#why-rebar3)
Expand Down Expand Up @@ -94,7 +94,7 @@ by [Erlang Solutions](https://www.erlang-solutions.com/resources/download.html),
but be sure to choose the "Standard" download option or you'll have issues building
projects.

Do note that if you are planning to work with multiple Erlang versions on the same machine, you will want to build Rebar3 with the oldest one of them. The five newest major Erlang releases are supported at any given time: if the newest version is OTP-23, building with versions as old as OTP-19 will be supported, and produce an executable that will work with those that follow.
Do note that if you are planning to work with multiple Erlang versions on the same machine, you will want to build Rebar3 with the oldest one of them. The 3 newest major Erlang releases are supported at any given time: if the newest version is OTP-24, building with versions as old as OTP-22 will be supported, and produce an executable that will work with those that follow.

## Documentation

Expand Down
18 changes: 9 additions & 9 deletions src/rebar_prv_escriptize.erl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ escriptize(State0, App) ->
%% to pull in all the .beam files.
TopInclApps = lists:usort([ec_cnv:to_atom(AppName) | rebar_state:get(State, escript_incl_apps, [])]),
AllApps = rebar_state:all_deps(State)++rebar_state:project_apps(State),
InclApps = find_deps(TopInclApps, AllApps),
InclApps = find_deps(TopInclApps, AllApps, State),
?DEBUG("bundled applications:~n\t~p", [InclApps]),
InclBeams = get_apps_beams(InclApps, AllApps),

Expand Down Expand Up @@ -257,20 +257,20 @@ usort(List) ->
get_nonempty(Files) ->
[{FName,FBin} || {FName,FBin} <- Files, FBin =/= <<>>].

find_deps(AppNames, AllApps) ->
find_deps(AppNames, AllApps, State) ->
BinAppNames = [rebar_utils:to_binary(Name) || Name <- AppNames],
[ec_cnv:to_atom(Name) ||
Name <- find_deps_of_deps(BinAppNames, AllApps, BinAppNames)].
Name <- find_deps_of_deps(BinAppNames, AllApps, State, BinAppNames)].

%% Should look at the app files to find direct dependencies
find_deps_of_deps([], _, Acc) -> Acc;
find_deps_of_deps([Name|Names], Apps, Acc) ->
find_deps_of_deps([], _, _, Acc) -> Acc;
find_deps_of_deps([Name|Names], Apps, State, Acc) ->
?DIAGNOSTIC("processing ~p", [Name]),
App = case rebar_app_utils:find(Name, Apps) of
{ok, Found} ->
Found;
error ->
case find_external_app(Name) of
case find_external_app(Name, State) of
error -> throw(?PRV_ERROR({bad_app, binary_to_atom(Name, utf8)}));
App0 -> App0
end
Expand All @@ -283,15 +283,15 @@ find_deps_of_deps([Name|Names], Apps, Acc) ->
not lists:prefix(code:root_dir(), DepDir)]
-- ([Name|Names]++Acc), % avoid already seen deps
?DIAGNOSTIC("new deps of ~p found to be ~p", [Name, BinDepNames]),
find_deps_of_deps(BinDepNames ++ Names, Apps, BinDepNames ++ Acc).
find_deps_of_deps(BinDepNames ++ Names, Apps, State, BinDepNames ++ Acc).

%% This is for apps which are on the code path (ERL_LIBS) but not part of OTP
find_external_app(Name) ->
find_external_app(Name, State) ->
case code:lib_dir(binary_to_atom(Name, utf8)) of
{error, bad_name} ->
error;
Dir ->
case rebar_app_discover:find_app(Dir, valid) of
case rebar_app_discover:find_app(Dir, valid, State) of
{true, App} -> App;
false -> error
end
Expand Down

0 comments on commit 1ee4514

Please sign in to comment.